diff --git a/README.md b/README.md index 3281cf2..cf97e58 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Deploy to Skynet action -This action deploys a directory to [Skynet](https://siasky.net) and comments on pull request with a skylink url. +This action deploys a directory to Skynet and comments on pull request with a skylink url (defaults to [siasky.net](https://siasky.net) portal). ![Screenshot of Pull Request notification](screenshot.png) @@ -22,7 +22,7 @@ Find out more about github token from [documentation](https://docs.github.com/en ### `registry-seed` -You can provide a seed (keep it secret, keep it safe) and this action will set corresponding skynet registry entry value to the deployed skylink. +You can provide a seed (keep it secret, keep it safe) and this action will set corresponding skynet registry entry value to the deployed resolver skylink. Public link to the registry entry will be printed in the action log. @@ -32,6 +32,12 @@ Default value: `skylink.txt` You can define custom datakey for a registry entry when used with `registry-seed`. Change only if you want to use a specific key, default value will work in all other cases. +### `portal-url` + +Default value: `https://siasky.net` + +You can override default skynet portal url with any compatible community portal or self hosted one. + ## Outputs ### `skylink` @@ -46,10 +52,23 @@ The resulting skylink url (base32 encoded skylink in subdomain). Example: `https://400bk2i89lheb6d8olltc2grqgfaqfge1im134ed6q1ro0g0fbnk1to.siasky.net` +### `resolver-skylink` + +A resolver skylink pointing at the resulting skylink. Resolver skylink will remain the same throughout the deploys, but will always resolve to the latest deploy. + +Example: `sia://AQDwh1jnoZas9LaLHC_D4-2yP9XYDdZzNtz62H4Dww1jDA` + +### `resolver-skylink-url` + +The resulting resolver skylink url (base32 encoded skylink in subdomain). Resolver skylink will remain the same throughout the deploys, but will always resolve to the latest deploy. + +Example: `https://040f11qosugpdb7kmq5hobu3sfmr4fulr06tcspmrjtdgvg3oc6m630.siasky.net/` + ## Example usage ```yaml -uses: SkynetLabs/deploy-to-skynet-action@v1 +uses: SkynetLabs/deploy-to-skynet-action@v2 + with: upload-dir: public github-token: ${{ secrets.GITHUB_TOKEN }} @@ -71,10 +90,9 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - node-version: 14.x + node-version: 16.x - name: Install dependencies run: yarn @@ -83,7 +101,8 @@ jobs: run: yarn build - name: Deploy to Skynet - uses: SkynetLabs/deploy-to-skynet-action@v1 + uses: SkynetLabs/deploy-to-skynet-action@v2 + with: upload-dir: public github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/action.yml b/action.yml index e2c981f..24496d4 100644 --- a/action.yml +++ b/action.yml @@ -12,14 +12,24 @@ inputs: required: true registry-seed: description: "Seed that generates registry private key (optional, only if you want to update the registry entry with skylink)" + required: false registry-datakey: description: "Registry datakey to use when updating the registry entry" + required: true default: "skylink.txt" + portal-url: + description: "Skynet portal api url" + required: true + default: "https://siasky.net" outputs: skylink: description: "Uploaded resource skylink" skylink-url: - description: "Uploaded resource skylink url on https://siasky.net" + description: "Uploaded resource skylink url" + resolver-skylink: + description: "Resolver skylink pointing to uploaded resource" + resolver-skylink-url: + description: "Resolver skylink url (as a subdomain)" runs: using: "node12" main: index.js diff --git a/index.js b/index.js index d17f635..29eeae7 100644 --- a/index.js +++ b/index.js @@ -1,23 +1,7 @@ const core = require("@actions/core"); const github = require("@actions/github"); const { SkynetClient: NodeSkynetClient } = require("@nebulous/skynet"); -const { parseSkylink, genKeyPairFromSeed, SkynetClient } = require("skynet-js"); -const base64 = require("base64-js"); -const base32Encode = require("base32-encode"); -const parseUrl = require("parse-url"); -const qs = require("qs"); - -function decodeBase64(input = "") { - return base64.toByteArray( - input.padEnd(input.length + 4 - (input.length % 4), "=") - ); -} - -function encodeBase32(input) { - return base32Encode(input, "RFC4648-HEX", { - padding: false, - }).toLowerCase(); -} +const { genKeyPairFromSeed, SkynetClient } = require("skynet-js"); function outputAxiosErrorMessage(error) { if (error.response) { @@ -31,53 +15,53 @@ function outputAxiosErrorMessage(error) { } } -function createSkynsEntry(entryUrl) { - const { query } = parseUrl(entryUrl, {}); - const { publickey, datakey } = qs.parse(query); - - return `skyns://${encodeURIComponent(publickey)}/${datakey}`; -} - (async () => { try { // upload to skynet - const skynetClient = new NodeSkynetClient(); - const skylink = await skynetClient.uploadDirectory( + const nodeClient = new NodeSkynetClient(core.getInput("portal-url")); + const skynetClient = new SkynetClient(core.getInput("portal-url")); + const skylink = await nodeClient.uploadDirectory( core.getInput("upload-dir") ); + + // generate base32 skylink url from base64 skylink + const skylinkUrl = await skynetClient.getSkylinkUrl(skylink, { + subdomain: true, + }); + core.setOutput("skylink", skylink); console.log(`Skylink: ${skylink}`); - // generate base32 skylink from base64 skylink - const rawSkylink = parseSkylink(skylink); - const skylinkDecoded = decodeBase64(rawSkylink); - const skylinkEncodedBase32 = encodeBase32(skylinkDecoded); - const skylinkUrl = `https://${skylinkEncodedBase32}.siasky.net`; - core.setOutput("skylink-url", skylinkUrl); console.log(`Deployed to: ${skylinkUrl}`); // if registry is properly configured, update the skylink in the entry if (core.getInput("registry-seed") && core.getInput("registry-datakey")) { try { - const skynetClient = new SkynetClient("https://siasky.net"); const seed = core.getInput("registry-seed"); const dataKey = core.getInput("registry-datakey"); const { publicKey, privateKey } = genKeyPairFromSeed(seed); - const { entry } = await skynetClient.registry.getEntry( - publicKey, - dataKey - ); - const revision = entry ? entry.revision + 1 : 0; - const updatedEntry = { datakey: dataKey, revision, data: rawSkylink }; - await skynetClient.registry.setEntry(privateKey, updatedEntry); - const entryUrl = skynetClient.registry.getEntryUrl(publicKey, dataKey); + + const [entryUrl, resolverSkylink] = await Promise.all([ + skynetClient.registry.getEntryUrl(publicKey, dataKey), + skynetClient.registry.getEntryLink(publicKey, dataKey), + skynetClient.db.setDataLink(privateKey, dataKey, skylink), + ]); + const resolverUrl = await skynetClient.getSkylinkUrl(resolverSkylink, { + subdomain: true, + }); + console.log(`Registry entry updated: ${entryUrl}`); - console.log(`Skyns entry: ${createSkynsEntry(entryUrl)}`); + + core.setOutput("resolver-skylink-url", resolverUrl); + console.log(`Resolver Skylink Url: ${resolverUrl}`); + + core.setOutput("resolver-skylink", resolverSkylink); + console.log(`Resolver Skylink: ${resolverSkylink}`); } catch (error) { outputAxiosErrorMessage(error); - console.log(`Failed to update registry entry ${error.message}`); + console.log(`Failed to update registry entry: ${error.message}`); } } diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 120000 index 0000000..fbb7ee0 --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1 @@ +../mime/cli.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index e223319..20a5ad8 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,48 +1,38 @@ { "name": "deploy-to-skynet-action", - "version": "1.2.0", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "node_modules/@actions/core": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.7.tgz", - "integrity": "sha512-kzLFD5BgEvq6ubcxdgPbRKGD2Qrgya/5j+wh4LZzqT915I0V3rED+MvjH6NXghbvk1MXknpNNQ3uKjXSEN00Ig==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.4.0.tgz", + "integrity": "sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg==" }, "node_modules/@actions/github": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-4.0.0.tgz", - "integrity": "sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==", - "license": "MIT", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz", + "integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==", "dependencies": { - "@actions/http-client": "^1.0.8", - "@octokit/core": "^3.0.0", - "@octokit/plugin-paginate-rest": "^2.2.3", - "@octokit/plugin-rest-endpoint-methods": "^4.0.0" + "@actions/http-client": "^1.0.11", + "@octokit/core": "^3.4.0", + "@octokit/plugin-paginate-rest": "^2.13.3", + "@octokit/plugin-rest-endpoint-methods": "^5.1.1" } }, "node_modules/@actions/http-client": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz", - "integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==", - "license": "MIT", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", + "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", "dependencies": { "tunnel": "0.0.6" } }, - "node_modules/@babel/runtime": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.5.tgz", - "integrity": "sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==", - "dependencies": { - "regenerator-runtime": "^0.13.4" - } - }, "node_modules/@nebulous/skynet": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@nebulous/skynet/-/skynet-2.0.1.tgz", "integrity": "sha512-aFoOEBRhzvR1dvSHLZ2uAasbGE3t4rXnF4vEGGshU9ZO0q/vFDCxFsMI8jK4OntEujf6U9ADG/G0np3SdRrmbQ==", - "license": "MIT", + "deprecated": "This package has been moved to @skynetlabs/skynet-nodejs", "dependencies": { "axios": "0.20.0", "form-data": "3.0.0", @@ -50,129 +40,125 @@ } }, "node_modules/@octokit/auth-token": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", - "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", - "license": "MIT", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", + "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==", "dependencies": { - "@octokit/types": "^5.0.0" + "@octokit/types": "^6.0.3" } }, "node_modules/@octokit/core": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.1.2.tgz", - "integrity": "sha512-AInOFULmwOa7+NFi9F8DlDkm5qtZVmDQayi7TUgChE3yeIGPq0Y+6cAEXPexQ3Ea+uZy66hKEazR7DJyU+4wfw==", - "license": "MIT", - "dependencies": { - "@octokit/auth-token": "^2.4.0", - "@octokit/graphql": "^4.3.1", - "@octokit/request": "^5.4.0", - "@octokit/types": "^5.0.0", - "before-after-hook": "^2.1.0", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", + "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", + "dependencies": { + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.0", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "node_modules/@octokit/endpoint": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.8.tgz", - "integrity": "sha512-MuRrgv+bM4Q+e9uEvxAB/Kf+Sj0O2JAOBA131uo1o6lgdq1iS8ejKwtqHgdfY91V3rN9R/hdGKFiQYMzVzVBEQ==", - "license": "MIT", + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", + "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", "dependencies": { - "@octokit/types": "^5.0.0", + "@octokit/types": "^6.0.3", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" } }, "node_modules/@octokit/graphql": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.6.tgz", - "integrity": "sha512-Rry+unqKTa3svswT2ZAuqenpLrzJd+JTv89LTeVa5UM/5OX8o4KTkPL7/1ABq4f/ZkELb0XEK/2IEoYwykcLXg==", - "license": "MIT", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.6.4.tgz", + "integrity": "sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg==", "dependencies": { - "@octokit/request": "^5.3.0", - "@octokit/types": "^5.0.0", + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", "universal-user-agent": "^6.0.0" } }, + "node_modules/@octokit/openapi-types": { + "version": "9.7.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-9.7.0.tgz", + "integrity": "sha512-TUJ16DJU8mekne6+KVcMV5g6g/rJlrnIKn7aALG9QrNpnEipFc1xjoarh0PKaAWf2Hf+HwthRKYt+9mCm5RsRg==" + }, "node_modules/@octokit/plugin-paginate-rest": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.4.0.tgz", - "integrity": "sha512-YT6Klz3LLH6/nNgi0pheJnUmTFW4kVnxGft+v8Itc41IIcjl7y1C8TatmKQBbCSuTSNFXO5pCENnqg6sjwpJhg==", - "license": "MIT", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.15.1.tgz", + "integrity": "sha512-47r52KkhQDkmvUKZqXzA1lKvcyJEfYh3TKAIe5+EzMeyDM3d+/s5v11i2gTk8/n6No6DPi3k5Ind6wtDbo/AEg==", "dependencies": { - "@octokit/types": "^5.5.0" + "@octokit/types": "^6.24.0" }, "peerDependencies": { "@octokit/core": ">=2" } }, "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.0.tgz", - "integrity": "sha512-1/qn1q1C1hGz6W/iEDm9DoyNoG/xdFDt78E3eZ5hHeUfJTLJgyAMdj9chL/cNBHjcjd+FH5aO1x0VCqR2RE0mw==", - "license": "MIT", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.8.0.tgz", + "integrity": "sha512-qeLZZLotNkoq+it6F+xahydkkbnvSK0iDjlXFo3jNTB+Ss0qIbYQb9V/soKLMkgGw8Q2sHjY5YEXiA47IVPp4A==", "dependencies": { - "@octokit/types": "^5.5.0", + "@octokit/types": "^6.25.0", "deprecation": "^2.3.1" + }, + "peerDependencies": { + "@octokit/core": ">=3" } }, "node_modules/@octokit/request": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", - "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", - "license": "MIT", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz", + "integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==", "dependencies": { "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.1", - "once": "^1.4.0", "universal-user-agent": "^6.0.0" } }, "node_modules/@octokit/request-error": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", - "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", "dependencies": { - "@octokit/types": "^5.0.1", + "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "node_modules/@octokit/types": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", - "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", - "license": "MIT", + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.25.0.tgz", + "integrity": "sha512-bNvyQKfngvAd/08COlYIN54nRgxskmejgywodizQNyiKoXmWRAjKup2/LYwm+T9V0gsKH6tuld1gM0PzmOiB4Q==", "dependencies": { - "@types/node": ">= 8" + "@octokit/openapi-types": "^9.5.0" } }, - "node_modules/@types/node": { - "version": "14.11.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.5.tgz", - "integrity": "sha512-jVFzDV6NTbrLMxm4xDSIW/gKnk8rQLF9wAzLWIOg+5nU6ACrIMndeBdXci0FGtqJbP9tQvm6V39eshc96TO2wQ==", - "license": "MIT" - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "license": "MIT" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { "version": "0.20.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz", "integrity": "sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==", - "license": "MIT", + "deprecated": "Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410", "dependencies": { "follow-redirects": "^1.10.0" } }, + "node_modules/base32-decode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base32-decode/-/base32-decode-1.0.0.tgz", + "integrity": "sha512-KNWUX/R7wKenwE/G/qFMzGScOgVntOmbE27vvc6GrniDGYb6a5+qWcuoXl8WIOQL7q0TpK7nZDm1Y04Yi3Yn5g==" + }, "node_modules/base32-encode": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/base32-encode/-/base32-encode-1.2.0.tgz", @@ -201,20 +187,19 @@ ] }, "node_modules/before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", - "license": "Apache-2.0" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" }, "node_modules/blakejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", + "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==" }, "node_modules/buffer": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.2.tgz", - "integrity": "sha512-XeXCUm+F7uY7fIzq4pKy+BLbZk4SgYS5xwlZOFYD3UEcAD+PwOoTaFr/SaXvhR1yRa8SKyPSZ7LNX4N65w7h8A==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -234,23 +219,24 @@ "ieee754": "^1.2.1" } }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/buffer-from": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-0.1.2.tgz", + "integrity": "sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg==" + }, + "node_modules/combine-errors": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/combine-errors/-/combine-errors-3.0.3.tgz", + "integrity": "sha1-9N9nQAg+VwOjGBEQwrEFUfAD2oY=", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "custom-error-instance": "2.1.1", + "lodash.uniqby": "4.5.0" } }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -258,19 +244,15 @@ "node": ">= 0.8" } }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "engines": { - "node": ">=0.10" - } + "node_modules/custom-error-instance": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/custom-error-instance/-/custom-error-instance-2.1.1.tgz", + "integrity": "sha1-PPY5FIemYppiR+sMoM4ACBt+Nho=" }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -278,37 +260,31 @@ "node_modules/deprecation": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", - "license": "ISC" - }, - "node_modules/filter-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", - "integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=", - "engines": { - "node": ">=0.10.0" - } + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" }, "node_modules/follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } } }, "node_modules/form-data": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -318,45 +294,10 @@ "node": ">= 6" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" }, "node_modules/ieee754": { "version": "1.2.1", @@ -381,35 +322,105 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/is-ssh": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz", - "integrity": "sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==" + }, + "node_modules/lodash._baseiteratee": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz", + "integrity": "sha1-NKm1VDVycnw9sueO2uPA6eZr0QI=", + "dependencies": { + "lodash._stringtopath": "~4.8.0" + } + }, + "node_modules/lodash._basetostring": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", + "integrity": "sha1-kyfJ3FFYhmt/pLnUL0Y45XZt2d8=" + }, + "node_modules/lodash._baseuniq": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz", + "integrity": "sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg=", + "dependencies": { + "lodash._createset": "~4.0.0", + "lodash._root": "~3.0.0" + } + }, + "node_modules/lodash._createset": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz", + "integrity": "sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=" + }, + "node_modules/lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=" + }, + "node_modules/lodash._stringtopath": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz", + "integrity": "sha1-lBvPDmQmbl/B1m/tCmlZVExXaCQ=", + "dependencies": { + "lodash._basetostring": "~4.12.0" + } + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" + }, + "node_modules/lodash.uniqby": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz", + "integrity": "sha1-o6F7v2LutiQPSRhG6XwcTipeHiE=", "dependencies": { - "protocols": "^1.1.0" + "lodash._baseiteratee": "~4.7.0", + "lodash._baseuniq": "~4.6.0" + } + }, + "node_modules/mime": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" } }, "node_modules/mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "license": "MIT", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "license": "MIT", + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", "dependencies": { - "mime-db": "1.44.0" + "mime-db": "1.49.0" }, "engines": { "node": ">= 0.6" @@ -419,105 +430,38 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "license": "MIT", "engines": { "node": "4.x || >=6.0.0" } }, - "node_modules/node-forge": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", - "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "license": "ISC", "dependencies": { "wrappy": "1" } }, - "node_modules/parse-path": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.3.tgz", - "integrity": "sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA==", - "dependencies": { - "is-ssh": "^1.3.0", - "protocols": "^1.4.0", - "qs": "^6.9.4", - "query-string": "^6.13.8" - } - }, - "node_modules/parse-url": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz", - "integrity": "sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA==", - "dependencies": { - "is-ssh": "^1.3.0", - "normalize-url": "^3.3.0", - "parse-path": "^4.0.0", - "protocols": "^1.4.0" - } - }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, - "node_modules/protocols": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz", - "integrity": "sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==" - }, - "node_modules/qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/post-me": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/post-me/-/post-me-0.4.5.tgz", + "integrity": "sha512-XgPdktF/2M5jglgVDULr9NUb/QNv3bY3g6RG22iTb5MIMtB07/5FJB5fbVmu5Eaopowc6uZx7K3e7x1shPwnXw==" }, - "node_modules/query-string": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz", - "integrity": "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==", + "node_modules/proper-lockfile": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-2.0.1.tgz", + "integrity": "sha1-FZ+wYZPTIAP0s2kd0uwaY0qoDR0=", "dependencies": { - "decode-uri-component": "^0.2.0", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" + "graceful-fs": "^4.1.2", + "retry": "^0.10.0" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4.0.0" } }, "node_modules/querystringify": { @@ -533,16 +477,19 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" }, + "node_modules/retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "engines": { + "node": "*" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -562,66 +509,51 @@ } ] }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node_modules/sjcl": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/sjcl/-/sjcl-1.0.8.tgz", + "integrity": "sha512-LzIjEQ0S0DpIgnxMEayM1rq9aGwGRG4OnZhCdjx7glTaJtf4zRfpg87ImfjSJjoW9vKpagd82McDOwbRT5kQKQ==", + "engines": { + "node": "*" } }, "node_modules/skynet-js": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/skynet-js/-/skynet-js-2.7.0.tgz", - "integrity": "sha512-ruEZ6Xwg8jnAWAz01ZVa1hY8DzPRoj7GZE0Q6UYDSOQo8mSqR1ezVoow1AluhvS/OEgdk45Iwy07En0Faao4iQ==", + "version": "4.0.12-beta", + "resolved": "https://registry.npmjs.org/skynet-js/-/skynet-js-4.0.12-beta.tgz", + "integrity": "sha512-VmsXsdbqAM1LZH2Jv0IuyFmxLT6n3DqKrVoSQTRGDuOCHiRYzPNWtjGUjMjUSvHifIMqPJh3nCjfQwIP4TSOqg==", "dependencies": { - "@babel/runtime": "^7.11.2", "axios": "^0.21.0", + "base32-decode": "^1.0.0", + "base32-encode": "^1.1.1", + "base64-js": "^1.3.1", "blakejs": "^1.1.0", "buffer": "^6.0.1", - "mime-db": "^1.45.0", - "node-forge": "^0.10.0", + "mime": "^2.5.2", "path-browserify": "^1.0.1", + "post-me": "^0.4.5", "randombytes": "^2.1.0", + "sjcl": "^1.0.8", + "skynet-mysky-utils": "^0.2.2", + "tus-js-client": "^2.2.0", + "tweetnacl": "^1.0.3", "url-join": "^4.0.1", - "url-parse": "^1.4.7" + "url-parse": "^1.5.1" } }, "node_modules/skynet-js/node_modules/axios": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz", - "integrity": "sha512-fmkJBknJKoZwem3/IKSSLpkdNXZeBu5Q7GA/aRsr2btgrptmSCxi2oFjZHqGdK9DoTil9PIHlPIZw2EcRJXRvw==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "dependencies": { "follow-redirects": "^1.10.0" } }, - "node_modules/skynet-js/node_modules/mime-db": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", - "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/split-on-first": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=", - "engines": { - "node": ">=4" + "node_modules/skynet-mysky-utils": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/skynet-mysky-utils/-/skynet-mysky-utils-0.2.3.tgz", + "integrity": "sha512-wRrAASn4haux2fu+2pJLv+uV/TGbBecXT1jaqD3/IQgqbEwZUpDNJJrYnYAfp/0cY5Xmuc2ZX90NNr34neAcWg==", + "dependencies": { + "post-me": "^0.4.5" } }, "node_modules/to-data-view": { @@ -633,27 +565,43 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "license": "MIT", "engines": { "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } }, + "node_modules/tus-js-client": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tus-js-client/-/tus-js-client-2.3.0.tgz", + "integrity": "sha512-I4cSwm6N5qxqCmBqenvutwSHe9ntf81lLrtf6BmLpG2v4wTl89atCQKqGgqvkodE6Lx+iKIjMbaXmfvStTg01g==", + "dependencies": { + "buffer-from": "^0.1.1", + "combine-errors": "^3.0.3", + "is-stream": "^2.0.0", + "js-base64": "^2.6.1", + "lodash.throttle": "^4.1.1", + "proper-lockfile": "^2.0.1", + "url-parse": "^1.4.3" + } + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", - "license": "ISC" + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" }, "node_modules/url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", - "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", - "license": "MIT" + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==" }, "node_modules/url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", + "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -662,8 +610,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "license": "ISC" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" } } } diff --git a/node_modules/@actions/core/README.md b/node_modules/@actions/core/README.md index 864d577..deffaa5 100644 --- a/node_modules/@actions/core/README.md +++ b/node_modules/@actions/core/README.md @@ -16,11 +16,14 @@ import * as core from '@actions/core'; #### Inputs/Outputs -Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled. +Action inputs can be read with `getInput` which returns a `string` or `getBooleanInput` which parses a boolean based on the [yaml 1.2 specification](https://yaml.org/spec/1.2/spec.html#id2804923). If `required` set to be false, the input should have a default value in `action.yml`. + +Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled. ```js const myInput = core.getInput('inputName', { required: true }); - +const myBooleanInput = core.getBooleanInput('booleanInputName', { required: true }); +const myMultilineInput = core.getMultilineInput('multilineInputName', { required: true }); core.setOutput('outputKey', 'outputVal'); ``` @@ -66,7 +69,6 @@ catch (err) { Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned. - #### Logging Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs). @@ -118,6 +120,7 @@ const result = await core.group('Do something async', async () => { Colored output is supported in the Action logs via standard [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). 3/4 bit, 8 bit and 24 bit colors are all supported. Foreground colors: + ```js // 3/4 bit core.info('\u001b[35mThis foreground will be magenta') @@ -130,6 +133,7 @@ core.info('\u001b[38;2;255;0;0mThis foreground will be bright red') ``` Background colors: + ```js // 3/4 bit core.info('\u001b[43mThis background will be yellow'); @@ -156,6 +160,7 @@ core.info('\u001b[31;46mRed foreground with a cyan background and \u001b[1mbold ``` > Note: Escape codes reset at the start of each line + ```js core.info('\u001b[35mThis foreground will be magenta') core.info('This foreground will reset to the default') @@ -170,9 +175,10 @@ core.info(style.color.ansi16m.hex('#abcdef') + 'Hello world!') #### Action state -You can use this library to save state and get state for sharing information between a given wrapper action: +You can use this library to save state and get state for sharing information between a given wrapper action: + +**action.yml**: -**action.yml** ```yaml name: 'Wrapper action sample' inputs: @@ -193,6 +199,7 @@ core.saveState("pidToKill", 12345); ``` In action's `cleanup.js`: + ```js const core = require('@actions/core'); diff --git a/node_modules/@actions/core/lib/command.js b/node_modules/@actions/core/lib/command.js index 10bf3eb..0b28c66 100644 --- a/node_modules/@actions/core/lib/command.js +++ b/node_modules/@actions/core/lib/command.js @@ -1,12 +1,25 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); +exports.issue = exports.issueCommand = void 0; const os = __importStar(require("os")); const utils_1 = require("./utils"); /** diff --git a/node_modules/@actions/core/lib/command.js.map b/node_modules/@actions/core/lib/command.js.map index a95b303..51c7c63 100644 --- a/node_modules/@actions/core/lib/command.js.map +++ b/node_modules/@actions/core/lib/command.js.map @@ -1 +1 @@ -{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AACxB,mCAAsC;AAWtC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} \ No newline at end of file +{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,mCAAsC;AAWtC;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,OAAO,GAAG,EAAE;IAC9C,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,sBAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@actions/core/lib/core.d.ts b/node_modules/@actions/core/lib/core.d.ts index 8bb5093..6735251 100644 --- a/node_modules/@actions/core/lib/core.d.ts +++ b/node_modules/@actions/core/lib/core.d.ts @@ -4,6 +4,8 @@ export interface InputOptions { /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */ required?: boolean; + /** Optional. Whether leading/trailing whitespace will be trimmed for the input. Defaults to true */ + trimWhitespace?: boolean; } /** * The code to exit an action @@ -35,13 +37,35 @@ export declare function setSecret(secret: string): void; */ export declare function addPath(inputPath: string): void; /** - * Gets the value of an input. The value is also trimmed. + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ export declare function getInput(name: string, options?: InputOptions): string; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ +export declare function getMultilineInput(name: string, options?: InputOptions): string[]; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +export declare function getBooleanInput(name: string, options?: InputOptions): boolean; /** * Sets the value of an output. * diff --git a/node_modules/@actions/core/lib/core.js b/node_modules/@actions/core/lib/core.js index 9bf191a..f9dbee3 100644 --- a/node_modules/@actions/core/lib/core.js +++ b/node_modules/@actions/core/lib/core.js @@ -1,4 +1,23 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -8,14 +27,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; Object.defineProperty(exports, "__esModule", { value: true }); +exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; const command_1 = require("./command"); const file_command_1 = require("./file-command"); const utils_1 = require("./utils"); @@ -82,7 +95,9 @@ function addPath(inputPath) { } exports.addPath = addPath; /** - * Gets the value of an input. The value is also trimmed. + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. * * @param name name of the input to get * @param options optional. See InputOptions. @@ -93,9 +108,49 @@ function getInput(name, options) { if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } + if (options && options.trimWhitespace === false) { + return val; + } return val.trim(); } exports.getInput = getInput; +/** + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * + */ +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + return inputs; +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +function getBooleanInput(name, options) { + const trueValue = ['true', 'True', 'TRUE']; + const falseValue = ['false', 'False', 'FALSE']; + const val = getInput(name, options); + if (trueValue.includes(val)) + return true; + if (falseValue.includes(val)) + return false; + throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; /** * Sets the value of an output. * diff --git a/node_modules/@actions/core/lib/core.js.map b/node_modules/@actions/core/lib/core.js.map index 0198697..8bd42c0 100644 --- a/node_modules/@actions/core/lib/core.js.map +++ b/node_modules/@actions/core/lib/core.js.map @@ -1 +1 @@ -{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAC7C,iDAA+D;AAC/D,mCAAsC;AAEtC,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,8DAA8D;AAC9D,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAQ;IACnD,MAAM,YAAY,GAAG,sBAAc,CAAC,GAAG,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAA;IAEhC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IAChD,IAAI,QAAQ,EAAE;QACZ,MAAM,SAAS,GAAG,qCAAqC,CAAA;QACvD,MAAM,YAAY,GAAG,GAAG,IAAI,KAAK,SAAS,GAAG,EAAE,CAAC,GAAG,GAAG,YAAY,GAAG,EAAE,CAAC,GAAG,GAAG,SAAS,EAAE,CAAA;QACzF,2BAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;KACtC;SAAM;QACL,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,YAAY,CAAC,CAAA;KAC9C;AACH,CAAC;AAZD,wCAYC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;IACjD,IAAI,QAAQ,EAAE;QACZ,2BAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;KACpC;SAAM;QACL,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;KACxC;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AARD,0BAQC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAHD,8BAGC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAgB;IAC7C,eAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACvC,CAAC;AAFD,wCAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAuB;IAC/C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IAEnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAJD,8BAIC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAA;AAC5C,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAuB;IAC3C,eAAK,CAAC,OAAO,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AACzE,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAuB;IAC7C,eAAK,CAAC,SAAS,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AAC3E,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"} \ No newline at end of file +{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAC7C,iDAA+D;AAC/D,mCAAsC;AAEtC,uCAAwB;AACxB,2CAA4B;AAa5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,8DAA8D;AAC9D,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAQ;IACnD,MAAM,YAAY,GAAG,sBAAc,CAAC,GAAG,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAA;IAEhC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IAChD,IAAI,QAAQ,EAAE;QACZ,MAAM,SAAS,GAAG,qCAAqC,CAAA;QACvD,MAAM,YAAY,GAAG,GAAG,IAAI,KAAK,SAAS,GAAG,EAAE,CAAC,GAAG,GAAG,YAAY,GAAG,EAAE,CAAC,GAAG,GAAG,SAAS,EAAE,CAAA;QACzF,2BAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;KACtC;SAAM;QACL,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,YAAY,CAAC,CAAA;KAC9C;AACH,CAAC;AAZD,wCAYC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;IACjD,IAAI,QAAQ,EAAE;QACZ,2BAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;KACpC;SAAM;QACL,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;KACxC;IACD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AARD,0BAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,cAAc,KAAK,KAAK,EAAE;QAC/C,OAAO,GAAG,CAAA;KACX;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AAZD,4BAYC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,IAAY,EACZ,OAAsB;IAEtB,MAAM,MAAM,GAAa,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;SAC7C,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;IAExB,OAAO,MAAM,CAAA;AACf,CAAC;AATD,8CASC;AAED;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,IAAY,EAAE,OAAsB;IAClE,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACnC,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACxC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IAC1C,MAAM,IAAI,SAAS,CACjB,6DAA6D,IAAI,IAAI;QACnE,4EAA4E,CAC/E,CAAA;AACH,CAAC;AAVD,0CAUC;AAED;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;IAC5B,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAHD,8BAGC;AAED;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAgB;IAC7C,eAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACvC,CAAC;AAFD,wCAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAuB;IAC/C,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IAEnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAJD,8BAIC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAA;AAC5C,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAuB;IAC3C,eAAK,CAAC,OAAO,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AACzE,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAuB;IAC7C,eAAK,CAAC,SAAS,EAAE,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AAC3E,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/node_modules/@actions/core/lib/file-command.js b/node_modules/@actions/core/lib/file-command.js index 10783c0..55e3e9f 100644 --- a/node_modules/@actions/core/lib/file-command.js +++ b/node_modules/@actions/core/lib/file-command.js @@ -1,13 +1,26 @@ "use strict"; // For internal use, subject to change. +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); +exports.issueCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(require("fs")); diff --git a/node_modules/@actions/core/lib/file-command.js.map b/node_modules/@actions/core/lib/file-command.js.map index 45fd8c4..ee35699 100644 --- a/node_modules/@actions/core/lib/file-command.js.map +++ b/node_modules/@actions/core/lib/file-command.js.map @@ -1 +1 @@ -{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,YAAY,CAAC,OAAe,EAAE,OAAY;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,oCAcC"} \ No newline at end of file +{"version":3,"file":"file-command.js","sourceRoot":"","sources":["../src/file-command.ts"],"names":[],"mappings":";AAAA,uCAAuC;;;;;;;;;;;;;;;;;;;;;;AAEvC,mCAAmC;AACnC,uDAAuD;AAEvD,uCAAwB;AACxB,uCAAwB;AACxB,mCAAsC;AAEtC,SAAgB,YAAY,CAAC,OAAe,EAAE,OAAY;IACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAA;IACjD,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CACb,wDAAwD,OAAO,EAAE,CAClE,CAAA;KACF;IACD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAA;KACrD;IAED,EAAE,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACjE,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAA;AACJ,CAAC;AAdD,oCAcC"} \ No newline at end of file diff --git a/node_modules/@actions/core/lib/utils.js b/node_modules/@actions/core/lib/utils.js index 97cea33..e83052e 100644 --- a/node_modules/@actions/core/lib/utils.js +++ b/node_modules/@actions/core/lib/utils.js @@ -2,6 +2,7 @@ // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.toCommandValue = void 0; /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string diff --git a/node_modules/@actions/core/lib/utils.js.map b/node_modules/@actions/core/lib/utils.js.map index ce43f03..6b68d95 100644 --- a/node_modules/@actions/core/lib/utils.js.map +++ b/node_modules/@actions/core/lib/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;AAEvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC"} \ No newline at end of file +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA,mCAAmC;AACnC,uDAAuD;;;AAEvD;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC"} \ No newline at end of file diff --git a/node_modules/@actions/core/package.json b/node_modules/@actions/core/package.json index a0e72b3..9403749 100644 --- a/node_modules/@actions/core/package.json +++ b/node_modules/@actions/core/package.json @@ -1,6 +1,6 @@ { "name": "@actions/core", - "version": "1.2.7", + "version": "1.4.0", "description": "Actions core lib", "keywords": [ "github", diff --git a/node_modules/@actions/github/LICENSE.md b/node_modules/@actions/github/LICENSE.md new file mode 100644 index 0000000..dbae2ed --- /dev/null +++ b/node_modules/@actions/github/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright 2019 GitHub + +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. \ No newline at end of file diff --git a/node_modules/@actions/github/README.md b/node_modules/@actions/github/README.md index 02e9be0..21daad3 100644 --- a/node_modules/@actions/github/README.md +++ b/node_modules/@actions/github/README.md @@ -22,7 +22,7 @@ async function run() { // You can also pass in additional options as a second parameter to getOctokit // const octokit = github.getOctokit(myToken, {userAgent: "MyActionVersion1"}); - const { data: pullRequest } = await octokit.pulls.get({ + const { data: pullRequest } = await octokit.rest.pulls.get({ owner: 'octokit', repo: 'rest.js', pull_number: 123, @@ -50,7 +50,7 @@ const github = require('@actions/github'); const context = github.context; -const newIssue = await octokit.issues.create({ +const newIssue = await octokit.rest.issues.create({ ...context.repo, title: 'New issue!', body: 'Hello Universe!' @@ -90,7 +90,7 @@ const octokit = GitHub.plugin(enterpriseServer220Admin) const myToken = core.getInput('myToken'); const myOctokit = new octokit(getOctokitOptions(token)) // Create a new user -myOctokit.enterpriseAdmin.createUser({ +myOctokit.rest.enterpriseAdmin.createUser({ login: "testuser", email: "testuser@test.com", }); diff --git a/node_modules/@actions/github/lib/context.d.ts b/node_modules/@actions/github/lib/context.d.ts index daab690..7d3a7de 100644 --- a/node_modules/@actions/github/lib/context.d.ts +++ b/node_modules/@actions/github/lib/context.d.ts @@ -13,6 +13,9 @@ export declare class Context { job: string; runNumber: number; runId: number; + apiUrl: string; + serverUrl: string; + graphqlUrl: string; /** * Hydrate the context from the environment */ diff --git a/node_modules/@actions/github/lib/context.js b/node_modules/@actions/github/lib/context.js index dd4d10a..767933c 100644 --- a/node_modules/@actions/github/lib/context.js +++ b/node_modules/@actions/github/lib/context.js @@ -8,6 +8,7 @@ class Context { * Hydrate the context from the environment */ constructor() { + var _a, _b, _c; this.payload = {}; if (process.env.GITHUB_EVENT_PATH) { if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) { @@ -27,6 +28,9 @@ class Context { this.job = process.env.GITHUB_JOB; this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10); this.runId = parseInt(process.env.GITHUB_RUN_ID, 10); + this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`; + this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`; + this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`; } get issue() { const payload = this.payload; diff --git a/node_modules/@actions/github/lib/context.js.map b/node_modules/@actions/github/lib/context.js.map index 9c4eafe..91fb9a9 100644 --- a/node_modules/@actions/github/lib/context.js.map +++ b/node_modules/@actions/github/lib/context.js.map @@ -1 +1 @@ -{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAEA,2BAA2C;AAC3C,2BAAsB;AAEtB,MAAa,OAAO;IAgBlB;;OAEG;IACH;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,IAAI,eAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAChE,CAAA;aACF;iBAAM;gBACL,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;gBAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,IAAI,kBAAkB,QAAG,EAAE,CAAC,CAAA;aACvE;SACF;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAA2B,CAAA;QACxD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAyB,CAAA;QACrD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAuB,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAsB,CAAA;QAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAA2B,EAAE,EAAE,CAAC,CAAA;QACtE,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAuB,EAAE,EAAE,CAAC,CAAA;IAChE,CAAC;IAED,IAAI,KAAK;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,uCACK,IAAI,CAAC,IAAI,KACZ,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,CAAC,MAAM,IAClE;IACH,CAAC;IAED,IAAI,IAAI;QACN,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC9D,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,CAAA;SACrB;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK;gBAC1C,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI;aACnC,CAAA;SACF;QAED,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAA;IACH,CAAC;CACF;AApED,0BAoEC"} \ No newline at end of file +{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAEA,2BAA2C;AAC3C,2BAAsB;AAEtB,MAAa,OAAO;IAmBlB;;OAEG;IACH;;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,IAAI,eAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAY,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAChE,CAAA;aACF;iBAAM;gBACL,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAA;gBAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,IAAI,kBAAkB,QAAG,EAAE,CAAC,CAAA;aACvE;SACF;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAA2B,CAAA;QACxD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAyB,CAAA;QACrD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,aAAuB,CAAA;QACjD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAsB,CAAA;QAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAoB,CAAA;QAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAA2B,EAAE,EAAE,CAAC,CAAA;QACtE,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAuB,EAAE,EAAE,CAAC,CAAA;QAC9D,IAAI,CAAC,MAAM,SAAG,OAAO,CAAC,GAAG,CAAC,cAAc,mCAAI,wBAAwB,CAAA;QACpE,IAAI,CAAC,SAAS,SAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,mCAAI,oBAAoB,CAAA;QACtE,IAAI,CAAC,UAAU,SACb,OAAO,CAAC,GAAG,CAAC,kBAAkB,mCAAI,gCAAgC,CAAA;IACtE,CAAC;IAED,IAAI,KAAK;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAE5B,uCACK,IAAI,CAAC,IAAI,KACZ,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,CAAC,MAAM,IAClE;IACH,CAAC;IAED,IAAI,IAAI;QACN,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC9D,OAAO,EAAC,KAAK,EAAE,IAAI,EAAC,CAAA;SACrB;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK;gBAC1C,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI;aACnC,CAAA;SACF;QAED,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAA;IACH,CAAC;CACF;AA3ED,0BA2EC"} \ No newline at end of file diff --git a/node_modules/@actions/github/lib/github.js b/node_modules/@actions/github/lib/github.js index e30e81e..f02c9fb 100644 --- a/node_modules/@actions/github/lib/github.js +++ b/node_modules/@actions/github/lib/github.js @@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; diff --git a/node_modules/@actions/github/lib/internal/utils.js b/node_modules/@actions/github/lib/internal/utils.js index 197a441..175a4da 100644 --- a/node_modules/@actions/github/lib/internal/utils.js +++ b/node_modules/@actions/github/lib/internal/utils.js @@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; diff --git a/node_modules/@actions/github/lib/utils.d.ts b/node_modules/@actions/github/lib/utils.d.ts index 0015a35..fe28cbd 100644 --- a/node_modules/@actions/github/lib/utils.d.ts +++ b/node_modules/@actions/github/lib/utils.d.ts @@ -2,14 +2,7 @@ import * as Context from './context'; import { Octokit } from '@octokit/core'; import { OctokitOptions } from '@octokit/core/dist-types/types'; export declare const context: Context.Context; -export declare const GitHub: (new (...args: any[]) => { - [x: string]: any; -}) & { - new (...args: any[]): { - [x: string]: any; - }; - plugins: any[]; -} & typeof Octokit & import("@octokit/core/dist-types/types").Constructor; /** diff --git a/node_modules/@actions/github/lib/utils.js b/node_modules/@actions/github/lib/utils.js index b066c22..afb40e9 100644 --- a/node_modules/@actions/github/lib/utils.js +++ b/node_modules/@actions/github/lib/utils.js @@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; diff --git a/node_modules/@actions/github/package.json b/node_modules/@actions/github/package.json index 0288f17..091cebc 100644 --- a/node_modules/@actions/github/package.json +++ b/node_modules/@actions/github/package.json @@ -1,12 +1,12 @@ { "name": "@actions/github", - "version": "4.0.0", + "version": "5.0.0", "description": "Actions github lib", "keywords": [ "github", "actions" ], - "homepage": "https://github.com/actions/toolkit/tree/master/packages/github", + "homepage": "https://github.com/actions/toolkit/tree/main/packages/github", "license": "MIT", "main": "lib/github.js", "types": "lib/github.d.ts", @@ -27,7 +27,7 @@ "directory": "packages/github" }, "scripts": { - "audit-moderate": "npm install && npm audit --audit-level=moderate", + "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", "test": "jest", "build": "tsc", "format": "prettier --write **/*.ts", @@ -38,13 +38,13 @@ "url": "https://github.com/actions/toolkit/issues" }, "dependencies": { - "@actions/http-client": "^1.0.8", - "@octokit/core": "^3.0.0", - "@octokit/plugin-paginate-rest": "^2.2.3", - "@octokit/plugin-rest-endpoint-methods": "^4.0.0" + "@actions/http-client": "^1.0.11", + "@octokit/core": "^3.4.0", + "@octokit/plugin-paginate-rest": "^2.13.3", + "@octokit/plugin-rest-endpoint-methods": "^5.1.1" }, "devDependencies": { - "jest": "^25.1.0", - "proxy": "^1.0.1" + "jest": "^26.6.3", + "proxy": "^1.0.2" } } diff --git a/node_modules/@actions/http-client/RELEASES.md b/node_modules/@actions/http-client/RELEASES.md index 79f9a58..935178a 100644 --- a/node_modules/@actions/http-client/RELEASES.md +++ b/node_modules/@actions/http-client/RELEASES.md @@ -1,5 +1,15 @@ ## Releases +## 1.0.10 + +Contains a bug fix where proxy is defined without a user and password. see [PR here](https://github.com/actions/http-client/pull/42) + +## 1.0.9 +Throw HttpClientError instead of a generic Error from the \Json() helper methods when the server responds with a non-successful status code. + +## 1.0.8 +Fixed security issue where a redirect (e.g. 302) to another domain would pass headers. The fix was to strip the authorization header if the hostname was different. More [details in PR #27](https://github.com/actions/http-client/pull/27) + ## 1.0.7 Update NPM dependencies and add 429 to the list of HttpCodes @@ -13,4 +23,4 @@ Adds \Json() helper methods for json over http scenarios. Started to add \Json() helper methods. Do not use this release for that. Use >= 1.0.5 since there was an issue with types. ## 1.0.1 to 1.0.3 -Adds proxy support. \ No newline at end of file +Adds proxy support. diff --git a/node_modules/@actions/http-client/index.d.ts b/node_modules/@actions/http-client/index.d.ts index 7cdc115..9583dc7 100644 --- a/node_modules/@actions/http-client/index.d.ts +++ b/node_modules/@actions/http-client/index.d.ts @@ -42,6 +42,11 @@ export declare enum MediaTypes { * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ export declare function getProxyUrl(serverUrl: string): string; +export declare class HttpClientError extends Error { + constructor(message: string, statusCode: number); + statusCode: number; + result?: any; +} export declare class HttpClientResponse implements ifm.IHttpClientResponse { constructor(message: http.IncomingMessage); message: http.IncomingMessage; diff --git a/node_modules/@actions/http-client/index.js b/node_modules/@actions/http-client/index.js index e1930da..43b2b10 100644 --- a/node_modules/@actions/http-client/index.js +++ b/node_modules/@actions/http-client/index.js @@ -1,6 +1,5 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const url = require("url"); const http = require("http"); const https = require("https"); const pm = require("./proxy"); @@ -49,7 +48,7 @@ var MediaTypes; * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ function getProxyUrl(serverUrl) { - let proxyUrl = pm.getProxyUrl(url.parse(serverUrl)); + let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } exports.getProxyUrl = getProxyUrl; @@ -68,6 +67,15 @@ const HttpResponseRetryCodes = [ const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const ExponentialBackoffCeiling = 10; const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } +} +exports.HttpClientError = HttpClientError; class HttpClientResponse { constructor(message) { this.message = message; @@ -86,7 +94,7 @@ class HttpClientResponse { } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { - let parsedUrl = url.parse(requestUrl); + let parsedUrl = new URL(requestUrl); return parsedUrl.protocol === 'https:'; } exports.isHttps = isHttps; @@ -191,7 +199,7 @@ class HttpClient { if (this._disposed) { throw new Error('Client has already been disposed.'); } - let parsedUrl = url.parse(requestUrl); + let parsedUrl = new URL(requestUrl); let info = this._prepareRequest(verb, parsedUrl, headers); // Only perform retries on reads since writes may not be idempotent. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 @@ -230,7 +238,7 @@ class HttpClient { // if there's no location to redirect to, we won't break; } - let parsedRedirectUrl = url.parse(redirectUrl); + let parsedRedirectUrl = new URL(redirectUrl); if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { @@ -346,7 +354,7 @@ class HttpClient { * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { - let parsedUrl = url.parse(serverUrl); + let parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } _prepareRequest(method, requestUrl, headers) { @@ -419,7 +427,9 @@ class HttpClient { maxSockets: maxSockets, keepAlive: this._keepAlive, proxy: { - proxyAuth: proxyUrl.auth, + ...((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), host: proxyUrl.hostname, port: proxyUrl.port } @@ -514,12 +524,8 @@ class HttpClient { else { msg = 'Failed request: (' + statusCode + ')'; } - let err = new Error(msg); - // attach statusCode and body obj (if available) to the error object - err['statusCode'] = statusCode; - if (response.result) { - err['result'] = response.result; - } + let err = new HttpClientError(msg, statusCode); + err.result = response.result; reject(err); } else { diff --git a/node_modules/@actions/http-client/interfaces.d.ts b/node_modules/@actions/http-client/interfaces.d.ts index 0b348dc..78bd85b 100644 --- a/node_modules/@actions/http-client/interfaces.d.ts +++ b/node_modules/@actions/http-client/interfaces.d.ts @@ -1,6 +1,5 @@ /// import http = require('http'); -import url = require('url'); export interface IHeaders { [key: string]: any; } @@ -27,7 +26,7 @@ export interface IHttpClientResponse { } export interface IRequestInfo { options: http.RequestOptions; - parsedUrl: url.Url; + parsedUrl: URL; httpModule: any; } export interface IRequestOptions { diff --git a/node_modules/@actions/http-client/package.json b/node_modules/@actions/http-client/package.json index e57d099..0c99fd4 100644 --- a/node_modules/@actions/http-client/package.json +++ b/node_modules/@actions/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "1.0.8", + "version": "1.0.11", "description": "Actions Http Client", "main": "index.js", "scripts": { diff --git a/node_modules/@actions/http-client/proxy.d.ts b/node_modules/@actions/http-client/proxy.d.ts index 9995ea5..4599865 100644 --- a/node_modules/@actions/http-client/proxy.d.ts +++ b/node_modules/@actions/http-client/proxy.d.ts @@ -1,4 +1,2 @@ -/// -import * as url from 'url'; -export declare function getProxyUrl(reqUrl: url.Url): url.Url | undefined; -export declare function checkBypass(reqUrl: url.Url): boolean; +export declare function getProxyUrl(reqUrl: URL): URL | undefined; +export declare function checkBypass(reqUrl: URL): boolean; diff --git a/node_modules/@actions/http-client/proxy.js b/node_modules/@actions/http-client/proxy.js index 06936b3..88f00ec 100644 --- a/node_modules/@actions/http-client/proxy.js +++ b/node_modules/@actions/http-client/proxy.js @@ -1,6 +1,5 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const url = require("url"); function getProxyUrl(reqUrl) { let usingSsl = reqUrl.protocol === 'https:'; let proxyUrl; @@ -15,7 +14,7 @@ function getProxyUrl(reqUrl) { proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; } if (proxyVar) { - proxyUrl = url.parse(proxyVar); + proxyUrl = new URL(proxyVar); } return proxyUrl; } diff --git a/node_modules/@babel/runtime/LICENSE b/node_modules/@babel/runtime/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/node_modules/@babel/runtime/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other 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/@babel/runtime/README.md b/node_modules/@babel/runtime/README.md deleted file mode 100644 index 119c99d..0000000 --- a/node_modules/@babel/runtime/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/runtime - -> babel's modular runtime helpers - -See our website [@babel/runtime](https://babeljs.io/docs/en/babel-runtime) for more information. - -## Install - -Using npm: - -```sh -npm install --save @babel/runtime -``` - -or using yarn: - -```sh -yarn add @babel/runtime -``` diff --git a/node_modules/@babel/runtime/helpers/AsyncGenerator.js b/node_modules/@babel/runtime/helpers/AsyncGenerator.js deleted file mode 100644 index 5e23730..0000000 --- a/node_modules/@babel/runtime/helpers/AsyncGenerator.js +++ /dev/null @@ -1,100 +0,0 @@ -var AwaitValue = require("./AwaitValue"); - -function AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen["return"] !== "function") { - this["return"] = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -AsyncGenerator.prototype["throw"] = function (arg) { - return this._invoke("throw", arg); -}; - -AsyncGenerator.prototype["return"] = function (arg) { - return this._invoke("return", arg); -}; - -module.exports = AsyncGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/AwaitValue.js b/node_modules/@babel/runtime/helpers/AwaitValue.js deleted file mode 100644 index f9f4184..0000000 --- a/node_modules/@babel/runtime/helpers/AwaitValue.js +++ /dev/null @@ -1,5 +0,0 @@ -function _AwaitValue(value) { - this.wrapped = value; -} - -module.exports = _AwaitValue; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js b/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js deleted file mode 100644 index b0b41dd..0000000 --- a/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +++ /dev/null @@ -1,30 +0,0 @@ -function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} - -module.exports = _applyDecoratedDescriptor; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/arrayLikeToArray.js b/node_modules/@babel/runtime/helpers/arrayLikeToArray.js deleted file mode 100644 index d620194..0000000 --- a/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +++ /dev/null @@ -1,11 +0,0 @@ -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; -} - -module.exports = _arrayLikeToArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/arrayWithHoles.js b/node_modules/@babel/runtime/helpers/arrayWithHoles.js deleted file mode 100644 index 5a62a8c..0000000 --- a/node_modules/@babel/runtime/helpers/arrayWithHoles.js +++ /dev/null @@ -1,5 +0,0 @@ -function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} - -module.exports = _arrayWithHoles; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js b/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js deleted file mode 100644 index 694681c..0000000 --- a/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +++ /dev/null @@ -1,7 +0,0 @@ -var arrayLikeToArray = require("./arrayLikeToArray"); - -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return arrayLikeToArray(arr); -} - -module.exports = _arrayWithoutHoles; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/assertThisInitialized.js b/node_modules/@babel/runtime/helpers/assertThisInitialized.js deleted file mode 100644 index 98d2949..0000000 --- a/node_modules/@babel/runtime/helpers/assertThisInitialized.js +++ /dev/null @@ -1,9 +0,0 @@ -function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} - -module.exports = _assertThisInitialized; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js b/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js deleted file mode 100644 index c37ecf2..0000000 --- a/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +++ /dev/null @@ -1,58 +0,0 @@ -function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner["throw"] === "function") { - iter["throw"] = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner["return"] === "function") { - iter["return"] = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} - -module.exports = _asyncGeneratorDelegate; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/asyncIterator.js b/node_modules/@babel/runtime/helpers/asyncIterator.js deleted file mode 100644 index ef5db27..0000000 --- a/node_modules/@babel/runtime/helpers/asyncIterator.js +++ /dev/null @@ -1,19 +0,0 @@ -function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} - -module.exports = _asyncIterator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/asyncToGenerator.js b/node_modules/@babel/runtime/helpers/asyncToGenerator.js deleted file mode 100644 index f5db93d..0000000 --- a/node_modules/@babel/runtime/helpers/asyncToGenerator.js +++ /dev/null @@ -1,37 +0,0 @@ -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} - -module.exports = _asyncToGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js b/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js deleted file mode 100644 index 59f797a..0000000 --- a/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +++ /dev/null @@ -1,7 +0,0 @@ -var AwaitValue = require("./AwaitValue"); - -function _awaitAsyncGenerator(value) { - return new AwaitValue(value); -} - -module.exports = _awaitAsyncGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classCallCheck.js b/node_modules/@babel/runtime/helpers/classCallCheck.js deleted file mode 100644 index f389f2e..0000000 --- a/node_modules/@babel/runtime/helpers/classCallCheck.js +++ /dev/null @@ -1,7 +0,0 @@ -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -module.exports = _classCallCheck; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classNameTDZError.js b/node_modules/@babel/runtime/helpers/classNameTDZError.js deleted file mode 100644 index 8c1bdf5..0000000 --- a/node_modules/@babel/runtime/helpers/classNameTDZError.js +++ /dev/null @@ -1,5 +0,0 @@ -function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} - -module.exports = _classNameTDZError; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js b/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js deleted file mode 100644 index fab9105..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +++ /dev/null @@ -1,28 +0,0 @@ -function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} - -module.exports = _classPrivateFieldDestructureSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js b/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js deleted file mode 100644 index 106c3cd..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +++ /dev/null @@ -1,15 +0,0 @@ -function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -module.exports = _classPrivateFieldGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js b/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js deleted file mode 100644 index 64ed79d..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +++ /dev/null @@ -1,9 +0,0 @@ -function _classPrivateFieldBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} - -module.exports = _classPrivateFieldBase; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js b/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js deleted file mode 100644 index a1a6417..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +++ /dev/null @@ -1,7 +0,0 @@ -var id = 0; - -function _classPrivateFieldKey(name) { - return "__private_" + id++ + "_" + name; -} - -module.exports = _classPrivateFieldKey; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js b/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js deleted file mode 100644 index c92f97a..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +++ /dev/null @@ -1,21 +0,0 @@ -function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -module.exports = _classPrivateFieldSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js deleted file mode 100644 index a3432b9..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +++ /dev/null @@ -1,9 +0,0 @@ -function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} - -module.exports = _classPrivateMethodGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js deleted file mode 100644 index 3847284..0000000 --- a/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +++ /dev/null @@ -1,5 +0,0 @@ -function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} - -module.exports = _classPrivateMethodSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js deleted file mode 100644 index c2b6766..0000000 --- a/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +++ /dev/null @@ -1,13 +0,0 @@ -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} - -module.exports = _classStaticPrivateFieldSpecGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js deleted file mode 100644 index 8799fbb..0000000 --- a/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +++ /dev/null @@ -1,19 +0,0 @@ -function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} - -module.exports = _classStaticPrivateFieldSpecSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js deleted file mode 100644 index f9b0d00..0000000 --- a/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +++ /dev/null @@ -1,9 +0,0 @@ -function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} - -module.exports = _classStaticPrivateMethodGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js deleted file mode 100644 index 89042da..0000000 --- a/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +++ /dev/null @@ -1,5 +0,0 @@ -function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} - -module.exports = _classStaticPrivateMethodSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/construct.js b/node_modules/@babel/runtime/helpers/construct.js deleted file mode 100644 index e6cccf0..0000000 --- a/node_modules/@babel/runtime/helpers/construct.js +++ /dev/null @@ -1,22 +0,0 @@ -var setPrototypeOf = require("./setPrototypeOf"); - -var isNativeReflectConstruct = require("./isNativeReflectConstruct"); - -function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { - module.exports = _construct = Reflect.construct; - } else { - module.exports = _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} - -module.exports = _construct; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/createClass.js b/node_modules/@babel/runtime/helpers/createClass.js deleted file mode 100644 index f9d4841..0000000 --- a/node_modules/@babel/runtime/helpers/createClass.js +++ /dev/null @@ -1,17 +0,0 @@ -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} - -module.exports = _createClass; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js b/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js deleted file mode 100644 index fbb3743..0000000 --- a/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +++ /dev/null @@ -1,60 +0,0 @@ -var unsupportedIterableToArray = require("./unsupportedIterableToArray"); - -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - - var F = function F() {}; - - return { - s: F, - n: function n() { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }, - e: function e(_e) { - throw _e; - }, - f: F - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - var normalCompletion = true, - didErr = false, - err; - return { - s: function s() { - it = o[Symbol.iterator](); - }, - n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function e(_e2) { - didErr = true; - err = _e2; - }, - f: function f() { - try { - if (!normalCompletion && it["return"] != null) it["return"](); - } finally { - if (didErr) throw err; - } - } - }; -} - -module.exports = _createForOfIteratorHelper; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js b/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js deleted file mode 100644 index 547d4b9..0000000 --- a/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +++ /dev/null @@ -1,28 +0,0 @@ -var unsupportedIterableToArray = require("./unsupportedIterableToArray"); - -function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} - -module.exports = _createForOfIteratorHelperLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/createSuper.js b/node_modules/@babel/runtime/helpers/createSuper.js deleted file mode 100644 index fcf1283..0000000 --- a/node_modules/@babel/runtime/helpers/createSuper.js +++ /dev/null @@ -1,24 +0,0 @@ -var getPrototypeOf = require("./getPrototypeOf"); - -var isNativeReflectConstruct = require("./isNativeReflectConstruct"); - -var possibleConstructorReturn = require("./possibleConstructorReturn"); - -function _createSuper(Derived) { - var hasNativeReflectConstruct = isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return possibleConstructorReturn(this, result); - }; -} - -module.exports = _createSuper; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/decorate.js b/node_modules/@babel/runtime/helpers/decorate.js deleted file mode 100644 index 77c0b98..0000000 --- a/node_modules/@babel/runtime/helpers/decorate.js +++ /dev/null @@ -1,400 +0,0 @@ -var toArray = require("./toArray"); - -var toPropertyKey = require("./toPropertyKey"); - -function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function _getDecoratorsApi() { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function initializeInstanceElements(O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function initializeClassElements(F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function defineClassElement(receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function decorateClass(elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - "static": [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function addElementPlacement(element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function decorateElement(element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function decorateConstructor(elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function fromElementDescriptor(element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function toElementDescriptors(elementObjects) { - if (elementObjects === undefined) return; - return toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function toElementDescriptor(elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = toPropertyKey(elementObject.key); - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function toElementFinisherExtras(elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function fromClassDescriptor(elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function toClassDescriptor(obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function runClassFinishers(constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function disallowProperty(obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = toPropertyKey(def.key); - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function isSameElement(other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} - -module.exports = _decorate; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/defaults.js b/node_modules/@babel/runtime/helpers/defaults.js deleted file mode 100644 index 55ba1fe..0000000 --- a/node_modules/@babel/runtime/helpers/defaults.js +++ /dev/null @@ -1,16 +0,0 @@ -function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} - -module.exports = _defaults; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js b/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js deleted file mode 100644 index 5d80ea1..0000000 --- a/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +++ /dev/null @@ -1,24 +0,0 @@ -function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} - -module.exports = _defineEnumerableProperties; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/defineProperty.js b/node_modules/@babel/runtime/helpers/defineProperty.js deleted file mode 100644 index 32a8d73..0000000 --- a/node_modules/@babel/runtime/helpers/defineProperty.js +++ /dev/null @@ -1,16 +0,0 @@ -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; -} - -module.exports = _defineProperty; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js b/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js deleted file mode 100644 index 4e746cf..0000000 --- a/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js +++ /dev/null @@ -1,97 +0,0 @@ -import AwaitValue from "@babel/runtime/helpers/esm/AwaitValue"; -export default function AsyncGenerator(gen) { - var front, back; - - function send(key, arg) { - return new Promise(function (resolve, reject) { - var request = { - key: key, - arg: arg, - resolve: resolve, - reject: reject, - next: null - }; - - if (back) { - back = back.next = request; - } else { - front = back = request; - resume(key, arg); - } - }); - } - - function resume(key, arg) { - try { - var result = gen[key](arg); - var value = result.value; - var wrappedAwait = value instanceof AwaitValue; - Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { - if (wrappedAwait) { - resume(key === "return" ? "return" : "next", arg); - return; - } - - settle(result.done ? "return" : "normal", arg); - }, function (err) { - resume("throw", err); - }); - } catch (err) { - settle("throw", err); - } - } - - function settle(type, value) { - switch (type) { - case "return": - front.resolve({ - value: value, - done: true - }); - break; - - case "throw": - front.reject(value); - break; - - default: - front.resolve({ - value: value, - done: false - }); - break; - } - - front = front.next; - - if (front) { - resume(front.key, front.arg); - } else { - back = null; - } - } - - this._invoke = send; - - if (typeof gen["return"] !== "function") { - this["return"] = undefined; - } -} - -if (typeof Symbol === "function" && Symbol.asyncIterator) { - AsyncGenerator.prototype[Symbol.asyncIterator] = function () { - return this; - }; -} - -AsyncGenerator.prototype.next = function (arg) { - return this._invoke("next", arg); -}; - -AsyncGenerator.prototype["throw"] = function (arg) { - return this._invoke("throw", arg); -}; - -AsyncGenerator.prototype["return"] = function (arg) { - return this._invoke("return", arg); -}; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/AwaitValue.js b/node_modules/@babel/runtime/helpers/esm/AwaitValue.js deleted file mode 100644 index 5237e18..0000000 --- a/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _AwaitValue(value) { - this.wrapped = value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js b/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js deleted file mode 100644 index 84b5961..0000000 --- a/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +++ /dev/null @@ -1,28 +0,0 @@ -export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { - var desc = {}; - Object.keys(descriptor).forEach(function (key) { - desc[key] = descriptor[key]; - }); - desc.enumerable = !!desc.enumerable; - desc.configurable = !!desc.configurable; - - if ('value' in desc || desc.initializer) { - desc.writable = true; - } - - desc = decorators.slice().reverse().reduce(function (desc, decorator) { - return decorator(target, property, desc) || desc; - }, desc); - - if (context && desc.initializer !== void 0) { - desc.value = desc.initializer ? desc.initializer.call(context) : void 0; - desc.initializer = undefined; - } - - if (desc.initializer === void 0) { - Object.defineProperty(target, property, desc); - desc = null; - } - - return desc; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js b/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js deleted file mode 100644 index edbeb8e..0000000 --- a/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +++ /dev/null @@ -1,9 +0,0 @@ -export default function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - - return arr2; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js b/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js deleted file mode 100644 index be734fc..0000000 --- a/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js b/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js deleted file mode 100644 index 80d4b5b..0000000 --- a/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +++ /dev/null @@ -1,4 +0,0 @@ -import arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray"; -export default function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) return arrayLikeToArray(arr); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js b/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js deleted file mode 100644 index bbf849c..0000000 --- a/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +++ /dev/null @@ -1,7 +0,0 @@ -export default function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return self; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js b/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js deleted file mode 100644 index eb56fe5..0000000 --- a/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +++ /dev/null @@ -1,56 +0,0 @@ -export default function _asyncGeneratorDelegate(inner, awaitWrap) { - var iter = {}, - waiting = false; - - function pump(key, value) { - waiting = true; - value = new Promise(function (resolve) { - resolve(inner[key](value)); - }); - return { - done: false, - value: awaitWrap(value) - }; - } - - ; - - if (typeof Symbol === "function" && Symbol.iterator) { - iter[Symbol.iterator] = function () { - return this; - }; - } - - iter.next = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("next", value); - }; - - if (typeof inner["throw"] === "function") { - iter["throw"] = function (value) { - if (waiting) { - waiting = false; - throw value; - } - - return pump("throw", value); - }; - } - - if (typeof inner["return"] === "function") { - iter["return"] = function (value) { - if (waiting) { - waiting = false; - return value; - } - - return pump("return", value); - }; - } - - return iter; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/asyncIterator.js b/node_modules/@babel/runtime/helpers/esm/asyncIterator.js deleted file mode 100644 index e03fa97..0000000 --- a/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +++ /dev/null @@ -1,17 +0,0 @@ -export default function _asyncIterator(iterable) { - var method; - - if (typeof Symbol !== "undefined") { - if (Symbol.asyncIterator) { - method = iterable[Symbol.asyncIterator]; - if (method != null) return method.call(iterable); - } - - if (Symbol.iterator) { - method = iterable[Symbol.iterator]; - if (method != null) return method.call(iterable); - } - } - - throw new TypeError("Object is not async iterable"); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js b/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js deleted file mode 100644 index 2a25f54..0000000 --- a/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +++ /dev/null @@ -1,35 +0,0 @@ -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } -} - -export default function _asyncToGenerator(fn) { - return function () { - var self = this, - args = arguments; - return new Promise(function (resolve, reject) { - var gen = fn.apply(self, args); - - function _next(value) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); - } - - function _throw(err) { - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); - } - - _next(undefined); - }); - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js b/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js deleted file mode 100644 index 32db496..0000000 --- a/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +++ /dev/null @@ -1,4 +0,0 @@ -import AwaitValue from "@babel/runtime/helpers/esm/AwaitValue"; -export default function _awaitAsyncGenerator(value) { - return new AwaitValue(value); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classCallCheck.js b/node_modules/@babel/runtime/helpers/esm/classCallCheck.js deleted file mode 100644 index 2f1738a..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +++ /dev/null @@ -1,5 +0,0 @@ -export default function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js b/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js deleted file mode 100644 index f7b6dd5..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _classNameTDZError(name) { - throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js deleted file mode 100644 index 1f265bc..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +++ /dev/null @@ -1,26 +0,0 @@ -export default function _classPrivateFieldDestructureSet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - - var descriptor = privateMap.get(receiver); - - if (descriptor.set) { - if (!("__destrObj" in descriptor)) { - descriptor.__destrObj = { - set value(v) { - descriptor.set.call(receiver, v); - } - - }; - } - - return descriptor.__destrObj; - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - return descriptor; - } -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js deleted file mode 100644 index f8287f1..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +++ /dev/null @@ -1,13 +0,0 @@ -export default function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to get private field on non-instance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js deleted file mode 100644 index 5b10916..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +++ /dev/null @@ -1,7 +0,0 @@ -export default function _classPrivateFieldBase(receiver, privateKey) { - if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { - throw new TypeError("attempted to use private field on non-instance"); - } - - return receiver; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js deleted file mode 100644 index 5b7e5ac..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +++ /dev/null @@ -1,4 +0,0 @@ -var id = 0; -export default function _classPrivateFieldKey(name) { - return "__private_" + id++ + "_" + name; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js deleted file mode 100644 index fb4e5d2..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +++ /dev/null @@ -1,19 +0,0 @@ -export default function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = privateMap.get(receiver); - - if (!descriptor) { - throw new TypeError("attempted to set private field on non-instance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js deleted file mode 100644 index 38b9d58..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +++ /dev/null @@ -1,7 +0,0 @@ -export default function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - - return fn; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js deleted file mode 100644 index 2bbaf3a..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _classPrivateMethodSet() { - throw new TypeError("attempted to reassign private method"); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js deleted file mode 100644 index 75a9b7c..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.get) { - return descriptor.get.call(receiver); - } - - return descriptor.value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js deleted file mode 100644 index 163279f..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +++ /dev/null @@ -1,17 +0,0 @@ -export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError("attempted to set read only private field"); - } - - descriptor.value = value; - } - - return value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js deleted file mode 100644 index da9b1e5..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +++ /dev/null @@ -1,7 +0,0 @@ -export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) { - if (receiver !== classConstructor) { - throw new TypeError("Private static access of wrong provenance"); - } - - return method; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js deleted file mode 100644 index d5ab60a..0000000 --- a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _classStaticPrivateMethodSet() { - throw new TypeError("attempted to set read only static private field"); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/construct.js b/node_modules/@babel/runtime/helpers/esm/construct.js deleted file mode 100644 index f9a94cd..0000000 --- a/node_modules/@babel/runtime/helpers/esm/construct.js +++ /dev/null @@ -1,18 +0,0 @@ -import setPrototypeOf from "@babel/runtime/helpers/esm/setPrototypeOf"; -import isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct"; -export default function _construct(Parent, args, Class) { - if (isNativeReflectConstruct()) { - _construct = Reflect.construct; - } else { - _construct = function _construct(Parent, args, Class) { - var a = [null]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) setPrototypeOf(instance, Class.prototype); - return instance; - }; - } - - return _construct.apply(null, arguments); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/createClass.js b/node_modules/@babel/runtime/helpers/esm/createClass.js deleted file mode 100644 index d6cf412..0000000 --- a/node_modules/@babel/runtime/helpers/esm/createClass.js +++ /dev/null @@ -1,15 +0,0 @@ -function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } -} - -export default function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js b/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js deleted file mode 100644 index f929137..0000000 --- a/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +++ /dev/null @@ -1,57 +0,0 @@ -import unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -export default function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - - var F = function F() {}; - - return { - s: F, - n: function n() { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }, - e: function e(_e) { - throw _e; - }, - f: F - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - var normalCompletion = true, - didErr = false, - err; - return { - s: function s() { - it = o[Symbol.iterator](); - }, - n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function e(_e2) { - didErr = true; - err = _e2; - }, - f: function f() { - try { - if (!normalCompletion && it["return"] != null) it["return"](); - } finally { - if (didErr) throw err; - } - } - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js b/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js deleted file mode 100644 index 49b6389..0000000 --- a/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +++ /dev/null @@ -1,25 +0,0 @@ -import unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -export default function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it; - - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - it = o[Symbol.iterator](); - return it.next.bind(it); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/createSuper.js b/node_modules/@babel/runtime/helpers/esm/createSuper.js deleted file mode 100644 index 456a95b..0000000 --- a/node_modules/@babel/runtime/helpers/esm/createSuper.js +++ /dev/null @@ -1,19 +0,0 @@ -import getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct"; -import possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -export default function _createSuper(Derived) { - var hasNativeReflectConstruct = isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = getPrototypeOf(Derived), - result; - - if (hasNativeReflectConstruct) { - var NewTarget = getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - - return possibleConstructorReturn(this, result); - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/decorate.js b/node_modules/@babel/runtime/helpers/esm/decorate.js deleted file mode 100644 index 04871f0..0000000 --- a/node_modules/@babel/runtime/helpers/esm/decorate.js +++ /dev/null @@ -1,396 +0,0 @@ -import toArray from "@babel/runtime/helpers/esm/toArray"; -import toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey"; -export default function _decorate(decorators, factory, superClass, mixins) { - var api = _getDecoratorsApi(); - - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - api = mixins[i](api); - } - } - - var r = factory(function initialize(O) { - api.initializeInstanceElements(O, decorated.elements); - }, superClass); - var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); - api.initializeClassElements(r.F, decorated.elements); - return api.runClassFinishers(r.F, decorated.finishers); -} - -function _getDecoratorsApi() { - _getDecoratorsApi = function _getDecoratorsApi() { - return api; - }; - - var api = { - elementsDefinitionOrder: [["method"], ["field"]], - initializeInstanceElements: function initializeInstanceElements(O, elements) { - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - if (element.kind === kind && element.placement === "own") { - this.defineClassElement(O, element); - } - }, this); - }, this); - }, - initializeClassElements: function initializeClassElements(F, elements) { - var proto = F.prototype; - ["method", "field"].forEach(function (kind) { - elements.forEach(function (element) { - var placement = element.placement; - - if (element.kind === kind && (placement === "static" || placement === "prototype")) { - var receiver = placement === "static" ? F : proto; - this.defineClassElement(receiver, element); - } - }, this); - }, this); - }, - defineClassElement: function defineClassElement(receiver, element) { - var descriptor = element.descriptor; - - if (element.kind === "field") { - var initializer = element.initializer; - descriptor = { - enumerable: descriptor.enumerable, - writable: descriptor.writable, - configurable: descriptor.configurable, - value: initializer === void 0 ? void 0 : initializer.call(receiver) - }; - } - - Object.defineProperty(receiver, element.key, descriptor); - }, - decorateClass: function decorateClass(elements, decorators) { - var newElements = []; - var finishers = []; - var placements = { - "static": [], - prototype: [], - own: [] - }; - elements.forEach(function (element) { - this.addElementPlacement(element, placements); - }, this); - elements.forEach(function (element) { - if (!_hasDecorators(element)) return newElements.push(element); - var elementFinishersExtras = this.decorateElement(element, placements); - newElements.push(elementFinishersExtras.element); - newElements.push.apply(newElements, elementFinishersExtras.extras); - finishers.push.apply(finishers, elementFinishersExtras.finishers); - }, this); - - if (!decorators) { - return { - elements: newElements, - finishers: finishers - }; - } - - var result = this.decorateConstructor(newElements, decorators); - finishers.push.apply(finishers, result.finishers); - result.finishers = finishers; - return result; - }, - addElementPlacement: function addElementPlacement(element, placements, silent) { - var keys = placements[element.placement]; - - if (!silent && keys.indexOf(element.key) !== -1) { - throw new TypeError("Duplicated element (" + element.key + ")"); - } - - keys.push(element.key); - }, - decorateElement: function decorateElement(element, placements) { - var extras = []; - var finishers = []; - - for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { - var keys = placements[element.placement]; - keys.splice(keys.indexOf(element.key), 1); - var elementObject = this.fromElementDescriptor(element); - var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); - element = elementFinisherExtras.element; - this.addElementPlacement(element, placements); - - if (elementFinisherExtras.finisher) { - finishers.push(elementFinisherExtras.finisher); - } - - var newExtras = elementFinisherExtras.extras; - - if (newExtras) { - for (var j = 0; j < newExtras.length; j++) { - this.addElementPlacement(newExtras[j], placements); - } - - extras.push.apply(extras, newExtras); - } - } - - return { - element: element, - finishers: finishers, - extras: extras - }; - }, - decorateConstructor: function decorateConstructor(elements, decorators) { - var finishers = []; - - for (var i = decorators.length - 1; i >= 0; i--) { - var obj = this.fromClassDescriptor(elements); - var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); - - if (elementsAndFinisher.finisher !== undefined) { - finishers.push(elementsAndFinisher.finisher); - } - - if (elementsAndFinisher.elements !== undefined) { - elements = elementsAndFinisher.elements; - - for (var j = 0; j < elements.length - 1; j++) { - for (var k = j + 1; k < elements.length; k++) { - if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { - throw new TypeError("Duplicated element (" + elements[j].key + ")"); - } - } - } - } - } - - return { - elements: elements, - finishers: finishers - }; - }, - fromElementDescriptor: function fromElementDescriptor(element) { - var obj = { - kind: element.kind, - key: element.key, - placement: element.placement, - descriptor: element.descriptor - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - if (element.kind === "field") obj.initializer = element.initializer; - return obj; - }, - toElementDescriptors: function toElementDescriptors(elementObjects) { - if (elementObjects === undefined) return; - return toArray(elementObjects).map(function (elementObject) { - var element = this.toElementDescriptor(elementObject); - this.disallowProperty(elementObject, "finisher", "An element descriptor"); - this.disallowProperty(elementObject, "extras", "An element descriptor"); - return element; - }, this); - }, - toElementDescriptor: function toElementDescriptor(elementObject) { - var kind = String(elementObject.kind); - - if (kind !== "method" && kind !== "field") { - throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); - } - - var key = toPropertyKey(elementObject.key); - var placement = String(elementObject.placement); - - if (placement !== "static" && placement !== "prototype" && placement !== "own") { - throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); - } - - var descriptor = elementObject.descriptor; - this.disallowProperty(elementObject, "elements", "An element descriptor"); - var element = { - kind: kind, - key: key, - placement: placement, - descriptor: Object.assign({}, descriptor) - }; - - if (kind !== "field") { - this.disallowProperty(elementObject, "initializer", "A method descriptor"); - } else { - this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); - this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); - element.initializer = elementObject.initializer; - } - - return element; - }, - toElementFinisherExtras: function toElementFinisherExtras(elementObject) { - var element = this.toElementDescriptor(elementObject); - - var finisher = _optionalCallableProperty(elementObject, "finisher"); - - var extras = this.toElementDescriptors(elementObject.extras); - return { - element: element, - finisher: finisher, - extras: extras - }; - }, - fromClassDescriptor: function fromClassDescriptor(elements) { - var obj = { - kind: "class", - elements: elements.map(this.fromElementDescriptor, this) - }; - var desc = { - value: "Descriptor", - configurable: true - }; - Object.defineProperty(obj, Symbol.toStringTag, desc); - return obj; - }, - toClassDescriptor: function toClassDescriptor(obj) { - var kind = String(obj.kind); - - if (kind !== "class") { - throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); - } - - this.disallowProperty(obj, "key", "A class descriptor"); - this.disallowProperty(obj, "placement", "A class descriptor"); - this.disallowProperty(obj, "descriptor", "A class descriptor"); - this.disallowProperty(obj, "initializer", "A class descriptor"); - this.disallowProperty(obj, "extras", "A class descriptor"); - - var finisher = _optionalCallableProperty(obj, "finisher"); - - var elements = this.toElementDescriptors(obj.elements); - return { - elements: elements, - finisher: finisher - }; - }, - runClassFinishers: function runClassFinishers(constructor, finishers) { - for (var i = 0; i < finishers.length; i++) { - var newConstructor = (0, finishers[i])(constructor); - - if (newConstructor !== undefined) { - if (typeof newConstructor !== "function") { - throw new TypeError("Finishers must return a constructor."); - } - - constructor = newConstructor; - } - } - - return constructor; - }, - disallowProperty: function disallowProperty(obj, name, objectType) { - if (obj[name] !== undefined) { - throw new TypeError(objectType + " can't have a ." + name + " property."); - } - } - }; - return api; -} - -function _createElementDescriptor(def) { - var key = toPropertyKey(def.key); - var descriptor; - - if (def.kind === "method") { - descriptor = { - value: def.value, - writable: true, - configurable: true, - enumerable: false - }; - } else if (def.kind === "get") { - descriptor = { - get: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "set") { - descriptor = { - set: def.value, - configurable: true, - enumerable: false - }; - } else if (def.kind === "field") { - descriptor = { - configurable: true, - writable: true, - enumerable: true - }; - } - - var element = { - kind: def.kind === "field" ? "field" : "method", - key: key, - placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype", - descriptor: descriptor - }; - if (def.decorators) element.decorators = def.decorators; - if (def.kind === "field") element.initializer = def.value; - return element; -} - -function _coalesceGetterSetter(element, other) { - if (element.descriptor.get !== undefined) { - other.descriptor.get = element.descriptor.get; - } else { - other.descriptor.set = element.descriptor.set; - } -} - -function _coalesceClassElements(elements) { - var newElements = []; - - var isSameElement = function isSameElement(other) { - return other.kind === "method" && other.key === element.key && other.placement === element.placement; - }; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - var other; - - if (element.kind === "method" && (other = newElements.find(isSameElement))) { - if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { - if (_hasDecorators(element) || _hasDecorators(other)) { - throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); - } - - other.descriptor = element.descriptor; - } else { - if (_hasDecorators(element)) { - if (_hasDecorators(other)) { - throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); - } - - other.decorators = element.decorators; - } - - _coalesceGetterSetter(element, other); - } - } else { - newElements.push(element); - } - } - - return newElements; -} - -function _hasDecorators(element) { - return element.decorators && element.decorators.length; -} - -function _isDataDescriptor(desc) { - return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); -} - -function _optionalCallableProperty(obj, name) { - var value = obj[name]; - - if (value !== undefined && typeof value !== "function") { - throw new TypeError("Expected '" + name + "' to be a function"); - } - - return value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/defaults.js b/node_modules/@babel/runtime/helpers/esm/defaults.js deleted file mode 100644 index 3de1d8e..0000000 --- a/node_modules/@babel/runtime/helpers/esm/defaults.js +++ /dev/null @@ -1,14 +0,0 @@ -export default function _defaults(obj, defaults) { - var keys = Object.getOwnPropertyNames(defaults); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = Object.getOwnPropertyDescriptor(defaults, key); - - if (value && value.configurable && obj[key] === undefined) { - Object.defineProperty(obj, key, value); - } - } - - return obj; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js b/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js deleted file mode 100644 index 7981acd..0000000 --- a/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +++ /dev/null @@ -1,22 +0,0 @@ -export default function _defineEnumerableProperties(obj, descs) { - for (var key in descs) { - var desc = descs[key]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, key, desc); - } - - if (Object.getOwnPropertySymbols) { - var objectSymbols = Object.getOwnPropertySymbols(descs); - - for (var i = 0; i < objectSymbols.length; i++) { - var sym = objectSymbols[i]; - var desc = descs[sym]; - desc.configurable = desc.enumerable = true; - if ("value" in desc) desc.writable = true; - Object.defineProperty(obj, sym, desc); - } - } - - return obj; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/defineProperty.js b/node_modules/@babel/runtime/helpers/esm/defineProperty.js deleted file mode 100644 index 7cf6e59..0000000 --- a/node_modules/@babel/runtime/helpers/esm/defineProperty.js +++ /dev/null @@ -1,14 +0,0 @@ -export default 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; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/extends.js b/node_modules/@babel/runtime/helpers/esm/extends.js deleted file mode 100644 index b9b138d..0000000 --- a/node_modules/@babel/runtime/helpers/esm/extends.js +++ /dev/null @@ -1,17 +0,0 @@ -export default function _extends() { - _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/get.js b/node_modules/@babel/runtime/helpers/esm/get.js deleted file mode 100644 index c228da9..0000000 --- a/node_modules/@babel/runtime/helpers/esm/get.js +++ /dev/null @@ -1,20 +0,0 @@ -import superPropBase from "@babel/runtime/helpers/esm/superPropBase"; -export default function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js b/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js deleted file mode 100644 index 5abafe3..0000000 --- a/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +++ /dev/null @@ -1,6 +0,0 @@ -export default function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/inherits.js b/node_modules/@babel/runtime/helpers/esm/inherits.js deleted file mode 100644 index 8e2a7d6..0000000 --- a/node_modules/@babel/runtime/helpers/esm/inherits.js +++ /dev/null @@ -1,15 +0,0 @@ -import setPrototypeOf from "@babel/runtime/helpers/esm/setPrototypeOf"; -export default function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) setPrototypeOf(subClass, superClass); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js b/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js deleted file mode 100644 index 32017e6..0000000 --- a/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +++ /dev/null @@ -1,5 +0,0 @@ -export default function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js b/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js deleted file mode 100644 index 26fdea0..0000000 --- a/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +++ /dev/null @@ -1,9 +0,0 @@ -export default function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js b/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js deleted file mode 100644 index 30d518c..0000000 --- a/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/instanceof.js b/node_modules/@babel/runtime/helpers/esm/instanceof.js deleted file mode 100644 index 8c43b71..0000000 --- a/node_modules/@babel/runtime/helpers/esm/instanceof.js +++ /dev/null @@ -1,7 +0,0 @@ -export default function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js b/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js deleted file mode 100644 index c2df7b6..0000000 --- a/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +++ /dev/null @@ -1,5 +0,0 @@ -export default function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js b/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js deleted file mode 100644 index 2a2ab59..0000000 --- a/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +++ /dev/null @@ -1,53 +0,0 @@ -import _typeof from "@babel/runtime/helpers/esm/typeof"; - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - - return cache; -} - -export default function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { - return { - "default": obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj["default"] = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js b/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js deleted file mode 100644 index 7b1bc82..0000000 --- a/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js b/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js deleted file mode 100644 index 9829e0f..0000000 --- a/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +++ /dev/null @@ -1,12 +0,0 @@ -export default function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/iterableToArray.js b/node_modules/@babel/runtime/helpers/esm/iterableToArray.js deleted file mode 100644 index 6cd6ae3..0000000 --- a/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js b/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js deleted file mode 100644 index 6402595..0000000 --- a/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +++ /dev/null @@ -1,26 +0,0 @@ -export default function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js b/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js deleted file mode 100644 index 025c0ea..0000000 --- a/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +++ /dev/null @@ -1,12 +0,0 @@ -export default function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/jsx.js b/node_modules/@babel/runtime/helpers/esm/jsx.js deleted file mode 100644 index 3a98cec..0000000 --- a/node_modules/@babel/runtime/helpers/esm/jsx.js +++ /dev/null @@ -1,46 +0,0 @@ -var REACT_ELEMENT_TYPE; -export default function _createRawReactElement(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js b/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js deleted file mode 100644 index bdea218..0000000 --- a/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +++ /dev/null @@ -1,9 +0,0 @@ -import arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray"; -export default function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js b/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js deleted file mode 100644 index d6cd864..0000000 --- a/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +++ /dev/null @@ -1,5 +0,0 @@ -export default function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js b/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js deleted file mode 100644 index b349d00..0000000 --- a/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js b/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js deleted file mode 100644 index 82d8296..0000000 --- a/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js b/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js deleted file mode 100644 index 82b67d2..0000000 --- a/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectSpread.js b/node_modules/@babel/runtime/helpers/esm/objectSpread.js deleted file mode 100644 index 88b2a01..0000000 --- a/node_modules/@babel/runtime/helpers/esm/objectSpread.js +++ /dev/null @@ -1,19 +0,0 @@ -import defineProperty from "@babel/runtime/helpers/esm/defineProperty"; -export default function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - defineProperty(target, key, source[key]); - }); - } - - return target; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectSpread2.js b/node_modules/@babel/runtime/helpers/esm/objectSpread2.js deleted file mode 100644 index 5669da7..0000000 --- a/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +++ /dev/null @@ -1,35 +0,0 @@ -import defineProperty from "@babel/runtime/helpers/esm/defineProperty"; - -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; -} - -export default 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; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js b/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js deleted file mode 100644 index bff7ea9..0000000 --- a/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +++ /dev/null @@ -1,19 +0,0 @@ -import objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; -export default 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; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js b/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js deleted file mode 100644 index c36815c..0000000 --- a/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +++ /dev/null @@ -1,14 +0,0 @@ -export default 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; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/package.json b/node_modules/@babel/runtime/helpers/esm/package.json deleted file mode 100644 index aead43d..0000000 --- a/node_modules/@babel/runtime/helpers/esm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js b/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js deleted file mode 100644 index 88a8ef2..0000000 --- a/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +++ /dev/null @@ -1,9 +0,0 @@ -import _typeof from "@babel/runtime/helpers/esm/typeof"; -import assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized"; -export default function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === "object" || typeof call === "function")) { - return call; - } - - return assertThisInitialized(self); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/readOnlyError.js b/node_modules/@babel/runtime/helpers/esm/readOnlyError.js deleted file mode 100644 index 166e40e..0000000 --- a/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _readOnlyError(name) { - throw new TypeError("\"" + name + "\" is read-only"); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/set.js b/node_modules/@babel/runtime/helpers/esm/set.js deleted file mode 100644 index c07cc7e..0000000 --- a/node_modules/@babel/runtime/helpers/esm/set.js +++ /dev/null @@ -1,51 +0,0 @@ -import superPropBase from "@babel/runtime/helpers/esm/superPropBase"; -import defineProperty from "@babel/runtime/helpers/esm/defineProperty"; - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = superPropBase(target, property); - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -export default function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js b/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js deleted file mode 100644 index e6ef03e..0000000 --- a/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +++ /dev/null @@ -1,8 +0,0 @@ -export default function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js b/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js deleted file mode 100644 index cadd9bb..0000000 --- a/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +++ /dev/null @@ -1,7 +0,0 @@ -export default function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/slicedToArray.js b/node_modules/@babel/runtime/helpers/esm/slicedToArray.js deleted file mode 100644 index ee16a28..0000000 --- a/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +++ /dev/null @@ -1,7 +0,0 @@ -import arrayWithHoles from "@babel/runtime/helpers/esm/arrayWithHoles"; -import iterableToArrayLimit from "@babel/runtime/helpers/esm/iterableToArrayLimit"; -import unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import nonIterableRest from "@babel/runtime/helpers/esm/nonIterableRest"; -export default function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js b/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js deleted file mode 100644 index a794b5d..0000000 --- a/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js +++ /dev/null @@ -1,7 +0,0 @@ -import arrayWithHoles from "@babel/runtime/helpers/esm/arrayWithHoles"; -import iterableToArrayLimitLoose from "@babel/runtime/helpers/esm/iterableToArrayLimitLoose"; -import unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import nonIterableRest from "@babel/runtime/helpers/esm/nonIterableRest"; -export default function _slicedToArrayLoose(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/superPropBase.js b/node_modules/@babel/runtime/helpers/esm/superPropBase.js deleted file mode 100644 index cff405f..0000000 --- a/node_modules/@babel/runtime/helpers/esm/superPropBase.js +++ /dev/null @@ -1,9 +0,0 @@ -import getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -export default function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = getPrototypeOf(object); - if (object === null) break; - } - - return object; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js b/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js deleted file mode 100644 index 421f18a..0000000 --- a/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js b/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js deleted file mode 100644 index c8f081e..0000000 --- a/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +++ /dev/null @@ -1,8 +0,0 @@ -export default function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/tdz.js b/node_modules/@babel/runtime/helpers/esm/tdz.js deleted file mode 100644 index d5d0adc..0000000 --- a/node_modules/@babel/runtime/helpers/esm/tdz.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function _tdzError(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/temporalRef.js b/node_modules/@babel/runtime/helpers/esm/temporalRef.js deleted file mode 100644 index 335b47a..0000000 --- a/node_modules/@babel/runtime/helpers/esm/temporalRef.js +++ /dev/null @@ -1,5 +0,0 @@ -import undef from "@babel/runtime/helpers/esm/temporalUndefined"; -import err from "@babel/runtime/helpers/esm/tdz"; -export default function _temporalRef(val, name) { - return val === undef ? err(name) : val; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js b/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js deleted file mode 100644 index 1a35717..0000000 --- a/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +++ /dev/null @@ -1 +0,0 @@ -export default function _temporalUndefined() {} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toArray.js b/node_modules/@babel/runtime/helpers/esm/toArray.js deleted file mode 100644 index 871eda8..0000000 --- a/node_modules/@babel/runtime/helpers/esm/toArray.js +++ /dev/null @@ -1,7 +0,0 @@ -import arrayWithHoles from "@babel/runtime/helpers/esm/arrayWithHoles"; -import iterableToArray from "@babel/runtime/helpers/esm/iterableToArray"; -import unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import nonIterableRest from "@babel/runtime/helpers/esm/nonIterableRest"; -export default function _toArray(arr) { - return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest(); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js b/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js deleted file mode 100644 index b5ef5c9..0000000 --- a/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +++ /dev/null @@ -1,7 +0,0 @@ -import arrayWithoutHoles from "@babel/runtime/helpers/esm/arrayWithoutHoles"; -import iterableToArray from "@babel/runtime/helpers/esm/iterableToArray"; -import unsupportedIterableToArray from "@babel/runtime/helpers/esm/unsupportedIterableToArray"; -import nonIterableSpread from "@babel/runtime/helpers/esm/nonIterableSpread"; -export default function _toConsumableArray(arr) { - return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toPrimitive.js b/node_modules/@babel/runtime/helpers/esm/toPrimitive.js deleted file mode 100644 index 7b37ab9..0000000 --- a/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +++ /dev/null @@ -1,13 +0,0 @@ -import _typeof from "@babel/runtime/helpers/esm/typeof"; -export default function _toPrimitive(input, hint) { - if (_typeof(input) !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (_typeof(res) !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js b/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js deleted file mode 100644 index c0ab594..0000000 --- a/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +++ /dev/null @@ -1,6 +0,0 @@ -import _typeof from "@babel/runtime/helpers/esm/typeof"; -import toPrimitive from "@babel/runtime/helpers/esm/toPrimitive"; -export default function _toPropertyKey(arg) { - var key = toPrimitive(arg, "string"); - return _typeof(key) === "symbol" ? key : String(key); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/typeof.js b/node_modules/@babel/runtime/helpers/esm/typeof.js deleted file mode 100644 index eb444f7..0000000 --- a/node_modules/@babel/runtime/helpers/esm/typeof.js +++ /dev/null @@ -1,15 +0,0 @@ -export default function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js b/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js deleted file mode 100644 index 2de9ecf..0000000 --- a/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +++ /dev/null @@ -1,9 +0,0 @@ -import arrayLikeToArray from "@babel/runtime/helpers/esm/arrayLikeToArray"; -export default function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js b/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js deleted file mode 100644 index ece5d70..0000000 --- a/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +++ /dev/null @@ -1,6 +0,0 @@ -import AsyncGenerator from "@babel/runtime/helpers/esm/AsyncGenerator"; -export default function _wrapAsyncGenerator(fn) { - return function () { - return new AsyncGenerator(fn.apply(this, arguments)); - }; -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js b/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js deleted file mode 100644 index e982d48..0000000 --- a/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +++ /dev/null @@ -1,37 +0,0 @@ -import getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import setPrototypeOf from "@babel/runtime/helpers/esm/setPrototypeOf"; -import isNativeFunction from "@babel/runtime/helpers/esm/isNativeFunction"; -import construct from "@babel/runtime/helpers/esm/construct"; -export default function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return construct(Class, arguments, getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js b/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js deleted file mode 100644 index 6ad3604..0000000 --- a/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +++ /dev/null @@ -1,69 +0,0 @@ -import _typeof from "@babel/runtime/helpers/esm/typeof"; -import wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; -import getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -import inherits from "@babel/runtime/helpers/esm/inherits"; -export default function _wrapRegExp(re, groups) { - _wrapRegExp = function _wrapRegExp(re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (_typeof(args[args.length - 1]) !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/extends.js b/node_modules/@babel/runtime/helpers/extends.js deleted file mode 100644 index 1816877..0000000 --- a/node_modules/@babel/runtime/helpers/extends.js +++ /dev/null @@ -1,19 +0,0 @@ -function _extends() { - module.exports = _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; - }; - - return _extends.apply(this, arguments); -} - -module.exports = _extends; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/get.js b/node_modules/@babel/runtime/helpers/get.js deleted file mode 100644 index 31ffc65..0000000 --- a/node_modules/@babel/runtime/helpers/get.js +++ /dev/null @@ -1,23 +0,0 @@ -var superPropBase = require("./superPropBase"); - -function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - module.exports = _get = Reflect.get; - } else { - module.exports = _get = function _get(target, property, receiver) { - var base = superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.get) { - return desc.get.call(receiver); - } - - return desc.value; - }; - } - - return _get(target, property, receiver || target); -} - -module.exports = _get; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/getPrototypeOf.js b/node_modules/@babel/runtime/helpers/getPrototypeOf.js deleted file mode 100644 index 5fc9a16..0000000 --- a/node_modules/@babel/runtime/helpers/getPrototypeOf.js +++ /dev/null @@ -1,8 +0,0 @@ -function _getPrototypeOf(o) { - module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); -} - -module.exports = _getPrototypeOf; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/inherits.js b/node_modules/@babel/runtime/helpers/inherits.js deleted file mode 100644 index 6b4f286..0000000 --- a/node_modules/@babel/runtime/helpers/inherits.js +++ /dev/null @@ -1,18 +0,0 @@ -var setPrototypeOf = require("./setPrototypeOf"); - -function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) setPrototypeOf(subClass, superClass); -} - -module.exports = _inherits; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/inheritsLoose.js b/node_modules/@babel/runtime/helpers/inheritsLoose.js deleted file mode 100644 index c3f7cdb..0000000 --- a/node_modules/@babel/runtime/helpers/inheritsLoose.js +++ /dev/null @@ -1,7 +0,0 @@ -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -module.exports = _inheritsLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/initializerDefineProperty.js b/node_modules/@babel/runtime/helpers/initializerDefineProperty.js deleted file mode 100644 index 4caa5ca..0000000 --- a/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +++ /dev/null @@ -1,11 +0,0 @@ -function _initializerDefineProperty(target, property, descriptor, context) { - if (!descriptor) return; - Object.defineProperty(target, property, { - enumerable: descriptor.enumerable, - configurable: descriptor.configurable, - writable: descriptor.writable, - value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 - }); -} - -module.exports = _initializerDefineProperty; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/initializerWarningHelper.js b/node_modules/@babel/runtime/helpers/initializerWarningHelper.js deleted file mode 100644 index 50ec82c..0000000 --- a/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +++ /dev/null @@ -1,5 +0,0 @@ -function _initializerWarningHelper(descriptor, context) { - throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); -} - -module.exports = _initializerWarningHelper; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/instanceof.js b/node_modules/@babel/runtime/helpers/instanceof.js deleted file mode 100644 index efe134c..0000000 --- a/node_modules/@babel/runtime/helpers/instanceof.js +++ /dev/null @@ -1,9 +0,0 @@ -function _instanceof(left, right) { - if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { - return !!right[Symbol.hasInstance](left); - } else { - return left instanceof right; - } -} - -module.exports = _instanceof; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/interopRequireDefault.js b/node_modules/@babel/runtime/helpers/interopRequireDefault.js deleted file mode 100644 index f713d13..0000000 --- a/node_modules/@babel/runtime/helpers/interopRequireDefault.js +++ /dev/null @@ -1,7 +0,0 @@ -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; -} - -module.exports = _interopRequireDefault; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/interopRequireWildcard.js b/node_modules/@babel/runtime/helpers/interopRequireWildcard.js deleted file mode 100644 index 90209ad..0000000 --- a/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +++ /dev/null @@ -1,55 +0,0 @@ -var _typeof = require("@babel/runtime/helpers/typeof"); - -function _getRequireWildcardCache() { - if (typeof WeakMap !== "function") return null; - var cache = new WeakMap(); - - _getRequireWildcardCache = function _getRequireWildcardCache() { - return cache; - }; - - return cache; -} - -function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } - - if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { - return { - "default": obj - }; - } - - var cache = _getRequireWildcardCache(); - - if (cache && cache.has(obj)) { - return cache.get(obj); - } - - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - - newObj["default"] = obj; - - if (cache) { - cache.set(obj, newObj); - } - - return newObj; -} - -module.exports = _interopRequireWildcard; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/isNativeFunction.js b/node_modules/@babel/runtime/helpers/isNativeFunction.js deleted file mode 100644 index e2dc3ed..0000000 --- a/node_modules/@babel/runtime/helpers/isNativeFunction.js +++ /dev/null @@ -1,5 +0,0 @@ -function _isNativeFunction(fn) { - return Function.toString.call(fn).indexOf("[native code]") !== -1; -} - -module.exports = _isNativeFunction; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js b/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js deleted file mode 100644 index 4dc5853..0000000 --- a/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +++ /dev/null @@ -1,14 +0,0 @@ -function _isNativeReflectConstruct() { - if (typeof Reflect === "undefined" || !Reflect.construct) return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === "function") return true; - - try { - Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); - return true; - } catch (e) { - return false; - } -} - -module.exports = _isNativeReflectConstruct; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/iterableToArray.js b/node_modules/@babel/runtime/helpers/iterableToArray.js deleted file mode 100644 index 954244b..0000000 --- a/node_modules/@babel/runtime/helpers/iterableToArray.js +++ /dev/null @@ -1,5 +0,0 @@ -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); -} - -module.exports = _iterableToArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js b/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js deleted file mode 100644 index 548e639..0000000 --- a/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +++ /dev/null @@ -1,28 +0,0 @@ -function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; -} - -module.exports = _iterableToArrayLimit; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js b/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js deleted file mode 100644 index e1a959f..0000000 --- a/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +++ /dev/null @@ -1,14 +0,0 @@ -function _iterableToArrayLimitLoose(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; -} - -module.exports = _iterableToArrayLimitLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/jsx.js b/node_modules/@babel/runtime/helpers/jsx.js deleted file mode 100644 index 4b1ee54..0000000 --- a/node_modules/@babel/runtime/helpers/jsx.js +++ /dev/null @@ -1,49 +0,0 @@ -var REACT_ELEMENT_TYPE; - -function _createRawReactElement(type, props, key, children) { - if (!REACT_ELEMENT_TYPE) { - REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; - } - - var defaultProps = type && type.defaultProps; - var childrenLength = arguments.length - 3; - - if (!props && childrenLength !== 0) { - props = { - children: void 0 - }; - } - - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = new Array(childrenLength); - - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 3]; - } - - props.children = childArray; - } - - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } - - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key === undefined ? null : '' + key, - ref: null, - props: props, - _owner: null - }; -} - -module.exports = _createRawReactElement; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/maybeArrayLike.js b/node_modules/@babel/runtime/helpers/maybeArrayLike.js deleted file mode 100644 index 0a09c43..0000000 --- a/node_modules/@babel/runtime/helpers/maybeArrayLike.js +++ /dev/null @@ -1,12 +0,0 @@ -var arrayLikeToArray = require("./arrayLikeToArray"); - -function _maybeArrayLike(next, arr, i) { - if (arr && !Array.isArray(arr) && typeof arr.length === "number") { - var len = arr.length; - return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); - } - - return next(arr, i); -} - -module.exports = _maybeArrayLike; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/newArrowCheck.js b/node_modules/@babel/runtime/helpers/newArrowCheck.js deleted file mode 100644 index 9b59f58..0000000 --- a/node_modules/@babel/runtime/helpers/newArrowCheck.js +++ /dev/null @@ -1,7 +0,0 @@ -function _newArrowCheck(innerThis, boundThis) { - if (innerThis !== boundThis) { - throw new TypeError("Cannot instantiate an arrow function"); - } -} - -module.exports = _newArrowCheck; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/nonIterableRest.js b/node_modules/@babel/runtime/helpers/nonIterableRest.js deleted file mode 100644 index 5b3a52e..0000000 --- a/node_modules/@babel/runtime/helpers/nonIterableRest.js +++ /dev/null @@ -1,5 +0,0 @@ -function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -module.exports = _nonIterableRest; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/nonIterableSpread.js b/node_modules/@babel/runtime/helpers/nonIterableSpread.js deleted file mode 100644 index 65457a2..0000000 --- a/node_modules/@babel/runtime/helpers/nonIterableSpread.js +++ /dev/null @@ -1,5 +0,0 @@ -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} - -module.exports = _nonIterableSpread; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js b/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js deleted file mode 100644 index 1d5c04a..0000000 --- a/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +++ /dev/null @@ -1,5 +0,0 @@ -function _objectDestructuringEmpty(obj) { - if (obj == null) throw new TypeError("Cannot destructure undefined"); -} - -module.exports = _objectDestructuringEmpty; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectSpread.js b/node_modules/@babel/runtime/helpers/objectSpread.js deleted file mode 100644 index ad8036e..0000000 --- a/node_modules/@babel/runtime/helpers/objectSpread.js +++ /dev/null @@ -1,22 +0,0 @@ -var defineProperty = require("./defineProperty"); - -function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? Object(arguments[i]) : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - defineProperty(target, key, source[key]); - }); - } - - return target; -} - -module.exports = _objectSpread; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectSpread2.js b/node_modules/@babel/runtime/helpers/objectSpread2.js deleted file mode 100644 index f067f3e..0000000 --- a/node_modules/@babel/runtime/helpers/objectSpread2.js +++ /dev/null @@ -1,37 +0,0 @@ -var defineProperty = require("./defineProperty"); - -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; -} - -module.exports = _objectSpread2; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectWithoutProperties.js b/node_modules/@babel/runtime/helpers/objectWithoutProperties.js deleted file mode 100644 index 253d33c..0000000 --- a/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +++ /dev/null @@ -1,22 +0,0 @@ -var objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose"); - -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; -} - -module.exports = _objectWithoutProperties; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js b/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js deleted file mode 100644 index a58c56b..0000000 --- a/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +++ /dev/null @@ -1,16 +0,0 @@ -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; -} - -module.exports = _objectWithoutPropertiesLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js b/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js deleted file mode 100644 index 7262929..0000000 --- a/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +++ /dev/null @@ -1,13 +0,0 @@ -var _typeof = require("@babel/runtime/helpers/typeof"); - -var assertThisInitialized = require("./assertThisInitialized"); - -function _possibleConstructorReturn(self, call) { - if (call && (_typeof(call) === "object" || typeof call === "function")) { - return call; - } - - return assertThisInitialized(self); -} - -module.exports = _possibleConstructorReturn; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/readOnlyError.js b/node_modules/@babel/runtime/helpers/readOnlyError.js deleted file mode 100644 index 9888f6d..0000000 --- a/node_modules/@babel/runtime/helpers/readOnlyError.js +++ /dev/null @@ -1,5 +0,0 @@ -function _readOnlyError(name) { - throw new TypeError("\"" + name + "\" is read-only"); -} - -module.exports = _readOnlyError; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/set.js b/node_modules/@babel/runtime/helpers/set.js deleted file mode 100644 index 97fa8c3..0000000 --- a/node_modules/@babel/runtime/helpers/set.js +++ /dev/null @@ -1,54 +0,0 @@ -var superPropBase = require("./superPropBase"); - -var defineProperty = require("./defineProperty"); - -function set(target, property, value, receiver) { - if (typeof Reflect !== "undefined" && Reflect.set) { - set = Reflect.set; - } else { - set = function set(target, property, value, receiver) { - var base = superPropBase(target, property); - var desc; - - if (base) { - desc = Object.getOwnPropertyDescriptor(base, property); - - if (desc.set) { - desc.set.call(receiver, value); - return true; - } else if (!desc.writable) { - return false; - } - } - - desc = Object.getOwnPropertyDescriptor(receiver, property); - - if (desc) { - if (!desc.writable) { - return false; - } - - desc.value = value; - Object.defineProperty(receiver, property, desc); - } else { - defineProperty(receiver, property, value); - } - - return true; - }; - } - - return set(target, property, value, receiver); -} - -function _set(target, property, value, receiver, isStrict) { - var s = set(target, property, value, receiver || target); - - if (!s && isStrict) { - throw new Error('failed to set property'); - } - - return value; -} - -module.exports = _set; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/setPrototypeOf.js b/node_modules/@babel/runtime/helpers/setPrototypeOf.js deleted file mode 100644 index d86e2fc..0000000 --- a/node_modules/@babel/runtime/helpers/setPrototypeOf.js +++ /dev/null @@ -1,10 +0,0 @@ -function _setPrototypeOf(o, p) { - module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - - return _setPrototypeOf(o, p); -} - -module.exports = _setPrototypeOf; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js b/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js deleted file mode 100644 index e1d6c86..0000000 --- a/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +++ /dev/null @@ -1,9 +0,0 @@ -function _skipFirstGeneratorNext(fn) { - return function () { - var it = fn.apply(this, arguments); - it.next(); - return it; - }; -} - -module.exports = _skipFirstGeneratorNext; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/slicedToArray.js b/node_modules/@babel/runtime/helpers/slicedToArray.js deleted file mode 100644 index 4255ab9..0000000 --- a/node_modules/@babel/runtime/helpers/slicedToArray.js +++ /dev/null @@ -1,13 +0,0 @@ -var arrayWithHoles = require("./arrayWithHoles"); - -var iterableToArrayLimit = require("./iterableToArrayLimit"); - -var unsupportedIterableToArray = require("./unsupportedIterableToArray"); - -var nonIterableRest = require("./nonIterableRest"); - -function _slicedToArray(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); -} - -module.exports = _slicedToArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js b/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js deleted file mode 100644 index 7304013..0000000 --- a/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js +++ /dev/null @@ -1,13 +0,0 @@ -var arrayWithHoles = require("./arrayWithHoles"); - -var iterableToArrayLimitLoose = require("./iterableToArrayLimitLoose"); - -var unsupportedIterableToArray = require("./unsupportedIterableToArray"); - -var nonIterableRest = require("./nonIterableRest"); - -function _slicedToArrayLoose(arr, i) { - return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); -} - -module.exports = _slicedToArrayLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/superPropBase.js b/node_modules/@babel/runtime/helpers/superPropBase.js deleted file mode 100644 index bbb34a2..0000000 --- a/node_modules/@babel/runtime/helpers/superPropBase.js +++ /dev/null @@ -1,12 +0,0 @@ -var getPrototypeOf = require("./getPrototypeOf"); - -function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = getPrototypeOf(object); - if (object === null) break; - } - - return object; -} - -module.exports = _superPropBase; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js b/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js deleted file mode 100644 index bdcc1e9..0000000 --- a/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +++ /dev/null @@ -1,13 +0,0 @@ -function _taggedTemplateLiteral(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -} - -module.exports = _taggedTemplateLiteral; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js b/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js deleted file mode 100644 index beced54..0000000 --- a/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +++ /dev/null @@ -1,10 +0,0 @@ -function _taggedTemplateLiteralLoose(strings, raw) { - if (!raw) { - raw = strings.slice(0); - } - - strings.raw = raw; - return strings; -} - -module.exports = _taggedTemplateLiteralLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/tdz.js b/node_modules/@babel/runtime/helpers/tdz.js deleted file mode 100644 index 6075e8d..0000000 --- a/node_modules/@babel/runtime/helpers/tdz.js +++ /dev/null @@ -1,5 +0,0 @@ -function _tdzError(name) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); -} - -module.exports = _tdzError; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/temporalRef.js b/node_modules/@babel/runtime/helpers/temporalRef.js deleted file mode 100644 index 8aa5e5e..0000000 --- a/node_modules/@babel/runtime/helpers/temporalRef.js +++ /dev/null @@ -1,9 +0,0 @@ -var temporalUndefined = require("./temporalUndefined"); - -var tdz = require("./tdz"); - -function _temporalRef(val, name) { - return val === temporalUndefined ? tdz(name) : val; -} - -module.exports = _temporalRef; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/temporalUndefined.js b/node_modules/@babel/runtime/helpers/temporalUndefined.js deleted file mode 100644 index 416d9b3..0000000 --- a/node_modules/@babel/runtime/helpers/temporalUndefined.js +++ /dev/null @@ -1,3 +0,0 @@ -function _temporalUndefined() {} - -module.exports = _temporalUndefined; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toArray.js b/node_modules/@babel/runtime/helpers/toArray.js deleted file mode 100644 index f113822..0000000 --- a/node_modules/@babel/runtime/helpers/toArray.js +++ /dev/null @@ -1,13 +0,0 @@ -var arrayWithHoles = require("./arrayWithHoles"); - -var iterableToArray = require("./iterableToArray"); - -var unsupportedIterableToArray = require("./unsupportedIterableToArray"); - -var nonIterableRest = require("./nonIterableRest"); - -function _toArray(arr) { - return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest(); -} - -module.exports = _toArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toConsumableArray.js b/node_modules/@babel/runtime/helpers/toConsumableArray.js deleted file mode 100644 index ec51d2e..0000000 --- a/node_modules/@babel/runtime/helpers/toConsumableArray.js +++ /dev/null @@ -1,13 +0,0 @@ -var arrayWithoutHoles = require("./arrayWithoutHoles"); - -var iterableToArray = require("./iterableToArray"); - -var unsupportedIterableToArray = require("./unsupportedIterableToArray"); - -var nonIterableSpread = require("./nonIterableSpread"); - -function _toConsumableArray(arr) { - return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); -} - -module.exports = _toConsumableArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toPrimitive.js b/node_modules/@babel/runtime/helpers/toPrimitive.js deleted file mode 100644 index 436137d..0000000 --- a/node_modules/@babel/runtime/helpers/toPrimitive.js +++ /dev/null @@ -1,16 +0,0 @@ -var _typeof = require("@babel/runtime/helpers/typeof"); - -function _toPrimitive(input, hint) { - if (_typeof(input) !== "object" || input === null) return input; - var prim = input[Symbol.toPrimitive]; - - if (prim !== undefined) { - var res = prim.call(input, hint || "default"); - if (_typeof(res) !== "object") return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - - return (hint === "string" ? String : Number)(input); -} - -module.exports = _toPrimitive; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toPropertyKey.js b/node_modules/@babel/runtime/helpers/toPropertyKey.js deleted file mode 100644 index fe042a9..0000000 --- a/node_modules/@babel/runtime/helpers/toPropertyKey.js +++ /dev/null @@ -1,10 +0,0 @@ -var _typeof = require("@babel/runtime/helpers/typeof"); - -var toPrimitive = require("./toPrimitive"); - -function _toPropertyKey(arg) { - var key = toPrimitive(arg, "string"); - return _typeof(key) === "symbol" ? key : String(key); -} - -module.exports = _toPropertyKey; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/typeof.js b/node_modules/@babel/runtime/helpers/typeof.js deleted file mode 100644 index cad1233..0000000 --- a/node_modules/@babel/runtime/helpers/typeof.js +++ /dev/null @@ -1,17 +0,0 @@ -function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - module.exports = _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - module.exports = _typeof = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); -} - -module.exports = _typeof; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js b/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js deleted file mode 100644 index 3d3e12a..0000000 --- a/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +++ /dev/null @@ -1,12 +0,0 @@ -var arrayLikeToArray = require("./arrayLikeToArray"); - -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); -} - -module.exports = _unsupportedIterableToArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js b/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js deleted file mode 100644 index 11554f3..0000000 --- a/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +++ /dev/null @@ -1,9 +0,0 @@ -var AsyncGenerator = require("./AsyncGenerator"); - -function _wrapAsyncGenerator(fn) { - return function () { - return new AsyncGenerator(fn.apply(this, arguments)); - }; -} - -module.exports = _wrapAsyncGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/wrapNativeSuper.js b/node_modules/@babel/runtime/helpers/wrapNativeSuper.js deleted file mode 100644 index 3d4bd7a..0000000 --- a/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +++ /dev/null @@ -1,43 +0,0 @@ -var getPrototypeOf = require("./getPrototypeOf"); - -var setPrototypeOf = require("./setPrototypeOf"); - -var isNativeFunction = require("./isNativeFunction"); - -var construct = require("./construct"); - -function _wrapNativeSuper(Class) { - var _cache = typeof Map === "function" ? new Map() : undefined; - - module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) { - if (Class === null || !isNativeFunction(Class)) return Class; - - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } - - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - - _cache.set(Class, Wrapper); - } - - function Wrapper() { - return construct(Class, arguments, getPrototypeOf(this).constructor); - } - - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writable: true, - configurable: true - } - }); - return setPrototypeOf(Wrapper, Class); - }; - - return _wrapNativeSuper(Class); -} - -module.exports = _wrapNativeSuper; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/wrapRegExp.js b/node_modules/@babel/runtime/helpers/wrapRegExp.js deleted file mode 100644 index 75ed826..0000000 --- a/node_modules/@babel/runtime/helpers/wrapRegExp.js +++ /dev/null @@ -1,76 +0,0 @@ -var _typeof = require("@babel/runtime/helpers/typeof"); - -var wrapNativeSuper = require("./wrapNativeSuper"); - -var getPrototypeOf = require("./getPrototypeOf"); - -var possibleConstructorReturn = require("./possibleConstructorReturn"); - -var inherits = require("./inherits"); - -function _wrapRegExp(re, groups) { - module.exports = _wrapRegExp = function _wrapRegExp(re, groups) { - return new BabelRegExp(re, undefined, groups); - }; - - var _RegExp = wrapNativeSuper(RegExp); - - var _super = RegExp.prototype; - - var _groups = new WeakMap(); - - function BabelRegExp(re, flags, groups) { - var _this = _RegExp.call(this, re, flags); - - _groups.set(_this, groups || _groups.get(re)); - - return _this; - } - - inherits(BabelRegExp, _RegExp); - - BabelRegExp.prototype.exec = function (str) { - var result = _super.exec.call(this, str); - - if (result) result.groups = buildGroups(result, this); - return result; - }; - - BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { - if (typeof substitution === "string") { - var groups = _groups.get(this); - - return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { - return "$" + groups[name]; - })); - } else if (typeof substitution === "function") { - var _this = this; - - return _super[Symbol.replace].call(this, str, function () { - var args = []; - args.push.apply(args, arguments); - - if (_typeof(args[args.length - 1]) !== "object") { - args.push(buildGroups(args, _this)); - } - - return substitution.apply(this, args); - }); - } else { - return _super[Symbol.replace].call(this, str, substitution); - } - }; - - function buildGroups(result, re) { - var g = _groups.get(re); - - return Object.keys(g).reduce(function (groups, name) { - groups[name] = result[g[name]]; - return groups; - }, Object.create(null)); - } - - return _wrapRegExp.apply(this, arguments); -} - -module.exports = _wrapRegExp; \ No newline at end of file diff --git a/node_modules/@babel/runtime/package.json b/node_modules/@babel/runtime/package.json deleted file mode 100644 index 2070466..0000000 --- a/node_modules/@babel/runtime/package.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "name": "@babel/runtime", - "version": "7.12.5", - "description": "babel's modular runtime helpers", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-runtime" - }, - "homepage": "https://babeljs.io/", - "author": "Sebastian McKenzie ", - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "exports": { - "./helpers/": "./helpers/", - "./helpers/typeof": "./helpers/typeof.js", - "./helpers/jsx": "./helpers/jsx.js", - "./helpers/asyncIterator": "./helpers/asyncIterator.js", - "./helpers/AwaitValue": "./helpers/AwaitValue.js", - "./helpers/AsyncGenerator": "./helpers/AsyncGenerator.js", - "./helpers/wrapAsyncGenerator": "./helpers/wrapAsyncGenerator.js", - "./helpers/awaitAsyncGenerator": "./helpers/awaitAsyncGenerator.js", - "./helpers/asyncGeneratorDelegate": "./helpers/asyncGeneratorDelegate.js", - "./helpers/asyncToGenerator": "./helpers/asyncToGenerator.js", - "./helpers/classCallCheck": "./helpers/classCallCheck.js", - "./helpers/createClass": "./helpers/createClass.js", - "./helpers/defineEnumerableProperties": "./helpers/defineEnumerableProperties.js", - "./helpers/defaults": "./helpers/defaults.js", - "./helpers/defineProperty": "./helpers/defineProperty.js", - "./helpers/extends": "./helpers/extends.js", - "./helpers/objectSpread": "./helpers/objectSpread.js", - "./helpers/objectSpread2": "./helpers/objectSpread2.js", - "./helpers/inherits": "./helpers/inherits.js", - "./helpers/inheritsLoose": "./helpers/inheritsLoose.js", - "./helpers/getPrototypeOf": "./helpers/getPrototypeOf.js", - "./helpers/setPrototypeOf": "./helpers/setPrototypeOf.js", - "./helpers/isNativeReflectConstruct": "./helpers/isNativeReflectConstruct.js", - "./helpers/construct": "./helpers/construct.js", - "./helpers/isNativeFunction": "./helpers/isNativeFunction.js", - "./helpers/wrapNativeSuper": "./helpers/wrapNativeSuper.js", - "./helpers/instanceof": "./helpers/instanceof.js", - "./helpers/interopRequireDefault": "./helpers/interopRequireDefault.js", - "./helpers/interopRequireWildcard": "./helpers/interopRequireWildcard.js", - "./helpers/newArrowCheck": "./helpers/newArrowCheck.js", - "./helpers/objectDestructuringEmpty": "./helpers/objectDestructuringEmpty.js", - "./helpers/objectWithoutPropertiesLoose": "./helpers/objectWithoutPropertiesLoose.js", - "./helpers/objectWithoutProperties": "./helpers/objectWithoutProperties.js", - "./helpers/assertThisInitialized": "./helpers/assertThisInitialized.js", - "./helpers/possibleConstructorReturn": "./helpers/possibleConstructorReturn.js", - "./helpers/createSuper": "./helpers/createSuper.js", - "./helpers/superPropBase": "./helpers/superPropBase.js", - "./helpers/get": "./helpers/get.js", - "./helpers/set": "./helpers/set.js", - "./helpers/taggedTemplateLiteral": "./helpers/taggedTemplateLiteral.js", - "./helpers/taggedTemplateLiteralLoose": "./helpers/taggedTemplateLiteralLoose.js", - "./helpers/readOnlyError": "./helpers/readOnlyError.js", - "./helpers/classNameTDZError": "./helpers/classNameTDZError.js", - "./helpers/temporalUndefined": "./helpers/temporalUndefined.js", - "./helpers/tdz": "./helpers/tdz.js", - "./helpers/temporalRef": "./helpers/temporalRef.js", - "./helpers/slicedToArray": "./helpers/slicedToArray.js", - "./helpers/slicedToArrayLoose": "./helpers/slicedToArrayLoose.js", - "./helpers/toArray": "./helpers/toArray.js", - "./helpers/toConsumableArray": "./helpers/toConsumableArray.js", - "./helpers/arrayWithoutHoles": "./helpers/arrayWithoutHoles.js", - "./helpers/arrayWithHoles": "./helpers/arrayWithHoles.js", - "./helpers/maybeArrayLike": "./helpers/maybeArrayLike.js", - "./helpers/iterableToArray": "./helpers/iterableToArray.js", - "./helpers/iterableToArrayLimit": "./helpers/iterableToArrayLimit.js", - "./helpers/iterableToArrayLimitLoose": "./helpers/iterableToArrayLimitLoose.js", - "./helpers/unsupportedIterableToArray": "./helpers/unsupportedIterableToArray.js", - "./helpers/arrayLikeToArray": "./helpers/arrayLikeToArray.js", - "./helpers/nonIterableSpread": "./helpers/nonIterableSpread.js", - "./helpers/nonIterableRest": "./helpers/nonIterableRest.js", - "./helpers/createForOfIteratorHelper": "./helpers/createForOfIteratorHelper.js", - "./helpers/createForOfIteratorHelperLoose": "./helpers/createForOfIteratorHelperLoose.js", - "./helpers/skipFirstGeneratorNext": "./helpers/skipFirstGeneratorNext.js", - "./helpers/toPrimitive": "./helpers/toPrimitive.js", - "./helpers/toPropertyKey": "./helpers/toPropertyKey.js", - "./helpers/initializerWarningHelper": "./helpers/initializerWarningHelper.js", - "./helpers/initializerDefineProperty": "./helpers/initializerDefineProperty.js", - "./helpers/applyDecoratedDescriptor": "./helpers/applyDecoratedDescriptor.js", - "./helpers/classPrivateFieldLooseKey": "./helpers/classPrivateFieldLooseKey.js", - "./helpers/classPrivateFieldLooseBase": "./helpers/classPrivateFieldLooseBase.js", - "./helpers/classPrivateFieldGet": "./helpers/classPrivateFieldGet.js", - "./helpers/classPrivateFieldSet": "./helpers/classPrivateFieldSet.js", - "./helpers/classPrivateFieldDestructureSet": "./helpers/classPrivateFieldDestructureSet.js", - "./helpers/classStaticPrivateFieldSpecGet": "./helpers/classStaticPrivateFieldSpecGet.js", - "./helpers/classStaticPrivateFieldSpecSet": "./helpers/classStaticPrivateFieldSpecSet.js", - "./helpers/classStaticPrivateMethodGet": "./helpers/classStaticPrivateMethodGet.js", - "./helpers/classStaticPrivateMethodSet": "./helpers/classStaticPrivateMethodSet.js", - "./helpers/decorate": "./helpers/decorate.js", - "./helpers/classPrivateMethodGet": "./helpers/classPrivateMethodGet.js", - "./helpers/classPrivateMethodSet": "./helpers/classPrivateMethodSet.js", - "./helpers/wrapRegExp": "./helpers/wrapRegExp.js", - "./helpers/esm/typeof": "./helpers/esm/typeof.js", - "./helpers/esm/jsx": "./helpers/esm/jsx.js", - "./helpers/esm/asyncIterator": "./helpers/esm/asyncIterator.js", - "./helpers/esm/AwaitValue": "./helpers/esm/AwaitValue.js", - "./helpers/esm/AsyncGenerator": "./helpers/esm/AsyncGenerator.js", - "./helpers/esm/wrapAsyncGenerator": "./helpers/esm/wrapAsyncGenerator.js", - "./helpers/esm/awaitAsyncGenerator": "./helpers/esm/awaitAsyncGenerator.js", - "./helpers/esm/asyncGeneratorDelegate": "./helpers/esm/asyncGeneratorDelegate.js", - "./helpers/esm/asyncToGenerator": "./helpers/esm/asyncToGenerator.js", - "./helpers/esm/classCallCheck": "./helpers/esm/classCallCheck.js", - "./helpers/esm/createClass": "./helpers/esm/createClass.js", - "./helpers/esm/defineEnumerableProperties": "./helpers/esm/defineEnumerableProperties.js", - "./helpers/esm/defaults": "./helpers/esm/defaults.js", - "./helpers/esm/defineProperty": "./helpers/esm/defineProperty.js", - "./helpers/esm/extends": "./helpers/esm/extends.js", - "./helpers/esm/objectSpread": "./helpers/esm/objectSpread.js", - "./helpers/esm/objectSpread2": "./helpers/esm/objectSpread2.js", - "./helpers/esm/inherits": "./helpers/esm/inherits.js", - "./helpers/esm/inheritsLoose": "./helpers/esm/inheritsLoose.js", - "./helpers/esm/getPrototypeOf": "./helpers/esm/getPrototypeOf.js", - "./helpers/esm/setPrototypeOf": "./helpers/esm/setPrototypeOf.js", - "./helpers/esm/isNativeReflectConstruct": "./helpers/esm/isNativeReflectConstruct.js", - "./helpers/esm/construct": "./helpers/esm/construct.js", - "./helpers/esm/isNativeFunction": "./helpers/esm/isNativeFunction.js", - "./helpers/esm/wrapNativeSuper": "./helpers/esm/wrapNativeSuper.js", - "./helpers/esm/instanceof": "./helpers/esm/instanceof.js", - "./helpers/esm/interopRequireDefault": "./helpers/esm/interopRequireDefault.js", - "./helpers/esm/interopRequireWildcard": "./helpers/esm/interopRequireWildcard.js", - "./helpers/esm/newArrowCheck": "./helpers/esm/newArrowCheck.js", - "./helpers/esm/objectDestructuringEmpty": "./helpers/esm/objectDestructuringEmpty.js", - "./helpers/esm/objectWithoutPropertiesLoose": "./helpers/esm/objectWithoutPropertiesLoose.js", - "./helpers/esm/objectWithoutProperties": "./helpers/esm/objectWithoutProperties.js", - "./helpers/esm/assertThisInitialized": "./helpers/esm/assertThisInitialized.js", - "./helpers/esm/possibleConstructorReturn": "./helpers/esm/possibleConstructorReturn.js", - "./helpers/esm/createSuper": "./helpers/esm/createSuper.js", - "./helpers/esm/superPropBase": "./helpers/esm/superPropBase.js", - "./helpers/esm/get": "./helpers/esm/get.js", - "./helpers/esm/set": "./helpers/esm/set.js", - "./helpers/esm/taggedTemplateLiteral": "./helpers/esm/taggedTemplateLiteral.js", - "./helpers/esm/taggedTemplateLiteralLoose": "./helpers/esm/taggedTemplateLiteralLoose.js", - "./helpers/esm/readOnlyError": "./helpers/esm/readOnlyError.js", - "./helpers/esm/classNameTDZError": "./helpers/esm/classNameTDZError.js", - "./helpers/esm/temporalUndefined": "./helpers/esm/temporalUndefined.js", - "./helpers/esm/tdz": "./helpers/esm/tdz.js", - "./helpers/esm/temporalRef": "./helpers/esm/temporalRef.js", - "./helpers/esm/slicedToArray": "./helpers/esm/slicedToArray.js", - "./helpers/esm/slicedToArrayLoose": "./helpers/esm/slicedToArrayLoose.js", - "./helpers/esm/toArray": "./helpers/esm/toArray.js", - "./helpers/esm/toConsumableArray": "./helpers/esm/toConsumableArray.js", - "./helpers/esm/arrayWithoutHoles": "./helpers/esm/arrayWithoutHoles.js", - "./helpers/esm/arrayWithHoles": "./helpers/esm/arrayWithHoles.js", - "./helpers/esm/maybeArrayLike": "./helpers/esm/maybeArrayLike.js", - "./helpers/esm/iterableToArray": "./helpers/esm/iterableToArray.js", - "./helpers/esm/iterableToArrayLimit": "./helpers/esm/iterableToArrayLimit.js", - "./helpers/esm/iterableToArrayLimitLoose": "./helpers/esm/iterableToArrayLimitLoose.js", - "./helpers/esm/unsupportedIterableToArray": "./helpers/esm/unsupportedIterableToArray.js", - "./helpers/esm/arrayLikeToArray": "./helpers/esm/arrayLikeToArray.js", - "./helpers/esm/nonIterableSpread": "./helpers/esm/nonIterableSpread.js", - "./helpers/esm/nonIterableRest": "./helpers/esm/nonIterableRest.js", - "./helpers/esm/createForOfIteratorHelper": "./helpers/esm/createForOfIteratorHelper.js", - "./helpers/esm/createForOfIteratorHelperLoose": "./helpers/esm/createForOfIteratorHelperLoose.js", - "./helpers/esm/skipFirstGeneratorNext": "./helpers/esm/skipFirstGeneratorNext.js", - "./helpers/esm/toPrimitive": "./helpers/esm/toPrimitive.js", - "./helpers/esm/toPropertyKey": "./helpers/esm/toPropertyKey.js", - "./helpers/esm/initializerWarningHelper": "./helpers/esm/initializerWarningHelper.js", - "./helpers/esm/initializerDefineProperty": "./helpers/esm/initializerDefineProperty.js", - "./helpers/esm/applyDecoratedDescriptor": "./helpers/esm/applyDecoratedDescriptor.js", - "./helpers/esm/classPrivateFieldLooseKey": "./helpers/esm/classPrivateFieldLooseKey.js", - "./helpers/esm/classPrivateFieldLooseBase": "./helpers/esm/classPrivateFieldLooseBase.js", - "./helpers/esm/classPrivateFieldGet": "./helpers/esm/classPrivateFieldGet.js", - "./helpers/esm/classPrivateFieldSet": "./helpers/esm/classPrivateFieldSet.js", - "./helpers/esm/classPrivateFieldDestructureSet": "./helpers/esm/classPrivateFieldDestructureSet.js", - "./helpers/esm/classStaticPrivateFieldSpecGet": "./helpers/esm/classStaticPrivateFieldSpecGet.js", - "./helpers/esm/classStaticPrivateFieldSpecSet": "./helpers/esm/classStaticPrivateFieldSpecSet.js", - "./helpers/esm/classStaticPrivateMethodGet": "./helpers/esm/classStaticPrivateMethodGet.js", - "./helpers/esm/classStaticPrivateMethodSet": "./helpers/esm/classStaticPrivateMethodSet.js", - "./helpers/esm/decorate": "./helpers/esm/decorate.js", - "./helpers/esm/classPrivateMethodGet": "./helpers/esm/classPrivateMethodGet.js", - "./helpers/esm/classPrivateMethodSet": "./helpers/esm/classPrivateMethodSet.js", - "./helpers/esm/wrapRegExp": "./helpers/esm/wrapRegExp.js", - "./package": "./package.json", - "./package.json": "./package.json", - "./regenerator": "./regenerator/index.js", - "./regenerator/": "./regenerator/" - } -} \ No newline at end of file diff --git a/node_modules/@babel/runtime/regenerator/index.js b/node_modules/@babel/runtime/regenerator/index.js deleted file mode 100644 index 9fd4158..0000000 --- a/node_modules/@babel/runtime/regenerator/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("regenerator-runtime"); diff --git a/node_modules/@octokit/auth-token/README.md b/node_modules/@octokit/auth-token/README.md index 8ea6a03..b4791f0 100644 --- a/node_modules/@octokit/auth-token/README.md +++ b/node_modules/@octokit/auth-token/README.md @@ -33,11 +33,11 @@ It is useful if you want to support multiple authentication strategies, as it’ Browsers -Load `@octokit/auth-token` directly from [cdn.pika.dev](https://cdn.pika.dev) +Load `@octokit/auth-token` directly from [cdn.skypack.dev](https://cdn.skypack.dev) ```html ``` @@ -64,6 +64,7 @@ const authentication = await auth(); // type: 'token', // token: '1234567890abcdef1234567890abcdef12345678', // tokenType: 'oauth' +// } ``` ## `createTokenAuth(token) options` @@ -231,7 +232,7 @@ const TOKEN = "1234567890abcdef1234567890abcdef12345678"; const auth = createTokenAuth(TOKEN); const authentication = await auth(); -const response = await request("GET /repos/:owner/:repo", { +const response = await request("GET /repos/{owner}/{repo}", { owner: 'octocat', repo: 'hello-world' headers: authentication.headers diff --git a/node_modules/@octokit/auth-token/dist-node/index.js.map b/node_modules/@octokit/auth-token/dist-node/index.js.map index 8a92b69..46cf5e1 100644 --- a/node_modules/@octokit/auth-token/dist-node/index.js.map +++ b/node_modules/@octokit/auth-token/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/with-authorization-prefix.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["export async function auth(token) {\n const tokenType = token.split(/\\./).length === 3\n ? \"app\"\n : /^v\\d+\\./.test(token)\n ? \"installation\"\n : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n","/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nexport function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nexport async function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport const createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n"],"names":["auth","token","tokenType","split","length","test","type","withAuthorizationPrefix","hook","request","route","parameters","endpoint","merge","headers","authorization","createTokenAuth","Error","replace","Object","assign","bind"],"mappings":";;;;AAAO,eAAeA,IAAf,CAAoBC,KAApB,EAA2B;AAC9B,QAAMC,SAAS,GAAGD,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAA7B,GACZ,KADY,GAEZ,UAAUC,IAAV,CAAeJ,KAAf,IACI,cADJ,GAEI,OAJV;AAKA,SAAO;AACHK,IAAAA,IAAI,EAAE,OADH;AAEHL,IAAAA,KAAK,EAAEA,KAFJ;AAGHC,IAAAA;AAHG,GAAP;AAKH;;ACXD;;;;;AAKA,AAAO,SAASK,uBAAT,CAAiCN,KAAjC,EAAwC;AAC3C,MAAIA,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAAjC,EAAoC;AAChC,WAAQ,UAASH,KAAM,EAAvB;AACH;;AACD,SAAQ,SAAQA,KAAM,EAAtB;AACH;;ACTM,eAAeO,IAAf,CAAoBP,KAApB,EAA2BQ,OAA3B,EAAoCC,KAApC,EAA2CC,UAA3C,EAAuD;AAC1D,QAAMC,QAAQ,GAAGH,OAAO,CAACG,QAAR,CAAiBC,KAAjB,CAAuBH,KAAvB,EAA8BC,UAA9B,CAAjB;AACAC,EAAAA,QAAQ,CAACE,OAAT,CAAiBC,aAAjB,GAAiCR,uBAAuB,CAACN,KAAD,CAAxD;AACA,SAAOQ,OAAO,CAACG,QAAD,CAAd;AACH;;MCHYI,eAAe,GAAG,SAASA,eAAT,CAAyBf,KAAzB,EAAgC;AAC3D,MAAI,CAACA,KAAL,EAAY;AACR,UAAM,IAAIgB,KAAJ,CAAU,0DAAV,CAAN;AACH;;AACD,MAAI,OAAOhB,KAAP,KAAiB,QAArB,EAA+B;AAC3B,UAAM,IAAIgB,KAAJ,CAAU,uEAAV,CAAN;AACH;;AACDhB,EAAAA,KAAK,GAAGA,KAAK,CAACiB,OAAN,CAAc,oBAAd,EAAoC,EAApC,CAAR;AACA,SAAOC,MAAM,CAACC,MAAP,CAAcpB,IAAI,CAACqB,IAAL,CAAU,IAAV,EAAgBpB,KAAhB,CAAd,EAAsC;AACzCO,IAAAA,IAAI,EAAEA,IAAI,CAACa,IAAL,CAAU,IAAV,EAAgBpB,KAAhB;AADmC,GAAtC,CAAP;AAGH,CAXM;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/auth.js","../dist-src/with-authorization-prefix.js","../dist-src/hook.js","../dist-src/index.js"],"sourcesContent":["export async function auth(token) {\n const tokenType = token.split(/\\./).length === 3\n ? \"app\"\n : /^v\\d+\\./.test(token)\n ? \"installation\"\n : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n","/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nexport function withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n return `token ${token}`;\n}\n","import { withAuthorizationPrefix } from \"./with-authorization-prefix\";\nexport async function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n","import { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nexport const createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n"],"names":["auth","token","tokenType","split","length","test","type","withAuthorizationPrefix","hook","request","route","parameters","endpoint","merge","headers","authorization","createTokenAuth","Error","replace","Object","assign","bind"],"mappings":";;;;AAAO,eAAeA,IAAf,CAAoBC,KAApB,EAA2B;AAC9B,QAAMC,SAAS,GAAGD,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAA7B,GACZ,KADY,GAEZ,UAAUC,IAAV,CAAeJ,KAAf,IACI,cADJ,GAEI,OAJV;AAKA,SAAO;AACHK,IAAAA,IAAI,EAAE,OADH;AAEHL,IAAAA,KAAK,EAAEA,KAFJ;AAGHC,IAAAA;AAHG,GAAP;AAKH;;ACXD;AACA;AACA;AACA;AACA;AACA,AAAO,SAASK,uBAAT,CAAiCN,KAAjC,EAAwC;AAC3C,MAAIA,KAAK,CAACE,KAAN,CAAY,IAAZ,EAAkBC,MAAlB,KAA6B,CAAjC,EAAoC;AAChC,WAAQ,UAASH,KAAM,EAAvB;AACH;;AACD,SAAQ,SAAQA,KAAM,EAAtB;AACH;;ACTM,eAAeO,IAAf,CAAoBP,KAApB,EAA2BQ,OAA3B,EAAoCC,KAApC,EAA2CC,UAA3C,EAAuD;AAC1D,QAAMC,QAAQ,GAAGH,OAAO,CAACG,QAAR,CAAiBC,KAAjB,CAAuBH,KAAvB,EAA8BC,UAA9B,CAAjB;AACAC,EAAAA,QAAQ,CAACE,OAAT,CAAiBC,aAAjB,GAAiCR,uBAAuB,CAACN,KAAD,CAAxD;AACA,SAAOQ,OAAO,CAACG,QAAD,CAAd;AACH;;MCHYI,eAAe,GAAG,SAASA,eAAT,CAAyBf,KAAzB,EAAgC;AAC3D,MAAI,CAACA,KAAL,EAAY;AACR,UAAM,IAAIgB,KAAJ,CAAU,0DAAV,CAAN;AACH;;AACD,MAAI,OAAOhB,KAAP,KAAiB,QAArB,EAA+B;AAC3B,UAAM,IAAIgB,KAAJ,CAAU,uEAAV,CAAN;AACH;;AACDhB,EAAAA,KAAK,GAAGA,KAAK,CAACiB,OAAN,CAAc,oBAAd,EAAoC,EAApC,CAAR;AACA,SAAOC,MAAM,CAACC,MAAP,CAAcpB,IAAI,CAACqB,IAAL,CAAU,IAAV,EAAgBpB,KAAhB,CAAd,EAAsC;AACzCO,IAAAA,IAAI,EAAEA,IAAI,CAACa,IAAL,CAAU,IAAV,EAAgBpB,KAAhB;AADmC,GAAtC,CAAP;AAGH,CAXM;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/auth-token/dist-src/types.js b/node_modules/@octokit/auth-token/dist-src/types.js index e69de29..cb0ff5c 100644 --- a/node_modules/@octokit/auth-token/dist-src/types.js +++ b/node_modules/@octokit/auth-token/dist-src/types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@octokit/auth-token/dist-types/types.d.ts b/node_modules/@octokit/auth-token/dist-types/types.d.ts index 53a4ab1..c302dc9 100644 --- a/node_modules/@octokit/auth-token/dist-types/types.d.ts +++ b/node_modules/@octokit/auth-token/dist-types/types.d.ts @@ -1,6 +1,9 @@ import * as OctokitTypes from "@octokit/types"; export declare type AnyResponse = OctokitTypes.OctokitResponse; -export declare type StrategyInterface = OctokitTypes.StrategyInterface<[Token], [], Authentication>; +export declare type StrategyInterface = OctokitTypes.StrategyInterface<[ + Token +], [ +], Authentication>; export declare type EndpointDefaults = OctokitTypes.EndpointDefaults; export declare type EndpointOptions = OctokitTypes.EndpointOptions; export declare type RequestParameters = OctokitTypes.RequestParameters; diff --git a/node_modules/@octokit/auth-token/package.json b/node_modules/@octokit/auth-token/package.json index c0bb27f..5be9ea7 100644 --- a/node_modules/@octokit/auth-token/package.json +++ b/node_modules/@octokit/auth-token/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/auth-token", "description": "GitHub API token authentication for browsers and Node.js", - "version": "2.4.2", + "version": "2.4.5", "license": "MIT", "files": [ "dist-*/", @@ -21,10 +21,10 @@ }, "repository": "https://github.com/octokit/auth-token.js", "dependencies": { - "@octokit/types": "^5.0.0" + "@octokit/types": "^6.0.3" }, "devDependencies": { - "@octokit/core": "^2.2.0", + "@octokit/core": "^3.0.0", "@octokit/request": "^5.3.0", "@pika/pack": "^0.5.0", "@pika/plugin-build-node": "^0.9.0", @@ -33,10 +33,10 @@ "@types/fetch-mock": "^7.3.1", "@types/jest": "^26.0.0", "fetch-mock": "^9.0.0", - "jest": "^25.1.0", + "jest": "^26.0.0", "semantic-release": "^17.0.0", - "ts-jest": "^25.1.0", - "typescript": "^3.7.2" + "ts-jest": "^26.0.0", + "typescript": "^4.0.0" }, "publishConfig": { "access": "public" diff --git a/node_modules/@octokit/core/README.md b/node_modules/@octokit/core/README.md index 64c5182..129d6ce 100644 --- a/node_modules/@octokit/core/README.md +++ b/node_modules/@octokit/core/README.md @@ -32,11 +32,11 @@ If you don't need the Plugin API then using [`@octokit/request`](https://github. Browsers -Load @octokit/core directly from cdn.pika.dev +Load @octokit/core directly from cdn.skypack.dev ```html ``` @@ -62,7 +62,7 @@ const { Octokit } = require("@octokit/core"); // Create a personal access token at https://github.com/settings/tokens/new?scopes=repo const octokit = new Octokit({ auth: `personal-access-token123` }); -const response = await octokit.request("GET /orgs/:org/repos", { +const response = await octokit.request("GET /orgs/{org}/repos", { org: "octokit", type: "private", }); @@ -114,7 +114,7 @@ See [`@octokit/graphql`](https://github.com/octokit/graphql.js) for full documen Function - Defaults to @octokit/auth-token. See Authentication below for examples. + Defaults to @octokit/auth-token. See Authentication below for examples. @@ -125,7 +125,7 @@ See [`@octokit/graphql`](https://github.com/octokit/graphql.js) for full documen String or Object - See Authentication below for examples. + See Authentication below for examples. @@ -159,7 +159,7 @@ Some REST API endpoints require preview headers to be set, or enable additional features. Preview headers can be set on a per-request basis, e.g. ```js -octokit.request("POST /repos/:owner/:repo/pulls", { +octokit.request("POST /repos/{owner}/{repo}/pulls", { mediaType: { previews: ["shadow-cat"], }, @@ -298,7 +298,9 @@ const octokit = new Octokit({ const { data } = await octokit.request("/user"); ``` -To use a different authentication strategy, set `options.authStrategy`. A set of officially supported authentication strategies can be retrieved from [`@octokit/auth`](https://github.com/octokit/auth-app.js#readme). Example +To use a different authentication strategy, set `options.authStrategy`. A list of authentication strategies is available at [octokit/authentication-strategies.js](https://github.com/octokit/authentication-strategies.js/#readme). + +Example ```js import { Octokit } from "@octokit/core"; @@ -307,7 +309,7 @@ import { createAppAuth } from "@octokit/auth-app"; const appOctokit = new Octokit({ authStrategy: createAppAuth, auth: { - id: 123, + appId: 123, privateKey: process.env.PRIVATE_KEY, }, }); @@ -358,7 +360,7 @@ octokit.hook.after("request", async (response, options) => { }); octokit.hook.error("request", async (error, options) => { if (error.status === 304) { - return findInCache(error.headers.etag); + return findInCache(error.response.headers.etag); } throw error; diff --git a/node_modules/@octokit/core/dist-node/index.js b/node_modules/@octokit/core/dist-node/index.js index 2d04f8e..5ad37e1 100644 --- a/node_modules/@octokit/core/dist-node/index.js +++ b/node_modules/@octokit/core/dist-node/index.js @@ -8,57 +8,45 @@ var request = require('@octokit/request'); var graphql = require('@octokit/graphql'); var authToken = require('@octokit/auth-token'); -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; +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 obj; + return target; } -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; - 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); - } + var target = _objectWithoutPropertiesLoose(source, excluded); - return keys; -} + var key, i; -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - 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)); - }); + 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 = "3.1.2"; +const VERSION = "3.5.1"; +const _excluded = ["authStrategy"]; class Octokit { constructor(options = {}) { const hook = new beforeAfterHook.Collection(); @@ -66,6 +54,7 @@ class Octokit { baseUrl: request.request.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type hook: hook.bind(null, "request") }), mediaType: { @@ -89,9 +78,7 @@ class Octokit { } this.request = request.request.defaults(requestDefaults); - this.graphql = graphql.withCustomRequest(this.request).defaults(_objectSpread2(_objectSpread2({}, requestDefaults), {}, { - baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api") - })); + this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); this.log = Object.assign({ debug: () => {}, info: () => {}, @@ -99,7 +86,7 @@ class Octokit { error: console.error.bind(console) }, options.log); this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. // (2) If only `options.auth` is set, use the default token authentication strategy. // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. // TODO: type `options.auth` based on `options.authStrategy`. @@ -118,8 +105,21 @@ class Octokit { this.auth = auth; } } else { - const auth = options.authStrategy(Object.assign({ - request: this.request + const { + authStrategy + } = options, + otherOptions = _objectWithoutProperties(options, _excluded); + + const auth = authStrategy(Object.assign({ + request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ hook.wrap("request", auth.hook); diff --git a/node_modules/@octokit/core/dist-node/index.js.map b/node_modules/@octokit/core/dist-node/index.js.map index 3efcbe4..19485f9 100644 --- a/node_modules/@octokit/core/dist-node/index.js.map +++ b/node_modules/@octokit/core/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"3.1.2\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { Collection } from \"before-after-hook\";\nimport { request } from \"@octokit/request\";\nimport { withCustomRequest } from \"@octokit/graphql\";\nimport { createTokenAuth } from \"@octokit/auth-token\";\nimport { VERSION } from \"./version\";\nexport class Octokit {\n constructor(options = {}) {\n const hook = new Collection();\n const requestDefaults = {\n baseUrl: request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n hook: hook.bind(null, \"request\"),\n }),\n mediaType: {\n previews: [],\n format: \"\",\n },\n };\n // prepend default user agent with `options.userAgent` if set\n requestDefaults.headers[\"user-agent\"] = [\n options.userAgent,\n `octokit-core.js/${VERSION} ${getUserAgent()}`,\n ]\n .filter(Boolean)\n .join(\" \");\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n this.request = request.defaults(requestDefaults);\n this.graphql = withCustomRequest(this.request).defaults({\n ...requestDefaults,\n baseUrl: requestDefaults.baseUrl.replace(/\\/api\\/v3$/, \"/api\"),\n });\n this.log = Object.assign({\n debug: () => { },\n info: () => { },\n warn: console.warn.bind(console),\n error: console.error.bind(console),\n }, options.log);\n this.hook = hook;\n // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\",\n });\n }\n else {\n // (2)\n const auth = createTokenAuth(options.auth);\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n }\n else {\n const auth = options.authStrategy(Object.assign({\n request: this.request,\n }, options.auth));\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n // apply plugins\n // https://stackoverflow.com/a/16345172\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach((plugin) => {\n Object.assign(this, plugin(this, options));\n });\n }\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent\n ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`,\n }\n : null));\n }\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n static plugin(...newPlugins) {\n var _a;\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {\n },\n _a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))),\n _a);\n return NewOctokit;\n }\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n"],"names":["VERSION","Octokit","constructor","options","hook","Collection","requestDefaults","baseUrl","request","endpoint","DEFAULTS","headers","Object","assign","bind","mediaType","previews","format","userAgent","getUserAgent","filter","Boolean","join","timeZone","defaults","graphql","withCustomRequest","replace","log","debug","info","warn","console","error","authStrategy","auth","type","createTokenAuth","wrap","classConstructor","plugins","forEach","plugin","OctokitWithDefaults","args","newPlugins","_a","currentPlugins","NewOctokit","concat","includes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACMA,MAAMC,OAAN,CAAc;AACjBC,EAAAA,WAAW,CAACC,OAAO,GAAG,EAAX,EAAe;AACtB,UAAMC,IAAI,GAAG,IAAIC,0BAAJ,EAAb;AACA,UAAMC,eAAe,GAAG;AACpBC,MAAAA,OAAO,EAAEC,eAAO,CAACC,QAAR,CAAiBC,QAAjB,CAA0BH,OADf;AAEpBI,MAAAA,OAAO,EAAE,EAFW;AAGpBH,MAAAA,OAAO,EAAEI,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBV,OAAO,CAACK,OAA1B,EAAmC;AACxCJ,QAAAA,IAAI,EAAEA,IAAI,CAACU,IAAL,CAAU,IAAV,EAAgB,SAAhB;AADkC,OAAnC,CAHW;AAMpBC,MAAAA,SAAS,EAAE;AACPC,QAAAA,QAAQ,EAAE,EADH;AAEPC,QAAAA,MAAM,EAAE;AAFD;AANS,KAAxB,CAFsB;;AActBX,IAAAA,eAAe,CAACK,OAAhB,CAAwB,YAAxB,IAAwC,CACpCR,OAAO,CAACe,SAD4B,EAEnC,mBAAkBlB,OAAQ,IAAGmB,+BAAY,EAAG,EAFT,EAInCC,MAJmC,CAI5BC,OAJ4B,EAKnCC,IALmC,CAK9B,GAL8B,CAAxC;;AAMA,QAAInB,OAAO,CAACI,OAAZ,EAAqB;AACjBD,MAAAA,eAAe,CAACC,OAAhB,GAA0BJ,OAAO,CAACI,OAAlC;AACH;;AACD,QAAIJ,OAAO,CAACa,QAAZ,EAAsB;AAClBV,MAAAA,eAAe,CAACS,SAAhB,CAA0BC,QAA1B,GAAqCb,OAAO,CAACa,QAA7C;AACH;;AACD,QAAIb,OAAO,CAACoB,QAAZ,EAAsB;AAClBjB,MAAAA,eAAe,CAACK,OAAhB,CAAwB,WAAxB,IAAuCR,OAAO,CAACoB,QAA/C;AACH;;AACD,SAAKf,OAAL,GAAeA,eAAO,CAACgB,QAAR,CAAiBlB,eAAjB,CAAf;AACA,SAAKmB,OAAL,GAAeC,yBAAiB,CAAC,KAAKlB,OAAN,CAAjB,CAAgCgB,QAAhC,mCACRlB,eADQ;AAEXC,MAAAA,OAAO,EAAED,eAAe,CAACC,OAAhB,CAAwBoB,OAAxB,CAAgC,YAAhC,EAA8C,MAA9C;AAFE,OAAf;AAIA,SAAKC,GAAL,GAAWhB,MAAM,CAACC,MAAP,CAAc;AACrBgB,MAAAA,KAAK,EAAE,MAAM,EADQ;AAErBC,MAAAA,IAAI,EAAE,MAAM,EAFS;AAGrBC,MAAAA,IAAI,EAAEC,OAAO,CAACD,IAAR,CAAajB,IAAb,CAAkBkB,OAAlB,CAHe;AAIrBC,MAAAA,KAAK,EAAED,OAAO,CAACC,KAAR,CAAcnB,IAAd,CAAmBkB,OAAnB;AAJc,KAAd,EAKR7B,OAAO,CAACyB,GALA,CAAX;AAMA,SAAKxB,IAAL,GAAYA,IAAZ,CAxCsB;AA0CtB;AACA;AACA;AACA;;AACA,QAAI,CAACD,OAAO,CAAC+B,YAAb,EAA2B;AACvB,UAAI,CAAC/B,OAAO,CAACgC,IAAb,EAAmB;AACf;AACA,aAAKA,IAAL,GAAY,aAAa;AACrBC,UAAAA,IAAI,EAAE;AADe,SAAb,CAAZ;AAGH,OALD,MAMK;AACD;AACA,cAAMD,IAAI,GAAGE,yBAAe,CAAClC,OAAO,CAACgC,IAAT,CAA5B,CAFC;;AAID/B,QAAAA,IAAI,CAACkC,IAAL,CAAU,SAAV,EAAqBH,IAAI,CAAC/B,IAA1B;AACA,aAAK+B,IAAL,GAAYA,IAAZ;AACH;AACJ,KAdD,MAeK;AACD,YAAMA,IAAI,GAAGhC,OAAO,CAAC+B,YAAR,CAAqBtB,MAAM,CAACC,MAAP,CAAc;AAC5CL,QAAAA,OAAO,EAAE,KAAKA;AAD8B,OAAd,EAE/BL,OAAO,CAACgC,IAFuB,CAArB,CAAb,CADC;;AAKD/B,MAAAA,IAAI,CAACkC,IAAL,CAAU,SAAV,EAAqBH,IAAI,CAAC/B,IAA1B;AACA,WAAK+B,IAAL,GAAYA,IAAZ;AACH,KApEqB;AAsEtB;;;AACA,UAAMI,gBAAgB,GAAG,KAAKrC,WAA9B;AACAqC,IAAAA,gBAAgB,CAACC,OAAjB,CAAyBC,OAAzB,CAAkCC,MAAD,IAAY;AACzC9B,MAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoB6B,MAAM,CAAC,IAAD,EAAOvC,OAAP,CAA1B;AACH,KAFD;AAGH;;AACD,SAAOqB,QAAP,CAAgBA,QAAhB,EAA0B;AACtB,UAAMmB,mBAAmB,GAAG,cAAc,IAAd,CAAmB;AAC3CzC,MAAAA,WAAW,CAAC,GAAG0C,IAAJ,EAAU;AACjB,cAAMzC,OAAO,GAAGyC,IAAI,CAAC,CAAD,CAAJ,IAAW,EAA3B;;AACA,YAAI,OAAOpB,QAAP,KAAoB,UAAxB,EAAoC;AAChC,gBAAMA,QAAQ,CAACrB,OAAD,CAAd;AACA;AACH;;AACD,cAAMS,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBW,QAAlB,EAA4BrB,OAA5B,EAAqCA,OAAO,CAACe,SAAR,IAAqBM,QAAQ,CAACN,SAA9B,GACrC;AACEA,UAAAA,SAAS,EAAG,GAAEf,OAAO,CAACe,SAAU,IAAGM,QAAQ,CAACN,SAAU;AADxD,SADqC,GAIrC,IAJA,CAAN;AAKH;;AAZ0C,KAA/C;AAcA,WAAOyB,mBAAP;AACH;AACD;;;;;;;;AAMA,SAAOD,MAAP,CAAc,GAAGG,UAAjB,EAA6B;AACzB,QAAIC,EAAJ;;AACA,UAAMC,cAAc,GAAG,KAAKP,OAA5B;AACA,UAAMQ,UAAU,IAAIF,EAAE,GAAG,cAAc,IAAd,CAAmB,EAAxB,EAEhBA,EAAE,CAACN,OAAH,GAAaO,cAAc,CAACE,MAAf,CAAsBJ,UAAU,CAACzB,MAAX,CAAmBsB,MAAD,IAAY,CAACK,cAAc,CAACG,QAAf,CAAwBR,MAAxB,CAA/B,CAAtB,CAFG,EAGhBI,EAHY,CAAhB;AAIA,WAAOE,UAAP;AACH;;AA5GgB;AA8GrB/C,OAAO,CAACD,OAAR,GAAkBA,OAAlB;AACAC,OAAO,CAACuC,OAAR,GAAkB,EAAlB;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"3.5.1\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { Collection } from \"before-after-hook\";\nimport { request } from \"@octokit/request\";\nimport { withCustomRequest } from \"@octokit/graphql\";\nimport { createTokenAuth } from \"@octokit/auth-token\";\nimport { VERSION } from \"./version\";\nexport class Octokit {\n constructor(options = {}) {\n const hook = new Collection();\n const requestDefaults = {\n baseUrl: request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\"),\n }),\n mediaType: {\n previews: [],\n format: \"\",\n },\n };\n // prepend default user agent with `options.userAgent` if set\n requestDefaults.headers[\"user-agent\"] = [\n options.userAgent,\n `octokit-core.js/${VERSION} ${getUserAgent()}`,\n ]\n .filter(Boolean)\n .join(\" \");\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n this.request = request.defaults(requestDefaults);\n this.graphql = withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => { },\n info: () => { },\n warn: console.warn.bind(console),\n error: console.error.bind(console),\n }, options.log);\n this.hook = hook;\n // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\",\n });\n }\n else {\n // (2)\n const auth = createTokenAuth(options.auth);\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n }\n else {\n const { authStrategy, ...otherOptions } = options;\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions,\n }, options.auth));\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n // apply plugins\n // https://stackoverflow.com/a/16345172\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach((plugin) => {\n Object.assign(this, plugin(this, options));\n });\n }\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent\n ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`,\n }\n : null));\n }\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n static plugin(...newPlugins) {\n var _a;\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {\n },\n _a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))),\n _a);\n return NewOctokit;\n }\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n"],"names":["VERSION","Octokit","constructor","options","hook","Collection","requestDefaults","baseUrl","request","endpoint","DEFAULTS","headers","Object","assign","bind","mediaType","previews","format","userAgent","getUserAgent","filter","Boolean","join","timeZone","defaults","graphql","withCustomRequest","log","debug","info","warn","console","error","authStrategy","auth","type","createTokenAuth","wrap","otherOptions","octokit","octokitOptions","classConstructor","plugins","forEach","plugin","OctokitWithDefaults","args","newPlugins","_a","currentPlugins","NewOctokit","concat","includes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;;ACAP,AAMO,MAAMC,OAAN,CAAc;AACjBC,EAAAA,WAAW,CAACC,OAAO,GAAG,EAAX,EAAe;AACtB,UAAMC,IAAI,GAAG,IAAIC,0BAAJ,EAAb;AACA,UAAMC,eAAe,GAAG;AACpBC,MAAAA,OAAO,EAAEC,eAAO,CAACC,QAAR,CAAiBC,QAAjB,CAA0BH,OADf;AAEpBI,MAAAA,OAAO,EAAE,EAFW;AAGpBH,MAAAA,OAAO,EAAEI,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBV,OAAO,CAACK,OAA1B,EAAmC;AACxC;AACAJ,QAAAA,IAAI,EAAEA,IAAI,CAACU,IAAL,CAAU,IAAV,EAAgB,SAAhB;AAFkC,OAAnC,CAHW;AAOpBC,MAAAA,SAAS,EAAE;AACPC,QAAAA,QAAQ,EAAE,EADH;AAEPC,QAAAA,MAAM,EAAE;AAFD;AAPS,KAAxB,CAFsB;;AAetBX,IAAAA,eAAe,CAACK,OAAhB,CAAwB,YAAxB,IAAwC,CACpCR,OAAO,CAACe,SAD4B,EAEnC,mBAAkBlB,OAAQ,IAAGmB,+BAAY,EAAG,EAFT,EAInCC,MAJmC,CAI5BC,OAJ4B,EAKnCC,IALmC,CAK9B,GAL8B,CAAxC;;AAMA,QAAInB,OAAO,CAACI,OAAZ,EAAqB;AACjBD,MAAAA,eAAe,CAACC,OAAhB,GAA0BJ,OAAO,CAACI,OAAlC;AACH;;AACD,QAAIJ,OAAO,CAACa,QAAZ,EAAsB;AAClBV,MAAAA,eAAe,CAACS,SAAhB,CAA0BC,QAA1B,GAAqCb,OAAO,CAACa,QAA7C;AACH;;AACD,QAAIb,OAAO,CAACoB,QAAZ,EAAsB;AAClBjB,MAAAA,eAAe,CAACK,OAAhB,CAAwB,WAAxB,IAAuCR,OAAO,CAACoB,QAA/C;AACH;;AACD,SAAKf,OAAL,GAAeA,eAAO,CAACgB,QAAR,CAAiBlB,eAAjB,CAAf;AACA,SAAKmB,OAAL,GAAeC,yBAAiB,CAAC,KAAKlB,OAAN,CAAjB,CAAgCgB,QAAhC,CAAyClB,eAAzC,CAAf;AACA,SAAKqB,GAAL,GAAWf,MAAM,CAACC,MAAP,CAAc;AACrBe,MAAAA,KAAK,EAAE,MAAM,EADQ;AAErBC,MAAAA,IAAI,EAAE,MAAM,EAFS;AAGrBC,MAAAA,IAAI,EAAEC,OAAO,CAACD,IAAR,CAAahB,IAAb,CAAkBiB,OAAlB,CAHe;AAIrBC,MAAAA,KAAK,EAAED,OAAO,CAACC,KAAR,CAAclB,IAAd,CAAmBiB,OAAnB;AAJc,KAAd,EAKR5B,OAAO,CAACwB,GALA,CAAX;AAMA,SAAKvB,IAAL,GAAYA,IAAZ,CAtCsB;AAwCtB;AACA;AACA;AACA;;AACA,QAAI,CAACD,OAAO,CAAC8B,YAAb,EAA2B;AACvB,UAAI,CAAC9B,OAAO,CAAC+B,IAAb,EAAmB;AACf;AACA,aAAKA,IAAL,GAAY,aAAa;AACrBC,UAAAA,IAAI,EAAE;AADe,SAAb,CAAZ;AAGH,OALD,MAMK;AACD;AACA,cAAMD,IAAI,GAAGE,yBAAe,CAACjC,OAAO,CAAC+B,IAAT,CAA5B,CAFC;;AAID9B,QAAAA,IAAI,CAACiC,IAAL,CAAU,SAAV,EAAqBH,IAAI,CAAC9B,IAA1B;AACA,aAAK8B,IAAL,GAAYA,IAAZ;AACH;AACJ,KAdD,MAeK;AACD,YAAM;AAAED,QAAAA;AAAF,UAAoC9B,OAA1C;AAAA,YAAyBmC,YAAzB,4BAA0CnC,OAA1C;;AACA,YAAM+B,IAAI,GAAGD,YAAY,CAACrB,MAAM,CAACC,MAAP,CAAc;AACpCL,QAAAA,OAAO,EAAE,KAAKA,OADsB;AAEpCmB,QAAAA,GAAG,EAAE,KAAKA,GAF0B;AAGpC;AACA;AACA;AACA;AACA;AACAY,QAAAA,OAAO,EAAE,IAR2B;AASpCC,QAAAA,cAAc,EAAEF;AAToB,OAAd,EAUvBnC,OAAO,CAAC+B,IAVe,CAAD,CAAzB,CAFC;;AAcD9B,MAAAA,IAAI,CAACiC,IAAL,CAAU,SAAV,EAAqBH,IAAI,CAAC9B,IAA1B;AACA,WAAK8B,IAAL,GAAYA,IAAZ;AACH,KA3EqB;AA6EtB;;;AACA,UAAMO,gBAAgB,GAAG,KAAKvC,WAA9B;AACAuC,IAAAA,gBAAgB,CAACC,OAAjB,CAAyBC,OAAzB,CAAkCC,MAAD,IAAY;AACzChC,MAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoB+B,MAAM,CAAC,IAAD,EAAOzC,OAAP,CAA1B;AACH,KAFD;AAGH;;AACc,SAARqB,QAAQ,CAACA,QAAD,EAAW;AACtB,UAAMqB,mBAAmB,GAAG,cAAc,IAAd,CAAmB;AAC3C3C,MAAAA,WAAW,CAAC,GAAG4C,IAAJ,EAAU;AACjB,cAAM3C,OAAO,GAAG2C,IAAI,CAAC,CAAD,CAAJ,IAAW,EAA3B;;AACA,YAAI,OAAOtB,QAAP,KAAoB,UAAxB,EAAoC;AAChC,gBAAMA,QAAQ,CAACrB,OAAD,CAAd;AACA;AACH;;AACD,cAAMS,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBW,QAAlB,EAA4BrB,OAA5B,EAAqCA,OAAO,CAACe,SAAR,IAAqBM,QAAQ,CAACN,SAA9B,GACrC;AACEA,UAAAA,SAAS,EAAG,GAAEf,OAAO,CAACe,SAAU,IAAGM,QAAQ,CAACN,SAAU;AADxD,SADqC,GAIrC,IAJA,CAAN;AAKH;;AAZ0C,KAA/C;AAcA,WAAO2B,mBAAP;AACH;AACD;AACJ;AACA;AACA;AACA;AACA;;;AACiB,SAAND,MAAM,CAAC,GAAGG,UAAJ,EAAgB;AACzB,QAAIC,EAAJ;;AACA,UAAMC,cAAc,GAAG,KAAKP,OAA5B;AACA,UAAMQ,UAAU,IAAIF,EAAE,GAAG,cAAc,IAAd,CAAmB,EAAxB,EAEhBA,EAAE,CAACN,OAAH,GAAaO,cAAc,CAACE,MAAf,CAAsBJ,UAAU,CAAC3B,MAAX,CAAmBwB,MAAD,IAAY,CAACK,cAAc,CAACG,QAAf,CAAwBR,MAAxB,CAA/B,CAAtB,CAFG,EAGhBI,EAHY,CAAhB;AAIA,WAAOE,UAAP;AACH;;AAnHgB;AAqHrBjD,OAAO,CAACD,OAAR,GAAkBA,OAAlB;AACAC,OAAO,CAACyC,OAAR,GAAkB,EAAlB;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/core/dist-src/index.js b/node_modules/@octokit/core/dist-src/index.js index e22e939..bdbc335 100644 --- a/node_modules/@octokit/core/dist-src/index.js +++ b/node_modules/@octokit/core/dist-src/index.js @@ -11,6 +11,7 @@ export class Octokit { baseUrl: request.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type hook: hook.bind(null, "request"), }), mediaType: { @@ -35,10 +36,7 @@ export class Octokit { requestDefaults.headers["time-zone"] = options.timeZone; } this.request = request.defaults(requestDefaults); - this.graphql = withCustomRequest(this.request).defaults({ - ...requestDefaults, - baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api"), - }); + this.graphql = withCustomRequest(this.request).defaults(requestDefaults); this.log = Object.assign({ debug: () => { }, info: () => { }, @@ -47,7 +45,7 @@ export class Octokit { }, options.log); this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. // (2) If only `options.auth` is set, use the default token authentication strategy. // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. // TODO: type `options.auth` based on `options.authStrategy`. @@ -67,8 +65,17 @@ export class Octokit { } } else { - const auth = options.authStrategy(Object.assign({ + const { authStrategy, ...otherOptions } = options; + const auth = authStrategy(Object.assign({ request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions, }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ hook.wrap("request", auth.hook); diff --git a/node_modules/@octokit/core/dist-src/types.js b/node_modules/@octokit/core/dist-src/types.js index e69de29..cb0ff5c 100644 --- a/node_modules/@octokit/core/dist-src/types.js +++ b/node_modules/@octokit/core/dist-src/types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@octokit/core/dist-src/version.js b/node_modules/@octokit/core/dist-src/version.js index cff7ee8..f53b635 100644 --- a/node_modules/@octokit/core/dist-src/version.js +++ b/node_modules/@octokit/core/dist-src/version.js @@ -1 +1 @@ -export const VERSION = "3.1.2"; +export const VERSION = "3.5.1"; diff --git a/node_modules/@octokit/core/dist-types/index.d.ts b/node_modules/@octokit/core/dist-types/index.d.ts index 1033622..b757c5b 100644 --- a/node_modules/@octokit/core/dist-types/index.d.ts +++ b/node_modules/@octokit/core/dist-types/index.d.ts @@ -1,14 +1,10 @@ import { HookCollection } from "before-after-hook"; import { request } from "@octokit/request"; import { graphql } from "@octokit/graphql"; -import { Constructor, OctokitOptions, OctokitPlugin, ReturnTypeOf, UnionToIntersection } from "./types"; +import { Constructor, Hooks, OctokitOptions, OctokitPlugin, ReturnTypeOf, UnionToIntersection } from "./types"; export declare class Octokit { static VERSION: string; - static defaults>(this: S, defaults: OctokitOptions | Function): { - new (...args: any[]): { - [x: string]: any; - }; - } & S; + static defaults>(this: S, defaults: OctokitOptions | Function): S; static plugins: OctokitPlugin[]; /** * Attach a plugin (or many) to your Octokit instance. @@ -18,12 +14,7 @@ export declare class Octokit { */ static plugin & { plugins: any[]; - }, T extends OctokitPlugin[]>(this: S, ...newPlugins: T): { - new (...args: any[]): { - [x: string]: any; - }; - plugins: any[]; - } & S & Constructor>>; + }, T extends OctokitPlugin[]>(this: S, ...newPlugins: T): S & Constructor>>; constructor(options?: OctokitOptions); request: typeof request; graphql: typeof graphql; @@ -34,7 +25,6 @@ export declare class Octokit { error: (message: string, additionalInfo?: object) => any; [key: string]: any; }; - hook: HookCollection; + hook: HookCollection; auth: (...args: unknown[]) => Promise; - [key: string]: any; } diff --git a/node_modules/@octokit/core/dist-types/types.d.ts b/node_modules/@octokit/core/dist-types/types.d.ts index 59b284e..06c0f7a 100644 --- a/node_modules/@octokit/core/dist-types/types.d.ts +++ b/node_modules/@octokit/core/dist-types/types.d.ts @@ -1,4 +1,5 @@ import * as OctokitTypes from "@octokit/types"; +import { RequestError } from "@octokit/request-error"; import { Octokit } from "."; export declare type RequestParameters = OctokitTypes.RequestParameters; export declare type OctokitOptions = { @@ -18,7 +19,7 @@ export declare type OctokitOptions = { [option: string]: any; }; export declare type Constructor = new (...args: any[]) => T; -export declare type ReturnTypeOf = T extends AnyFunction ? ReturnType : T extends AnyFunction[] ? UnionToIntersection> : never; +export declare type ReturnTypeOf = T extends AnyFunction ? ReturnType : T extends AnyFunction[] ? UnionToIntersection, void>> : never; /** * @author https://stackoverflow.com/users/2887218/jcalz * @see https://stackoverflow.com/a/50375286/10325032 @@ -28,4 +29,16 @@ declare type AnyFunction = (...args: any) => any; export declare type OctokitPlugin = (octokit: Octokit, options: OctokitOptions) => { [key: string]: any; } | void; +export declare type Hooks = { + request: { + Options: Required; + Result: OctokitTypes.OctokitResponse; + Error: RequestError | Error; + }; + [key: string]: { + Options: unknown; + Result: unknown; + Error: unknown; + }; +}; export {}; diff --git a/node_modules/@octokit/core/dist-types/version.d.ts b/node_modules/@octokit/core/dist-types/version.d.ts index 31e9409..8bb7c7f 100644 --- a/node_modules/@octokit/core/dist-types/version.d.ts +++ b/node_modules/@octokit/core/dist-types/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "3.1.2"; +export declare const VERSION = "3.5.1"; diff --git a/node_modules/@octokit/core/dist-web/index.js b/node_modules/@octokit/core/dist-web/index.js index 6d3d47b..2828d97 100644 --- a/node_modules/@octokit/core/dist-web/index.js +++ b/node_modules/@octokit/core/dist-web/index.js @@ -4,7 +4,7 @@ import { request } from '@octokit/request'; import { withCustomRequest } from '@octokit/graphql'; import { createTokenAuth } from '@octokit/auth-token'; -const VERSION = "3.1.2"; +const VERSION = "3.5.1"; class Octokit { constructor(options = {}) { @@ -13,6 +13,7 @@ class Octokit { baseUrl: request.endpoint.DEFAULTS.baseUrl, headers: {}, request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type hook: hook.bind(null, "request"), }), mediaType: { @@ -37,10 +38,7 @@ class Octokit { requestDefaults.headers["time-zone"] = options.timeZone; } this.request = request.defaults(requestDefaults); - this.graphql = withCustomRequest(this.request).defaults({ - ...requestDefaults, - baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api"), - }); + this.graphql = withCustomRequest(this.request).defaults(requestDefaults); this.log = Object.assign({ debug: () => { }, info: () => { }, @@ -49,7 +47,7 @@ class Octokit { }, options.log); this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred. + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. // (2) If only `options.auth` is set, use the default token authentication strategy. // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. // TODO: type `options.auth` based on `options.authStrategy`. @@ -69,8 +67,17 @@ class Octokit { } } else { - const auth = options.authStrategy(Object.assign({ + const { authStrategy, ...otherOptions } = options; + const auth = authStrategy(Object.assign({ request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions, }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ hook.wrap("request", auth.hook); diff --git a/node_modules/@octokit/core/dist-web/index.js.map b/node_modules/@octokit/core/dist-web/index.js.map index 10cd9ea..084574c 100644 --- a/node_modules/@octokit/core/dist-web/index.js.map +++ b/node_modules/@octokit/core/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"3.1.2\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { Collection } from \"before-after-hook\";\nimport { request } from \"@octokit/request\";\nimport { withCustomRequest } from \"@octokit/graphql\";\nimport { createTokenAuth } from \"@octokit/auth-token\";\nimport { VERSION } from \"./version\";\nexport class Octokit {\n constructor(options = {}) {\n const hook = new Collection();\n const requestDefaults = {\n baseUrl: request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n hook: hook.bind(null, \"request\"),\n }),\n mediaType: {\n previews: [],\n format: \"\",\n },\n };\n // prepend default user agent with `options.userAgent` if set\n requestDefaults.headers[\"user-agent\"] = [\n options.userAgent,\n `octokit-core.js/${VERSION} ${getUserAgent()}`,\n ]\n .filter(Boolean)\n .join(\" \");\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n this.request = request.defaults(requestDefaults);\n this.graphql = withCustomRequest(this.request).defaults({\n ...requestDefaults,\n baseUrl: requestDefaults.baseUrl.replace(/\\/api\\/v3$/, \"/api\"),\n });\n this.log = Object.assign({\n debug: () => { },\n info: () => { },\n warn: console.warn.bind(console),\n error: console.error.bind(console),\n }, options.log);\n this.hook = hook;\n // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registred.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\",\n });\n }\n else {\n // (2)\n const auth = createTokenAuth(options.auth);\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n }\n else {\n const auth = options.authStrategy(Object.assign({\n request: this.request,\n }, options.auth));\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n // apply plugins\n // https://stackoverflow.com/a/16345172\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach((plugin) => {\n Object.assign(this, plugin(this, options));\n });\n }\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent\n ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`,\n }\n : null));\n }\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n static plugin(...newPlugins) {\n var _a;\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {\n },\n _a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))),\n _a);\n return NewOctokit;\n }\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n"],"names":[],"mappings":";;;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACMnC,MAAM,OAAO,CAAC;AACrB,IAAI,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;AACtC,QAAQ,MAAM,eAAe,GAAG;AAChC,YAAY,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO;AACtD,YAAY,OAAO,EAAE,EAAE;AACvB,YAAY,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE;AACxD,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;AAChD,aAAa,CAAC;AACd,YAAY,SAAS,EAAE;AACvB,gBAAgB,QAAQ,EAAE,EAAE;AAC5B,gBAAgB,MAAM,EAAE,EAAE;AAC1B,aAAa;AACb,SAAS,CAAC;AACV;AACA,QAAQ,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG;AAChD,YAAY,OAAO,CAAC,SAAS;AAC7B,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AAC1D,SAAS;AACT,aAAa,MAAM,CAAC,OAAO,CAAC;AAC5B,aAAa,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE;AAC7B,YAAY,eAAe,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtD,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE;AAC9B,YAAY,eAAe,CAAC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AAClE,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE;AAC9B,YAAY,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;AACpE,SAAS;AACT,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACzD,QAAQ,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;AAChE,YAAY,GAAG,eAAe;AAC9B,YAAY,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;AAC1E,SAAS,CAAC,CAAC;AACX,QAAQ,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;AACjC,YAAY,KAAK,EAAE,MAAM,GAAG;AAC5B,YAAY,IAAI,EAAE,MAAM,GAAG;AAC3B,YAAY,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AAC5C,YAAY,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;AAC9C,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AACxB,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;AACnC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AAC/B;AACA,gBAAgB,IAAI,CAAC,IAAI,GAAG,aAAa;AACzC,oBAAoB,IAAI,EAAE,iBAAiB;AAC3C,iBAAiB,CAAC,CAAC;AACnB,aAAa;AACb,iBAAiB;AACjB;AACA,gBAAgB,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3D;AACA,gBAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAChD,gBAAgB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACjC,aAAa;AACb,SAAS;AACT,aAAa;AACb,YAAY,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;AAC5D,gBAAgB,OAAO,EAAE,IAAI,CAAC,OAAO;AACrC,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9B;AACA,YAAY,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,YAAY,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AAC7B,SAAS;AACT;AACA;AACA,QAAQ,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;AAClD,QAAQ,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AACrD,YAAY,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACvD,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,QAAQ,EAAE;AAC9B,QAAQ,MAAM,mBAAmB,GAAG,cAAc,IAAI,CAAC;AACvD,YAAY,WAAW,CAAC,GAAG,IAAI,EAAE;AACjC,gBAAgB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,gBAAgB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AACpD,oBAAoB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7C,oBAAoB,OAAO;AAC3B,iBAAiB;AACjB,gBAAgB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS;AAClG,sBAAsB;AACtB,wBAAwB,SAAS,EAAE,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC/E,qBAAqB;AACrB,sBAAsB,IAAI,CAAC,CAAC,CAAC;AAC7B,aAAa;AACb,SAAS,CAAC;AACV,QAAQ,OAAO,mBAAmB,CAAC;AACnC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,MAAM,CAAC,GAAG,UAAU,EAAE;AACjC,QAAQ,IAAI,EAAE,CAAC;AACf,QAAQ,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC;AAC5C,QAAQ,MAAM,UAAU,IAAI,EAAE,GAAG,cAAc,IAAI,CAAC;AACpD,aAAa;AACb,YAAY,EAAE,CAAC,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/G,YAAY,EAAE,CAAC,CAAC;AAChB,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"3.5.1\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { Collection } from \"before-after-hook\";\nimport { request } from \"@octokit/request\";\nimport { withCustomRequest } from \"@octokit/graphql\";\nimport { createTokenAuth } from \"@octokit/auth-token\";\nimport { VERSION } from \"./version\";\nexport class Octokit {\n constructor(options = {}) {\n const hook = new Collection();\n const requestDefaults = {\n baseUrl: request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\"),\n }),\n mediaType: {\n previews: [],\n format: \"\",\n },\n };\n // prepend default user agent with `options.userAgent` if set\n requestDefaults.headers[\"user-agent\"] = [\n options.userAgent,\n `octokit-core.js/${VERSION} ${getUserAgent()}`,\n ]\n .filter(Boolean)\n .join(\" \");\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n this.request = request.defaults(requestDefaults);\n this.graphql = withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => { },\n info: () => { },\n warn: console.warn.bind(console),\n error: console.error.bind(console),\n }, options.log);\n this.hook = hook;\n // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\",\n });\n }\n else {\n // (2)\n const auth = createTokenAuth(options.auth);\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n }\n else {\n const { authStrategy, ...otherOptions } = options;\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions,\n }, options.auth));\n // @ts-ignore ¯\\_(ツ)_/¯\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n // apply plugins\n // https://stackoverflow.com/a/16345172\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach((plugin) => {\n Object.assign(this, plugin(this, options));\n });\n }\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent\n ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`,\n }\n : null));\n }\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n static plugin(...newPlugins) {\n var _a;\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {\n },\n _a.plugins = currentPlugins.concat(newPlugins.filter((plugin) => !currentPlugins.includes(plugin))),\n _a);\n return NewOctokit;\n }\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n"],"names":[],"mappings":";;;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACMnC,MAAM,OAAO,CAAC;AACrB,IAAI,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;AAC9B,QAAQ,MAAM,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;AACtC,QAAQ,MAAM,eAAe,GAAG;AAChC,YAAY,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO;AACtD,YAAY,OAAO,EAAE,EAAE;AACvB,YAAY,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE;AACxD;AACA,gBAAgB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC;AAChD,aAAa,CAAC;AACd,YAAY,SAAS,EAAE;AACvB,gBAAgB,QAAQ,EAAE,EAAE;AAC5B,gBAAgB,MAAM,EAAE,EAAE;AAC1B,aAAa;AACb,SAAS,CAAC;AACV;AACA,QAAQ,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG;AAChD,YAAY,OAAO,CAAC,SAAS;AAC7B,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AAC1D,SAAS;AACT,aAAa,MAAM,CAAC,OAAO,CAAC;AAC5B,aAAa,IAAI,CAAC,GAAG,CAAC,CAAC;AACvB,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE;AAC7B,YAAY,eAAe,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtD,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE;AAC9B,YAAY,eAAe,CAAC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AAClE,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE;AAC9B,YAAY,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;AACpE,SAAS;AACT,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACzD,QAAQ,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;AACjF,QAAQ,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;AACjC,YAAY,KAAK,EAAE,MAAM,GAAG;AAC5B,YAAY,IAAI,EAAE,MAAM,GAAG;AAC3B,YAAY,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AAC5C,YAAY,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;AAC9C,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;AACxB,QAAQ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;AACnC,YAAY,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AAC/B;AACA,gBAAgB,IAAI,CAAC,IAAI,GAAG,aAAa;AACzC,oBAAoB,IAAI,EAAE,iBAAiB;AAC3C,iBAAiB,CAAC,CAAC;AACnB,aAAa;AACb,iBAAiB;AACjB;AACA,gBAAgB,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3D;AACA,gBAAgB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAChD,gBAAgB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACjC,aAAa;AACb,SAAS;AACT,aAAa;AACb,YAAY,MAAM,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;AAC9D,YAAY,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;AACpD,gBAAgB,OAAO,EAAE,IAAI,CAAC,OAAO;AACrC,gBAAgB,GAAG,EAAE,IAAI,CAAC,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,cAAc,EAAE,YAAY;AAC5C,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9B;AACA,YAAY,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5C,YAAY,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AAC7B,SAAS;AACT;AACA;AACA,QAAQ,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;AAClD,QAAQ,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AACrD,YAAY,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACvD,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,QAAQ,EAAE;AAC9B,QAAQ,MAAM,mBAAmB,GAAG,cAAc,IAAI,CAAC;AACvD,YAAY,WAAW,CAAC,GAAG,IAAI,EAAE;AACjC,gBAAgB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,gBAAgB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;AACpD,oBAAoB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7C,oBAAoB,OAAO;AAC3B,iBAAiB;AACjB,gBAAgB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS;AAClG,sBAAsB;AACtB,wBAAwB,SAAS,EAAE,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC/E,qBAAqB;AACrB,sBAAsB,IAAI,CAAC,CAAC,CAAC;AAC7B,aAAa;AACb,SAAS,CAAC;AACV,QAAQ,OAAO,mBAAmB,CAAC;AACnC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,MAAM,CAAC,GAAG,UAAU,EAAE;AACjC,QAAQ,IAAI,EAAE,CAAC;AACf,QAAQ,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC;AAC5C,QAAQ,MAAM,UAAU,IAAI,EAAE,GAAG,cAAc,IAAI,CAAC;AACpD,aAAa;AACb,YAAY,EAAE,CAAC,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/G,YAAY,EAAE,CAAC,CAAC;AAChB,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,CAAC;AACD,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/core/package.json b/node_modules/@octokit/core/package.json index 8c4b1ee..cb35459 100644 --- a/node_modules/@octokit/core/package.json +++ b/node_modules/@octokit/core/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/core", "description": "Extendable client for GitHub's REST & GraphQL APIs", - "version": "3.1.2", + "version": "3.5.1", "license": "MIT", "files": [ "dist-*/", @@ -16,17 +16,18 @@ "sdk", "toolkit" ], - "repository": "https://github.com/octokit/core.js", + "repository": "github:octokit/core.js", "dependencies": { - "@octokit/auth-token": "^2.4.0", - "@octokit/graphql": "^4.3.1", - "@octokit/request": "^5.4.0", - "@octokit/types": "^5.0.0", - "before-after-hook": "^2.1.0", + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.0", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" }, "devDependencies": { - "@octokit/auth": "^2.0.0", + "@octokit/auth": "^3.0.1", "@pika/pack": "^0.5.0", "@pika/plugin-build-node": "^0.9.0", "@pika/plugin-build-web": "^0.9.0", @@ -38,14 +39,14 @@ "@types/node-fetch": "^2.5.0", "fetch-mock": "^9.0.0", "http-proxy-agent": "^4.0.1", - "jest": "^26.1.0", + "jest": "^27.0.0", "lolex": "^6.0.0", - "prettier": "^2.0.4", + "prettier": "2.3.1", "proxy": "^1.0.1", "semantic-release": "^17.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", - "ts-jest": "^26.1.3", - "typescript": "^3.5.3" + "ts-jest": "^27.0.0", + "typescript": "^4.0.2" }, "publishConfig": { "access": "public" diff --git a/node_modules/@octokit/endpoint/README.md b/node_modules/@octokit/endpoint/README.md index ec54be2..1e5153f 100644 --- a/node_modules/@octokit/endpoint/README.md +++ b/node_modules/@octokit/endpoint/README.md @@ -32,11 +32,11 @@ Browsers -Load @octokit/endpoint directly from cdn.pika.dev +Load @octokit/endpoint directly from cdn.skypack.dev ```html ``` @@ -59,7 +59,7 @@ const { endpoint } = require("@octokit/endpoint"); Example for [List organization repositories](https://developer.github.com/v3/repos/#list-organization-repositories) ```js -const requestOptions = endpoint("GET /orgs/:org/repos", { +const requestOptions = endpoint("GET /orgs/{org}/repos", { headers: { authorization: "token 0000000000000000000000000000000000000001", }, @@ -123,7 +123,7 @@ axios(requestOptions); String - If set, it has to be a string consisting of URL and the request method, e.g., GET /orgs/:org. If it’s set to a URL, only the method defaults to GET. + If set, it has to be a string consisting of URL and the request method, e.g., GET /orgs/{org}. If it’s set to a URL, only the method defaults to GET. @@ -146,7 +146,7 @@ axios(requestOptions); Required unless route is set. A path or full URL which may contain :variable or {variable} placeholders, - e.g., /orgs/:org/repos. The url is parsed using url-template. + e.g., /orgs/{org}/repos. The url is parsed using url-template. @@ -222,7 +222,7 @@ axios(requestOptions); All other options will be passed depending on the `method` and `url` options. -1. If the option key has a placeholder in the `url`, it will be used as the replacement. For example, if the passed options are `{url: '/orgs/:org/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos`. +1. If the option key has a placeholder in the `url`, it will be used as the replacement. For example, if the passed options are `{url: '/orgs/{org}/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos`. 2. If the `method` is `GET` or `HEAD`, the option is passed as a query parameter. 3. Otherwise, the parameter is passed in the request body as a JSON key. @@ -289,7 +289,7 @@ const myEndpoint = require("@octokit/endpoint").defaults({ per_page: 100, }); -request(myEndpoint(`GET /orgs/:org/repos`)); +request(myEndpoint(`GET /orgs/{org}/repos`)); ``` You can call `.defaults()` again on the returned method, the defaults will cascade. @@ -337,7 +337,7 @@ const myProjectEndpoint = endpoint.defaults({ }, org: "my-project", }); -myProjectEndpoint.merge("GET /orgs/:org/repos", { +myProjectEndpoint.merge("GET /orgs/{org}/repos", { headers: { authorization: `token 0000000000000000000000000000000000000001`, }, @@ -348,7 +348,7 @@ myProjectEndpoint.merge("GET /orgs/:org/repos", { // { // baseUrl: 'https://github-enterprise.acme-inc.com/api/v3', // method: 'GET', -// url: '/orgs/:org/repos', +// url: '/orgs/{org}/repos', // headers: { // accept: 'application/vnd.github.v3+json', // authorization: `token 0000000000000000000000000000000000000001`, diff --git a/node_modules/@octokit/endpoint/dist-node/index.js b/node_modules/@octokit/endpoint/dist-node/index.js index b6a9d86..70f24ff 100644 --- a/node_modules/@octokit/endpoint/dist-node/index.js +++ b/node_modules/@octokit/endpoint/dist-node/index.js @@ -366,7 +366,7 @@ function withDefaults(oldDefaults, newDefaults) { }); } -const VERSION = "6.0.8"; +const VERSION = "6.0.12"; const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. // So we use RequestParameters and add method as additional required property. diff --git a/node_modules/@octokit/endpoint/dist-node/index.js.map b/node_modules/@octokit/endpoint/dist-node/index.js.map index 0ce19c6..003e4f2 100644 --- a/node_modules/@octokit/endpoint/dist-node/index.js.map +++ b/node_modules/@octokit/endpoint/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/util/lowercase-keys.js","../dist-src/util/merge-deep.js","../dist-src/util/remove-undefined-properties.js","../dist-src/merge.js","../dist-src/util/add-query-parameters.js","../dist-src/util/extract-url-variable-names.js","../dist-src/util/omit.js","../dist-src/util/url-template.js","../dist-src/parse.js","../dist-src/endpoint-with-defaults.js","../dist-src/with-defaults.js","../dist-src/version.js","../dist-src/defaults.js","../dist-src/index.js"],"sourcesContent":["export function lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n","import { isPlainObject } from \"is-plain-object\";\nexport function mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach((key) => {\n if (isPlainObject(options[key])) {\n if (!(key in defaults))\n Object.assign(result, { [key]: options[key] });\n else\n result[key] = mergeDeep(defaults[key], options[key]);\n }\n else {\n Object.assign(result, { [key]: options[key] });\n }\n });\n return result;\n}\n","export function removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n}\n","import { lowercaseKeys } from \"./util/lowercase-keys\";\nimport { mergeDeep } from \"./util/merge-deep\";\nimport { removeUndefinedProperties } from \"./util/remove-undefined-properties\";\nexport function merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? { method, url } : { url: method }, options);\n }\n else {\n options = Object.assign({}, route);\n }\n // lowercase header names before merging with defaults to avoid duplicates\n options.headers = lowercaseKeys(options.headers);\n // remove properties with undefined values before merging\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options);\n // mediaType.previews arrays are merged, instead of overwritten\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews\n .filter((preview) => !mergedOptions.mediaType.previews.includes(preview))\n .concat(mergedOptions.mediaType.previews);\n }\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n","export function addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n if (names.length === 0) {\n return url;\n }\n return (url +\n separator +\n names\n .map((name) => {\n if (name === \"q\") {\n return (\"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\"));\n }\n return `${name}=${encodeURIComponent(parameters[name])}`;\n })\n .join(\"&\"));\n}\n","const urlVariableRegex = /\\{[^}]+\\}/g;\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\nexport function extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n if (!matches) {\n return [];\n }\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n","export function omit(object, keysToOmit) {\n return Object.keys(object)\n .filter((option) => !keysToOmit.includes(option))\n .reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n","// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str\n .split(/(%[0-9A-Fa-f]{2})/g)\n .map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n return part;\n })\n .join(\"\");\n}\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\nfunction encodeValue(operator, value, key) {\n value =\n operator === \"+\" || operator === \"#\"\n ? encodeReserved(value)\n : encodeUnreserved(value);\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n }\n else {\n return value;\n }\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\nfunction getValues(context, operator, key, modifier) {\n var value = context[key], result = [];\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") {\n value = value.toString();\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n }\n else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n }\n else {\n const tmp = [];\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n }\n else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n }\n else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n }\n else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n }\n else if (value === \"\") {\n result.push(\"\");\n }\n }\n return result;\n}\nexport function parseUrl(template) {\n return {\n expand: expand.bind(null, template),\n };\n}\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n if (operator && operator !== \"+\") {\n var separator = \",\";\n if (operator === \"?\") {\n separator = \"&\";\n }\n else if (operator !== \"#\") {\n separator = operator;\n }\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n }\n else {\n return values.join(\",\");\n }\n }\n else {\n return encodeReserved(literal);\n }\n });\n}\n","import { addQueryParameters } from \"./util/add-query-parameters\";\nimport { extractUrlVariableNames } from \"./util/extract-url-variable-names\";\nimport { omit } from \"./util/omit\";\nimport { parseUrl } from \"./util/url-template\";\nexport function parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase();\n // replace :varname with {varname} to make it RFC 6570 compatible\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"mediaType\",\n ]);\n // extract variable names from URL to calculate remaining variables later\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n const omittedParameters = Object.keys(options)\n .filter((option) => urlVariableNames.includes(option))\n .concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept\n .split(/,/)\n .map((preview) => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))\n .join(\",\");\n }\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader\n .concat(options.mediaType.previews)\n .map((preview) => {\n const format = options.mediaType.format\n ? `.${options.mediaType.format}`\n : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n })\n .join(\",\");\n }\n }\n // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n }\n else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n }\n else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n else {\n headers[\"content-length\"] = 0;\n }\n }\n }\n // default content-type for JSON if body is set\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n }\n // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n }\n // Only return body/request keys if present\n return Object.assign({ method, url, headers }, typeof body !== \"undefined\" ? { body } : null, options.request ? { request: options.request } : null);\n}\n","import { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n","import { endpointWithDefaults } from \"./endpoint-with-defaults\";\nimport { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse,\n });\n}\n","export const VERSION = \"6.0.8\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nconst userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;\n// DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\nexport const DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent,\n },\n mediaType: {\n format: \"\",\n previews: [],\n },\n};\n","import { withDefaults } from \"./with-defaults\";\nimport { DEFAULTS } from \"./defaults\";\nexport const endpoint = withDefaults(null, DEFAULTS);\n"],"names":["lowercaseKeys","object","Object","keys","reduce","newObj","key","toLowerCase","mergeDeep","defaults","options","result","assign","forEach","isPlainObject","removeUndefinedProperties","obj","undefined","merge","route","method","url","split","headers","mergedOptions","mediaType","previews","length","filter","preview","includes","concat","map","replace","addQueryParameters","parameters","separator","test","names","name","q","encodeURIComponent","join","urlVariableRegex","removeNonChars","variableName","extractUrlVariableNames","matches","match","a","b","omit","keysToOmit","option","encodeReserved","str","part","encodeURI","encodeUnreserved","c","charCodeAt","toString","toUpperCase","encodeValue","operator","value","isDefined","isKeyOperator","getValues","context","modifier","substring","parseInt","push","Array","isArray","k","tmp","parseUrl","template","expand","bind","operators","_","expression","literal","values","indexOf","charAt","substr","variable","exec","parse","body","urlVariableNames","baseUrl","omittedParameters","remainingParameters","isBinaryRequest","accept","format","previewsFromAcceptHeader","data","request","endpointWithDefaults","withDefaults","oldDefaults","newDefaults","DEFAULTS","endpoint","VERSION","userAgent","getUserAgent"],"mappings":";;;;;;;AAAO,SAASA,aAAT,CAAuBC,MAAvB,EAA+B;AAClC,MAAI,CAACA,MAAL,EAAa;AACT,WAAO,EAAP;AACH;;AACD,SAAOC,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBG,MAApB,CAA2B,CAACC,MAAD,EAASC,GAAT,KAAiB;AAC/CD,IAAAA,MAAM,CAACC,GAAG,CAACC,WAAJ,EAAD,CAAN,GAA4BN,MAAM,CAACK,GAAD,CAAlC;AACA,WAAOD,MAAP;AACH,GAHM,EAGJ,EAHI,CAAP;AAIH;;ACPM,SAASG,SAAT,CAAmBC,QAAnB,EAA6BC,OAA7B,EAAsC;AACzC,QAAMC,MAAM,GAAGT,MAAM,CAACU,MAAP,CAAc,EAAd,EAAkBH,QAAlB,CAAf;AACAP,EAAAA,MAAM,CAACC,IAAP,CAAYO,OAAZ,EAAqBG,OAArB,CAA8BP,GAAD,IAAS;AAClC,QAAIQ,2BAAa,CAACJ,OAAO,CAACJ,GAAD,CAAR,CAAjB,EAAiC;AAC7B,UAAI,EAAEA,GAAG,IAAIG,QAAT,CAAJ,EACIP,MAAM,CAACU,MAAP,CAAcD,MAAd,EAAsB;AAAE,SAACL,GAAD,GAAOI,OAAO,CAACJ,GAAD;AAAhB,OAAtB,EADJ,KAGIK,MAAM,CAACL,GAAD,CAAN,GAAcE,SAAS,CAACC,QAAQ,CAACH,GAAD,CAAT,EAAgBI,OAAO,CAACJ,GAAD,CAAvB,CAAvB;AACP,KALD,MAMK;AACDJ,MAAAA,MAAM,CAACU,MAAP,CAAcD,MAAd,EAAsB;AAAE,SAACL,GAAD,GAAOI,OAAO,CAACJ,GAAD;AAAhB,OAAtB;AACH;AACJ,GAVD;AAWA,SAAOK,MAAP;AACH;;ACfM,SAASI,yBAAT,CAAmCC,GAAnC,EAAwC;AAC3C,OAAK,MAAMV,GAAX,IAAkBU,GAAlB,EAAuB;AACnB,QAAIA,GAAG,CAACV,GAAD,CAAH,KAAaW,SAAjB,EAA4B;AACxB,aAAOD,GAAG,CAACV,GAAD,CAAV;AACH;AACJ;;AACD,SAAOU,GAAP;AACH;;ACJM,SAASE,KAAT,CAAeT,QAAf,EAAyBU,KAAzB,EAAgCT,OAAhC,EAAyC;AAC5C,MAAI,OAAOS,KAAP,KAAiB,QAArB,EAA+B;AAC3B,QAAI,CAACC,MAAD,EAASC,GAAT,IAAgBF,KAAK,CAACG,KAAN,CAAY,GAAZ,CAApB;AACAZ,IAAAA,OAAO,GAAGR,MAAM,CAACU,MAAP,CAAcS,GAAG,GAAG;AAAED,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAH,GAAqB;AAAEA,MAAAA,GAAG,EAAED;AAAP,KAAtC,EAAuDV,OAAvD,CAAV;AACH,GAHD,MAIK;AACDA,IAAAA,OAAO,GAAGR,MAAM,CAACU,MAAP,CAAc,EAAd,EAAkBO,KAAlB,CAAV;AACH,GAP2C;;;AAS5CT,EAAAA,OAAO,CAACa,OAAR,GAAkBvB,aAAa,CAACU,OAAO,CAACa,OAAT,CAA/B,CAT4C;;AAW5CR,EAAAA,yBAAyB,CAACL,OAAD,CAAzB;AACAK,EAAAA,yBAAyB,CAACL,OAAO,CAACa,OAAT,CAAzB;AACA,QAAMC,aAAa,GAAGhB,SAAS,CAACC,QAAQ,IAAI,EAAb,EAAiBC,OAAjB,CAA/B,CAb4C;;AAe5C,MAAID,QAAQ,IAAIA,QAAQ,CAACgB,SAAT,CAAmBC,QAAnB,CAA4BC,MAA5C,EAAoD;AAChDH,IAAAA,aAAa,CAACC,SAAd,CAAwBC,QAAxB,GAAmCjB,QAAQ,CAACgB,SAAT,CAAmBC,QAAnB,CAC9BE,MAD8B,CACtBC,OAAD,IAAa,CAACL,aAAa,CAACC,SAAd,CAAwBC,QAAxB,CAAiCI,QAAjC,CAA0CD,OAA1C,CADS,EAE9BE,MAF8B,CAEvBP,aAAa,CAACC,SAAd,CAAwBC,QAFD,CAAnC;AAGH;;AACDF,EAAAA,aAAa,CAACC,SAAd,CAAwBC,QAAxB,GAAmCF,aAAa,CAACC,SAAd,CAAwBC,QAAxB,CAAiCM,GAAjC,CAAsCH,OAAD,IAAaA,OAAO,CAACI,OAAR,CAAgB,UAAhB,EAA4B,EAA5B,CAAlD,CAAnC;AACA,SAAOT,aAAP;AACH;;ACzBM,SAASU,kBAAT,CAA4Bb,GAA5B,EAAiCc,UAAjC,EAA6C;AAChD,QAAMC,SAAS,GAAG,KAAKC,IAAL,CAAUhB,GAAV,IAAiB,GAAjB,GAAuB,GAAzC;AACA,QAAMiB,KAAK,GAAGpC,MAAM,CAACC,IAAP,CAAYgC,UAAZ,CAAd;;AACA,MAAIG,KAAK,CAACX,MAAN,KAAiB,CAArB,EAAwB;AACpB,WAAON,GAAP;AACH;;AACD,SAAQA,GAAG,GACPe,SADI,GAEJE,KAAK,CACAN,GADL,CACUO,IAAD,IAAU;AACf,QAAIA,IAAI,KAAK,GAAb,EAAkB;AACd,aAAQ,OAAOJ,UAAU,CAACK,CAAX,CAAalB,KAAb,CAAmB,GAAnB,EAAwBU,GAAxB,CAA4BS,kBAA5B,EAAgDC,IAAhD,CAAqD,GAArD,CAAf;AACH;;AACD,WAAQ,GAAEH,IAAK,IAAGE,kBAAkB,CAACN,UAAU,CAACI,IAAD,CAAX,CAAmB,EAAvD;AACH,GAND,EAOKG,IAPL,CAOU,GAPV,CAFJ;AAUH;;AChBD,MAAMC,gBAAgB,GAAG,YAAzB;;AACA,SAASC,cAAT,CAAwBC,YAAxB,EAAsC;AAClC,SAAOA,YAAY,CAACZ,OAAb,CAAqB,YAArB,EAAmC,EAAnC,EAAuCX,KAAvC,CAA6C,GAA7C,CAAP;AACH;;AACD,AAAO,SAASwB,uBAAT,CAAiCzB,GAAjC,EAAsC;AACzC,QAAM0B,OAAO,GAAG1B,GAAG,CAAC2B,KAAJ,CAAUL,gBAAV,CAAhB;;AACA,MAAI,CAACI,OAAL,EAAc;AACV,WAAO,EAAP;AACH;;AACD,SAAOA,OAAO,CAACf,GAAR,CAAYY,cAAZ,EAA4BxC,MAA5B,CAAmC,CAAC6C,CAAD,EAAIC,CAAJ,KAAUD,CAAC,CAAClB,MAAF,CAASmB,CAAT,CAA7C,EAA0D,EAA1D,CAAP;AACH;;ACVM,SAASC,IAAT,CAAclD,MAAd,EAAsBmD,UAAtB,EAAkC;AACrC,SAAOlD,MAAM,CAACC,IAAP,CAAYF,MAAZ,EACF2B,MADE,CACMyB,MAAD,IAAY,CAACD,UAAU,CAACtB,QAAX,CAAoBuB,MAApB,CADlB,EAEFjD,MAFE,CAEK,CAACY,GAAD,EAAMV,GAAN,KAAc;AACtBU,IAAAA,GAAG,CAACV,GAAD,CAAH,GAAWL,MAAM,CAACK,GAAD,CAAjB;AACA,WAAOU,GAAP;AACH,GALM,EAKJ,EALI,CAAP;AAMH;;ACPD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA,SAASsC,cAAT,CAAwBC,GAAxB,EAA6B;AACzB,SAAOA,GAAG,CACLjC,KADE,CACI,oBADJ,EAEFU,GAFE,CAEE,UAAUwB,IAAV,EAAgB;AACrB,QAAI,CAAC,eAAenB,IAAf,CAAoBmB,IAApB,CAAL,EAAgC;AAC5BA,MAAAA,IAAI,GAAGC,SAAS,CAACD,IAAD,CAAT,CAAgBvB,OAAhB,CAAwB,MAAxB,EAAgC,GAAhC,EAAqCA,OAArC,CAA6C,MAA7C,EAAqD,GAArD,CAAP;AACH;;AACD,WAAOuB,IAAP;AACH,GAPM,EAQFd,IARE,CAQG,EARH,CAAP;AASH;;AACD,SAASgB,gBAAT,CAA0BH,GAA1B,EAA+B;AAC3B,SAAOd,kBAAkB,CAACc,GAAD,CAAlB,CAAwBtB,OAAxB,CAAgC,UAAhC,EAA4C,UAAU0B,CAAV,EAAa;AAC5D,WAAO,MAAMA,CAAC,CAACC,UAAF,CAAa,CAAb,EAAgBC,QAAhB,CAAyB,EAAzB,EAA6BC,WAA7B,EAAb;AACH,GAFM,CAAP;AAGH;;AACD,SAASC,WAAT,CAAqBC,QAArB,EAA+BC,KAA/B,EAAsC3D,GAAtC,EAA2C;AACvC2D,EAAAA,KAAK,GACDD,QAAQ,KAAK,GAAb,IAAoBA,QAAQ,KAAK,GAAjC,GACMV,cAAc,CAACW,KAAD,CADpB,GAEMP,gBAAgB,CAACO,KAAD,CAH1B;;AAIA,MAAI3D,GAAJ,EAAS;AACL,WAAOoD,gBAAgB,CAACpD,GAAD,CAAhB,GAAwB,GAAxB,GAA8B2D,KAArC;AACH,GAFD,MAGK;AACD,WAAOA,KAAP;AACH;AACJ;;AACD,SAASC,SAAT,CAAmBD,KAAnB,EAA0B;AACtB,SAAOA,KAAK,KAAKhD,SAAV,IAAuBgD,KAAK,KAAK,IAAxC;AACH;;AACD,SAASE,aAAT,CAAuBH,QAAvB,EAAiC;AAC7B,SAAOA,QAAQ,KAAK,GAAb,IAAoBA,QAAQ,KAAK,GAAjC,IAAwCA,QAAQ,KAAK,GAA5D;AACH;;AACD,SAASI,SAAT,CAAmBC,OAAnB,EAA4BL,QAA5B,EAAsC1D,GAAtC,EAA2CgE,QAA3C,EAAqD;AACjD,MAAIL,KAAK,GAAGI,OAAO,CAAC/D,GAAD,CAAnB;AAAA,MAA0BK,MAAM,GAAG,EAAnC;;AACA,MAAIuD,SAAS,CAACD,KAAD,CAAT,IAAoBA,KAAK,KAAK,EAAlC,EAAsC;AAClC,QAAI,OAAOA,KAAP,KAAiB,QAAjB,IACA,OAAOA,KAAP,KAAiB,QADjB,IAEA,OAAOA,KAAP,KAAiB,SAFrB,EAEgC;AAC5BA,MAAAA,KAAK,GAAGA,KAAK,CAACJ,QAAN,EAAR;;AACA,UAAIS,QAAQ,IAAIA,QAAQ,KAAK,GAA7B,EAAkC;AAC9BL,QAAAA,KAAK,GAAGA,KAAK,CAACM,SAAN,CAAgB,CAAhB,EAAmBC,QAAQ,CAACF,QAAD,EAAW,EAAX,CAA3B,CAAR;AACH;;AACD3D,MAAAA,MAAM,CAAC8D,IAAP,CAAYV,WAAW,CAACC,QAAD,EAAWC,KAAX,EAAkBE,aAAa,CAACH,QAAD,CAAb,GAA0B1D,GAA1B,GAAgC,EAAlD,CAAvB;AACH,KARD,MASK;AACD,UAAIgE,QAAQ,KAAK,GAAjB,EAAsB;AAClB,YAAII,KAAK,CAACC,OAAN,CAAcV,KAAd,CAAJ,EAA0B;AACtBA,UAAAA,KAAK,CAACrC,MAAN,CAAasC,SAAb,EAAwBrD,OAAxB,CAAgC,UAAUoD,KAAV,EAAiB;AAC7CtD,YAAAA,MAAM,CAAC8D,IAAP,CAAYV,WAAW,CAACC,QAAD,EAAWC,KAAX,EAAkBE,aAAa,CAACH,QAAD,CAAb,GAA0B1D,GAA1B,GAAgC,EAAlD,CAAvB;AACH,WAFD;AAGH,SAJD,MAKK;AACDJ,UAAAA,MAAM,CAACC,IAAP,CAAY8D,KAAZ,EAAmBpD,OAAnB,CAA2B,UAAU+D,CAAV,EAAa;AACpC,gBAAIV,SAAS,CAACD,KAAK,CAACW,CAAD,CAAN,CAAb,EAAyB;AACrBjE,cAAAA,MAAM,CAAC8D,IAAP,CAAYV,WAAW,CAACC,QAAD,EAAWC,KAAK,CAACW,CAAD,CAAhB,EAAqBA,CAArB,CAAvB;AACH;AACJ,WAJD;AAKH;AACJ,OAbD,MAcK;AACD,cAAMC,GAAG,GAAG,EAAZ;;AACA,YAAIH,KAAK,CAACC,OAAN,CAAcV,KAAd,CAAJ,EAA0B;AACtBA,UAAAA,KAAK,CAACrC,MAAN,CAAasC,SAAb,EAAwBrD,OAAxB,CAAgC,UAAUoD,KAAV,EAAiB;AAC7CY,YAAAA,GAAG,CAACJ,IAAJ,CAASV,WAAW,CAACC,QAAD,EAAWC,KAAX,CAApB;AACH,WAFD;AAGH,SAJD,MAKK;AACD/D,UAAAA,MAAM,CAACC,IAAP,CAAY8D,KAAZ,EAAmBpD,OAAnB,CAA2B,UAAU+D,CAAV,EAAa;AACpC,gBAAIV,SAAS,CAACD,KAAK,CAACW,CAAD,CAAN,CAAb,EAAyB;AACrBC,cAAAA,GAAG,CAACJ,IAAJ,CAASf,gBAAgB,CAACkB,CAAD,CAAzB;AACAC,cAAAA,GAAG,CAACJ,IAAJ,CAASV,WAAW,CAACC,QAAD,EAAWC,KAAK,CAACW,CAAD,CAAL,CAASf,QAAT,EAAX,CAApB;AACH;AACJ,WALD;AAMH;;AACD,YAAIM,aAAa,CAACH,QAAD,CAAjB,EAA6B;AACzBrD,UAAAA,MAAM,CAAC8D,IAAP,CAAYf,gBAAgB,CAACpD,GAAD,CAAhB,GAAwB,GAAxB,GAA8BuE,GAAG,CAACnC,IAAJ,CAAS,GAAT,CAA1C;AACH,SAFD,MAGK,IAAImC,GAAG,CAAClD,MAAJ,KAAe,CAAnB,EAAsB;AACvBhB,UAAAA,MAAM,CAAC8D,IAAP,CAAYI,GAAG,CAACnC,IAAJ,CAAS,GAAT,CAAZ;AACH;AACJ;AACJ;AACJ,GAhDD,MAiDK;AACD,QAAIsB,QAAQ,KAAK,GAAjB,EAAsB;AAClB,UAAIE,SAAS,CAACD,KAAD,CAAb,EAAsB;AAClBtD,QAAAA,MAAM,CAAC8D,IAAP,CAAYf,gBAAgB,CAACpD,GAAD,CAA5B;AACH;AACJ,KAJD,MAKK,IAAI2D,KAAK,KAAK,EAAV,KAAiBD,QAAQ,KAAK,GAAb,IAAoBA,QAAQ,KAAK,GAAlD,CAAJ,EAA4D;AAC7DrD,MAAAA,MAAM,CAAC8D,IAAP,CAAYf,gBAAgB,CAACpD,GAAD,CAAhB,GAAwB,GAApC;AACH,KAFI,MAGA,IAAI2D,KAAK,KAAK,EAAd,EAAkB;AACnBtD,MAAAA,MAAM,CAAC8D,IAAP,CAAY,EAAZ;AACH;AACJ;;AACD,SAAO9D,MAAP;AACH;;AACD,AAAO,SAASmE,QAAT,CAAkBC,QAAlB,EAA4B;AAC/B,SAAO;AACHC,IAAAA,MAAM,EAAEA,MAAM,CAACC,IAAP,CAAY,IAAZ,EAAkBF,QAAlB;AADL,GAAP;AAGH;;AACD,SAASC,MAAT,CAAgBD,QAAhB,EAA0BV,OAA1B,EAAmC;AAC/B,MAAIa,SAAS,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,GAAhB,EAAqB,GAArB,EAA0B,GAA1B,EAA+B,GAA/B,CAAhB;AACA,SAAOH,QAAQ,CAAC9C,OAAT,CAAiB,4BAAjB,EAA+C,UAAUkD,CAAV,EAAaC,UAAb,EAAyBC,OAAzB,EAAkC;AACpF,QAAID,UAAJ,EAAgB;AACZ,UAAIpB,QAAQ,GAAG,EAAf;AACA,YAAMsB,MAAM,GAAG,EAAf;;AACA,UAAIJ,SAAS,CAACK,OAAV,CAAkBH,UAAU,CAACI,MAAX,CAAkB,CAAlB,CAAlB,MAA4C,CAAC,CAAjD,EAAoD;AAChDxB,QAAAA,QAAQ,GAAGoB,UAAU,CAACI,MAAX,CAAkB,CAAlB,CAAX;AACAJ,QAAAA,UAAU,GAAGA,UAAU,CAACK,MAAX,CAAkB,CAAlB,CAAb;AACH;;AACDL,MAAAA,UAAU,CAAC9D,KAAX,CAAiB,IAAjB,EAAuBT,OAAvB,CAA+B,UAAU6E,QAAV,EAAoB;AAC/C,YAAIb,GAAG,GAAG,4BAA4Bc,IAA5B,CAAiCD,QAAjC,CAAV;AACAJ,QAAAA,MAAM,CAACb,IAAP,CAAYL,SAAS,CAACC,OAAD,EAAUL,QAAV,EAAoBa,GAAG,CAAC,CAAD,CAAvB,EAA4BA,GAAG,CAAC,CAAD,CAAH,IAAUA,GAAG,CAAC,CAAD,CAAzC,CAArB;AACH,OAHD;;AAIA,UAAIb,QAAQ,IAAIA,QAAQ,KAAK,GAA7B,EAAkC;AAC9B,YAAI5B,SAAS,GAAG,GAAhB;;AACA,YAAI4B,QAAQ,KAAK,GAAjB,EAAsB;AAClB5B,UAAAA,SAAS,GAAG,GAAZ;AACH,SAFD,MAGK,IAAI4B,QAAQ,KAAK,GAAjB,EAAsB;AACvB5B,UAAAA,SAAS,GAAG4B,QAAZ;AACH;;AACD,eAAO,CAACsB,MAAM,CAAC3D,MAAP,KAAkB,CAAlB,GAAsBqC,QAAtB,GAAiC,EAAlC,IAAwCsB,MAAM,CAAC5C,IAAP,CAAYN,SAAZ,CAA/C;AACH,OATD,MAUK;AACD,eAAOkD,MAAM,CAAC5C,IAAP,CAAY,GAAZ,CAAP;AACH;AACJ,KAxBD,MAyBK;AACD,aAAOY,cAAc,CAAC+B,OAAD,CAArB;AACH;AACJ,GA7BM,CAAP;AA8BH;;AC/JM,SAASO,KAAT,CAAelF,OAAf,EAAwB;AAC3B;AACA,MAAIU,MAAM,GAAGV,OAAO,CAACU,MAAR,CAAe0C,WAAf,EAAb,CAF2B;;AAI3B,MAAIzC,GAAG,GAAG,CAACX,OAAO,CAACW,GAAR,IAAe,GAAhB,EAAqBY,OAArB,CAA6B,cAA7B,EAA6C,MAA7C,CAAV;AACA,MAAIV,OAAO,GAAGrB,MAAM,CAACU,MAAP,CAAc,EAAd,EAAkBF,OAAO,CAACa,OAA1B,CAAd;AACA,MAAIsE,IAAJ;AACA,MAAI1D,UAAU,GAAGgB,IAAI,CAACzC,OAAD,EAAU,CAC3B,QAD2B,EAE3B,SAF2B,EAG3B,KAH2B,EAI3B,SAJ2B,EAK3B,SAL2B,EAM3B,WAN2B,CAAV,CAArB,CAP2B;;AAgB3B,QAAMoF,gBAAgB,GAAGhD,uBAAuB,CAACzB,GAAD,CAAhD;AACAA,EAAAA,GAAG,GAAGyD,QAAQ,CAACzD,GAAD,CAAR,CAAc2D,MAAd,CAAqB7C,UAArB,CAAN;;AACA,MAAI,CAAC,QAAQE,IAAR,CAAahB,GAAb,CAAL,EAAwB;AACpBA,IAAAA,GAAG,GAAGX,OAAO,CAACqF,OAAR,GAAkB1E,GAAxB;AACH;;AACD,QAAM2E,iBAAiB,GAAG9F,MAAM,CAACC,IAAP,CAAYO,OAAZ,EACrBkB,MADqB,CACbyB,MAAD,IAAYyC,gBAAgB,CAAChE,QAAjB,CAA0BuB,MAA1B,CADE,EAErBtB,MAFqB,CAEd,SAFc,CAA1B;AAGA,QAAMkE,mBAAmB,GAAG9C,IAAI,CAAChB,UAAD,EAAa6D,iBAAb,CAAhC;AACA,QAAME,eAAe,GAAG,6BAA6B7D,IAA7B,CAAkCd,OAAO,CAAC4E,MAA1C,CAAxB;;AACA,MAAI,CAACD,eAAL,EAAsB;AAClB,QAAIxF,OAAO,CAACe,SAAR,CAAkB2E,MAAtB,EAA8B;AAC1B;AACA7E,MAAAA,OAAO,CAAC4E,MAAR,GAAiB5E,OAAO,CAAC4E,MAAR,CACZ7E,KADY,CACN,GADM,EAEZU,GAFY,CAEPH,OAAD,IAAaA,OAAO,CAACI,OAAR,CAAgB,kDAAhB,EAAqE,uBAAsBvB,OAAO,CAACe,SAAR,CAAkB2E,MAAO,EAApH,CAFL,EAGZ1D,IAHY,CAGP,GAHO,CAAjB;AAIH;;AACD,QAAIhC,OAAO,CAACe,SAAR,CAAkBC,QAAlB,CAA2BC,MAA/B,EAAuC;AACnC,YAAM0E,wBAAwB,GAAG9E,OAAO,CAAC4E,MAAR,CAAenD,KAAf,CAAqB,qBAArB,KAA+C,EAAhF;AACAzB,MAAAA,OAAO,CAAC4E,MAAR,GAAiBE,wBAAwB,CACpCtE,MADY,CACLrB,OAAO,CAACe,SAAR,CAAkBC,QADb,EAEZM,GAFY,CAEPH,OAAD,IAAa;AAClB,cAAMuE,MAAM,GAAG1F,OAAO,CAACe,SAAR,CAAkB2E,MAAlB,GACR,IAAG1F,OAAO,CAACe,SAAR,CAAkB2E,MAAO,EADpB,GAET,OAFN;AAGA,eAAQ,0BAAyBvE,OAAQ,WAAUuE,MAAO,EAA1D;AACH,OAPgB,EAQZ1D,IARY,CAQP,GARO,CAAjB;AASH;AACJ,GA9C0B;AAgD3B;;;AACA,MAAI,CAAC,KAAD,EAAQ,MAAR,EAAgBZ,QAAhB,CAAyBV,MAAzB,CAAJ,EAAsC;AAClCC,IAAAA,GAAG,GAAGa,kBAAkB,CAACb,GAAD,EAAM4E,mBAAN,CAAxB;AACH,GAFD,MAGK;AACD,QAAI,UAAUA,mBAAd,EAAmC;AAC/BJ,MAAAA,IAAI,GAAGI,mBAAmB,CAACK,IAA3B;AACH,KAFD,MAGK;AACD,UAAIpG,MAAM,CAACC,IAAP,CAAY8F,mBAAZ,EAAiCtE,MAArC,EAA6C;AACzCkE,QAAAA,IAAI,GAAGI,mBAAP;AACH,OAFD,MAGK;AACD1E,QAAAA,OAAO,CAAC,gBAAD,CAAP,GAA4B,CAA5B;AACH;AACJ;AACJ,GAhE0B;;;AAkE3B,MAAI,CAACA,OAAO,CAAC,cAAD,CAAR,IAA4B,OAAOsE,IAAP,KAAgB,WAAhD,EAA6D;AACzDtE,IAAAA,OAAO,CAAC,cAAD,CAAP,GAA0B,iCAA1B;AACH,GApE0B;AAsE3B;;;AACA,MAAI,CAAC,OAAD,EAAU,KAAV,EAAiBO,QAAjB,CAA0BV,MAA1B,KAAqC,OAAOyE,IAAP,KAAgB,WAAzD,EAAsE;AAClEA,IAAAA,IAAI,GAAG,EAAP;AACH,GAzE0B;;;AA2E3B,SAAO3F,MAAM,CAACU,MAAP,CAAc;AAAEQ,IAAAA,MAAF;AAAUC,IAAAA,GAAV;AAAeE,IAAAA;AAAf,GAAd,EAAwC,OAAOsE,IAAP,KAAgB,WAAhB,GAA8B;AAAEA,IAAAA;AAAF,GAA9B,GAAyC,IAAjF,EAAuFnF,OAAO,CAAC6F,OAAR,GAAkB;AAAEA,IAAAA,OAAO,EAAE7F,OAAO,CAAC6F;AAAnB,GAAlB,GAAiD,IAAxI,CAAP;AACH;;AC9EM,SAASC,oBAAT,CAA8B/F,QAA9B,EAAwCU,KAAxC,EAA+CT,OAA/C,EAAwD;AAC3D,SAAOkF,KAAK,CAAC1E,KAAK,CAACT,QAAD,EAAWU,KAAX,EAAkBT,OAAlB,CAAN,CAAZ;AACH;;ACDM,SAAS+F,YAAT,CAAsBC,WAAtB,EAAmCC,WAAnC,EAAgD;AACnD,QAAMC,QAAQ,GAAG1F,KAAK,CAACwF,WAAD,EAAcC,WAAd,CAAtB;AACA,QAAME,QAAQ,GAAGL,oBAAoB,CAACvB,IAArB,CAA0B,IAA1B,EAAgC2B,QAAhC,CAAjB;AACA,SAAO1G,MAAM,CAACU,MAAP,CAAciG,QAAd,EAAwB;AAC3BD,IAAAA,QAD2B;AAE3BnG,IAAAA,QAAQ,EAAEgG,YAAY,CAACxB,IAAb,CAAkB,IAAlB,EAAwB2B,QAAxB,CAFiB;AAG3B1F,IAAAA,KAAK,EAAEA,KAAK,CAAC+D,IAAN,CAAW,IAAX,EAAiB2B,QAAjB,CAHoB;AAI3BhB,IAAAA;AAJ2B,GAAxB,CAAP;AAMH;;ACZM,MAAMkB,OAAO,GAAG,mBAAhB;;ACEP,MAAMC,SAAS,GAAI,uBAAsBD,OAAQ,IAAGE,+BAAY,EAAG,EAAnE;AAEA;;AACA,AAAO,MAAMJ,QAAQ,GAAG;AACpBxF,EAAAA,MAAM,EAAE,KADY;AAEpB2E,EAAAA,OAAO,EAAE,wBAFW;AAGpBxE,EAAAA,OAAO,EAAE;AACL4E,IAAAA,MAAM,EAAE,gCADH;AAEL,kBAAcY;AAFT,GAHW;AAOpBtF,EAAAA,SAAS,EAAE;AACP2E,IAAAA,MAAM,EAAE,EADD;AAEP1E,IAAAA,QAAQ,EAAE;AAFH;AAPS,CAAjB;;MCHMmF,QAAQ,GAAGJ,YAAY,CAAC,IAAD,EAAOG,QAAP,CAA7B;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/util/lowercase-keys.js","../dist-src/util/merge-deep.js","../dist-src/util/remove-undefined-properties.js","../dist-src/merge.js","../dist-src/util/add-query-parameters.js","../dist-src/util/extract-url-variable-names.js","../dist-src/util/omit.js","../dist-src/util/url-template.js","../dist-src/parse.js","../dist-src/endpoint-with-defaults.js","../dist-src/with-defaults.js","../dist-src/version.js","../dist-src/defaults.js","../dist-src/index.js"],"sourcesContent":["export function lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n","import { isPlainObject } from \"is-plain-object\";\nexport function mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach((key) => {\n if (isPlainObject(options[key])) {\n if (!(key in defaults))\n Object.assign(result, { [key]: options[key] });\n else\n result[key] = mergeDeep(defaults[key], options[key]);\n }\n else {\n Object.assign(result, { [key]: options[key] });\n }\n });\n return result;\n}\n","export function removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n}\n","import { lowercaseKeys } from \"./util/lowercase-keys\";\nimport { mergeDeep } from \"./util/merge-deep\";\nimport { removeUndefinedProperties } from \"./util/remove-undefined-properties\";\nexport function merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? { method, url } : { url: method }, options);\n }\n else {\n options = Object.assign({}, route);\n }\n // lowercase header names before merging with defaults to avoid duplicates\n options.headers = lowercaseKeys(options.headers);\n // remove properties with undefined values before merging\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options);\n // mediaType.previews arrays are merged, instead of overwritten\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews\n .filter((preview) => !mergedOptions.mediaType.previews.includes(preview))\n .concat(mergedOptions.mediaType.previews);\n }\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n","export function addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n if (names.length === 0) {\n return url;\n }\n return (url +\n separator +\n names\n .map((name) => {\n if (name === \"q\") {\n return (\"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\"));\n }\n return `${name}=${encodeURIComponent(parameters[name])}`;\n })\n .join(\"&\"));\n}\n","const urlVariableRegex = /\\{[^}]+\\}/g;\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\nexport function extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n if (!matches) {\n return [];\n }\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n","export function omit(object, keysToOmit) {\n return Object.keys(object)\n .filter((option) => !keysToOmit.includes(option))\n .reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n","// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str\n .split(/(%[0-9A-Fa-f]{2})/g)\n .map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n return part;\n })\n .join(\"\");\n}\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\nfunction encodeValue(operator, value, key) {\n value =\n operator === \"+\" || operator === \"#\"\n ? encodeReserved(value)\n : encodeUnreserved(value);\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n }\n else {\n return value;\n }\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\nfunction getValues(context, operator, key, modifier) {\n var value = context[key], result = [];\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") {\n value = value.toString();\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n }\n else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n }\n else {\n const tmp = [];\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n }\n else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n }\n else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n }\n else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n }\n else if (value === \"\") {\n result.push(\"\");\n }\n }\n return result;\n}\nexport function parseUrl(template) {\n return {\n expand: expand.bind(null, template),\n };\n}\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n if (operator && operator !== \"+\") {\n var separator = \",\";\n if (operator === \"?\") {\n separator = \"&\";\n }\n else if (operator !== \"#\") {\n separator = operator;\n }\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n }\n else {\n return values.join(\",\");\n }\n }\n else {\n return encodeReserved(literal);\n }\n });\n}\n","import { addQueryParameters } from \"./util/add-query-parameters\";\nimport { extractUrlVariableNames } from \"./util/extract-url-variable-names\";\nimport { omit } from \"./util/omit\";\nimport { parseUrl } from \"./util/url-template\";\nexport function parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase();\n // replace :varname with {varname} to make it RFC 6570 compatible\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"mediaType\",\n ]);\n // extract variable names from URL to calculate remaining variables later\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n const omittedParameters = Object.keys(options)\n .filter((option) => urlVariableNames.includes(option))\n .concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept\n .split(/,/)\n .map((preview) => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))\n .join(\",\");\n }\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader\n .concat(options.mediaType.previews)\n .map((preview) => {\n const format = options.mediaType.format\n ? `.${options.mediaType.format}`\n : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n })\n .join(\",\");\n }\n }\n // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n }\n else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n }\n else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n else {\n headers[\"content-length\"] = 0;\n }\n }\n }\n // default content-type for JSON if body is set\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n }\n // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n }\n // Only return body/request keys if present\n return Object.assign({ method, url, headers }, typeof body !== \"undefined\" ? { body } : null, options.request ? { request: options.request } : null);\n}\n","import { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n","import { endpointWithDefaults } from \"./endpoint-with-defaults\";\nimport { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse,\n });\n}\n","export const VERSION = \"6.0.12\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nconst userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;\n// DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\nexport const DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent,\n },\n mediaType: {\n format: \"\",\n previews: [],\n },\n};\n","import { withDefaults } from \"./with-defaults\";\nimport { DEFAULTS } from \"./defaults\";\nexport const endpoint = withDefaults(null, DEFAULTS);\n"],"names":["lowercaseKeys","object","Object","keys","reduce","newObj","key","toLowerCase","mergeDeep","defaults","options","result","assign","forEach","isPlainObject","removeUndefinedProperties","obj","undefined","merge","route","method","url","split","headers","mergedOptions","mediaType","previews","length","filter","preview","includes","concat","map","replace","addQueryParameters","parameters","separator","test","names","name","q","encodeURIComponent","join","urlVariableRegex","removeNonChars","variableName","extractUrlVariableNames","matches","match","a","b","omit","keysToOmit","option","encodeReserved","str","part","encodeURI","encodeUnreserved","c","charCodeAt","toString","toUpperCase","encodeValue","operator","value","isDefined","isKeyOperator","getValues","context","modifier","substring","parseInt","push","Array","isArray","k","tmp","parseUrl","template","expand","bind","operators","_","expression","literal","values","indexOf","charAt","substr","variable","exec","parse","body","urlVariableNames","baseUrl","omittedParameters","remainingParameters","isBinaryRequest","accept","format","previewsFromAcceptHeader","data","request","endpointWithDefaults","withDefaults","oldDefaults","newDefaults","DEFAULTS","endpoint","VERSION","userAgent","getUserAgent"],"mappings":";;;;;;;AAAO,SAASA,aAAT,CAAuBC,MAAvB,EAA+B;AAClC,MAAI,CAACA,MAAL,EAAa;AACT,WAAO,EAAP;AACH;;AACD,SAAOC,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBG,MAApB,CAA2B,CAACC,MAAD,EAASC,GAAT,KAAiB;AAC/CD,IAAAA,MAAM,CAACC,GAAG,CAACC,WAAJ,EAAD,CAAN,GAA4BN,MAAM,CAACK,GAAD,CAAlC;AACA,WAAOD,MAAP;AACH,GAHM,EAGJ,EAHI,CAAP;AAIH;;ACPM,SAASG,SAAT,CAAmBC,QAAnB,EAA6BC,OAA7B,EAAsC;AACzC,QAAMC,MAAM,GAAGT,MAAM,CAACU,MAAP,CAAc,EAAd,EAAkBH,QAAlB,CAAf;AACAP,EAAAA,MAAM,CAACC,IAAP,CAAYO,OAAZ,EAAqBG,OAArB,CAA8BP,GAAD,IAAS;AAClC,QAAIQ,2BAAa,CAACJ,OAAO,CAACJ,GAAD,CAAR,CAAjB,EAAiC;AAC7B,UAAI,EAAEA,GAAG,IAAIG,QAAT,CAAJ,EACIP,MAAM,CAACU,MAAP,CAAcD,MAAd,EAAsB;AAAE,SAACL,GAAD,GAAOI,OAAO,CAACJ,GAAD;AAAhB,OAAtB,EADJ,KAGIK,MAAM,CAACL,GAAD,CAAN,GAAcE,SAAS,CAACC,QAAQ,CAACH,GAAD,CAAT,EAAgBI,OAAO,CAACJ,GAAD,CAAvB,CAAvB;AACP,KALD,MAMK;AACDJ,MAAAA,MAAM,CAACU,MAAP,CAAcD,MAAd,EAAsB;AAAE,SAACL,GAAD,GAAOI,OAAO,CAACJ,GAAD;AAAhB,OAAtB;AACH;AACJ,GAVD;AAWA,SAAOK,MAAP;AACH;;ACfM,SAASI,yBAAT,CAAmCC,GAAnC,EAAwC;AAC3C,OAAK,MAAMV,GAAX,IAAkBU,GAAlB,EAAuB;AACnB,QAAIA,GAAG,CAACV,GAAD,CAAH,KAAaW,SAAjB,EAA4B;AACxB,aAAOD,GAAG,CAACV,GAAD,CAAV;AACH;AACJ;;AACD,SAAOU,GAAP;AACH;;ACJM,SAASE,KAAT,CAAeT,QAAf,EAAyBU,KAAzB,EAAgCT,OAAhC,EAAyC;AAC5C,MAAI,OAAOS,KAAP,KAAiB,QAArB,EAA+B;AAC3B,QAAI,CAACC,MAAD,EAASC,GAAT,IAAgBF,KAAK,CAACG,KAAN,CAAY,GAAZ,CAApB;AACAZ,IAAAA,OAAO,GAAGR,MAAM,CAACU,MAAP,CAAcS,GAAG,GAAG;AAAED,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAH,GAAqB;AAAEA,MAAAA,GAAG,EAAED;AAAP,KAAtC,EAAuDV,OAAvD,CAAV;AACH,GAHD,MAIK;AACDA,IAAAA,OAAO,GAAGR,MAAM,CAACU,MAAP,CAAc,EAAd,EAAkBO,KAAlB,CAAV;AACH,GAP2C;;;AAS5CT,EAAAA,OAAO,CAACa,OAAR,GAAkBvB,aAAa,CAACU,OAAO,CAACa,OAAT,CAA/B,CAT4C;;AAW5CR,EAAAA,yBAAyB,CAACL,OAAD,CAAzB;AACAK,EAAAA,yBAAyB,CAACL,OAAO,CAACa,OAAT,CAAzB;AACA,QAAMC,aAAa,GAAGhB,SAAS,CAACC,QAAQ,IAAI,EAAb,EAAiBC,OAAjB,CAA/B,CAb4C;;AAe5C,MAAID,QAAQ,IAAIA,QAAQ,CAACgB,SAAT,CAAmBC,QAAnB,CAA4BC,MAA5C,EAAoD;AAChDH,IAAAA,aAAa,CAACC,SAAd,CAAwBC,QAAxB,GAAmCjB,QAAQ,CAACgB,SAAT,CAAmBC,QAAnB,CAC9BE,MAD8B,CACtBC,OAAD,IAAa,CAACL,aAAa,CAACC,SAAd,CAAwBC,QAAxB,CAAiCI,QAAjC,CAA0CD,OAA1C,CADS,EAE9BE,MAF8B,CAEvBP,aAAa,CAACC,SAAd,CAAwBC,QAFD,CAAnC;AAGH;;AACDF,EAAAA,aAAa,CAACC,SAAd,CAAwBC,QAAxB,GAAmCF,aAAa,CAACC,SAAd,CAAwBC,QAAxB,CAAiCM,GAAjC,CAAsCH,OAAD,IAAaA,OAAO,CAACI,OAAR,CAAgB,UAAhB,EAA4B,EAA5B,CAAlD,CAAnC;AACA,SAAOT,aAAP;AACH;;ACzBM,SAASU,kBAAT,CAA4Bb,GAA5B,EAAiCc,UAAjC,EAA6C;AAChD,QAAMC,SAAS,GAAG,KAAKC,IAAL,CAAUhB,GAAV,IAAiB,GAAjB,GAAuB,GAAzC;AACA,QAAMiB,KAAK,GAAGpC,MAAM,CAACC,IAAP,CAAYgC,UAAZ,CAAd;;AACA,MAAIG,KAAK,CAACX,MAAN,KAAiB,CAArB,EAAwB;AACpB,WAAON,GAAP;AACH;;AACD,SAAQA,GAAG,GACPe,SADI,GAEJE,KAAK,CACAN,GADL,CACUO,IAAD,IAAU;AACf,QAAIA,IAAI,KAAK,GAAb,EAAkB;AACd,aAAQ,OAAOJ,UAAU,CAACK,CAAX,CAAalB,KAAb,CAAmB,GAAnB,EAAwBU,GAAxB,CAA4BS,kBAA5B,EAAgDC,IAAhD,CAAqD,GAArD,CAAf;AACH;;AACD,WAAQ,GAAEH,IAAK,IAAGE,kBAAkB,CAACN,UAAU,CAACI,IAAD,CAAX,CAAmB,EAAvD;AACH,GAND,EAOKG,IAPL,CAOU,GAPV,CAFJ;AAUH;;AChBD,MAAMC,gBAAgB,GAAG,YAAzB;;AACA,SAASC,cAAT,CAAwBC,YAAxB,EAAsC;AAClC,SAAOA,YAAY,CAACZ,OAAb,CAAqB,YAArB,EAAmC,EAAnC,EAAuCX,KAAvC,CAA6C,GAA7C,CAAP;AACH;;AACD,AAAO,SAASwB,uBAAT,CAAiCzB,GAAjC,EAAsC;AACzC,QAAM0B,OAAO,GAAG1B,GAAG,CAAC2B,KAAJ,CAAUL,gBAAV,CAAhB;;AACA,MAAI,CAACI,OAAL,EAAc;AACV,WAAO,EAAP;AACH;;AACD,SAAOA,OAAO,CAACf,GAAR,CAAYY,cAAZ,EAA4BxC,MAA5B,CAAmC,CAAC6C,CAAD,EAAIC,CAAJ,KAAUD,CAAC,CAAClB,MAAF,CAASmB,CAAT,CAA7C,EAA0D,EAA1D,CAAP;AACH;;ACVM,SAASC,IAAT,CAAclD,MAAd,EAAsBmD,UAAtB,EAAkC;AACrC,SAAOlD,MAAM,CAACC,IAAP,CAAYF,MAAZ,EACF2B,MADE,CACMyB,MAAD,IAAY,CAACD,UAAU,CAACtB,QAAX,CAAoBuB,MAApB,CADlB,EAEFjD,MAFE,CAEK,CAACY,GAAD,EAAMV,GAAN,KAAc;AACtBU,IAAAA,GAAG,CAACV,GAAD,CAAH,GAAWL,MAAM,CAACK,GAAD,CAAjB;AACA,WAAOU,GAAP;AACH,GALM,EAKJ,EALI,CAAP;AAMH;;ACPD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA,SAASsC,cAAT,CAAwBC,GAAxB,EAA6B;AACzB,SAAOA,GAAG,CACLjC,KADE,CACI,oBADJ,EAEFU,GAFE,CAEE,UAAUwB,IAAV,EAAgB;AACrB,QAAI,CAAC,eAAenB,IAAf,CAAoBmB,IAApB,CAAL,EAAgC;AAC5BA,MAAAA,IAAI,GAAGC,SAAS,CAACD,IAAD,CAAT,CAAgBvB,OAAhB,CAAwB,MAAxB,EAAgC,GAAhC,EAAqCA,OAArC,CAA6C,MAA7C,EAAqD,GAArD,CAAP;AACH;;AACD,WAAOuB,IAAP;AACH,GAPM,EAQFd,IARE,CAQG,EARH,CAAP;AASH;;AACD,SAASgB,gBAAT,CAA0BH,GAA1B,EAA+B;AAC3B,SAAOd,kBAAkB,CAACc,GAAD,CAAlB,CAAwBtB,OAAxB,CAAgC,UAAhC,EAA4C,UAAU0B,CAAV,EAAa;AAC5D,WAAO,MAAMA,CAAC,CAACC,UAAF,CAAa,CAAb,EAAgBC,QAAhB,CAAyB,EAAzB,EAA6BC,WAA7B,EAAb;AACH,GAFM,CAAP;AAGH;;AACD,SAASC,WAAT,CAAqBC,QAArB,EAA+BC,KAA/B,EAAsC3D,GAAtC,EAA2C;AACvC2D,EAAAA,KAAK,GACDD,QAAQ,KAAK,GAAb,IAAoBA,QAAQ,KAAK,GAAjC,GACMV,cAAc,CAACW,KAAD,CADpB,GAEMP,gBAAgB,CAACO,KAAD,CAH1B;;AAIA,MAAI3D,GAAJ,EAAS;AACL,WAAOoD,gBAAgB,CAACpD,GAAD,CAAhB,GAAwB,GAAxB,GAA8B2D,KAArC;AACH,GAFD,MAGK;AACD,WAAOA,KAAP;AACH;AACJ;;AACD,SAASC,SAAT,CAAmBD,KAAnB,EAA0B;AACtB,SAAOA,KAAK,KAAKhD,SAAV,IAAuBgD,KAAK,KAAK,IAAxC;AACH;;AACD,SAASE,aAAT,CAAuBH,QAAvB,EAAiC;AAC7B,SAAOA,QAAQ,KAAK,GAAb,IAAoBA,QAAQ,KAAK,GAAjC,IAAwCA,QAAQ,KAAK,GAA5D;AACH;;AACD,SAASI,SAAT,CAAmBC,OAAnB,EAA4BL,QAA5B,EAAsC1D,GAAtC,EAA2CgE,QAA3C,EAAqD;AACjD,MAAIL,KAAK,GAAGI,OAAO,CAAC/D,GAAD,CAAnB;AAAA,MAA0BK,MAAM,GAAG,EAAnC;;AACA,MAAIuD,SAAS,CAACD,KAAD,CAAT,IAAoBA,KAAK,KAAK,EAAlC,EAAsC;AAClC,QAAI,OAAOA,KAAP,KAAiB,QAAjB,IACA,OAAOA,KAAP,KAAiB,QADjB,IAEA,OAAOA,KAAP,KAAiB,SAFrB,EAEgC;AAC5BA,MAAAA,KAAK,GAAGA,KAAK,CAACJ,QAAN,EAAR;;AACA,UAAIS,QAAQ,IAAIA,QAAQ,KAAK,GAA7B,EAAkC;AAC9BL,QAAAA,KAAK,GAAGA,KAAK,CAACM,SAAN,CAAgB,CAAhB,EAAmBC,QAAQ,CAACF,QAAD,EAAW,EAAX,CAA3B,CAAR;AACH;;AACD3D,MAAAA,MAAM,CAAC8D,IAAP,CAAYV,WAAW,CAACC,QAAD,EAAWC,KAAX,EAAkBE,aAAa,CAACH,QAAD,CAAb,GAA0B1D,GAA1B,GAAgC,EAAlD,CAAvB;AACH,KARD,MASK;AACD,UAAIgE,QAAQ,KAAK,GAAjB,EAAsB;AAClB,YAAII,KAAK,CAACC,OAAN,CAAcV,KAAd,CAAJ,EAA0B;AACtBA,UAAAA,KAAK,CAACrC,MAAN,CAAasC,SAAb,EAAwBrD,OAAxB,CAAgC,UAAUoD,KAAV,EAAiB;AAC7CtD,YAAAA,MAAM,CAAC8D,IAAP,CAAYV,WAAW,CAACC,QAAD,EAAWC,KAAX,EAAkBE,aAAa,CAACH,QAAD,CAAb,GAA0B1D,GAA1B,GAAgC,EAAlD,CAAvB;AACH,WAFD;AAGH,SAJD,MAKK;AACDJ,UAAAA,MAAM,CAACC,IAAP,CAAY8D,KAAZ,EAAmBpD,OAAnB,CAA2B,UAAU+D,CAAV,EAAa;AACpC,gBAAIV,SAAS,CAACD,KAAK,CAACW,CAAD,CAAN,CAAb,EAAyB;AACrBjE,cAAAA,MAAM,CAAC8D,IAAP,CAAYV,WAAW,CAACC,QAAD,EAAWC,KAAK,CAACW,CAAD,CAAhB,EAAqBA,CAArB,CAAvB;AACH;AACJ,WAJD;AAKH;AACJ,OAbD,MAcK;AACD,cAAMC,GAAG,GAAG,EAAZ;;AACA,YAAIH,KAAK,CAACC,OAAN,CAAcV,KAAd,CAAJ,EAA0B;AACtBA,UAAAA,KAAK,CAACrC,MAAN,CAAasC,SAAb,EAAwBrD,OAAxB,CAAgC,UAAUoD,KAAV,EAAiB;AAC7CY,YAAAA,GAAG,CAACJ,IAAJ,CAASV,WAAW,CAACC,QAAD,EAAWC,KAAX,CAApB;AACH,WAFD;AAGH,SAJD,MAKK;AACD/D,UAAAA,MAAM,CAACC,IAAP,CAAY8D,KAAZ,EAAmBpD,OAAnB,CAA2B,UAAU+D,CAAV,EAAa;AACpC,gBAAIV,SAAS,CAACD,KAAK,CAACW,CAAD,CAAN,CAAb,EAAyB;AACrBC,cAAAA,GAAG,CAACJ,IAAJ,CAASf,gBAAgB,CAACkB,CAAD,CAAzB;AACAC,cAAAA,GAAG,CAACJ,IAAJ,CAASV,WAAW,CAACC,QAAD,EAAWC,KAAK,CAACW,CAAD,CAAL,CAASf,QAAT,EAAX,CAApB;AACH;AACJ,WALD;AAMH;;AACD,YAAIM,aAAa,CAACH,QAAD,CAAjB,EAA6B;AACzBrD,UAAAA,MAAM,CAAC8D,IAAP,CAAYf,gBAAgB,CAACpD,GAAD,CAAhB,GAAwB,GAAxB,GAA8BuE,GAAG,CAACnC,IAAJ,CAAS,GAAT,CAA1C;AACH,SAFD,MAGK,IAAImC,GAAG,CAAClD,MAAJ,KAAe,CAAnB,EAAsB;AACvBhB,UAAAA,MAAM,CAAC8D,IAAP,CAAYI,GAAG,CAACnC,IAAJ,CAAS,GAAT,CAAZ;AACH;AACJ;AACJ;AACJ,GAhDD,MAiDK;AACD,QAAIsB,QAAQ,KAAK,GAAjB,EAAsB;AAClB,UAAIE,SAAS,CAACD,KAAD,CAAb,EAAsB;AAClBtD,QAAAA,MAAM,CAAC8D,IAAP,CAAYf,gBAAgB,CAACpD,GAAD,CAA5B;AACH;AACJ,KAJD,MAKK,IAAI2D,KAAK,KAAK,EAAV,KAAiBD,QAAQ,KAAK,GAAb,IAAoBA,QAAQ,KAAK,GAAlD,CAAJ,EAA4D;AAC7DrD,MAAAA,MAAM,CAAC8D,IAAP,CAAYf,gBAAgB,CAACpD,GAAD,CAAhB,GAAwB,GAApC;AACH,KAFI,MAGA,IAAI2D,KAAK,KAAK,EAAd,EAAkB;AACnBtD,MAAAA,MAAM,CAAC8D,IAAP,CAAY,EAAZ;AACH;AACJ;;AACD,SAAO9D,MAAP;AACH;;AACD,AAAO,SAASmE,QAAT,CAAkBC,QAAlB,EAA4B;AAC/B,SAAO;AACHC,IAAAA,MAAM,EAAEA,MAAM,CAACC,IAAP,CAAY,IAAZ,EAAkBF,QAAlB;AADL,GAAP;AAGH;;AACD,SAASC,MAAT,CAAgBD,QAAhB,EAA0BV,OAA1B,EAAmC;AAC/B,MAAIa,SAAS,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,GAAhB,EAAqB,GAArB,EAA0B,GAA1B,EAA+B,GAA/B,CAAhB;AACA,SAAOH,QAAQ,CAAC9C,OAAT,CAAiB,4BAAjB,EAA+C,UAAUkD,CAAV,EAAaC,UAAb,EAAyBC,OAAzB,EAAkC;AACpF,QAAID,UAAJ,EAAgB;AACZ,UAAIpB,QAAQ,GAAG,EAAf;AACA,YAAMsB,MAAM,GAAG,EAAf;;AACA,UAAIJ,SAAS,CAACK,OAAV,CAAkBH,UAAU,CAACI,MAAX,CAAkB,CAAlB,CAAlB,MAA4C,CAAC,CAAjD,EAAoD;AAChDxB,QAAAA,QAAQ,GAAGoB,UAAU,CAACI,MAAX,CAAkB,CAAlB,CAAX;AACAJ,QAAAA,UAAU,GAAGA,UAAU,CAACK,MAAX,CAAkB,CAAlB,CAAb;AACH;;AACDL,MAAAA,UAAU,CAAC9D,KAAX,CAAiB,IAAjB,EAAuBT,OAAvB,CAA+B,UAAU6E,QAAV,EAAoB;AAC/C,YAAIb,GAAG,GAAG,4BAA4Bc,IAA5B,CAAiCD,QAAjC,CAAV;AACAJ,QAAAA,MAAM,CAACb,IAAP,CAAYL,SAAS,CAACC,OAAD,EAAUL,QAAV,EAAoBa,GAAG,CAAC,CAAD,CAAvB,EAA4BA,GAAG,CAAC,CAAD,CAAH,IAAUA,GAAG,CAAC,CAAD,CAAzC,CAArB;AACH,OAHD;;AAIA,UAAIb,QAAQ,IAAIA,QAAQ,KAAK,GAA7B,EAAkC;AAC9B,YAAI5B,SAAS,GAAG,GAAhB;;AACA,YAAI4B,QAAQ,KAAK,GAAjB,EAAsB;AAClB5B,UAAAA,SAAS,GAAG,GAAZ;AACH,SAFD,MAGK,IAAI4B,QAAQ,KAAK,GAAjB,EAAsB;AACvB5B,UAAAA,SAAS,GAAG4B,QAAZ;AACH;;AACD,eAAO,CAACsB,MAAM,CAAC3D,MAAP,KAAkB,CAAlB,GAAsBqC,QAAtB,GAAiC,EAAlC,IAAwCsB,MAAM,CAAC5C,IAAP,CAAYN,SAAZ,CAA/C;AACH,OATD,MAUK;AACD,eAAOkD,MAAM,CAAC5C,IAAP,CAAY,GAAZ,CAAP;AACH;AACJ,KAxBD,MAyBK;AACD,aAAOY,cAAc,CAAC+B,OAAD,CAArB;AACH;AACJ,GA7BM,CAAP;AA8BH;;AC/JM,SAASO,KAAT,CAAelF,OAAf,EAAwB;AAC3B;AACA,MAAIU,MAAM,GAAGV,OAAO,CAACU,MAAR,CAAe0C,WAAf,EAAb,CAF2B;;AAI3B,MAAIzC,GAAG,GAAG,CAACX,OAAO,CAACW,GAAR,IAAe,GAAhB,EAAqBY,OAArB,CAA6B,cAA7B,EAA6C,MAA7C,CAAV;AACA,MAAIV,OAAO,GAAGrB,MAAM,CAACU,MAAP,CAAc,EAAd,EAAkBF,OAAO,CAACa,OAA1B,CAAd;AACA,MAAIsE,IAAJ;AACA,MAAI1D,UAAU,GAAGgB,IAAI,CAACzC,OAAD,EAAU,CAC3B,QAD2B,EAE3B,SAF2B,EAG3B,KAH2B,EAI3B,SAJ2B,EAK3B,SAL2B,EAM3B,WAN2B,CAAV,CAArB,CAP2B;;AAgB3B,QAAMoF,gBAAgB,GAAGhD,uBAAuB,CAACzB,GAAD,CAAhD;AACAA,EAAAA,GAAG,GAAGyD,QAAQ,CAACzD,GAAD,CAAR,CAAc2D,MAAd,CAAqB7C,UAArB,CAAN;;AACA,MAAI,CAAC,QAAQE,IAAR,CAAahB,GAAb,CAAL,EAAwB;AACpBA,IAAAA,GAAG,GAAGX,OAAO,CAACqF,OAAR,GAAkB1E,GAAxB;AACH;;AACD,QAAM2E,iBAAiB,GAAG9F,MAAM,CAACC,IAAP,CAAYO,OAAZ,EACrBkB,MADqB,CACbyB,MAAD,IAAYyC,gBAAgB,CAAChE,QAAjB,CAA0BuB,MAA1B,CADE,EAErBtB,MAFqB,CAEd,SAFc,CAA1B;AAGA,QAAMkE,mBAAmB,GAAG9C,IAAI,CAAChB,UAAD,EAAa6D,iBAAb,CAAhC;AACA,QAAME,eAAe,GAAG,6BAA6B7D,IAA7B,CAAkCd,OAAO,CAAC4E,MAA1C,CAAxB;;AACA,MAAI,CAACD,eAAL,EAAsB;AAClB,QAAIxF,OAAO,CAACe,SAAR,CAAkB2E,MAAtB,EAA8B;AAC1B;AACA7E,MAAAA,OAAO,CAAC4E,MAAR,GAAiB5E,OAAO,CAAC4E,MAAR,CACZ7E,KADY,CACN,GADM,EAEZU,GAFY,CAEPH,OAAD,IAAaA,OAAO,CAACI,OAAR,CAAgB,kDAAhB,EAAqE,uBAAsBvB,OAAO,CAACe,SAAR,CAAkB2E,MAAO,EAApH,CAFL,EAGZ1D,IAHY,CAGP,GAHO,CAAjB;AAIH;;AACD,QAAIhC,OAAO,CAACe,SAAR,CAAkBC,QAAlB,CAA2BC,MAA/B,EAAuC;AACnC,YAAM0E,wBAAwB,GAAG9E,OAAO,CAAC4E,MAAR,CAAenD,KAAf,CAAqB,qBAArB,KAA+C,EAAhF;AACAzB,MAAAA,OAAO,CAAC4E,MAAR,GAAiBE,wBAAwB,CACpCtE,MADY,CACLrB,OAAO,CAACe,SAAR,CAAkBC,QADb,EAEZM,GAFY,CAEPH,OAAD,IAAa;AAClB,cAAMuE,MAAM,GAAG1F,OAAO,CAACe,SAAR,CAAkB2E,MAAlB,GACR,IAAG1F,OAAO,CAACe,SAAR,CAAkB2E,MAAO,EADpB,GAET,OAFN;AAGA,eAAQ,0BAAyBvE,OAAQ,WAAUuE,MAAO,EAA1D;AACH,OAPgB,EAQZ1D,IARY,CAQP,GARO,CAAjB;AASH;AACJ,GA9C0B;AAgD3B;;;AACA,MAAI,CAAC,KAAD,EAAQ,MAAR,EAAgBZ,QAAhB,CAAyBV,MAAzB,CAAJ,EAAsC;AAClCC,IAAAA,GAAG,GAAGa,kBAAkB,CAACb,GAAD,EAAM4E,mBAAN,CAAxB;AACH,GAFD,MAGK;AACD,QAAI,UAAUA,mBAAd,EAAmC;AAC/BJ,MAAAA,IAAI,GAAGI,mBAAmB,CAACK,IAA3B;AACH,KAFD,MAGK;AACD,UAAIpG,MAAM,CAACC,IAAP,CAAY8F,mBAAZ,EAAiCtE,MAArC,EAA6C;AACzCkE,QAAAA,IAAI,GAAGI,mBAAP;AACH,OAFD,MAGK;AACD1E,QAAAA,OAAO,CAAC,gBAAD,CAAP,GAA4B,CAA5B;AACH;AACJ;AACJ,GAhE0B;;;AAkE3B,MAAI,CAACA,OAAO,CAAC,cAAD,CAAR,IAA4B,OAAOsE,IAAP,KAAgB,WAAhD,EAA6D;AACzDtE,IAAAA,OAAO,CAAC,cAAD,CAAP,GAA0B,iCAA1B;AACH,GApE0B;AAsE3B;;;AACA,MAAI,CAAC,OAAD,EAAU,KAAV,EAAiBO,QAAjB,CAA0BV,MAA1B,KAAqC,OAAOyE,IAAP,KAAgB,WAAzD,EAAsE;AAClEA,IAAAA,IAAI,GAAG,EAAP;AACH,GAzE0B;;;AA2E3B,SAAO3F,MAAM,CAACU,MAAP,CAAc;AAAEQ,IAAAA,MAAF;AAAUC,IAAAA,GAAV;AAAeE,IAAAA;AAAf,GAAd,EAAwC,OAAOsE,IAAP,KAAgB,WAAhB,GAA8B;AAAEA,IAAAA;AAAF,GAA9B,GAAyC,IAAjF,EAAuFnF,OAAO,CAAC6F,OAAR,GAAkB;AAAEA,IAAAA,OAAO,EAAE7F,OAAO,CAAC6F;AAAnB,GAAlB,GAAiD,IAAxI,CAAP;AACH;;AC9EM,SAASC,oBAAT,CAA8B/F,QAA9B,EAAwCU,KAAxC,EAA+CT,OAA/C,EAAwD;AAC3D,SAAOkF,KAAK,CAAC1E,KAAK,CAACT,QAAD,EAAWU,KAAX,EAAkBT,OAAlB,CAAN,CAAZ;AACH;;ACDM,SAAS+F,YAAT,CAAsBC,WAAtB,EAAmCC,WAAnC,EAAgD;AACnD,QAAMC,QAAQ,GAAG1F,KAAK,CAACwF,WAAD,EAAcC,WAAd,CAAtB;AACA,QAAME,QAAQ,GAAGL,oBAAoB,CAACvB,IAArB,CAA0B,IAA1B,EAAgC2B,QAAhC,CAAjB;AACA,SAAO1G,MAAM,CAACU,MAAP,CAAciG,QAAd,EAAwB;AAC3BD,IAAAA,QAD2B;AAE3BnG,IAAAA,QAAQ,EAAEgG,YAAY,CAACxB,IAAb,CAAkB,IAAlB,EAAwB2B,QAAxB,CAFiB;AAG3B1F,IAAAA,KAAK,EAAEA,KAAK,CAAC+D,IAAN,CAAW,IAAX,EAAiB2B,QAAjB,CAHoB;AAI3BhB,IAAAA;AAJ2B,GAAxB,CAAP;AAMH;;ACZM,MAAMkB,OAAO,GAAG,mBAAhB;;ACEP,MAAMC,SAAS,GAAI,uBAAsBD,OAAQ,IAAGE,+BAAY,EAAG,EAAnE;AAEA;;AACA,AAAO,MAAMJ,QAAQ,GAAG;AACpBxF,EAAAA,MAAM,EAAE,KADY;AAEpB2E,EAAAA,OAAO,EAAE,wBAFW;AAGpBxE,EAAAA,OAAO,EAAE;AACL4E,IAAAA,MAAM,EAAE,gCADH;AAEL,kBAAcY;AAFT,GAHW;AAOpBtF,EAAAA,SAAS,EAAE;AACP2E,IAAAA,MAAM,EAAE,EADD;AAEP1E,IAAAA,QAAQ,EAAE;AAFH;AAPS,CAAjB;;MCHMmF,QAAQ,GAAGJ,YAAY,CAAC,IAAD,EAAOG,QAAP,CAA7B;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/endpoint/dist-src/version.js b/node_modules/@octokit/endpoint/dist-src/version.js index 2fd6ff6..930e255 100644 --- a/node_modules/@octokit/endpoint/dist-src/version.js +++ b/node_modules/@octokit/endpoint/dist-src/version.js @@ -1 +1 @@ -export const VERSION = "6.0.8"; +export const VERSION = "6.0.12"; diff --git a/node_modules/@octokit/endpoint/dist-types/version.d.ts b/node_modules/@octokit/endpoint/dist-types/version.d.ts index af5cdc8..330d47a 100644 --- a/node_modules/@octokit/endpoint/dist-types/version.d.ts +++ b/node_modules/@octokit/endpoint/dist-types/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "6.0.8"; +export declare const VERSION = "6.0.12"; diff --git a/node_modules/@octokit/endpoint/dist-web/index.js b/node_modules/@octokit/endpoint/dist-web/index.js index 952606a..e152163 100644 --- a/node_modules/@octokit/endpoint/dist-web/index.js +++ b/node_modules/@octokit/endpoint/dist-web/index.js @@ -357,7 +357,7 @@ function withDefaults(oldDefaults, newDefaults) { }); } -const VERSION = "6.0.8"; +const VERSION = "6.0.12"; const userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. diff --git a/node_modules/@octokit/endpoint/dist-web/index.js.map b/node_modules/@octokit/endpoint/dist-web/index.js.map index c04196f..1d60d02 100644 --- a/node_modules/@octokit/endpoint/dist-web/index.js.map +++ b/node_modules/@octokit/endpoint/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/util/lowercase-keys.js","../dist-src/util/merge-deep.js","../dist-src/util/remove-undefined-properties.js","../dist-src/merge.js","../dist-src/util/add-query-parameters.js","../dist-src/util/extract-url-variable-names.js","../dist-src/util/omit.js","../dist-src/util/url-template.js","../dist-src/parse.js","../dist-src/endpoint-with-defaults.js","../dist-src/with-defaults.js","../dist-src/version.js","../dist-src/defaults.js","../dist-src/index.js"],"sourcesContent":["export function lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n","import { isPlainObject } from \"is-plain-object\";\nexport function mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach((key) => {\n if (isPlainObject(options[key])) {\n if (!(key in defaults))\n Object.assign(result, { [key]: options[key] });\n else\n result[key] = mergeDeep(defaults[key], options[key]);\n }\n else {\n Object.assign(result, { [key]: options[key] });\n }\n });\n return result;\n}\n","export function removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n}\n","import { lowercaseKeys } from \"./util/lowercase-keys\";\nimport { mergeDeep } from \"./util/merge-deep\";\nimport { removeUndefinedProperties } from \"./util/remove-undefined-properties\";\nexport function merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? { method, url } : { url: method }, options);\n }\n else {\n options = Object.assign({}, route);\n }\n // lowercase header names before merging with defaults to avoid duplicates\n options.headers = lowercaseKeys(options.headers);\n // remove properties with undefined values before merging\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options);\n // mediaType.previews arrays are merged, instead of overwritten\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews\n .filter((preview) => !mergedOptions.mediaType.previews.includes(preview))\n .concat(mergedOptions.mediaType.previews);\n }\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n","export function addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n if (names.length === 0) {\n return url;\n }\n return (url +\n separator +\n names\n .map((name) => {\n if (name === \"q\") {\n return (\"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\"));\n }\n return `${name}=${encodeURIComponent(parameters[name])}`;\n })\n .join(\"&\"));\n}\n","const urlVariableRegex = /\\{[^}]+\\}/g;\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\nexport function extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n if (!matches) {\n return [];\n }\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n","export function omit(object, keysToOmit) {\n return Object.keys(object)\n .filter((option) => !keysToOmit.includes(option))\n .reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n","// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str\n .split(/(%[0-9A-Fa-f]{2})/g)\n .map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n return part;\n })\n .join(\"\");\n}\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\nfunction encodeValue(operator, value, key) {\n value =\n operator === \"+\" || operator === \"#\"\n ? encodeReserved(value)\n : encodeUnreserved(value);\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n }\n else {\n return value;\n }\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\nfunction getValues(context, operator, key, modifier) {\n var value = context[key], result = [];\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") {\n value = value.toString();\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n }\n else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n }\n else {\n const tmp = [];\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n }\n else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n }\n else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n }\n else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n }\n else if (value === \"\") {\n result.push(\"\");\n }\n }\n return result;\n}\nexport function parseUrl(template) {\n return {\n expand: expand.bind(null, template),\n };\n}\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n if (operator && operator !== \"+\") {\n var separator = \",\";\n if (operator === \"?\") {\n separator = \"&\";\n }\n else if (operator !== \"#\") {\n separator = operator;\n }\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n }\n else {\n return values.join(\",\");\n }\n }\n else {\n return encodeReserved(literal);\n }\n });\n}\n","import { addQueryParameters } from \"./util/add-query-parameters\";\nimport { extractUrlVariableNames } from \"./util/extract-url-variable-names\";\nimport { omit } from \"./util/omit\";\nimport { parseUrl } from \"./util/url-template\";\nexport function parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase();\n // replace :varname with {varname} to make it RFC 6570 compatible\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"mediaType\",\n ]);\n // extract variable names from URL to calculate remaining variables later\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n const omittedParameters = Object.keys(options)\n .filter((option) => urlVariableNames.includes(option))\n .concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept\n .split(/,/)\n .map((preview) => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))\n .join(\",\");\n }\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader\n .concat(options.mediaType.previews)\n .map((preview) => {\n const format = options.mediaType.format\n ? `.${options.mediaType.format}`\n : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n })\n .join(\",\");\n }\n }\n // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n }\n else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n }\n else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n else {\n headers[\"content-length\"] = 0;\n }\n }\n }\n // default content-type for JSON if body is set\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n }\n // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n }\n // Only return body/request keys if present\n return Object.assign({ method, url, headers }, typeof body !== \"undefined\" ? { body } : null, options.request ? { request: options.request } : null);\n}\n","import { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n","import { endpointWithDefaults } from \"./endpoint-with-defaults\";\nimport { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse,\n });\n}\n","export const VERSION = \"6.0.8\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nconst userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;\n// DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\nexport const DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent,\n },\n mediaType: {\n format: \"\",\n previews: [],\n },\n};\n","import { withDefaults } from \"./with-defaults\";\nimport { DEFAULTS } from \"./defaults\";\nexport const endpoint = withDefaults(null, DEFAULTS);\n"],"names":[],"mappings":";;;AAAO,SAAS,aAAa,CAAC,MAAM,EAAE;AACtC,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;AACvD,QAAQ,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAChD,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX;;ACPO,SAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC/C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1C,QAAQ,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE;AACzC,YAAY,IAAI,EAAE,GAAG,IAAI,QAAQ,CAAC;AAClC,gBAAgB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC/D;AACA,gBAAgB,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,SAAS;AACT,aAAa;AACb,YAAY,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3D,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;;ACfM,SAAS,yBAAyB,CAAC,GAAG,EAAE;AAC/C,IAAI,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;AAC3B,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;AACpC,YAAY,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,SAAS;AACT,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,CAAC;;ACJM,SAAS,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;AAChD,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7C,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;AAClF,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC3C,KAAK;AACL;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD;AACA,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;AACvC,IAAI,yBAAyB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/C,IAAI,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7D;AACA,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;AACxD,QAAQ,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ;AACtE,aAAa,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACrF,aAAa,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtD,KAAK;AACL,IAAI,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1H,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC;;ACzBM,SAAS,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE;AACpD,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AACjD,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC1C,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC5B,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK;AACL,IAAI,QAAQ,GAAG;AACf,QAAQ,SAAS;AACjB,QAAQ,KAAK;AACb,aAAa,GAAG,CAAC,CAAC,IAAI,KAAK;AAC3B,YAAY,IAAI,IAAI,KAAK,GAAG,EAAE;AAC9B,gBAAgB,QAAQ,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAC1F,aAAa;AACb,YAAY,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,SAAS,CAAC;AACV,aAAa,IAAI,CAAC,GAAG,CAAC,EAAE;AACxB,CAAC;;AChBD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,SAAS,cAAc,CAAC,YAAY,EAAE;AACtC,IAAI,OAAO,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AACD,AAAO,SAAS,uBAAuB,CAAC,GAAG,EAAE;AAC7C,IAAI,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAChD,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACzE,CAAC;;ACVM,SAAS,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE;AACzC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,SAAS,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzD,SAAS,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK;AAC9B,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;;ACPD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,IAAI,OAAO,GAAG;AACd,SAAS,KAAK,CAAC,oBAAoB,CAAC;AACpC,SAAS,GAAG,CAAC,UAAU,IAAI,EAAE;AAC7B,QAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACxC,YAAY,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC7E,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK,CAAC;AACN,SAAS,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAG,EAAE;AAC/B,IAAI,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE;AACpE,QAAQ,OAAO,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAChE,KAAK,CAAC,CAAC;AACP,CAAC;AACD,SAAS,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE;AAC3C,IAAI,KAAK;AACT,QAAQ,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG;AAC5C,cAAc,cAAc,CAAC,KAAK,CAAC;AACnC,cAAc,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACtC,IAAI,IAAI,GAAG,EAAE;AACb,QAAQ,OAAO,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;AACnD,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,CAAC;AACD,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AACjD,CAAC;AACD,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,IAAI,OAAO,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,CAAC;AACpE,CAAC;AACD,SAAS,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE;AACrD,IAAI,IAAI,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;AAC1C,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,EAAE;AAC1C,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,OAAO,KAAK,KAAK,SAAS,EAAE;AACxC,YAAY,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;AACrC,YAAY,IAAI,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC9C,gBAAgB,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AACnE,aAAa;AACb,YAAY,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AAC1F,SAAS;AACT,aAAa;AACb,YAAY,IAAI,QAAQ,KAAK,GAAG,EAAE;AAClC,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC1C,oBAAoB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AACrE,wBAAwB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACtG,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC5D,wBAAwB,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;AACjD,4BAA4B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5E,yBAAyB;AACzB,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,aAAa;AACb,iBAAiB;AACjB,gBAAgB,MAAM,GAAG,GAAG,EAAE,CAAC;AAC/B,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC1C,oBAAoB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AACrE,wBAAwB,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/D,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC5D,wBAAwB,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;AACjD,4BAA4B,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,4BAA4B,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AACjF,yBAAyB;AACzB,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,gBAAgB,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;AAC7C,oBAAoB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7E,iBAAiB;AACjB,qBAAqB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AAC3C,oBAAoB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,SAAS;AACT,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC9B,YAAY,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;AAClC,gBAAgB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,aAAa;AACb,SAAS;AACT,aAAa,IAAI,KAAK,KAAK,EAAE,KAAK,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,CAAC,EAAE;AACzE,YAAY,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACrD,SAAS;AACT,aAAa,IAAI,KAAK,KAAK,EAAE,EAAE;AAC/B,YAAY,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5B,SAAS;AACT,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,AAAO,SAAS,QAAQ,CAAC,QAAQ,EAAE;AACnC,IAAI,OAAO;AACX,QAAQ,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC3C,KAAK,CAAC;AACN,CAAC;AACD,SAAS,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE;AACnC,IAAI,IAAI,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxD,IAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,4BAA4B,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE;AAC5F,QAAQ,IAAI,UAAU,EAAE;AACxB,YAAY,IAAI,QAAQ,GAAG,EAAE,CAAC;AAC9B,YAAY,MAAM,MAAM,GAAG,EAAE,CAAC;AAC9B,YAAY,IAAI,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;AAChE,gBAAgB,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAChD,gBAAgB,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAClD,aAAa;AACb,YAAY,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,QAAQ,EAAE;AAC/D,gBAAgB,IAAI,GAAG,GAAG,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrE,gBAAgB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,aAAa,CAAC,CAAC;AACf,YAAY,IAAI,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC9C,gBAAgB,IAAI,SAAS,GAAG,GAAG,CAAC;AACpC,gBAAgB,IAAI,QAAQ,KAAK,GAAG,EAAE;AACtC,oBAAoB,SAAS,GAAG,GAAG,CAAC;AACpC,iBAAiB;AACjB,qBAAqB,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC3C,oBAAoB,SAAS,GAAG,QAAQ,CAAC;AACzC,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,QAAQ,GAAG,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACtF,aAAa;AACb,iBAAiB;AACjB,gBAAgB,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxC,aAAa;AACb,SAAS;AACT,aAAa;AACb,YAAY,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AAC3C,SAAS;AACT,KAAK,CAAC,CAAC;AACP,CAAC;;AC/JM,SAAS,KAAK,CAAC,OAAO,EAAE;AAC/B;AACA,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9C;AACA,IAAI,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AACnE,IAAI,IAAI,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD,IAAI,IAAI,IAAI,CAAC;AACb,IAAI,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE;AACnC,QAAQ,QAAQ;AAChB,QAAQ,SAAS;AACjB,QAAQ,KAAK;AACb,QAAQ,SAAS;AACjB,QAAQ,SAAS;AACjB,QAAQ,WAAW;AACnB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC;AAC1D,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAC3C,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAC5B,QAAQ,GAAG,GAAG,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;AACpC,KAAK;AACL,IAAI,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AAClD,SAAS,MAAM,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9D,SAAS,MAAM,CAAC,SAAS,CAAC,CAAC;AAC3B,IAAI,MAAM,mBAAmB,GAAG,IAAI,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AACpE,IAAI,MAAM,eAAe,GAAG,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9E,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE;AACtC;AACA,YAAY,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;AAC3C,iBAAiB,KAAK,CAAC,GAAG,CAAC;AAC3B,iBAAiB,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,kDAAkD,EAAE,CAAC,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACzJ,iBAAiB,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;AAC/C,YAAY,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAC/F,YAAY,OAAO,CAAC,MAAM,GAAG,wBAAwB;AACrD,iBAAiB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC;AACnD,iBAAiB,GAAG,CAAC,CAAC,OAAO,KAAK;AAClC,gBAAgB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM;AACvD,sBAAsB,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACpD,sBAAsB,OAAO,CAAC;AAC9B,gBAAgB,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5E,aAAa,CAAC;AACd,iBAAiB,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,SAAS;AACT,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC1C,QAAQ,GAAG,GAAG,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AAC3D,KAAK;AACL,SAAS;AACT,QAAQ,IAAI,MAAM,IAAI,mBAAmB,EAAE;AAC3C,YAAY,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC;AAC5C,SAAS;AACT,aAAa;AACb,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,EAAE;AACzD,gBAAgB,IAAI,GAAG,mBAAmB,CAAC;AAC3C,aAAa;AACb,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC9C,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACjE,QAAQ,OAAO,CAAC,cAAc,CAAC,GAAG,iCAAiC,CAAC;AACpE,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AAC1E,QAAQ,IAAI,GAAG,EAAE,CAAC;AAClB,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,OAAO,IAAI,KAAK,WAAW,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,OAAO,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACzJ,CAAC;;AC9EM,SAAS,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;AAC/D,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAClD,CAAC;;ACDM,SAAS,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE;AACvD,IAAI,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AACrD,IAAI,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC/D,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;AACnC,QAAQ,QAAQ;AAChB,QAAQ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACnD,QAAQ,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACzC,QAAQ,KAAK;AACb,KAAK,CAAC,CAAC;AACP,CAAC;;ACZM,MAAM,OAAO,GAAG,mBAAmB,CAAC;;ACE3C,MAAM,SAAS,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AACrE;AACA;AACA,AAAO,MAAM,QAAQ,GAAG;AACxB,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,OAAO,EAAE,wBAAwB;AACrC,IAAI,OAAO,EAAE;AACb,QAAQ,MAAM,EAAE,gCAAgC;AAChD,QAAQ,YAAY,EAAE,SAAS;AAC/B,KAAK;AACL,IAAI,SAAS,EAAE;AACf,QAAQ,MAAM,EAAE,EAAE;AAClB,QAAQ,QAAQ,EAAE,EAAE;AACpB,KAAK;AACL,CAAC,CAAC;;ACdU,MAAC,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/util/lowercase-keys.js","../dist-src/util/merge-deep.js","../dist-src/util/remove-undefined-properties.js","../dist-src/merge.js","../dist-src/util/add-query-parameters.js","../dist-src/util/extract-url-variable-names.js","../dist-src/util/omit.js","../dist-src/util/url-template.js","../dist-src/parse.js","../dist-src/endpoint-with-defaults.js","../dist-src/with-defaults.js","../dist-src/version.js","../dist-src/defaults.js","../dist-src/index.js"],"sourcesContent":["export function lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n","import { isPlainObject } from \"is-plain-object\";\nexport function mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach((key) => {\n if (isPlainObject(options[key])) {\n if (!(key in defaults))\n Object.assign(result, { [key]: options[key] });\n else\n result[key] = mergeDeep(defaults[key], options[key]);\n }\n else {\n Object.assign(result, { [key]: options[key] });\n }\n });\n return result;\n}\n","export function removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n}\n","import { lowercaseKeys } from \"./util/lowercase-keys\";\nimport { mergeDeep } from \"./util/merge-deep\";\nimport { removeUndefinedProperties } from \"./util/remove-undefined-properties\";\nexport function merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? { method, url } : { url: method }, options);\n }\n else {\n options = Object.assign({}, route);\n }\n // lowercase header names before merging with defaults to avoid duplicates\n options.headers = lowercaseKeys(options.headers);\n // remove properties with undefined values before merging\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options);\n // mediaType.previews arrays are merged, instead of overwritten\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews\n .filter((preview) => !mergedOptions.mediaType.previews.includes(preview))\n .concat(mergedOptions.mediaType.previews);\n }\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map((preview) => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n","export function addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n if (names.length === 0) {\n return url;\n }\n return (url +\n separator +\n names\n .map((name) => {\n if (name === \"q\") {\n return (\"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\"));\n }\n return `${name}=${encodeURIComponent(parameters[name])}`;\n })\n .join(\"&\"));\n}\n","const urlVariableRegex = /\\{[^}]+\\}/g;\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\nexport function extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n if (!matches) {\n return [];\n }\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n","export function omit(object, keysToOmit) {\n return Object.keys(object)\n .filter((option) => !keysToOmit.includes(option))\n .reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n","// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str\n .split(/(%[0-9A-Fa-f]{2})/g)\n .map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n return part;\n })\n .join(\"\");\n}\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\nfunction encodeValue(operator, value, key) {\n value =\n operator === \"+\" || operator === \"#\"\n ? encodeReserved(value)\n : encodeUnreserved(value);\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n }\n else {\n return value;\n }\n}\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\nfunction getValues(context, operator, key, modifier) {\n var value = context[key], result = [];\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\") {\n value = value.toString();\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n }\n else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n }\n else {\n const tmp = [];\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n }\n else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n }\n else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n }\n else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n }\n else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n }\n else if (value === \"\") {\n result.push(\"\");\n }\n }\n return result;\n}\nexport function parseUrl(template) {\n return {\n expand: expand.bind(null, template),\n };\n}\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n if (operator && operator !== \"+\") {\n var separator = \",\";\n if (operator === \"?\") {\n separator = \"&\";\n }\n else if (operator !== \"#\") {\n separator = operator;\n }\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n }\n else {\n return values.join(\",\");\n }\n }\n else {\n return encodeReserved(literal);\n }\n });\n}\n","import { addQueryParameters } from \"./util/add-query-parameters\";\nimport { extractUrlVariableNames } from \"./util/extract-url-variable-names\";\nimport { omit } from \"./util/omit\";\nimport { parseUrl } from \"./util/url-template\";\nexport function parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase();\n // replace :varname with {varname} to make it RFC 6570 compatible\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"mediaType\",\n ]);\n // extract variable names from URL to calculate remaining variables later\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n const omittedParameters = Object.keys(options)\n .filter((option) => urlVariableNames.includes(option))\n .concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept\n .split(/,/)\n .map((preview) => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`))\n .join(\",\");\n }\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader\n .concat(options.mediaType.previews)\n .map((preview) => {\n const format = options.mediaType.format\n ? `.${options.mediaType.format}`\n : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n })\n .join(\",\");\n }\n }\n // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n }\n else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n }\n else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n }\n else {\n headers[\"content-length\"] = 0;\n }\n }\n }\n // default content-type for JSON if body is set\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n }\n // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n }\n // Only return body/request keys if present\n return Object.assign({ method, url, headers }, typeof body !== \"undefined\" ? { body } : null, options.request ? { request: options.request } : null);\n}\n","import { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n","import { endpointWithDefaults } from \"./endpoint-with-defaults\";\nimport { merge } from \"./merge\";\nimport { parse } from \"./parse\";\nexport function withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse,\n });\n}\n","export const VERSION = \"6.0.12\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nconst userAgent = `octokit-endpoint.js/${VERSION} ${getUserAgent()}`;\n// DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\nexport const DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent,\n },\n mediaType: {\n format: \"\",\n previews: [],\n },\n};\n","import { withDefaults } from \"./with-defaults\";\nimport { DEFAULTS } from \"./defaults\";\nexport const endpoint = withDefaults(null, DEFAULTS);\n"],"names":[],"mappings":";;;AAAO,SAAS,aAAa,CAAC,MAAM,EAAE;AACtC,IAAI,IAAI,CAAC,MAAM,EAAE;AACjB,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;AACvD,QAAQ,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAChD,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX;;ACPO,SAAS,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC/C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC1C,QAAQ,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE;AACzC,YAAY,IAAI,EAAE,GAAG,IAAI,QAAQ,CAAC;AAClC,gBAAgB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC/D;AACA,gBAAgB,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,SAAS;AACT,aAAa;AACb,YAAY,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3D,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;;ACfM,SAAS,yBAAyB,CAAC,GAAG,EAAE;AAC/C,IAAI,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;AAC3B,QAAQ,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;AACpC,YAAY,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAC5B,SAAS;AACT,KAAK;AACL,IAAI,OAAO,GAAG,CAAC;AACf,CAAC;;ACJM,SAAS,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;AAChD,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7C,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;AAClF,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC3C,KAAK;AACL;AACA,IAAI,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD;AACA,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;AACvC,IAAI,yBAAyB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/C,IAAI,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7D;AACA,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;AACxD,QAAQ,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ;AACtE,aAAa,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACrF,aAAa,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtD,KAAK;AACL,IAAI,aAAa,CAAC,SAAS,CAAC,QAAQ,GAAG,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1H,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC;;ACzBM,SAAS,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE;AACpD,IAAI,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AACjD,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC1C,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC5B,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK;AACL,IAAI,QAAQ,GAAG;AACf,QAAQ,SAAS;AACjB,QAAQ,KAAK;AACb,aAAa,GAAG,CAAC,CAAC,IAAI,KAAK;AAC3B,YAAY,IAAI,IAAI,KAAK,GAAG,EAAE;AAC9B,gBAAgB,QAAQ,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAC1F,aAAa;AACb,YAAY,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,SAAS,CAAC;AACV,aAAa,IAAI,CAAC,GAAG,CAAC,EAAE;AACxB,CAAC;;AChBD,MAAM,gBAAgB,GAAG,YAAY,CAAC;AACtC,SAAS,cAAc,CAAC,YAAY,EAAE;AACtC,IAAI,OAAO,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AACD,AAAO,SAAS,uBAAuB,CAAC,GAAG,EAAE;AAC7C,IAAI,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAChD,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACzE,CAAC;;ACVM,SAAS,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE;AACzC,IAAI,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;AAC9B,SAAS,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzD,SAAS,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK;AAC9B,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/B,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;;ACPD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,IAAI,OAAO,GAAG;AACd,SAAS,KAAK,CAAC,oBAAoB,CAAC;AACpC,SAAS,GAAG,CAAC,UAAU,IAAI,EAAE;AAC7B,QAAQ,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACxC,YAAY,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC7E,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK,CAAC;AACN,SAAS,IAAI,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAG,EAAE;AAC/B,IAAI,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE;AACpE,QAAQ,OAAO,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAChE,KAAK,CAAC,CAAC;AACP,CAAC;AACD,SAAS,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE;AAC3C,IAAI,KAAK;AACT,QAAQ,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG;AAC5C,cAAc,cAAc,CAAC,KAAK,CAAC;AACnC,cAAc,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACtC,IAAI,IAAI,GAAG,EAAE;AACb,QAAQ,OAAO,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC;AACnD,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,CAAC;AACD,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AACjD,CAAC;AACD,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,IAAI,OAAO,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,CAAC;AACpE,CAAC;AACD,SAAS,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE;AACrD,IAAI,IAAI,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;AAC1C,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,EAAE;AAC1C,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAY,OAAO,KAAK,KAAK,SAAS,EAAE;AACxC,YAAY,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;AACrC,YAAY,IAAI,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC9C,gBAAgB,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AACnE,aAAa;AACb,YAAY,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AAC1F,SAAS;AACT,aAAa;AACb,YAAY,IAAI,QAAQ,KAAK,GAAG,EAAE;AAClC,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC1C,oBAAoB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AACrE,wBAAwB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACtG,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC5D,wBAAwB,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;AACjD,4BAA4B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5E,yBAAyB;AACzB,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,aAAa;AACb,iBAAiB;AACjB,gBAAgB,MAAM,GAAG,GAAG,EAAE,CAAC;AAC/B,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC1C,oBAAoB,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AACrE,wBAAwB,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/D,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC5D,wBAAwB,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;AACjD,4BAA4B,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,4BAA4B,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AACjF,yBAAyB;AACzB,qBAAqB,CAAC,CAAC;AACvB,iBAAiB;AACjB,gBAAgB,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE;AAC7C,oBAAoB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7E,iBAAiB;AACjB,qBAAqB,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;AAC3C,oBAAoB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,KAAK;AACL,SAAS;AACT,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC9B,YAAY,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE;AAClC,gBAAgB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,aAAa;AACb,SAAS;AACT,aAAa,IAAI,KAAK,KAAK,EAAE,KAAK,QAAQ,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,CAAC,EAAE;AACzE,YAAY,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACrD,SAAS;AACT,aAAa,IAAI,KAAK,KAAK,EAAE,EAAE;AAC/B,YAAY,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5B,SAAS;AACT,KAAK;AACL,IAAI,OAAO,MAAM,CAAC;AAClB,CAAC;AACD,AAAO,SAAS,QAAQ,CAAC,QAAQ,EAAE;AACnC,IAAI,OAAO;AACX,QAAQ,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC3C,KAAK,CAAC;AACN,CAAC;AACD,SAAS,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE;AACnC,IAAI,IAAI,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACxD,IAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,4BAA4B,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE;AAC5F,QAAQ,IAAI,UAAU,EAAE;AACxB,YAAY,IAAI,QAAQ,GAAG,EAAE,CAAC;AAC9B,YAAY,MAAM,MAAM,GAAG,EAAE,CAAC;AAC9B,YAAY,IAAI,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;AAChE,gBAAgB,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAChD,gBAAgB,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAClD,aAAa;AACb,YAAY,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,QAAQ,EAAE;AAC/D,gBAAgB,IAAI,GAAG,GAAG,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrE,gBAAgB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,aAAa,CAAC,CAAC;AACf,YAAY,IAAI,QAAQ,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC9C,gBAAgB,IAAI,SAAS,GAAG,GAAG,CAAC;AACpC,gBAAgB,IAAI,QAAQ,KAAK,GAAG,EAAE;AACtC,oBAAoB,SAAS,GAAG,GAAG,CAAC;AACpC,iBAAiB;AACjB,qBAAqB,IAAI,QAAQ,KAAK,GAAG,EAAE;AAC3C,oBAAoB,SAAS,GAAG,QAAQ,CAAC;AACzC,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,QAAQ,GAAG,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACtF,aAAa;AACb,iBAAiB;AACjB,gBAAgB,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxC,aAAa;AACb,SAAS;AACT,aAAa;AACb,YAAY,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AAC3C,SAAS;AACT,KAAK,CAAC,CAAC;AACP,CAAC;;AC/JM,SAAS,KAAK,CAAC,OAAO,EAAE;AAC/B;AACA,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9C;AACA,IAAI,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AACnE,IAAI,IAAI,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACrD,IAAI,IAAI,IAAI,CAAC;AACb,IAAI,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE;AACnC,QAAQ,QAAQ;AAChB,QAAQ,SAAS;AACjB,QAAQ,KAAK;AACb,QAAQ,SAAS;AACjB,QAAQ,SAAS;AACjB,QAAQ,WAAW;AACnB,KAAK,CAAC,CAAC;AACP;AACA,IAAI,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC;AAC1D,IAAI,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAC3C,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAC5B,QAAQ,GAAG,GAAG,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC;AACpC,KAAK;AACL,IAAI,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;AAClD,SAAS,MAAM,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9D,SAAS,MAAM,CAAC,SAAS,CAAC,CAAC;AAC3B,IAAI,MAAM,mBAAmB,GAAG,IAAI,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AACpE,IAAI,MAAM,eAAe,GAAG,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9E,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE;AACtC;AACA,YAAY,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;AAC3C,iBAAiB,KAAK,CAAC,GAAG,CAAC;AAC3B,iBAAiB,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,kDAAkD,EAAE,CAAC,oBAAoB,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACzJ,iBAAiB,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;AAC/C,YAAY,MAAM,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;AAC/F,YAAY,OAAO,CAAC,MAAM,GAAG,wBAAwB;AACrD,iBAAiB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC;AACnD,iBAAiB,GAAG,CAAC,CAAC,OAAO,KAAK;AAClC,gBAAgB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM;AACvD,sBAAsB,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACpD,sBAAsB,OAAO,CAAC;AAC9B,gBAAgB,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5E,aAAa,CAAC;AACd,iBAAiB,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B,SAAS;AACT,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC1C,QAAQ,GAAG,GAAG,kBAAkB,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;AAC3D,KAAK;AACL,SAAS;AACT,QAAQ,IAAI,MAAM,IAAI,mBAAmB,EAAE;AAC3C,YAAY,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC;AAC5C,SAAS;AACT,aAAa;AACb,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,MAAM,EAAE;AACzD,gBAAgB,IAAI,GAAG,mBAAmB,CAAC;AAC3C,aAAa;AACb,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC9C,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACjE,QAAQ,OAAO,CAAC,cAAc,CAAC,GAAG,iCAAiC,CAAC;AACpE,KAAK;AACL;AACA;AACA,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AAC1E,QAAQ,IAAI,GAAG,EAAE,CAAC;AAClB,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,OAAO,IAAI,KAAK,WAAW,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,OAAO,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACzJ,CAAC;;AC9EM,SAAS,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;AAC/D,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAClD,CAAC;;ACDM,SAAS,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE;AACvD,IAAI,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AACrD,IAAI,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC/D,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;AACnC,QAAQ,QAAQ;AAChB,QAAQ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACnD,QAAQ,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACzC,QAAQ,KAAK;AACb,KAAK,CAAC,CAAC;AACP,CAAC;;ACZM,MAAM,OAAO,GAAG,mBAAmB,CAAC;;ACE3C,MAAM,SAAS,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AACrE;AACA;AACA,AAAO,MAAM,QAAQ,GAAG;AACxB,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,OAAO,EAAE,wBAAwB;AACrC,IAAI,OAAO,EAAE;AACb,QAAQ,MAAM,EAAE,gCAAgC;AAChD,QAAQ,YAAY,EAAE,SAAS;AAC/B,KAAK;AACL,IAAI,SAAS,EAAE;AACf,QAAQ,MAAM,EAAE,EAAE;AAClB,QAAQ,QAAQ,EAAE,EAAE;AACpB,KAAK;AACL,CAAC,CAAC;;ACdU,MAAC,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/endpoint/package.json b/node_modules/@octokit/endpoint/package.json index c521849..4e4d425 100644 --- a/node_modules/@octokit/endpoint/package.json +++ b/node_modules/@octokit/endpoint/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/endpoint", "description": "Turns REST API endpoints into generic request options", - "version": "6.0.8", + "version": "6.0.12", "license": "MIT", "files": [ "dist-*/", @@ -15,16 +15,9 @@ "api", "rest" ], - "homepage": "https://github.com/octokit/endpoint.js#readme", - "bugs": { - "url": "https://github.com/octokit/endpoint.js/issues" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/octokit/endpoint.js.git" - }, + "repository": "github:octokit/endpoint.js", "dependencies": { - "@octokit/types": "^5.0.0", + "@octokit/types": "^6.0.3", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" }, @@ -34,11 +27,11 @@ "@pika/plugin-build-web": "^0.9.0", "@pika/plugin-ts-standard-pkg": "^0.9.0", "@types/jest": "^26.0.0", - "jest": "^26.0.1", - "prettier": "2.1.2", + "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": "^26.0.0", + "ts-jest": "^27.0.0-next.12", "typescript": "^4.0.2" }, "publishConfig": { diff --git a/node_modules/@octokit/graphql/README.md b/node_modules/@octokit/graphql/README.md index 0a227ee..7ba46fb 100644 --- a/node_modules/@octokit/graphql/README.md +++ b/node_modules/@octokit/graphql/README.md @@ -14,6 +14,8 @@ - [Pass query together with headers and variables](#pass-query-together-with-headers-and-variables) - [Use with GitHub Enterprise](#use-with-github-enterprise) - [Use custom `@octokit/request` instance](#use-custom-octokitrequest-instance) +- [TypeScript](#typescript) + - [Additional Types](#additional-types) - [Errors](#errors) - [Partial responses](#partial-responses) - [Writing tests](#writing-tests) @@ -29,11 +31,11 @@ Browsers -Load `@octokit/graphql` directly from [cdn.pika.dev](https://cdn.pika.dev) +Load `@octokit/graphql` directly from [cdn.skypack.dev](https://cdn.skypack.dev) ```html ``` @@ -247,6 +249,18 @@ await myGraphql(` // requestCounter is now 2 ``` +## TypeScript + +`@octokit/graphql` is exposing proper types for its usage with TypeScript projects. + +### Additional Types + +Additionally, `GraphQlQueryResponseData` has been exposed to users: + +```ts +import type { GraphQlQueryResponseData } from "@octokit/graphql"; +``` + ## Errors In case of a GraphQL error, `error.message` is set to the first error from the response’s `errors` array. All errors can be accessed at `error.errors`. `error.request` has the request options such as query, variables and headers set for easier debugging. @@ -269,14 +283,14 @@ try { } catch (error) { // server responds with // { - // "data": null, - // "errors": [{ - // "message": "Field 'bioHtml' doesn't exist on type 'User'", - // "locations": [{ - // "line": 3, - // "column": 5 - // }] - // }] + // "data": null, + // "errors": [{ + // "message": "Field 'bioHtml' doesn't exist on type 'User'", + // "locations": [{ + // "line": 3, + // "column": 5 + // }] + // }] // } console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } } diff --git a/node_modules/@octokit/graphql/dist-node/index.js b/node_modules/@octokit/graphql/dist-node/index.js index 13f47f9..3706e2b 100644 --- a/node_modules/@octokit/graphql/dist-node/index.js +++ b/node_modules/@octokit/graphql/dist-node/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); var request = require('@octokit/request'); var universalUserAgent = require('universal-user-agent'); -const VERSION = "4.5.6"; +const VERSION = "4.6.4"; class GraphqlError extends Error { constructor(request, response) { @@ -28,10 +28,18 @@ class GraphqlError extends Error { } const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; +const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; function graphql(request, query, options) { - if (typeof query === "string" && options && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + } + + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; + return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); + } } const parsedOptions = typeof query === "string" ? Object.assign({ diff --git a/node_modules/@octokit/graphql/dist-node/index.js.map b/node_modules/@octokit/graphql/dist-node/index.js.map index 833b8d3..0513384 100644 --- a/node_modules/@octokit/graphql/dist-node/index.js.map +++ b/node_modules/@octokit/graphql/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/error.js","../dist-src/graphql.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"4.5.6\";\n","export class GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, { headers: response.headers });\n this.name = \"GraphqlError\";\n this.request = request;\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n","import { GraphqlError } from \"./error\";\nconst NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\",\n];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nexport function graphql(request, query, options) {\n if (typeof query === \"string\" && options && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n const parsedOptions = typeof query === \"string\" ? Object.assign({ query }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = parsedOptions[key];\n return result;\n }, {});\n // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n return request(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data,\n });\n }\n return response.data.data;\n });\n}\n","import { request as Request } from \"@octokit/request\";\nimport { graphql } from \"./graphql\";\nexport function withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: Request.endpoint,\n });\n}\n","import { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport { withDefaults } from \"./with-defaults\";\nexport const graphql = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,\n },\n method: \"POST\",\n url: \"/graphql\",\n});\nexport function withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\",\n });\n}\n"],"names":["VERSION","GraphqlError","Error","constructor","request","response","message","data","errors","Object","assign","headers","name","captureStackTrace","NON_VARIABLE_OPTIONS","GHES_V3_SUFFIX_REGEX","graphql","query","options","Promise","reject","parsedOptions","requestOptions","keys","reduce","result","key","includes","variables","baseUrl","endpoint","DEFAULTS","test","url","replace","then","withDefaults","newDefaults","newRequest","defaults","newApi","bind","Request","getUserAgent","method","withCustomRequest","customRequest"],"mappings":";;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAA,MAAMC,YAAN,SAA2BC,KAA3B,CAAiC;AACpCC,EAAAA,WAAW,CAACC,OAAD,EAAUC,QAAV,EAAoB;AAC3B,UAAMC,OAAO,GAAGD,QAAQ,CAACE,IAAT,CAAcC,MAAd,CAAqB,CAArB,EAAwBF,OAAxC;AACA,UAAMA,OAAN;AACAG,IAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoBL,QAAQ,CAACE,IAA7B;AACAE,IAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoB;AAAEC,MAAAA,OAAO,EAAEN,QAAQ,CAACM;AAApB,KAApB;AACA,SAAKC,IAAL,GAAY,cAAZ;AACA,SAAKR,OAAL,GAAeA,OAAf,CAN2B;;AAQ3B;;AACA,QAAIF,KAAK,CAACW,iBAAV,EAA6B;AACzBX,MAAAA,KAAK,CAACW,iBAAN,CAAwB,IAAxB,EAA8B,KAAKV,WAAnC;AACH;AACJ;;AAbmC;;ACCxC,MAAMW,oBAAoB,GAAG,CACzB,QADyB,EAEzB,SAFyB,EAGzB,KAHyB,EAIzB,SAJyB,EAKzB,SALyB,EAMzB,OANyB,EAOzB,WAPyB,CAA7B;AASA,MAAMC,oBAAoB,GAAG,eAA7B;AACA,AAAO,SAASC,OAAT,CAAiBZ,OAAjB,EAA0Ba,KAA1B,EAAiCC,OAAjC,EAA0C;AAC7C,MAAI,OAAOD,KAAP,KAAiB,QAAjB,IAA6BC,OAA7B,IAAwC,WAAWA,OAAvD,EAAgE;AAC5D,WAAOC,OAAO,CAACC,MAAR,CAAe,IAAIlB,KAAJ,CAAW,4DAAX,CAAf,CAAP;AACH;;AACD,QAAMmB,aAAa,GAAG,OAAOJ,KAAP,KAAiB,QAAjB,GAA4BR,MAAM,CAACC,MAAP,CAAc;AAAEO,IAAAA;AAAF,GAAd,EAAyBC,OAAzB,CAA5B,GAAgED,KAAtF;AACA,QAAMK,cAAc,GAAGb,MAAM,CAACc,IAAP,CAAYF,aAAZ,EAA2BG,MAA3B,CAAkC,CAACC,MAAD,EAASC,GAAT,KAAiB;AACtE,QAAIZ,oBAAoB,CAACa,QAArB,CAA8BD,GAA9B,CAAJ,EAAwC;AACpCD,MAAAA,MAAM,CAACC,GAAD,CAAN,GAAcL,aAAa,CAACK,GAAD,CAA3B;AACA,aAAOD,MAAP;AACH;;AACD,QAAI,CAACA,MAAM,CAACG,SAAZ,EAAuB;AACnBH,MAAAA,MAAM,CAACG,SAAP,GAAmB,EAAnB;AACH;;AACDH,IAAAA,MAAM,CAACG,SAAP,CAAiBF,GAAjB,IAAwBL,aAAa,CAACK,GAAD,CAArC;AACA,WAAOD,MAAP;AACH,GAVsB,EAUpB,EAVoB,CAAvB,CAL6C;AAiB7C;;AACA,QAAMI,OAAO,GAAGR,aAAa,CAACQ,OAAd,IAAyBzB,OAAO,CAAC0B,QAAR,CAAiBC,QAAjB,CAA0BF,OAAnE;;AACA,MAAId,oBAAoB,CAACiB,IAArB,CAA0BH,OAA1B,CAAJ,EAAwC;AACpCP,IAAAA,cAAc,CAACW,GAAf,GAAqBJ,OAAO,CAACK,OAAR,CAAgBnB,oBAAhB,EAAsC,cAAtC,CAArB;AACH;;AACD,SAAOX,OAAO,CAACkB,cAAD,CAAP,CAAwBa,IAAxB,CAA8B9B,QAAD,IAAc;AAC9C,QAAIA,QAAQ,CAACE,IAAT,CAAcC,MAAlB,EAA0B;AACtB,YAAMG,OAAO,GAAG,EAAhB;;AACA,WAAK,MAAMe,GAAX,IAAkBjB,MAAM,CAACc,IAAP,CAAYlB,QAAQ,CAACM,OAArB,CAAlB,EAAiD;AAC7CA,QAAAA,OAAO,CAACe,GAAD,CAAP,GAAerB,QAAQ,CAACM,OAAT,CAAiBe,GAAjB,CAAf;AACH;;AACD,YAAM,IAAIzB,YAAJ,CAAiBqB,cAAjB,EAAiC;AACnCX,QAAAA,OADmC;AAEnCJ,QAAAA,IAAI,EAAEF,QAAQ,CAACE;AAFoB,OAAjC,CAAN;AAIH;;AACD,WAAOF,QAAQ,CAACE,IAAT,CAAcA,IAArB;AACH,GAZM,CAAP;AAaH;;AC5CM,SAAS6B,YAAT,CAAsBhC,SAAtB,EAA+BiC,WAA/B,EAA4C;AAC/C,QAAMC,UAAU,GAAGlC,SAAO,CAACmC,QAAR,CAAiBF,WAAjB,CAAnB;;AACA,QAAMG,MAAM,GAAG,CAACvB,KAAD,EAAQC,OAAR,KAAoB;AAC/B,WAAOF,OAAO,CAACsB,UAAD,EAAarB,KAAb,EAAoBC,OAApB,CAAd;AACH,GAFD;;AAGA,SAAOT,MAAM,CAACC,MAAP,CAAc8B,MAAd,EAAsB;AACzBD,IAAAA,QAAQ,EAAEH,YAAY,CAACK,IAAb,CAAkB,IAAlB,EAAwBH,UAAxB,CADe;AAEzBR,IAAAA,QAAQ,EAAEY,eAAO,CAACZ;AAFO,GAAtB,CAAP;AAIH;;MCPYd,SAAO,GAAGoB,YAAY,CAAChC,eAAD,EAAU;AACzCO,EAAAA,OAAO,EAAE;AACL,kBAAe,sBAAqBX,OAAQ,IAAG2C,+BAAY,EAAG;AADzD,GADgC;AAIzCC,EAAAA,MAAM,EAAE,MAJiC;AAKzCX,EAAAA,GAAG,EAAE;AALoC,CAAV,CAA5B;AAOP,AAAO,SAASY,iBAAT,CAA2BC,aAA3B,EAA0C;AAC7C,SAAOV,YAAY,CAACU,aAAD,EAAgB;AAC/BF,IAAAA,MAAM,EAAE,MADuB;AAE/BX,IAAAA,GAAG,EAAE;AAF0B,GAAhB,CAAnB;AAIH;;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/error.js","../dist-src/graphql.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"4.6.4\";\n","export class GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, { headers: response.headers });\n this.name = \"GraphqlError\";\n this.request = request;\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n","import { GraphqlError } from \"./error\";\nconst NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\",\n];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nexport function graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))\n continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n const parsedOptions = typeof query === \"string\" ? Object.assign({ query }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = parsedOptions[key];\n return result;\n }, {});\n // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n return request(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data,\n });\n }\n return response.data.data;\n });\n}\n","import { request as Request } from \"@octokit/request\";\nimport { graphql } from \"./graphql\";\nexport function withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: Request.endpoint,\n });\n}\n","import { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport { withDefaults } from \"./with-defaults\";\nexport const graphql = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,\n },\n method: \"POST\",\n url: \"/graphql\",\n});\nexport function withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\",\n });\n}\n"],"names":["VERSION","GraphqlError","Error","constructor","request","response","message","data","errors","Object","assign","headers","name","captureStackTrace","NON_VARIABLE_OPTIONS","FORBIDDEN_VARIABLE_OPTIONS","GHES_V3_SUFFIX_REGEX","graphql","query","options","Promise","reject","key","includes","parsedOptions","requestOptions","keys","reduce","result","variables","baseUrl","endpoint","DEFAULTS","test","url","replace","then","withDefaults","newDefaults","newRequest","defaults","newApi","bind","Request","getUserAgent","method","withCustomRequest","customRequest"],"mappings":";;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAA,MAAMC,YAAN,SAA2BC,KAA3B,CAAiC;AACpCC,EAAAA,WAAW,CAACC,OAAD,EAAUC,QAAV,EAAoB;AAC3B,UAAMC,OAAO,GAAGD,QAAQ,CAACE,IAAT,CAAcC,MAAd,CAAqB,CAArB,EAAwBF,OAAxC;AACA,UAAMA,OAAN;AACAG,IAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoBL,QAAQ,CAACE,IAA7B;AACAE,IAAAA,MAAM,CAACC,MAAP,CAAc,IAAd,EAAoB;AAAEC,MAAAA,OAAO,EAAEN,QAAQ,CAACM;AAApB,KAApB;AACA,SAAKC,IAAL,GAAY,cAAZ;AACA,SAAKR,OAAL,GAAeA,OAAf,CAN2B;;AAQ3B;;AACA,QAAIF,KAAK,CAACW,iBAAV,EAA6B;AACzBX,MAAAA,KAAK,CAACW,iBAAN,CAAwB,IAAxB,EAA8B,KAAKV,WAAnC;AACH;AACJ;;AAbmC;;ACCxC,MAAMW,oBAAoB,GAAG,CACzB,QADyB,EAEzB,SAFyB,EAGzB,KAHyB,EAIzB,SAJyB,EAKzB,SALyB,EAMzB,OANyB,EAOzB,WAPyB,CAA7B;AASA,MAAMC,0BAA0B,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,KAApB,CAAnC;AACA,MAAMC,oBAAoB,GAAG,eAA7B;AACA,AAAO,SAASC,OAAT,CAAiBb,OAAjB,EAA0Bc,KAA1B,EAAiCC,OAAjC,EAA0C;AAC7C,MAAIA,OAAJ,EAAa;AACT,QAAI,OAAOD,KAAP,KAAiB,QAAjB,IAA6B,WAAWC,OAA5C,EAAqD;AACjD,aAAOC,OAAO,CAACC,MAAR,CAAe,IAAInB,KAAJ,CAAW,4DAAX,CAAf,CAAP;AACH;;AACD,SAAK,MAAMoB,GAAX,IAAkBH,OAAlB,EAA2B;AACvB,UAAI,CAACJ,0BAA0B,CAACQ,QAA3B,CAAoCD,GAApC,CAAL,EACI;AACJ,aAAOF,OAAO,CAACC,MAAR,CAAe,IAAInB,KAAJ,CAAW,uBAAsBoB,GAAI,mCAArC,CAAf,CAAP;AACH;AACJ;;AACD,QAAME,aAAa,GAAG,OAAON,KAAP,KAAiB,QAAjB,GAA4BT,MAAM,CAACC,MAAP,CAAc;AAAEQ,IAAAA;AAAF,GAAd,EAAyBC,OAAzB,CAA5B,GAAgED,KAAtF;AACA,QAAMO,cAAc,GAAGhB,MAAM,CAACiB,IAAP,CAAYF,aAAZ,EAA2BG,MAA3B,CAAkC,CAACC,MAAD,EAASN,GAAT,KAAiB;AACtE,QAAIR,oBAAoB,CAACS,QAArB,CAA8BD,GAA9B,CAAJ,EAAwC;AACpCM,MAAAA,MAAM,CAACN,GAAD,CAAN,GAAcE,aAAa,CAACF,GAAD,CAA3B;AACA,aAAOM,MAAP;AACH;;AACD,QAAI,CAACA,MAAM,CAACC,SAAZ,EAAuB;AACnBD,MAAAA,MAAM,CAACC,SAAP,GAAmB,EAAnB;AACH;;AACDD,IAAAA,MAAM,CAACC,SAAP,CAAiBP,GAAjB,IAAwBE,aAAa,CAACF,GAAD,CAArC;AACA,WAAOM,MAAP;AACH,GAVsB,EAUpB,EAVoB,CAAvB,CAZ6C;AAwB7C;;AACA,QAAME,OAAO,GAAGN,aAAa,CAACM,OAAd,IAAyB1B,OAAO,CAAC2B,QAAR,CAAiBC,QAAjB,CAA0BF,OAAnE;;AACA,MAAId,oBAAoB,CAACiB,IAArB,CAA0BH,OAA1B,CAAJ,EAAwC;AACpCL,IAAAA,cAAc,CAACS,GAAf,GAAqBJ,OAAO,CAACK,OAAR,CAAgBnB,oBAAhB,EAAsC,cAAtC,CAArB;AACH;;AACD,SAAOZ,OAAO,CAACqB,cAAD,CAAP,CAAwBW,IAAxB,CAA8B/B,QAAD,IAAc;AAC9C,QAAIA,QAAQ,CAACE,IAAT,CAAcC,MAAlB,EAA0B;AACtB,YAAMG,OAAO,GAAG,EAAhB;;AACA,WAAK,MAAMW,GAAX,IAAkBb,MAAM,CAACiB,IAAP,CAAYrB,QAAQ,CAACM,OAArB,CAAlB,EAAiD;AAC7CA,QAAAA,OAAO,CAACW,GAAD,CAAP,GAAejB,QAAQ,CAACM,OAAT,CAAiBW,GAAjB,CAAf;AACH;;AACD,YAAM,IAAIrB,YAAJ,CAAiBwB,cAAjB,EAAiC;AACnCd,QAAAA,OADmC;AAEnCJ,QAAAA,IAAI,EAAEF,QAAQ,CAACE;AAFoB,OAAjC,CAAN;AAIH;;AACD,WAAOF,QAAQ,CAACE,IAAT,CAAcA,IAArB;AACH,GAZM,CAAP;AAaH;;ACpDM,SAAS8B,YAAT,CAAsBjC,SAAtB,EAA+BkC,WAA/B,EAA4C;AAC/C,QAAMC,UAAU,GAAGnC,SAAO,CAACoC,QAAR,CAAiBF,WAAjB,CAAnB;;AACA,QAAMG,MAAM,GAAG,CAACvB,KAAD,EAAQC,OAAR,KAAoB;AAC/B,WAAOF,OAAO,CAACsB,UAAD,EAAarB,KAAb,EAAoBC,OAApB,CAAd;AACH,GAFD;;AAGA,SAAOV,MAAM,CAACC,MAAP,CAAc+B,MAAd,EAAsB;AACzBD,IAAAA,QAAQ,EAAEH,YAAY,CAACK,IAAb,CAAkB,IAAlB,EAAwBH,UAAxB,CADe;AAEzBR,IAAAA,QAAQ,EAAEY,eAAO,CAACZ;AAFO,GAAtB,CAAP;AAIH;;MCPYd,SAAO,GAAGoB,YAAY,CAACjC,eAAD,EAAU;AACzCO,EAAAA,OAAO,EAAE;AACL,kBAAe,sBAAqBX,OAAQ,IAAG4C,+BAAY,EAAG;AADzD,GADgC;AAIzCC,EAAAA,MAAM,EAAE,MAJiC;AAKzCX,EAAAA,GAAG,EAAE;AALoC,CAAV,CAA5B;AAOP,AAAO,SAASY,iBAAT,CAA2BC,aAA3B,EAA0C;AAC7C,SAAOV,YAAY,CAACU,aAAD,EAAgB;AAC/BF,IAAAA,MAAM,EAAE,MADuB;AAE/BX,IAAAA,GAAG,EAAE;AAF0B,GAAhB,CAAnB;AAIH;;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/graphql/dist-src/graphql.js b/node_modules/@octokit/graphql/dist-src/graphql.js index deb9488..4fef9b1 100644 --- a/node_modules/@octokit/graphql/dist-src/graphql.js +++ b/node_modules/@octokit/graphql/dist-src/graphql.js @@ -8,10 +8,18 @@ const NON_VARIABLE_OPTIONS = [ "query", "mediaType", ]; +const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; export function graphql(request, query, options) { - if (typeof query === "string" && options && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + } + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) + continue; + return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); + } } const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { diff --git a/node_modules/@octokit/graphql/dist-src/types.js b/node_modules/@octokit/graphql/dist-src/types.js index e69de29..cb0ff5c 100644 --- a/node_modules/@octokit/graphql/dist-src/types.js +++ b/node_modules/@octokit/graphql/dist-src/types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@octokit/graphql/dist-src/version.js b/node_modules/@octokit/graphql/dist-src/version.js index db3f178..202b8c6 100644 --- a/node_modules/@octokit/graphql/dist-src/version.js +++ b/node_modules/@octokit/graphql/dist-src/version.js @@ -1 +1 @@ -export const VERSION = "4.5.6"; +export const VERSION = "4.6.4"; diff --git a/node_modules/@octokit/graphql/dist-types/index.d.ts b/node_modules/@octokit/graphql/dist-types/index.d.ts index 1878fd4..a0d263b 100644 --- a/node_modules/@octokit/graphql/dist-types/index.d.ts +++ b/node_modules/@octokit/graphql/dist-types/index.d.ts @@ -1,3 +1,4 @@ import { request } from "@octokit/request"; export declare const graphql: import("./types").graphql; +export { GraphQlQueryResponseData } from "./types"; export declare function withCustomRequest(customRequest: typeof request): import("./types").graphql; diff --git a/node_modules/@octokit/graphql/dist-types/types.d.ts b/node_modules/@octokit/graphql/dist-types/types.d.ts index ef60d95..a3cf6eb 100644 --- a/node_modules/@octokit/graphql/dist-types/types.d.ts +++ b/node_modules/@octokit/graphql/dist-types/types.d.ts @@ -36,15 +36,19 @@ export declare type GraphQlQueryResponseData = { }; export declare type GraphQlQueryResponse = { data: ResponseData; - errors?: [{ - message: string; - path: [string]; - extensions: { - [key: string]: any; - }; - locations: [{ - line: number; - column: number; - }]; - }]; + errors?: [ + { + message: string; + path: [string]; + extensions: { + [key: string]: any; + }; + locations: [ + { + line: number; + column: number; + } + ]; + } + ]; }; diff --git a/node_modules/@octokit/graphql/dist-types/version.d.ts b/node_modules/@octokit/graphql/dist-types/version.d.ts index 71cccb7..c1c71f7 100644 --- a/node_modules/@octokit/graphql/dist-types/version.d.ts +++ b/node_modules/@octokit/graphql/dist-types/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "4.5.6"; +export declare const VERSION = "4.6.4"; diff --git a/node_modules/@octokit/graphql/dist-web/index.js b/node_modules/@octokit/graphql/dist-web/index.js index 0d90419..79868ba 100644 --- a/node_modules/@octokit/graphql/dist-web/index.js +++ b/node_modules/@octokit/graphql/dist-web/index.js @@ -1,7 +1,7 @@ import { request } from '@octokit/request'; import { getUserAgent } from 'universal-user-agent'; -const VERSION = "4.5.6"; +const VERSION = "4.6.4"; class GraphqlError extends Error { constructor(request, response) { @@ -28,10 +28,18 @@ const NON_VARIABLE_OPTIONS = [ "query", "mediaType", ]; +const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; function graphql(request, query, options) { - if (typeof query === "string" && options && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + } + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) + continue; + return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); + } } const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { diff --git a/node_modules/@octokit/graphql/dist-web/index.js.map b/node_modules/@octokit/graphql/dist-web/index.js.map index 8c5d199..8fcf95a 100644 --- a/node_modules/@octokit/graphql/dist-web/index.js.map +++ b/node_modules/@octokit/graphql/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/error.js","../dist-src/graphql.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"4.5.6\";\n","export class GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, { headers: response.headers });\n this.name = \"GraphqlError\";\n this.request = request;\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n","import { GraphqlError } from \"./error\";\nconst NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\",\n];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nexport function graphql(request, query, options) {\n if (typeof query === \"string\" && options && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n const parsedOptions = typeof query === \"string\" ? Object.assign({ query }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = parsedOptions[key];\n return result;\n }, {});\n // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n return request(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data,\n });\n }\n return response.data.data;\n });\n}\n","import { request as Request } from \"@octokit/request\";\nimport { graphql } from \"./graphql\";\nexport function withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: Request.endpoint,\n });\n}\n","import { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport { withDefaults } from \"./with-defaults\";\nexport const graphql = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,\n },\n method: \"POST\",\n url: \"/graphql\",\n});\nexport function withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\",\n });\n}\n"],"names":["request","Request","graphql"],"mappings":";;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACAnC,MAAM,YAAY,SAAS,KAAK,CAAC;AACxC,IAAI,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE;AACnC,QAAQ,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACxD,QAAQ,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC3C,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3D,QAAQ,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;AACnC,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B;AACA;AACA,QAAQ,IAAI,KAAK,CAAC,iBAAiB,EAAE;AACrC,YAAY,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5D,SAAS;AACT,KAAK;AACL,CAAC;;ACbD,MAAM,oBAAoB,GAAG;AAC7B,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,OAAO;AACX,IAAI,WAAW;AACf,CAAC,CAAC;AACF,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAC7C,AAAO,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;AACjD,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,EAAE;AACpE,QAAQ,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,0DAA0D,CAAC,CAAC,CAAC,CAAC;AACvG,KAAK;AACL,IAAI,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;AAChG,IAAI,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;AAC9E,QAAQ,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAChD,YAAY,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAC7C,YAAY,OAAO,MAAM,CAAC;AAC1B,SAAS;AACT,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;AAC/B,YAAY,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;AAClC,SAAS;AACT,QAAQ,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACnD,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX;AACA;AACA,IAAI,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC/E,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;AAC5C,QAAQ,cAAc,CAAC,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;AACnF,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK;AACtD,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE;AAClC,YAAY,MAAM,OAAO,GAAG,EAAE,CAAC;AAC/B,YAAY,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AAC7D,gBAAgB,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACrD,aAAa;AACb,YAAY,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE;AACnD,gBAAgB,OAAO;AACvB,gBAAgB,IAAI,EAAE,QAAQ,CAAC,IAAI;AACnC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;AAClC,KAAK,CAAC,CAAC;AACP,CAAC;;AC5CM,SAAS,YAAY,CAACA,SAAO,EAAE,WAAW,EAAE;AACnD,IAAI,MAAM,UAAU,GAAGA,SAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACrD,IAAI,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK;AACvC,QAAQ,OAAO,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACnD,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AACjC,QAAQ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;AACrD,QAAQ,QAAQ,EAAEC,OAAO,CAAC,QAAQ;AAClC,KAAK,CAAC,CAAC;AACP,CAAC;;ACPW,MAACC,SAAO,GAAG,YAAY,CAAC,OAAO,EAAE;AAC7C,IAAI,OAAO,EAAE;AACb,QAAQ,YAAY,EAAE,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,MAAM,EAAE,MAAM;AAClB,IAAI,GAAG,EAAE,UAAU;AACnB,CAAC,CAAC,CAAC;AACH,AAAO,SAAS,iBAAiB,CAAC,aAAa,EAAE;AACjD,IAAI,OAAO,YAAY,CAAC,aAAa,EAAE;AACvC,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,GAAG,EAAE,UAAU;AACvB,KAAK,CAAC,CAAC;AACP,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/error.js","../dist-src/graphql.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"4.6.4\";\n","export class GraphqlError extends Error {\n constructor(request, response) {\n const message = response.data.errors[0].message;\n super(message);\n Object.assign(this, response.data);\n Object.assign(this, { headers: response.headers });\n this.name = \"GraphqlError\";\n this.request = request;\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n","import { GraphqlError } from \"./error\";\nconst NON_VARIABLE_OPTIONS = [\n \"method\",\n \"baseUrl\",\n \"url\",\n \"headers\",\n \"request\",\n \"query\",\n \"mediaType\",\n];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nexport function graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))\n continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n const parsedOptions = typeof query === \"string\" ? Object.assign({ query }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n if (!result.variables) {\n result.variables = {};\n }\n result.variables[key] = parsedOptions[key];\n return result;\n }, {});\n // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n return request(requestOptions).then((response) => {\n if (response.data.errors) {\n const headers = {};\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n throw new GraphqlError(requestOptions, {\n headers,\n data: response.data,\n });\n }\n return response.data.data;\n });\n}\n","import { request as Request } from \"@octokit/request\";\nimport { graphql } from \"./graphql\";\nexport function withDefaults(request, newDefaults) {\n const newRequest = request.defaults(newDefaults);\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: Request.endpoint,\n });\n}\n","import { request } from \"@octokit/request\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport { withDefaults } from \"./with-defaults\";\nexport const graphql = withDefaults(request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${getUserAgent()}`,\n },\n method: \"POST\",\n url: \"/graphql\",\n});\nexport function withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\",\n });\n}\n"],"names":["request","Request","graphql"],"mappings":";;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACAnC,MAAM,YAAY,SAAS,KAAK,CAAC;AACxC,IAAI,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE;AACnC,QAAQ,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACxD,QAAQ,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC3C,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;AAC3D,QAAQ,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;AACnC,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B;AACA;AACA,QAAQ,IAAI,KAAK,CAAC,iBAAiB,EAAE;AACrC,YAAY,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5D,SAAS;AACT,KAAK;AACL,CAAC;;ACbD,MAAM,oBAAoB,GAAG;AAC7B,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,OAAO;AACX,IAAI,WAAW;AACf,CAAC,CAAC;AACF,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9D,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAC7C,AAAO,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;AACjD,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,OAAO,EAAE;AAC7D,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,0DAA0D,CAAC,CAAC,CAAC,CAAC;AAC3G,SAAS;AACT,QAAQ,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;AACnC,YAAY,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC,GAAG,CAAC;AACzD,gBAAgB,SAAS;AACzB,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,oBAAoB,EAAE,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC;AAC5G,SAAS;AACT,KAAK;AACL,IAAI,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;AAChG,IAAI,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK;AAC9E,QAAQ,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAChD,YAAY,MAAM,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAC7C,YAAY,OAAO,MAAM,CAAC;AAC1B,SAAS;AACT,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;AAC/B,YAAY,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;AAClC,SAAS;AACT,QAAQ,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AACnD,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX;AACA;AACA,IAAI,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC/E,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;AAC5C,QAAQ,cAAc,CAAC,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;AACnF,KAAK;AACL,IAAI,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK;AACtD,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE;AAClC,YAAY,MAAM,OAAO,GAAG,EAAE,CAAC;AAC/B,YAAY,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;AAC7D,gBAAgB,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACrD,aAAa;AACb,YAAY,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE;AACnD,gBAAgB,OAAO;AACvB,gBAAgB,IAAI,EAAE,QAAQ,CAAC,IAAI;AACnC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;AAClC,KAAK,CAAC,CAAC;AACP,CAAC;;ACpDM,SAAS,YAAY,CAACA,SAAO,EAAE,WAAW,EAAE;AACnD,IAAI,MAAM,UAAU,GAAGA,SAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACrD,IAAI,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK;AACvC,QAAQ,OAAO,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACnD,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AACjC,QAAQ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;AACrD,QAAQ,QAAQ,EAAEC,OAAO,CAAC,QAAQ;AAClC,KAAK,CAAC,CAAC;AACP,CAAC;;ACPW,MAACC,SAAO,GAAG,YAAY,CAAC,OAAO,EAAE;AAC7C,IAAI,OAAO,EAAE;AACb,QAAQ,YAAY,EAAE,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AACvE,KAAK;AACL,IAAI,MAAM,EAAE,MAAM;AAClB,IAAI,GAAG,EAAE,UAAU;AACnB,CAAC,CAAC,CAAC;AACH,AAAO,SAAS,iBAAiB,CAAC,aAAa,EAAE;AACjD,IAAI,OAAO,YAAY,CAAC,aAAa,EAAE;AACvC,QAAQ,MAAM,EAAE,MAAM;AACtB,QAAQ,GAAG,EAAE,UAAU;AACvB,KAAK,CAAC,CAAC;AACP,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/graphql/package.json b/node_modules/@octokit/graphql/package.json index 78087d9..a26fad7 100644 --- a/node_modules/@octokit/graphql/package.json +++ b/node_modules/@octokit/graphql/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/graphql", "description": "GitHub GraphQL API client for browsers and Node", - "version": "4.5.6", + "version": "4.6.4", "license": "MIT", "files": [ "dist-*/", @@ -15,17 +15,10 @@ "api", "graphql" ], - "homepage": "https://github.com/octokit/graphql.js#readme", - "bugs": { - "url": "https://github.com/octokit/graphql.js/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/octokit/graphql.js.git" - }, + "repository": "github:octokit/graphql.js", "dependencies": { - "@octokit/request": "^5.3.0", - "@octokit/types": "^5.0.0", + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", "universal-user-agent": "^6.0.0" }, "devDependencies": { @@ -37,12 +30,12 @@ "@types/jest": "^26.0.0", "@types/node": "^14.0.4", "fetch-mock": "^9.0.0", - "jest": "^25.1.0", - "prettier": "^2.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": "^25.1.0", - "typescript": "^3.4.5" + "ts-jest": "^27.0.0-next.12", + "typescript": "^4.0.0" }, "publishConfig": { "access": "public" diff --git a/node_modules/@octokit/openapi-types/README.md b/node_modules/@octokit/openapi-types/README.md new file mode 100644 index 0000000..9da833c --- /dev/null +++ b/node_modules/@octokit/openapi-types/README.md @@ -0,0 +1,17 @@ +# @octokit/openapi-types + +> Generated TypeScript definitions based on GitHub's OpenAPI spec + +This package is continously updated based on [GitHub's OpenAPI specification](https://github.com/github/rest-api-description/) + +## Usage + +```ts +import { components } from "@octokit/openapi-types"; + +type Repository = components["schemas"]["full-repository"]; +``` + +## License + +[MIT](LICENSE) diff --git a/node_modules/@octokit/openapi-types/package.json b/node_modules/@octokit/openapi-types/package.json new file mode 100644 index 0000000..c9939fe --- /dev/null +++ b/node_modules/@octokit/openapi-types/package.json @@ -0,0 +1,20 @@ +{ + "name": "@octokit/openapi-types", + "description": "Generated TypeScript definitions based on GitHub's OpenAPI spec for api.github.com", + "repository": { + "type": "git", + "url": "https://github.com/octokit/openapi-types.ts.git", + "directory": "packages/openapi-types" + }, + "publishConfig": { + "access": "public" + }, + "version": "9.7.0", + "main": "", + "types": "types.d.ts", + "author": "Gregor Martynus (https://twitter.com/gr2m)", + "license": "MIT", + "octokit": { + "openapi-version": "3.7.0" + } +} diff --git a/node_modules/@octokit/openapi-types/types.d.ts b/node_modules/@octokit/openapi-types/types.d.ts new file mode 100644 index 0000000..078fcb2 --- /dev/null +++ b/node_modules/@octokit/openapi-types/types.d.ts @@ -0,0 +1,33058 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export interface paths { + "/": { + /** Get Hypermedia links to resources accessible in GitHub's REST API */ + get: operations["meta/root"]; + }; + "/app": { + /** + * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-authenticated"]; + }; + "/app-manifests/{code}/conversions": { + /** Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. */ + post: operations["apps/create-from-manifest"]; + }; + "/app/hook/config": { + /** + * Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-webhook-config-for-app"]; + /** + * Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + patch: operations["apps/update-webhook-config-for-app"]; + }; + "/app/hook/deliveries": { + /** + * Returns a list of webhook deliveries for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/list-webhook-deliveries"]; + }; + "/app/hook/deliveries/{delivery_id}": { + /** + * Returns a delivery for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-webhook-delivery"]; + }; + "/app/hook/deliveries/{delivery_id}/attempts": { + /** + * Redeliver a delivery for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + post: operations["apps/redeliver-webhook-delivery"]; + }; + "/app/installations": { + /** + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * The permissions the installation has are included under the `permissions` key. + */ + get: operations["apps/list-installations"]; + }; + "/app/installations/{installation_id}": { + /** + * Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (`target_type`) will be either an organization or a user account, depending which account the repository belongs to. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-installation"]; + /** + * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/reference/apps/#suspend-an-app-installation)" endpoint. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + delete: operations["apps/delete-installation"]; + }; + "/app/installations/{installation_id}/access_tokens": { + /** + * Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + post: operations["apps/create-installation-access-token"]; + }; + "/app/installations/{installation_id}/suspended": { + /** + * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + put: operations["apps/suspend-installation"]; + /** + * Removes a GitHub App installation suspension. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + delete: operations["apps/unsuspend-installation"]; + }; + "/applications/grants": { + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. + */ + get: operations["oauth-authorizations/list-grants"]; + }; + "/applications/grants/{grant_id}": { + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + get: operations["oauth-authorizations/get-grant"]; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). + */ + delete: operations["oauth-authorizations/delete-grant"]; + }; + "/applications/{client_id}/grant": { + /** + * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. + * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). + */ + delete: operations["apps/delete-authorization"]; + }; + "/applications/{client_id}/grants/{access_token}": { + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted. + * + * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). + */ + delete: operations["apps/revoke-grant-for-application"]; + }; + "/applications/{client_id}/token": { + /** OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. */ + post: operations["apps/check-token"]; + /** OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ + delete: operations["apps/delete-token"]; + /** OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ + patch: operations["apps/reset-token"]; + }; + "/applications/{client_id}/token/scoped": { + /** Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ + post: operations["apps/scope-token"]; + }; + "/applications/{client_id}/tokens/{access_token}": { + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. + */ + get: operations["apps/check-authorization"]; + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. + */ + post: operations["apps/reset-authorization"]; + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. + */ + delete: operations["apps/revoke-authorization-for-application"]; + }; + "/apps/{app_slug}": { + /** + * **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). + * + * If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + get: operations["apps/get-by-slug"]; + }; + "/authorizations": { + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + get: operations["oauth-authorizations/list-authorizations"]; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). + * + * Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * + * To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them. + * + * You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). + * + * Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). + */ + post: operations["oauth-authorizations/create-authorization"]; + }; + "/authorizations/clients/{client_id}": { + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). + * + * Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. + * + * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + */ + put: operations["oauth-authorizations/get-or-create-authorization-for-app"]; + }; + "/authorizations/clients/{client_id}/{fingerprint}": { + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). + * + * This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. + * + * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + */ + put: operations["oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint"]; + }; + "/authorizations/{authorization_id}": { + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + get: operations["oauth-authorizations/get-authorization"]; + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + delete: operations["oauth-authorizations/delete-authorization"]; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * + * You can only send one of these scope keys at a time. + */ + patch: operations["oauth-authorizations/update-authorization"]; + }; + "/codes_of_conduct": { + get: operations["codes-of-conduct/get-all-codes-of-conduct"]; + }; + "/codes_of_conduct/{key}": { + get: operations["codes-of-conduct/get-conduct-code"]; + }; + "/emojis": { + /** Lists all the emojis available to use on GitHub. */ + get: operations["emojis/get"]; + }; + "/enterprises/{enterprise}/actions/permissions": { + /** + * Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/get-github-actions-permissions-enterprise"]; + /** + * Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/set-github-actions-permissions-enterprise"]; + }; + "/enterprises/{enterprise}/actions/permissions/organizations": { + /** + * Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/list-selected-organizations-enabled-github-actions-enterprise"]; + /** + * Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/set-selected-organizations-enabled-github-actions-enterprise"]; + }; + "/enterprises/{enterprise}/actions/permissions/organizations/{org_id}": { + /** + * Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/enable-selected-organization-github-actions-enterprise"]; + /** + * Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + delete: operations["enterprise-admin/disable-selected-organization-github-actions-enterprise"]; + }; + "/enterprises/{enterprise}/actions/permissions/selected-actions": { + /** + * Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/get-allowed-actions-enterprise"]; + /** + * Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/set-allowed-actions-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runner-groups": { + /** + * Lists all self-hosted runner groups for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/list-self-hosted-runner-groups-for-enterprise"]; + /** + * Creates a new self-hosted runner group for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + post: operations["enterprise-admin/create-self-hosted-runner-group-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}": { + /** + * Gets a specific self-hosted runner group for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/get-self-hosted-runner-group-for-enterprise"]; + /** + * Deletes a self-hosted runner group for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + delete: operations["enterprise-admin/delete-self-hosted-runner-group-from-enterprise"]; + /** + * Updates the `name` and `visibility` of a self-hosted runner group in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + patch: operations["enterprise-admin/update-self-hosted-runner-group-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations": { + /** + * Lists the organizations with access to a self-hosted runner group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/list-org-access-to-self-hosted-runner-group-in-enterprise"]; + /** + * Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/set-org-access-to-self-hosted-runner-group-in-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}": { + /** + * Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/add-org-access-to-self-hosted-runner-group-in-enterprise"]; + /** + * Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + delete: operations["enterprise-admin/remove-org-access-to-self-hosted-runner-group-in-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners": { + /** + * Lists the self-hosted runners that are in a specific enterprise group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/list-self-hosted-runners-in-group-for-enterprise"]; + /** + * Replaces the list of self-hosted runners that are part of an enterprise runner group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + put: operations["enterprise-admin/set-self-hosted-runners-in-group-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": { + /** + * Adds a self-hosted runner to a runner group configured in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` + * scope to use this endpoint. + */ + put: operations["enterprise-admin/add-self-hosted-runner-to-group-for-enterprise"]; + /** + * Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + delete: operations["enterprise-admin/remove-self-hosted-runner-from-group-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runners": { + /** + * Lists all self-hosted runners configured for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/list-self-hosted-runners-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runners/downloads": { + /** + * Lists binaries for the runner application that you can download and run. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/list-runner-applications-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runners/registration-token": { + /** + * Returns a token that you can pass to the `config` script. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + * + * #### Example using registration token + * + * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. + * + * ``` + * ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN + * ``` + */ + post: operations["enterprise-admin/create-registration-token-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runners/remove-token": { + /** + * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + * + * #### Example using remove token + * + * To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this + * endpoint. + * + * ``` + * ./config.sh remove --token TOKEN + * ``` + */ + post: operations["enterprise-admin/create-remove-token-for-enterprise"]; + }; + "/enterprises/{enterprise}/actions/runners/{runner_id}": { + /** + * Gets a specific self-hosted runner configured in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + get: operations["enterprise-admin/get-self-hosted-runner-for-enterprise"]; + /** + * Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + delete: operations["enterprise-admin/delete-self-hosted-runner-from-enterprise"]; + }; + "/enterprises/{enterprise}/audit-log": { + /** Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the `admin:enterprise` scope. */ + get: operations["enterprise-admin/get-audit-log"]; + }; + "/enterprises/{enterprise}/settings/billing/actions": { + /** + * Gets the summary of the free and paid GitHub Actions minutes used. + * + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * The authenticated user must be an enterprise admin. + */ + get: operations["billing/get-github-actions-billing-ghe"]; + }; + "/enterprises/{enterprise}/settings/billing/packages": { + /** + * Gets the free and paid storage used for GitHub Packages in gigabytes. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * The authenticated user must be an enterprise admin. + */ + get: operations["billing/get-github-packages-billing-ghe"]; + }; + "/enterprises/{enterprise}/settings/billing/shared-storage": { + /** + * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * The authenticated user must be an enterprise admin. + */ + get: operations["billing/get-shared-storage-billing-ghe"]; + }; + "/events": { + /** We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. */ + get: operations["activity/list-public-events"]; + }; + "/feeds": { + /** + * GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: + * + * * **Timeline**: The GitHub global public timeline + * * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) + * * **Current user public**: The public timeline for the authenticated user + * * **Current user**: The private timeline for the authenticated user + * * **Current user actor**: The private timeline for activity created by the authenticated user + * * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. + * * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. + * + * **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. + */ + get: operations["activity/get-feeds"]; + }; + "/gists": { + /** Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: */ + get: operations["gists/list"]; + /** + * Allows you to add a new gist with one or more files. + * + * **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. + */ + post: operations["gists/create"]; + }; + "/gists/public": { + /** + * List public gists sorted by most recently updated to least recently updated. + * + * Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. + */ + get: operations["gists/list-public"]; + }; + "/gists/starred": { + /** List the authenticated user's starred gists: */ + get: operations["gists/list-starred"]; + }; + "/gists/{gist_id}": { + get: operations["gists/get"]; + delete: operations["gists/delete"]; + /** Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. */ + patch: operations["gists/update"]; + }; + "/gists/{gist_id}/comments": { + get: operations["gists/list-comments"]; + post: operations["gists/create-comment"]; + }; + "/gists/{gist_id}/comments/{comment_id}": { + get: operations["gists/get-comment"]; + delete: operations["gists/delete-comment"]; + patch: operations["gists/update-comment"]; + }; + "/gists/{gist_id}/commits": { + get: operations["gists/list-commits"]; + }; + "/gists/{gist_id}/forks": { + get: operations["gists/list-forks"]; + /** **Note**: This was previously `/gists/:gist_id/fork`. */ + post: operations["gists/fork"]; + }; + "/gists/{gist_id}/star": { + get: operations["gists/check-is-starred"]; + /** Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ + put: operations["gists/star"]; + delete: operations["gists/unstar"]; + }; + "/gists/{gist_id}/{sha}": { + get: operations["gists/get-revision"]; + }; + "/gitignore/templates": { + /** List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). */ + get: operations["gitignore/get-all-templates"]; + }; + "/gitignore/templates/{name}": { + /** + * The API also allows fetching the source of a single template. + * Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. + */ + get: operations["gitignore/get-template"]; + }; + "/installation/repositories": { + /** + * List repositories that an app installation can access. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + get: operations["apps/list-repos-accessible-to-installation"]; + }; + "/installation/token": { + /** + * Revokes the installation token you're using to authenticate as an installation and access this endpoint. + * + * Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + delete: operations["apps/revoke-installation-access-token"]; + }; + "/issues": { + /** + * List issues assigned to the authenticated user across all visible repositories including owned repositories, member + * repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not + * necessarily assigned to you. + * + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + get: operations["issues/list"]; + }; + "/licenses": { + get: operations["licenses/get-all-commonly-used"]; + }; + "/licenses/{license}": { + get: operations["licenses/get"]; + }; + "/markdown": { + post: operations["markdown/render"]; + }; + "/markdown/raw": { + /** You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. */ + post: operations["markdown/render-raw"]; + }; + "/marketplace_listing/accounts/{account_id}": { + /** + * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + get: operations["apps/get-subscription-plan-for-account"]; + }; + "/marketplace_listing/plans": { + /** + * Lists all plans that are part of your GitHub Marketplace listing. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + get: operations["apps/list-plans"]; + }; + "/marketplace_listing/plans/{plan_id}/accounts": { + /** + * Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + get: operations["apps/list-accounts-for-plan"]; + }; + "/marketplace_listing/stubbed/accounts/{account_id}": { + /** + * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + get: operations["apps/get-subscription-plan-for-account-stubbed"]; + }; + "/marketplace_listing/stubbed/plans": { + /** + * Lists all plans that are part of your GitHub Marketplace listing. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + get: operations["apps/list-plans-stubbed"]; + }; + "/marketplace_listing/stubbed/plans/{plan_id}/accounts": { + /** + * Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + get: operations["apps/list-accounts-for-plan-stubbed"]; + }; + "/meta": { + /** + * Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." + * + * **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. + */ + get: operations["meta/get"]; + }; + "/networks/{owner}/{repo}/events": { + get: operations["activity/list-public-events-for-repo-network"]; + }; + "/notifications": { + /** List all notifications for the current user, sorted by most recently updated. */ + get: operations["activity/list-notifications-for-authenticated-user"]; + /** Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ + put: operations["activity/mark-notifications-as-read"]; + }; + "/notifications/threads/{thread_id}": { + get: operations["activity/get-thread"]; + patch: operations["activity/mark-thread-as-read"]; + }; + "/notifications/threads/{thread_id}/subscription": { + /** + * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). + * + * Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. + */ + get: operations["activity/get-thread-subscription-for-authenticated-user"]; + /** + * If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. + * + * You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. + * + * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. + */ + put: operations["activity/set-thread-subscription"]; + /** Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`. */ + delete: operations["activity/delete-thread-subscription"]; + }; + "/octocat": { + /** Get the octocat as ASCII art */ + get: operations["meta/get-octocat"]; + }; + "/organizations": { + /** + * Lists all organizations, in the order that they were created on GitHub. + * + * **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. + */ + get: operations["orgs/list"]; + }; + "/orgs/{org}": { + /** + * To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + * + * GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." + */ + get: operations["orgs/get"]; + /** + * **Parameter Deprecation Notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + * + * Enables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges. + */ + patch: operations["orgs/update"]; + }; + "/orgs/{org}/actions/permissions": { + /** + * Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + get: operations["actions/get-github-actions-permissions-organization"]; + /** + * Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. + * + * If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + put: operations["actions/set-github-actions-permissions-organization"]; + }; + "/orgs/{org}/actions/permissions/repositories": { + /** + * Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + get: operations["actions/list-selected-repositories-enabled-github-actions-organization"]; + /** + * Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + put: operations["actions/set-selected-repositories-enabled-github-actions-organization"]; + }; + "/orgs/{org}/actions/permissions/repositories/{repository_id}": { + /** + * Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + put: operations["actions/enable-selected-repository-github-actions-organization"]; + /** + * Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + delete: operations["actions/disable-selected-repository-github-actions-organization"]; + }; + "/orgs/{org}/actions/permissions/selected-actions": { + /** + * Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + get: operations["actions/get-allowed-actions-organization"]; + /** + * Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. + * + * To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + put: operations["actions/set-allowed-actions-organization"]; + }; + "/orgs/{org}/actions/runner-groups": { + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/list-self-hosted-runner-groups-for-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Creates a new self-hosted runner group for an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + post: operations["actions/create-self-hosted-runner-group-for-org"]; + }; + "/orgs/{org}/actions/runner-groups/{runner_group_id}": { + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Gets a specific self-hosted runner group for an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/get-self-hosted-runner-group-for-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Deletes a self-hosted runner group for an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + delete: operations["actions/delete-self-hosted-runner-group-from-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Updates the `name` and `visibility` of a self-hosted runner group in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + patch: operations["actions/update-self-hosted-runner-group-for-org"]; + }; + "/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": { + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Lists the repositories with access to a self-hosted runner group configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/list-repo-access-to-self-hosted-runner-group-in-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + put: operations["actions/set-repo-access-to-self-hosted-runner-group-in-org"]; + }; + "/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}": { + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` + * scope to use this endpoint. + */ + put: operations["actions/add-repo-access-to-self-hosted-runner-group-in-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + delete: operations["actions/remove-repo-access-to-self-hosted-runner-group-in-org"]; + }; + "/orgs/{org}/actions/runner-groups/{runner_group_id}/runners": { + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Lists self-hosted runners that are in a specific organization group. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/list-self-hosted-runners-in-group-for-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Replaces the list of self-hosted runners that are part of an organization runner group. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + put: operations["actions/set-self-hosted-runners-in-group-for-org"]; + }; + "/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": { + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Adds a self-hosted runner to a runner group configured in an organization. + * + * You must authenticate using an access token with the `admin:org` + * scope to use this endpoint. + */ + put: operations["actions/add-self-hosted-runner-to-group-for-org"]; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + delete: operations["actions/remove-self-hosted-runner-from-group-for-org"]; + }; + "/orgs/{org}/actions/runners": { + /** + * Lists all self-hosted runners configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/list-self-hosted-runners-for-org"]; + }; + "/orgs/{org}/actions/runners/downloads": { + /** + * Lists binaries for the runner application that you can download and run. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/list-runner-applications-for-org"]; + }; + "/orgs/{org}/actions/runners/registration-token": { + /** + * Returns a token that you can pass to the `config` script. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + * + * #### Example using registration token + * + * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. + * + * ``` + * ./config.sh --url https://github.com/octo-org --token TOKEN + * ``` + */ + post: operations["actions/create-registration-token-for-org"]; + }; + "/orgs/{org}/actions/runners/remove-token": { + /** + * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + * + * #### Example using remove token + * + * To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this + * endpoint. + * + * ``` + * ./config.sh remove --token TOKEN + * ``` + */ + post: operations["actions/create-remove-token-for-org"]; + }; + "/orgs/{org}/actions/runners/{runner_id}": { + /** + * Gets a specific self-hosted runner configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + get: operations["actions/get-self-hosted-runner-for-org"]; + /** + * Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + delete: operations["actions/delete-self-hosted-runner-from-org"]; + }; + "/orgs/{org}/actions/secrets": { + /** Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + get: operations["actions/list-org-secrets"]; + }; + "/orgs/{org}/actions/secrets/public-key": { + /** Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + get: operations["actions/get-org-public-key"]; + }; + "/orgs/{org}/actions/secrets/{secret_name}": { + /** Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + get: operations["actions/get-org-secret"]; + /** + * Creates or updates an organization secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to + * use this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + put: operations["actions/create-or-update-org-secret"]; + /** Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + delete: operations["actions/delete-org-secret"]; + }; + "/orgs/{org}/actions/secrets/{secret_name}/repositories": { + /** Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + get: operations["actions/list-selected-repos-for-org-secret"]; + /** Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + put: operations["actions/set-selected-repos-for-org-secret"]; + }; + "/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}": { + /** Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + put: operations["actions/add-selected-repo-to-org-secret"]; + /** Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + delete: operations["actions/remove-selected-repo-from-org-secret"]; + }; + "/orgs/{org}/audit-log": { + /** + * Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." + * + * To use this endpoint, you must be an organization owner, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `organization_administration` read permission to use this endpoint. + */ + get: operations["orgs/get-audit-log"]; + }; + "/orgs/{org}/blocks": { + /** List the users blocked by an organization. */ + get: operations["orgs/list-blocked-users"]; + }; + "/orgs/{org}/blocks/{username}": { + get: operations["orgs/check-blocked-user"]; + put: operations["orgs/block-user"]; + delete: operations["orgs/unblock-user"]; + }; + "/orgs/{org}/credential-authorizations": { + /** + * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). + * + * An authenticated organization owner with the `read:org` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). + */ + get: operations["orgs/list-saml-sso-authorizations"]; + }; + "/orgs/{org}/credential-authorizations/{credential_id}": { + /** + * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). + * + * An authenticated organization owner with the `admin:org` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. + */ + delete: operations["orgs/remove-saml-sso-authorization"]; + }; + "/orgs/{org}/events": { + get: operations["activity/list-public-org-events"]; + }; + "/orgs/{org}/failed_invitations": { + /** The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. */ + get: operations["orgs/list-failed-invitations"]; + }; + "/orgs/{org}/hooks": { + get: operations["orgs/list-webhooks"]; + /** Here's how you can create a hook that posts payloads in JSON format: */ + post: operations["orgs/create-webhook"]; + }; + "/orgs/{org}/hooks/{hook_id}": { + /** Returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." */ + get: operations["orgs/get-webhook"]; + delete: operations["orgs/delete-webhook"]; + /** Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." */ + patch: operations["orgs/update-webhook"]; + }; + "/orgs/{org}/hooks/{hook_id}/config": { + /** + * Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." + * + * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission. + */ + get: operations["orgs/get-webhook-config-for-org"]; + /** + * Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." + * + * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission. + */ + patch: operations["orgs/update-webhook-config-for-org"]; + }; + "/orgs/{org}/hooks/{hook_id}/deliveries": { + /** Returns a list of webhook deliveries for a webhook configured in an organization. */ + get: operations["orgs/list-webhook-deliveries"]; + }; + "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}": { + /** Returns a delivery for a webhook configured in an organization. */ + get: operations["orgs/get-webhook-delivery"]; + }; + "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts": { + /** Redeliver a delivery for a webhook configured in an organization. */ + post: operations["orgs/redeliver-webhook-delivery"]; + }; + "/orgs/{org}/hooks/{hook_id}/pings": { + /** This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ + post: operations["orgs/ping-webhook"]; + }; + "/orgs/{org}/installation": { + /** + * Enables an authenticated GitHub App to find the organization's installation information. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-org-installation"]; + }; + "/orgs/{org}/installations": { + /** Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with `admin:read` scope to use this endpoint. */ + get: operations["orgs/list-app-installations"]; + }; + "/orgs/{org}/interaction-limits": { + /** Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. */ + get: operations["interactions/get-restrictions-for-org"]; + /** Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. */ + put: operations["interactions/set-restrictions-for-org"]; + /** Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. */ + delete: operations["interactions/remove-restrictions-for-org"]; + }; + "/orgs/{org}/invitations": { + /** The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ + get: operations["orgs/list-pending-invitations"]; + /** + * Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["orgs/create-invitation"]; + }; + "/orgs/{org}/invitations/{invitation_id}": { + /** + * Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). + */ + delete: operations["orgs/cancel-invitation"]; + }; + "/orgs/{org}/invitations/{invitation_id}/teams": { + /** List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. */ + get: operations["orgs/list-invitation-teams"]; + }; + "/orgs/{org}/issues": { + /** + * List issues in an organization assigned to the authenticated user. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + get: operations["issues/list-for-org"]; + }; + "/orgs/{org}/members": { + /** List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. */ + get: operations["orgs/list-members"]; + }; + "/orgs/{org}/members/{username}": { + /** Check if a user is, publicly or privately, a member of the organization. */ + get: operations["orgs/check-membership-for-user"]; + /** Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. */ + delete: operations["orgs/remove-member"]; + }; + "/orgs/{org}/memberships/{username}": { + /** In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. */ + get: operations["orgs/get-membership-for-user"]; + /** + * Only authenticated organization owners can add a member to the organization or update the member's role. + * + * * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. + * + * * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. + * + * **Rate limits** + * + * To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + */ + put: operations["orgs/set-membership-for-user"]; + /** + * In order to remove a user's membership with an organization, the authenticated user must be an organization owner. + * + * If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + */ + delete: operations["orgs/remove-membership-for-user"]; + }; + "/orgs/{org}/migrations": { + /** Lists the most recent migrations. */ + get: operations["migrations/list-for-org"]; + /** Initiates the generation of a migration archive. */ + post: operations["migrations/start-for-org"]; + }; + "/orgs/{org}/migrations/{migration_id}": { + /** + * Fetches the status of a migration. + * + * The `state` of a migration can be one of the following values: + * + * * `pending`, which means the migration hasn't started yet. + * * `exporting`, which means the migration is in progress. + * * `exported`, which means the migration finished successfully. + * * `failed`, which means the migration failed. + */ + get: operations["migrations/get-status-for-org"]; + }; + "/orgs/{org}/migrations/{migration_id}/archive": { + /** Fetches the URL to a migration archive. */ + get: operations["migrations/download-archive-for-org"]; + /** Deletes a previous migration archive. Migration archives are automatically deleted after seven days. */ + delete: operations["migrations/delete-archive-for-org"]; + }; + "/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock": { + /** Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. */ + delete: operations["migrations/unlock-repo-for-org"]; + }; + "/orgs/{org}/migrations/{migration_id}/repositories": { + /** List all the repositories for this organization migration. */ + get: operations["migrations/list-repos-for-org"]; + }; + "/orgs/{org}/outside_collaborators": { + /** List all users who are outside collaborators of an organization. */ + get: operations["orgs/list-outside-collaborators"]; + }; + "/orgs/{org}/outside_collaborators/{username}": { + /** When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". */ + put: operations["orgs/convert-member-to-outside-collaborator"]; + /** Removing a user from this list will remove them from all the organization's repositories. */ + delete: operations["orgs/remove-outside-collaborator"]; + }; + "/orgs/{org}/packages/{package_type}/{package_name}": { + /** + * Gets a specific package in an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-package-for-organization"]; + /** + * Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. + */ + delete: operations["packages/delete-package-for-org"]; + }; + "/orgs/{org}/packages/{package_type}/{package_name}/restore": { + /** + * Restores an entire package in an organization. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. + */ + post: operations["packages/restore-package-for-org"]; + }; + "/orgs/{org}/packages/{package_type}/{package_name}/versions": { + /** + * Returns all package versions for a package owned by an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-all-package-versions-for-package-owned-by-org"]; + }; + "/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}": { + /** + * Gets a specific package version in an organization. + * + * You must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-package-version-for-organization"]; + /** + * Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. + */ + delete: operations["packages/delete-package-version-for-org"]; + }; + "/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore": { + /** + * Restores a specific package version in an organization. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. + */ + post: operations["packages/restore-package-version-for-org"]; + }; + "/orgs/{org}/projects": { + /** Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + get: operations["projects/list-for-org"]; + /** Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + post: operations["projects/create-for-org"]; + }; + "/orgs/{org}/public_members": { + /** Members of an organization can choose to have their membership publicized or not. */ + get: operations["orgs/list-public-members"]; + }; + "/orgs/{org}/public_members/{username}": { + get: operations["orgs/check-public-membership-for-user"]; + /** + * The user can publicize their own membership. (A user cannot publicize the membership for another user.) + * + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + put: operations["orgs/set-public-membership-for-authenticated-user"]; + delete: operations["orgs/remove-public-membership-for-authenticated-user"]; + }; + "/orgs/{org}/repos": { + /** Lists repositories for the specified organization. */ + get: operations["repos/list-for-org"]; + /** + * Creates a new repository in the specified organization. The authenticated user must be a member of the organization. + * + * **OAuth scope requirements** + * + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository + */ + post: operations["repos/create-in-org"]; + }; + "/orgs/{org}/settings/billing/actions": { + /** + * Gets the summary of the free and paid GitHub Actions minutes used. + * + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * Access tokens must have the `repo` or `admin:org` scope. + */ + get: operations["billing/get-github-actions-billing-org"]; + }; + "/orgs/{org}/settings/billing/packages": { + /** + * Gets the free and paid storage used for GitHub Packages in gigabytes. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `repo` or `admin:org` scope. + */ + get: operations["billing/get-github-packages-billing-org"]; + }; + "/orgs/{org}/settings/billing/shared-storage": { + /** + * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `repo` or `admin:org` scope. + */ + get: operations["billing/get-shared-storage-billing-org"]; + }; + "/orgs/{org}/team-sync/groups": { + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * List IdP groups available in an organization. You can limit your page results using the `per_page` parameter. GitHub generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." + * + * The `per_page` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user `octocat` wants to see two groups per page in `octo-org` via cURL, it would look like this: + */ + get: operations["teams/list-idp-groups-for-org"]; + }; + "/orgs/{org}/teams": { + /** Lists all teams in an organization that are visible to the authenticated user. */ + get: operations["teams/list"]; + /** + * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." + * + * When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". + */ + post: operations["teams/create"]; + }; + "/orgs/{org}/teams/{team_slug}": { + /** + * Gets a team using the team's `slug`. GitHub generates the `slug` from the team `name`. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. + */ + get: operations["teams/get-by-name"]; + /** + * To delete a team, the authenticated user must be an organization owner or team maintainer. + * + * If you are an organization owner, deleting a parent team will delete all of its child teams as well. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. + */ + delete: operations["teams/delete-in-org"]; + /** + * To edit a team, the authenticated user must either be an organization owner or a team maintainer. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. + */ + patch: operations["teams/update-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions": { + /** + * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. + */ + get: operations["teams/list-discussions-in-org"]; + /** + * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. + */ + post: operations["teams/create-discussion-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}": { + /** + * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + */ + get: operations["teams/get-discussion-in-org"]; + /** + * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + */ + delete: operations["teams/delete-discussion-in-org"]; + /** + * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + */ + patch: operations["teams/update-discussion-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments": { + /** + * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. + */ + get: operations["teams/list-discussion-comments-in-org"]; + /** + * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. + */ + post: operations["teams/create-discussion-comment-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}": { + /** + * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + */ + get: operations["teams/get-discussion-comment-in-org"]; + /** + * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + */ + delete: operations["teams/delete-discussion-comment-in-org"]; + /** + * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + */ + patch: operations["teams/update-discussion-comment-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions": { + /** + * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + */ + get: operations["reactions/list-for-team-discussion-comment-in-org"]; + /** + * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + */ + post: operations["reactions/create-for-team-discussion-comment-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}": { + /** + * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. + * + * Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + delete: operations["reactions/delete-for-team-discussion-comment"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions": { + /** + * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + */ + get: operations["reactions/list-for-team-discussion-in-org"]; + /** + * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + */ + post: operations["reactions/create-for-team-discussion-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}": { + /** + * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. + * + * Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + delete: operations["reactions/delete-for-team-discussion"]; + }; + "/orgs/{org}/teams/{team_slug}/invitations": { + /** + * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. + */ + get: operations["teams/list-pending-invitations-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/members": { + /** + * Team members will include the members of child teams. + * + * To list members in a team, the team must be visible to the authenticated user. + */ + get: operations["teams/list-members-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/memberships/{username}": { + /** + * Team members will include the members of child teams. + * + * To get a user's membership with a team, the team must be visible to the authenticated user. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. + * + * **Note:** + * The response contains the `state` of the membership and the member's `role`. + * + * The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + */ + get: operations["teams/get-membership-for-user-in-org"]; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. + * + * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. + */ + put: operations["teams/add-or-update-membership-for-user-in-org"]; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. + */ + delete: operations["teams/remove-membership-for-user-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/projects": { + /** + * Lists the organization projects for a team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. + */ + get: operations["teams/list-projects-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/projects/{project_id}": { + /** + * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + */ + get: operations["teams/check-permissions-for-project-in-org"]; + /** + * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + */ + put: operations["teams/add-or-update-project-permissions-in-org"]; + /** + * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + */ + delete: operations["teams/remove-project-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/repos": { + /** + * Lists a team's repositories visible to the authenticated user. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. + */ + get: operations["teams/list-repos-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}": { + /** + * Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. + * + * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header. + * + * If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + */ + get: operations["teams/check-permissions-for-repo-in-org"]; + /** + * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + * + * For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + */ + put: operations["teams/add-or-update-repo-permissions-in-org"]; + /** + * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + */ + delete: operations["teams/remove-repo-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/team-sync/group-mappings": { + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * List IdP groups connected to a team on GitHub. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. + */ + get: operations["teams/list-idp-groups-in-org"]; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. + */ + patch: operations["teams/create-or-update-idp-group-connections-in-org"]; + }; + "/orgs/{org}/teams/{team_slug}/teams": { + /** + * Lists the child teams of the team specified by `{team_slug}`. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. + */ + get: operations["teams/list-child-in-org"]; + }; + "/projects/columns/cards/{card_id}": { + get: operations["projects/get-card"]; + delete: operations["projects/delete-card"]; + patch: operations["projects/update-card"]; + }; + "/projects/columns/cards/{card_id}/moves": { + post: operations["projects/move-card"]; + }; + "/projects/columns/{column_id}": { + get: operations["projects/get-column"]; + delete: operations["projects/delete-column"]; + patch: operations["projects/update-column"]; + }; + "/projects/columns/{column_id}/cards": { + get: operations["projects/list-cards"]; + post: operations["projects/create-card"]; + }; + "/projects/columns/{column_id}/moves": { + post: operations["projects/move-column"]; + }; + "/projects/{project_id}": { + /** Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + get: operations["projects/get"]; + /** Deletes a project board. Returns a `404 Not Found` status if projects are disabled. */ + delete: operations["projects/delete"]; + /** Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + patch: operations["projects/update"]; + }; + "/projects/{project_id}/collaborators": { + /** Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. */ + get: operations["projects/list-collaborators"]; + }; + "/projects/{project_id}/collaborators/{username}": { + /** Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. */ + put: operations["projects/add-collaborator"]; + /** Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. */ + delete: operations["projects/remove-collaborator"]; + }; + "/projects/{project_id}/collaborators/{username}/permission": { + /** Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. */ + get: operations["projects/get-permission-for-user"]; + }; + "/projects/{project_id}/columns": { + get: operations["projects/list-columns"]; + post: operations["projects/create-column"]; + }; + "/rate_limit": { + /** + * **Note:** Accessing this endpoint does not count against your REST API rate limit. + * + * **Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + */ + get: operations["rate-limit/get"]; + }; + "/reactions/{reaction_id}": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). + * + * OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). + */ + delete: operations["reactions/delete-legacy"]; + }; + "/repos/{owner}/{repo}": { + /** + * When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. + * + * The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. + */ + get: operations["repos/get"]; + /** + * Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. + * + * If an organization owner has configured the organization to prevent members from deleting organization-owned + * repositories, you will get a `403 Forbidden` response. + */ + delete: operations["repos/delete"]; + /** **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. */ + patch: operations["repos/update"]; + }; + "/repos/{owner}/{repo}/actions/artifacts": { + /** Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/list-artifacts-for-repo"]; + }; + "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}": { + /** Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/get-artifact"]; + /** Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + delete: operations["actions/delete-artifact"]; + }; + "/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}": { + /** + * Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + * the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to + * the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. + * GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + get: operations["actions/download-artifact"]; + }; + "/repos/{owner}/{repo}/actions/jobs/{job_id}": { + /** Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/get-job-for-workflow-run"]; + }; + "/repos/{owner}/{repo}/actions/jobs/{job_id}/logs": { + /** + * Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look + * for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can + * use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must + * have the `actions:read` permission to use this endpoint. + */ + get: operations["actions/download-job-logs-for-workflow-run"]; + }; + "/repos/{owner}/{repo}/actions/permissions": { + /** + * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. + * + * You must authenticate using an access token with the `repo` scope to use this + * endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + get: operations["actions/get-github-actions-permissions-repository"]; + /** + * Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. + * + * If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + put: operations["actions/set-github-actions-permissions-repository"]; + }; + "/repos/{owner}/{repo}/actions/permissions/selected-actions": { + /** + * Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + get: operations["actions/get-allowed-actions-repository"]; + /** + * Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + * + * If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. + * + * To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + put: operations["actions/set-allowed-actions-repository"]; + }; + "/repos/{owner}/{repo}/actions/runners": { + /** Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. */ + get: operations["actions/list-self-hosted-runners-for-repo"]; + }; + "/repos/{owner}/{repo}/actions/runners/downloads": { + /** + * Lists binaries for the runner application that you can download and run. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. + */ + get: operations["actions/list-runner-applications-for-repo"]; + }; + "/repos/{owner}/{repo}/actions/runners/registration-token": { + /** + * Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate + * using an access token with the `repo` scope to use this endpoint. + * + * #### Example using registration token + * + * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. + * + * ``` + * ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN + * ``` + */ + post: operations["actions/create-registration-token-for-repo"]; + }; + "/repos/{owner}/{repo}/actions/runners/remove-token": { + /** + * Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. + * You must authenticate using an access token with the `repo` scope to use this endpoint. + * + * #### Example using remove token + * + * To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. + * + * ``` + * ./config.sh remove --token TOKEN + * ``` + */ + post: operations["actions/create-remove-token-for-repo"]; + }; + "/repos/{owner}/{repo}/actions/runners/{runner_id}": { + /** + * Gets a specific self-hosted runner configured in a repository. + * + * You must authenticate using an access token with the `repo` scope to use this + * endpoint. + */ + get: operations["actions/get-self-hosted-runner-for-repo"]; + /** + * Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + * + * You must authenticate using an access token with the `repo` + * scope to use this endpoint. + */ + delete: operations["actions/delete-self-hosted-runner-from-repo"]; + }; + "/repos/{owner}/{repo}/actions/runs": { + /** + * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * + * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + get: operations["actions/list-workflow-runs-for-repo"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}": { + /** Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/get-workflow-run"]; + /** + * Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is + * private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use + * this endpoint. + */ + delete: operations["actions/delete-workflow-run"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/approvals": { + /** Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/get-reviews-for-run"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/approve": { + /** + * Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + post: operations["actions/approve-workflow-run"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts": { + /** Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/list-workflow-run-artifacts"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/cancel": { + /** Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + post: operations["actions/cancel-workflow-run"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/jobs": { + /** Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). */ + get: operations["actions/list-jobs-for-workflow-run"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/logs": { + /** + * Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for + * `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use + * this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have + * the `actions:read` permission to use this endpoint. + */ + get: operations["actions/download-workflow-run-logs"]; + /** Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + delete: operations["actions/delete-workflow-run-logs"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments": { + /** + * Get all deployment environments for a workflow run that are waiting for protection rules to pass. + * + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + get: operations["actions/get-pending-deployments-for-run"]; + /** + * Approve or reject pending deployments that are waiting on approval by a required reviewer. + * + * Anyone with read access to the repository contents and deployments can use this endpoint. + */ + post: operations["actions/review-pending-deployments-for-run"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/rerun": { + /** Re-runs your workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + post: operations["actions/re-run-workflow"]; + }; + "/repos/{owner}/{repo}/actions/runs/{run_id}/timing": { + /** + * Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + get: operations["actions/get-workflow-run-usage"]; + }; + "/repos/{owner}/{repo}/actions/secrets": { + /** Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + get: operations["actions/list-repo-secrets"]; + }; + "/repos/{owner}/{repo}/actions/secrets/public-key": { + /** Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + get: operations["actions/get-repo-public-key"]; + }; + "/repos/{owner}/{repo}/actions/secrets/{secret_name}": { + /** Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + get: operations["actions/get-repo-secret"]; + /** + * Creates or updates a repository secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use + * this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + put: operations["actions/create-or-update-repo-secret"]; + /** Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + delete: operations["actions/delete-repo-secret"]; + }; + "/repos/{owner}/{repo}/actions/workflows": { + /** Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/list-repo-workflows"]; + }; + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}": { + /** Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["actions/get-workflow"]; + }; + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable": { + /** + * Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + put: operations["actions/disable-workflow"]; + }; + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": { + /** + * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." + */ + post: operations["actions/create-workflow-dispatch"]; + }; + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable": { + /** + * Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + put: operations["actions/enable-workflow"]; + }; + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs": { + /** + * List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * + * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. + */ + get: operations["actions/list-workflow-runs"]; + }; + "/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing": { + /** + * Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + get: operations["actions/get-workflow-usage"]; + }; + "/repos/{owner}/{repo}/assignees": { + /** Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. */ + get: operations["issues/list-assignees"]; + }; + "/repos/{owner}/{repo}/assignees/{assignee}": { + /** + * Checks if a user has permission to be assigned to an issue in this repository. + * + * If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. + * + * Otherwise a `404` status code is returned. + */ + get: operations["issues/check-user-can-be-assigned"]; + }; + "/repos/{owner}/{repo}/autolinks": { + /** + * This returns a list of autolinks configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + get: operations["repos/list-autolinks"]; + /** Users with admin access to the repository can create an autolink. */ + post: operations["repos/create-autolink"]; + }; + "/repos/{owner}/{repo}/autolinks/{autolink_id}": { + /** + * This returns a single autolink reference by ID that was configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + get: operations["repos/get-autolink"]; + /** + * This deletes a single autolink reference by ID that was configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + delete: operations["repos/delete-autolink"]; + }; + "/repos/{owner}/{repo}/automated-security-fixes": { + /** Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ + put: operations["repos/enable-automated-security-fixes"]; + /** Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ + delete: operations["repos/disable-automated-security-fixes"]; + }; + "/repos/{owner}/{repo}/branches": { + get: operations["repos/list-branches"]; + }; + "/repos/{owner}/{repo}/branches/{branch}": { + get: operations["repos/get-branch"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection": { + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + get: operations["repos/get-branch-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Protecting a branch requires admin or owner permissions to the repository. + * + * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. + * + * **Note**: The list of users, apps, and teams in total is limited to 100 items. + */ + put: operations["repos/update-branch-protection"]; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + delete: operations["repos/delete-branch-protection"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins": { + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + get: operations["repos/get-admin-branch-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + */ + post: operations["repos/set-admin-branch-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + */ + delete: operations["repos/delete-admin-branch-protection"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews": { + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + get: operations["repos/get-pull-request-review-protection"]; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + delete: operations["repos/delete-pull-request-review-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * + * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. + */ + patch: operations["repos/update-pull-request-review-protection"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures": { + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. + * + * **Note**: You must enable branch protection to require signed commits. + */ + get: operations["repos/get-commit-signature-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. + */ + post: operations["repos/create-commit-signature-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. + */ + delete: operations["repos/delete-commit-signature-protection"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks": { + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + get: operations["repos/get-status-checks-protection"]; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + delete: operations["repos/remove-status-check-protection"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + */ + patch: operations["repos/update-status-check-protection"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": { + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + get: operations["repos/get-all-status-check-contexts"]; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + put: operations["repos/set-status-check-contexts"]; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + post: operations["repos/add-status-check-contexts"]; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + delete: operations["repos/remove-status-check-contexts"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions": { + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists who has access to this protected branch. + * + * **Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories. + */ + get: operations["repos/get-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Disables the ability to restrict who can push to this branch. + */ + delete: operations["repos/delete-access-restrictions"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": { + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + */ + get: operations["repos/get-apps-with-access-to-protected-branch"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + * + * | Type | Description | + * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + put: operations["repos/set-app-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + * + * | Type | Description | + * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + post: operations["repos/add-app-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removes the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + * + * | Type | Description | + * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + delete: operations["repos/remove-app-access-restrictions"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": { + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists the teams who have push access to this branch. The list includes child teams. + */ + get: operations["repos/get-teams-with-access-to-protected-branch"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. + * + * | Type | Description | + * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | + * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + put: operations["repos/set-team-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Grants the specified teams push access for this branch. You can also give push access to child teams. + * + * | Type | Description | + * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | + * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + post: operations["repos/add-team-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removes the ability of a team to push to this branch. You can also remove push access for child teams. + * + * | Type | Description | + * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + delete: operations["repos/remove-team-access-restrictions"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": { + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists the people who have push access to this branch. + */ + get: operations["repos/get-users-with-access-to-protected-branch"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. + * + * | Type | Description | + * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + put: operations["repos/set-user-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Grants the specified people push access for this branch. + * + * | Type | Description | + * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + post: operations["repos/add-user-access-restrictions"]; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removes the ability of a user to push to this branch. + * + * | Type | Description | + * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + delete: operations["repos/remove-user-access-restrictions"]; + }; + "/repos/{owner}/{repo}/branches/{branch}/rename": { + /** + * Renames a branch in a repository. + * + * **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". + * + * The permissions required to use this endpoint depends on whether you are renaming the default branch. + * + * To rename a non-default branch: + * + * * Users must have push access. + * * GitHub Apps must have the `contents:write` repository permission. + * + * To rename the default branch: + * + * * Users must have admin or owner permissions. + * * GitHub Apps must have the `administration:write` repository permission. + */ + post: operations["repos/rename-branch"]; + }; + "/repos/{owner}/{repo}/check-runs": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs. + * + * In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. + */ + post: operations["checks/create"]; + }; + "/repos/{owner}/{repo}/check-runs/{check_run_id}": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Gets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. + */ + get: operations["checks/get"]; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Updates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs. + */ + patch: operations["checks/update"]; + }; + "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations": { + /** Lists annotations for a check run using the annotation `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the `repo` scope to get annotations for a check run in a private repository. */ + get: operations["checks/list-annotations"]; + }; + "/repos/{owner}/{repo}/check-suites": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. + * + * By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the `checks:write` permission to create check suites. + */ + post: operations["checks/create-suite"]; + }; + "/repos/{owner}/{repo}/check-suites/preferences": { + /** Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. */ + patch: operations["checks/set-suites-preferences"]; + }; + "/repos/{owner}/{repo}/check-suites/{check_suite_id}": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. + * + * Gets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. + */ + get: operations["checks/get-suite"]; + }; + "/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Lists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. + */ + get: operations["checks/list-for-suite"]; + }; + "/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest": { + /** + * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + * + * To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository. + */ + post: operations["checks/rerequest-suite"]; + }; + "/repos/{owner}/{repo}/code-scanning/alerts": { + /** + * Lists all open code scanning alerts for the default branch (usually `main` + * or `master`). You must use an access token with the `security_events` scope to use + * this endpoint. GitHub Apps must have the `security_events` read permission to use + * this endpoint. + * + * The response includes a `most_recent_instance` object. + * This provides details of the most recent instance of this alert + * for the default branch or for the specified Git reference + * (if you used `ref` in the request). + */ + get: operations["code-scanning/list-alerts-for-repo"]; + }; + "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}": { + /** + * Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * **Deprecation notice**: + * The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`. + */ + get: operations["code-scanning/get-alert"]; + /** Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ + patch: operations["code-scanning/update-alert"]; + }; + "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances": { + /** Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ + get: operations["code-scanning/list-alert-instances"]; + }; + "/repos/{owner}/{repo}/code-scanning/analyses": { + /** + * Lists the details of all code scanning analyses for a repository, + * starting with the most recent. + * The response is paginated and you can use the `page` and `per_page` parameters + * to list the analyses you're interested in. + * By default 30 analyses are listed per page. + * + * The `rules_count` field in the response give the number of rules + * that were run in the analysis. + * For very old analyses this data is not available, + * and `0` is returned in this field. + * + * You must use an access token with the `security_events` scope to use this endpoint. + * GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * **Deprecation notice**: + * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + */ + get: operations["code-scanning/list-recent-analyses"]; + }; + "/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}": { + /** + * Gets a specified code scanning analysis for a repository. + * You must use an access token with the `security_events` scope to use this endpoint. + * GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * The default JSON response contains fields that describe the analysis. + * This includes the Git reference and commit SHA to which the analysis relates, + * the datetime of the analysis, the name of the code scanning tool, + * and the number of alerts. + * + * The `rules_count` field in the default response give the number of rules + * that were run in the analysis. + * For very old analyses this data is not available, + * and `0` is returned in this field. + * + * If you use the Accept header `application/sarif+json`, + * the response contains the analysis data that was uploaded. + * This is formatted as + * [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). + * + * **Deprecation notice**: + * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + */ + get: operations["code-scanning/get-analysis"]; + /** + * Deletes a specified code scanning analysis from a repository. For + * private repositories, you must use an access token with the `repo` scope. For public repositories, + * you must use an access token with `public_repo` and `repo:security_events` scopes. + * GitHub Apps must have the `security_events` write permission to use this endpoint. + * + * You can delete one analysis at a time. + * To delete a series of analyses, start with the most recent analysis and work backwards. + * Conceptually, the process is similar to the undo function in a text editor. + * + * When you list the analyses for a repository, + * one or more will be identified as deletable in the response: + * + * ``` + * "deletable": true + * ``` + * + * An analysis is deletable when it's the most recent in a set of analyses. + * Typically, a repository will have multiple sets of analyses + * for each enabled code scanning tool, + * where a set is determined by a unique combination of analysis values: + * + * * `ref` + * * `tool` + * * `analysis_key` + * * `environment` + * + * If you attempt to delete an analysis that is not the most recent in a set, + * you'll get a 400 response with the message: + * + * ``` + * Analysis specified is not deletable. + * ``` + * + * The response from a successful `DELETE` operation provides you with + * two alternative URLs for deleting the next analysis in the set + * (see the example default response below). + * Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis + * in the set. This is a useful option if you want to preserve at least one analysis + * for the specified tool in your repository. + * Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. + * When you delete the last analysis in a set the value of `next_analysis_url` and `confirm_delete_url` + * in the 200 response is `null`. + * + * As an example of the deletion process, + * let's imagine that you added a workflow that configured a particular code scanning tool + * to analyze the code in a repository. This tool has added 15 analyses: + * 10 on the default branch, and another 5 on a topic branch. + * You therefore have two separate sets of analyses for this tool. + * You've now decided that you want to remove all of the analyses for the tool. + * To do this you must make 15 separate deletion requests. + * To start, you must find the deletable analysis for one of the sets, + * step through deleting the analyses in that set, + * and then repeat the process for the second set. + * The procedure therefore consists of a nested loop: + * + * **Outer loop**: + * * List the analyses for the repository, filtered by tool. + * * Parse this list to find a deletable analysis. If found: + * + * **Inner loop**: + * * Delete the identified analysis. + * * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration. + * + * The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely. + */ + delete: operations["code-scanning/delete-analysis"]; + }; + "/repos/{owner}/{repo}/code-scanning/sarifs": { + /** + * Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. + * + * There are two places where you can upload code scanning results. + * - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." + * - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)." + * + * You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example: + * + * ``` + * gzip -c analysis-data.sarif | base64 -w0 + * ``` + * + * SARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries. + * + * The `202 Accepted`, response includes an `id` value. + * You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint. + * For more information, see "[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload)." + */ + post: operations["code-scanning/upload-sarif"]; + }; + "/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}": { + /** Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository)." You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ + get: operations["code-scanning/get-sarif"]; + }; + "/repos/{owner}/{repo}/collaborators": { + /** + * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. + * + * Team members will include the members of child teams. + */ + get: operations["repos/list-collaborators"]; + }; + "/repos/{owner}/{repo}/collaborators/{username}": { + /** + * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. + * + * Team members will include the members of child teams. + */ + get: operations["repos/check-collaborator"]; + /** + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + * + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). + * + * **Rate limits** + * + * You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. + */ + put: operations["repos/add-collaborator"]; + delete: operations["repos/remove-collaborator"]; + }; + "/repos/{owner}/{repo}/collaborators/{username}/permission": { + /** Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`. */ + get: operations["repos/get-collaborator-permission-level"]; + }; + "/repos/{owner}/{repo}/comments": { + /** + * Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). + * + * Comments are ordered by ascending ID. + */ + get: operations["repos/list-commit-comments-for-repo"]; + }; + "/repos/{owner}/{repo}/comments/{comment_id}": { + get: operations["repos/get-commit-comment"]; + delete: operations["repos/delete-commit-comment"]; + patch: operations["repos/update-commit-comment"]; + }; + "/repos/{owner}/{repo}/comments/{comment_id}/reactions": { + /** List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ + get: operations["reactions/list-for-commit-comment"]; + /** Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. */ + post: operations["reactions/create-for-commit-comment"]; + }; + "/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}": { + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. + * + * Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + */ + delete: operations["reactions/delete-for-commit-comment"]; + }; + "/repos/{owner}/{repo}/commits": { + /** + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + get: operations["repos/list-commits"]; + }; + "/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head": { + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. + */ + get: operations["repos/list-branches-for-head-commit"]; + }; + "/repos/{owner}/{repo}/commits/{commit_sha}/comments": { + /** Use the `:commit_sha` to specify the commit that will have its comments listed. */ + get: operations["repos/list-comments-for-commit"]; + /** + * Create a comment for a commit using its `:commit_sha`. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["repos/create-commit-comment"]; + }; + "/repos/{owner}/{repo}/commits/{commit_sha}/pulls": { + /** Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. */ + get: operations["repos/list-pull-requests-associated-with-commit"]; + }; + "/repos/{owner}/{repo}/commits/{ref}": { + /** + * Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint. + * + * **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. + * + * You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property. + * + * To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + get: operations["repos/get-commit"]; + }; + "/repos/{owner}/{repo}/commits/{ref}/check-runs": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. + */ + get: operations["checks/list-for-ref"]; + }; + "/repos/{owner}/{repo}/commits/{ref}/check-suites": { + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. + * + * Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. + */ + get: operations["checks/list-suites-for-ref"]; + }; + "/repos/{owner}/{repo}/commits/{ref}/status": { + /** + * Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. + * + * The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. + * + * Additionally, a combined `state` is returned. The `state` is one of: + * + * * **failure** if any of the contexts report as `error` or `failure` + * * **pending** if there are no statuses or a context is `pending` + * * **success** if the latest status for all contexts is `success` + */ + get: operations["repos/get-combined-status-for-ref"]; + }; + "/repos/{owner}/{repo}/commits/{ref}/statuses": { + /** + * Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. + * + * This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. + */ + get: operations["repos/list-commit-statuses-for-ref"]; + }; + "/repos/{owner}/{repo}/community/code_of_conduct": { + /** + * Returns the contents of the repository's code of conduct file, if one is detected. + * + * A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. + */ + get: operations["codes-of-conduct/get-for-repo"]; + }; + "/repos/{owner}/{repo}/community/profile": { + /** + * This endpoint will return all community profile metrics, including an + * overall health score, repository description, the presence of documentation, detected + * code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, + * README, and CONTRIBUTING files. + * + * The `health_percentage` score is defined as a percentage of how many of + * these four documents are present: README, CONTRIBUTING, LICENSE, and + * CODE_OF_CONDUCT. For example, if all four documents are present, then + * the `health_percentage` is `100`. If only one is present, then the + * `health_percentage` is `25`. + * + * `content_reports_enabled` is only returned for organization-owned repositories. + */ + get: operations["repos/get-community-profile-metrics"]; + }; + "/repos/{owner}/{repo}/compare/{basehead}": { + /** + * The `basehead` param is comprised of two parts: `base` and `head`. Both must be branch names in `repo`. To compare branches across other repositories in the same network as `repo`, use the format `:branch`. + * + * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * + * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. + * + * **Working with large comparisons** + * + * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." + * + * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + get: operations["repos/compare-commits-with-basehead"]; + }; + "/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": { + /** + * Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. + * + * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + post: operations["apps/create-content-attachment-for-repo"]; + }; + "/repos/{owner}/{repo}/contents/{path}": { + /** + * Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit + * `:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. + * + * Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for + * retrieving the raw content or rendered HTML (when supported). All content types support [a custom media + * type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent + * object format. + * + * **Note**: + * * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). + * * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees + * API](https://docs.github.com/rest/reference/git#get-a-tree). + * * This API supports files up to 1 megabyte in size. + * + * #### If the content is a directory + * The response will be an array of objects, one object for each item in the directory. + * When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value + * _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). + * In the next major version of the API, the type will be returned as "submodule". + * + * #### If the content is a symlink + * If the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the + * API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object + * describing the symlink itself. + * + * #### If the content is a submodule + * The `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific + * commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out + * the submodule at that specific commit. + * + * If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the + * github.com URLs (`html_url` and `_links["html"]`) will have null values. + */ + get: operations["repos/get-content"]; + /** Creates a new file or replaces an existing file in a repository. */ + put: operations["repos/create-or-update-file-contents"]; + /** + * Deletes a file in a repository. + * + * You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author. + * + * The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used. + * + * You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code. + */ + delete: operations["repos/delete-file"]; + }; + "/repos/{owner}/{repo}/contributors": { + /** + * Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. + * + * GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. + */ + get: operations["repos/list-contributors"]; + }; + "/repos/{owner}/{repo}/deployments": { + /** Simple filtering of deployments is available via query parameters: */ + get: operations["repos/list-deployments"]; + /** + * Deployments offer a few configurable parameters with certain defaults. + * + * The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them + * before we merge a pull request. + * + * The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have + * multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter + * makes it easier to track which environments have requested deployments. The default environment is `production`. + * + * The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If + * the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, + * the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will + * return a failure response. + * + * By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a `success` + * state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to + * specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do + * not require any contexts or create any commit statuses, the deployment will always succeed. + * + * The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text + * field that will be passed on when a deployment event is dispatched. + * + * The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might + * be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an + * application with debugging enabled. + * + * Users with `repo` or `repo_deployment` scopes can create a deployment for a given ref. + * + * #### Merged branch response + * You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating + * a deployment. This auto-merge happens when: + * * Auto-merge option is enabled in the repository + * * Topic branch does not include the latest changes on the base branch, which is `master` in the response example + * * There are no merge conflicts + * + * If there are no new commits in the base branch, a new request to create a deployment should give a successful + * response. + * + * #### Merge conflict response + * This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't + * be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts. + * + * #### Failed commit status checks + * This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success` + * status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`. + */ + post: operations["repos/create-deployment"]; + }; + "/repos/{owner}/{repo}/deployments/{deployment_id}": { + get: operations["repos/get-deployment"]; + /** + * To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with `repo` or `repo_deployment` scopes can delete an inactive deployment. + * + * To set a deployment as inactive, you must: + * + * * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. + * * Mark the active deployment as inactive by adding any non-successful deployment status. + * + * For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." + */ + delete: operations["repos/delete-deployment"]; + }; + "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses": { + /** Users with pull access can view deployment statuses for a deployment: */ + get: operations["repos/list-deployment-statuses"]; + /** + * Users with `push` access can create deployment statuses for a given deployment. + * + * GitHub Apps require `read & write` access to "Deployments" and `read-only` access to "Repo contents" (for private repos). OAuth Apps require the `repo_deployment` scope. + */ + post: operations["repos/create-deployment-status"]; + }; + "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}": { + /** Users with pull access can view a deployment status for a deployment: */ + get: operations["repos/get-deployment-status"]; + }; + "/repos/{owner}/{repo}/dispatches": { + /** + * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." + * + * The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. + * + * This endpoint requires write access to the repository by providing either: + * + * - Personal access tokens with `repo` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. + * - GitHub Apps with both `metadata:read` and `contents:read&write` permissions. + * + * This input example shows how you can use the `client_payload` as a test to debug your workflow. + */ + post: operations["repos/create-dispatch-event"]; + }; + "/repos/{owner}/{repo}/environments": { + /** + * Get all environments for a repository. + * + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + get: operations["repos/get-all-environments"]; + }; + "/repos/{owner}/{repo}/environments/{environment_name}": { + /** Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + get: operations["repos/get-environment"]; + /** + * Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)." + * + * **Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see "[Environments](/actions/reference/environments#deployment-branches)." + * + * **Note:** To create or update secrets for an environment, see "[Secrets](/rest/reference/actions#secrets)." + * + * You must authenticate using an access token with the repo scope to use this endpoint. + */ + put: operations["repos/create-or-update-environment"]; + /** You must authenticate using an access token with the repo scope to use this endpoint. */ + delete: operations["repos/delete-an-environment"]; + }; + "/repos/{owner}/{repo}/events": { + get: operations["activity/list-repo-events"]; + }; + "/repos/{owner}/{repo}/forks": { + get: operations["repos/list-forks"]; + /** + * Create a fork for the authenticated user. + * + * **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=rest-api). + */ + post: operations["repos/create-fork"]; + }; + "/repos/{owner}/{repo}/git/blobs": { + post: operations["git/create-blob"]; + }; + "/repos/{owner}/{repo}/git/blobs/{file_sha}": { + /** + * The `content` in the response will always be Base64 encoded. + * + * _Note_: This API supports blobs up to 100 megabytes in size. + */ + get: operations["git/get-blob"]; + }; + "/repos/{owner}/{repo}/git/commits": { + /** + * Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + post: operations["git/create-commit"]; + }; + "/repos/{owner}/{repo}/git/commits/{commit_sha}": { + /** + * Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + get: operations["git/get-commit"]; + }; + "/repos/{owner}/{repo}/git/matching-refs/{ref}": { + /** + * Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array. + * + * When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`. + * + * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * + * If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. + */ + get: operations["git/list-matching-refs"]; + }; + "/repos/{owner}/{repo}/git/ref/{ref}": { + /** + * Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned. + * + * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + */ + get: operations["git/get-ref"]; + }; + "/repos/{owner}/{repo}/git/refs": { + /** Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. */ + post: operations["git/create-ref"]; + }; + "/repos/{owner}/{repo}/git/refs/{ref}": { + delete: operations["git/delete-ref"]; + patch: operations["git/update-ref"]; + }; + "/repos/{owner}/{repo}/git/tags": { + /** + * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + post: operations["git/create-tag"]; + }; + "/repos/{owner}/{repo}/git/tags/{tag_sha}": { + /** + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + get: operations["git/get-tag"]; + }; + "/repos/{owner}/{repo}/git/trees": { + /** + * The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. + * + * If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." + */ + post: operations["git/create-tree"]; + }; + "/repos/{owner}/{repo}/git/trees/{tree_sha}": { + /** + * Returns a single tree using the SHA1 value for that tree. + * + * If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. + */ + get: operations["git/get-tree"]; + }; + "/repos/{owner}/{repo}/hooks": { + get: operations["repos/list-webhooks"]; + /** + * Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can + * share the same `config` as long as those webhooks do not have any `events` that overlap. + */ + post: operations["repos/create-webhook"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}": { + /** Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." */ + get: operations["repos/get-webhook"]; + delete: operations["repos/delete-webhook"]; + /** Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." */ + patch: operations["repos/update-webhook"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}/config": { + /** + * Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." + * + * Access tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission. + */ + get: operations["repos/get-webhook-config-for-repo"]; + /** + * Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." + * + * Access tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission. + */ + patch: operations["repos/update-webhook-config-for-repo"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}/deliveries": { + /** Returns a list of webhook deliveries for a webhook configured in a repository. */ + get: operations["repos/list-webhook-deliveries"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}": { + /** Returns a delivery for a webhook configured in a repository. */ + get: operations["repos/get-webhook-delivery"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts": { + /** Redeliver a webhook delivery for a webhook configured in a repository. */ + post: operations["repos/redeliver-webhook-delivery"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}/pings": { + /** This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ + post: operations["repos/ping-webhook"]; + }; + "/repos/{owner}/{repo}/hooks/{hook_id}/tests": { + /** + * This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated. + * + * **Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test` + */ + post: operations["repos/test-push-webhook"]; + }; + "/repos/{owner}/{repo}/import": { + /** + * View the progress of an import. + * + * **Import status** + * + * This section includes details about the possible values of the `status` field of the Import Progress response. + * + * An import that does not have errors will progress through these steps: + * + * * `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL. + * * `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import). + * * `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. + * * `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects". + * * `complete` - the import is complete, and the repository is ready on GitHub. + * + * If there are problems, you will see one of these in the `status` field: + * + * * `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * * `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=rest-api) for more information. + * * `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * * `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. + * * `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * + * **The project_choices field** + * + * When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. + * + * **Git LFS related fields** + * + * This section includes details about Git LFS related fields that may be present in the Import Progress response. + * + * * `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken. + * * `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step. + * * `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository. + * * `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. + */ + get: operations["migrations/get-import-status"]; + /** Start a source import to a GitHub repository using GitHub Importer. */ + put: operations["migrations/start-import"]; + /** Stop an import for a repository. */ + delete: operations["migrations/cancel-import"]; + /** + * An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API + * request. If no parameters are provided, the import will be restarted. + */ + patch: operations["migrations/update-import"]; + }; + "/repos/{owner}/{repo}/import/authors": { + /** + * Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `. + * + * This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. + */ + get: operations["migrations/get-commit-authors"]; + }; + "/repos/{owner}/{repo}/import/authors/{author_id}": { + /** Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. */ + patch: operations["migrations/map-commit-author"]; + }; + "/repos/{owner}/{repo}/import/large_files": { + /** List files larger than 100MB found during the import */ + get: operations["migrations/get-large-files"]; + }; + "/repos/{owner}/{repo}/import/lfs": { + /** You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). */ + patch: operations["migrations/set-lfs-preference"]; + }; + "/repos/{owner}/{repo}/installation": { + /** + * Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-repo-installation"]; + }; + "/repos/{owner}/{repo}/interaction-limits": { + /** Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. */ + get: operations["interactions/get-restrictions-for-repo"]; + /** Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ + put: operations["interactions/set-restrictions-for-repo"]; + /** Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ + delete: operations["interactions/remove-restrictions-for-repo"]; + }; + "/repos/{owner}/{repo}/invitations": { + /** When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. */ + get: operations["repos/list-invitations"]; + }; + "/repos/{owner}/{repo}/invitations/{invitation_id}": { + delete: operations["repos/delete-invitation"]; + patch: operations["repos/update-invitation"]; + }; + "/repos/{owner}/{repo}/issues": { + /** + * List issues in a repository. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + get: operations["issues/list-for-repo"]; + /** + * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["issues/create"]; + }; + "/repos/{owner}/{repo}/issues/comments": { + /** By default, Issue Comments are ordered by ascending ID. */ + get: operations["issues/list-comments-for-repo"]; + }; + "/repos/{owner}/{repo}/issues/comments/{comment_id}": { + get: operations["issues/get-comment"]; + delete: operations["issues/delete-comment"]; + patch: operations["issues/update-comment"]; + }; + "/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions": { + /** List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ + get: operations["reactions/list-for-issue-comment"]; + /** Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. */ + post: operations["reactions/create-for-issue-comment"]; + }; + "/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}": { + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. + * + * Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + */ + delete: operations["reactions/delete-for-issue-comment"]; + }; + "/repos/{owner}/{repo}/issues/events": { + get: operations["issues/list-events-for-repo"]; + }; + "/repos/{owner}/{repo}/issues/events/{event_id}": { + get: operations["issues/get-event"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}": { + /** + * The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was + * [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If + * the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API + * returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read + * access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe + * to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + get: operations["issues/get"]; + /** Issue owners and users with push access can edit an issue. */ + patch: operations["issues/update"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/assignees": { + /** Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. */ + post: operations["issues/add-assignees"]; + /** Removes one or more assignees from an issue. */ + delete: operations["issues/remove-assignees"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/comments": { + /** Issue Comments are ordered by ascending ID. */ + get: operations["issues/list-comments"]; + /** This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ + post: operations["issues/create-comment"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/events": { + get: operations["issues/list-events"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/labels": { + get: operations["issues/list-labels-on-issue"]; + /** Removes any previous labels and sets the new labels for an issue. */ + put: operations["issues/set-labels"]; + post: operations["issues/add-labels"]; + delete: operations["issues/remove-all-labels"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}": { + /** Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. */ + delete: operations["issues/remove-label"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/lock": { + /** + * Users with push access can lock an issue or pull request's conversation. + * + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + put: operations["issues/lock"]; + /** Users with push access can unlock an issue's conversation. */ + delete: operations["issues/unlock"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/reactions": { + /** List the reactions to an [issue](https://docs.github.com/rest/reference/issues). */ + get: operations["reactions/list-for-issue"]; + /** Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with an HTTP `200` status means that you already added the reaction type to this issue. */ + post: operations["reactions/create-for-issue"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}": { + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. + * + * Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). + */ + delete: operations["reactions/delete-for-issue"]; + }; + "/repos/{owner}/{repo}/issues/{issue_number}/timeline": { + get: operations["issues/list-events-for-timeline"]; + }; + "/repos/{owner}/{repo}/keys": { + get: operations["repos/list-deploy-keys"]; + /** You can create a read-only deploy key. */ + post: operations["repos/create-deploy-key"]; + }; + "/repos/{owner}/{repo}/keys/{key_id}": { + get: operations["repos/get-deploy-key"]; + /** Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. */ + delete: operations["repos/delete-deploy-key"]; + }; + "/repos/{owner}/{repo}/labels": { + get: operations["issues/list-labels-for-repo"]; + post: operations["issues/create-label"]; + }; + "/repos/{owner}/{repo}/labels/{name}": { + get: operations["issues/get-label"]; + delete: operations["issues/delete-label"]; + patch: operations["issues/update-label"]; + }; + "/repos/{owner}/{repo}/languages": { + /** Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. */ + get: operations["repos/list-languages"]; + }; + "/repos/{owner}/{repo}/license": { + /** + * This method returns the contents of the repository's license file, if one is detected. + * + * Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. + */ + get: operations["licenses/get-for-repo"]; + }; + "/repos/{owner}/{repo}/merges": { + post: operations["repos/merge"]; + }; + "/repos/{owner}/{repo}/milestones": { + get: operations["issues/list-milestones"]; + post: operations["issues/create-milestone"]; + }; + "/repos/{owner}/{repo}/milestones/{milestone_number}": { + get: operations["issues/get-milestone"]; + delete: operations["issues/delete-milestone"]; + patch: operations["issues/update-milestone"]; + }; + "/repos/{owner}/{repo}/milestones/{milestone_number}/labels": { + get: operations["issues/list-labels-for-milestone"]; + }; + "/repos/{owner}/{repo}/notifications": { + /** List all notifications for the current user. */ + get: operations["activity/list-repo-notifications-for-authenticated-user"]; + /** Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ + put: operations["activity/mark-repo-notifications-as-read"]; + }; + "/repos/{owner}/{repo}/pages": { + get: operations["repos/get-pages"]; + /** Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). */ + put: operations["repos/update-information-about-pages-site"]; + /** Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." */ + post: operations["repos/create-pages-site"]; + delete: operations["repos/delete-pages-site"]; + }; + "/repos/{owner}/{repo}/pages/builds": { + get: operations["repos/list-pages-builds"]; + /** + * You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. + * + * Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. + */ + post: operations["repos/request-pages-build"]; + }; + "/repos/{owner}/{repo}/pages/builds/latest": { + get: operations["repos/get-latest-pages-build"]; + }; + "/repos/{owner}/{repo}/pages/builds/{build_id}": { + get: operations["repos/get-pages-build"]; + }; + "/repos/{owner}/{repo}/pages/health": { + /** + * Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages. + * + * The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response. + * + * Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint. + */ + get: operations["repos/get-pages-health-check"]; + }; + "/repos/{owner}/{repo}/projects": { + /** Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + get: operations["projects/list-for-repo"]; + /** Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + post: operations["projects/create-for-repo"]; + }; + "/repos/{owner}/{repo}/pulls": { + /** Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + get: operations["pulls/list"]; + /** + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + * + * You can create a new pull request. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + */ + post: operations["pulls/create"]; + }; + "/repos/{owner}/{repo}/pulls/comments": { + /** Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. */ + get: operations["pulls/list-review-comments-for-repo"]; + }; + "/repos/{owner}/{repo}/pulls/comments/{comment_id}": { + /** Provides details for a review comment. */ + get: operations["pulls/get-review-comment"]; + /** Deletes a review comment. */ + delete: operations["pulls/delete-review-comment"]; + /** Enables you to edit a review comment. */ + patch: operations["pulls/update-review-comment"]; + }; + "/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions": { + /** List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ + get: operations["reactions/list-for-pull-request-review-comment"]; + /** Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. */ + post: operations["reactions/create-for-pull-request-review-comment"]; + }; + "/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}": { + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` + * + * Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + */ + delete: operations["reactions/delete-for-pull-request-comment"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}": { + /** + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists details of a pull request by providing its number. + * + * When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * + * The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit. + * + * The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request: + * + * * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. + * * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. + * * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to. + * + * Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + */ + get: operations["pulls/get"]; + /** + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + */ + patch: operations["pulls/update"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/comments": { + /** Lists all review comments for a pull request. By default, review comments are in ascending order by ID. */ + get: operations["pulls/list-review-comments"]; + /** + * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. + * + * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). + * + * **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["pulls/create-review-comment"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies": { + /** + * Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["pulls/create-reply-for-review-comment"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/commits": { + /** Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. */ + get: operations["pulls/list-commits"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/files": { + /** **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. */ + get: operations["pulls/list-files"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/merge": { + get: operations["pulls/check-if-merged"]; + /** This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ + put: operations["pulls/merge"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers": { + get: operations["pulls/list-requested-reviewers"]; + /** This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ + post: operations["pulls/request-reviewers"]; + delete: operations["pulls/remove-requested-reviewers"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/reviews": { + /** The list of reviews returns in chronological order. */ + get: operations["pulls/list-reviews"]; + /** + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * Pull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response. + * + * **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. + * + * The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + */ + post: operations["pulls/create-review"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}": { + get: operations["pulls/get-review"]; + /** Update the review summary comment with new text. */ + put: operations["pulls/update-review"]; + delete: operations["pulls/delete-pending-review"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments": { + /** List comments for a specific pull request review. */ + get: operations["pulls/list-comments-for-review"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals": { + /** **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. */ + put: operations["pulls/dismiss-review"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events": { + post: operations["pulls/submit-review"]; + }; + "/repos/{owner}/{repo}/pulls/{pull_number}/update-branch": { + /** Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. */ + put: operations["pulls/update-branch"]; + }; + "/repos/{owner}/{repo}/readme": { + /** + * Gets the preferred README for a repository. + * + * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + */ + get: operations["repos/get-readme"]; + }; + "/repos/{owner}/{repo}/readme/{dir}": { + /** + * Gets the README from a repository directory. + * + * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + */ + get: operations["repos/get-readme-in-directory"]; + }; + "/repos/{owner}/{repo}/releases": { + /** + * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). + * + * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. + */ + get: operations["repos/list-releases"]; + /** + * Users with push access to the repository can create a release. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["repos/create-release"]; + }; + "/repos/{owner}/{repo}/releases/assets/{asset_id}": { + /** To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. */ + get: operations["repos/get-release-asset"]; + delete: operations["repos/delete-release-asset"]; + /** Users with push access to the repository can edit a release asset. */ + patch: operations["repos/update-release-asset"]; + }; + "/repos/{owner}/{repo}/releases/latest": { + /** + * View the latest published full release for the repository. + * + * The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. + */ + get: operations["repos/get-latest-release"]; + }; + "/repos/{owner}/{repo}/releases/tags/{tag}": { + /** Get a published release with the specified tag. */ + get: operations["repos/get-release-by-tag"]; + }; + "/repos/{owner}/{repo}/releases/{release_id}": { + /** **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). */ + get: operations["repos/get-release"]; + /** Users with push access to the repository can delete a release. */ + delete: operations["repos/delete-release"]; + /** Users with push access to the repository can edit a release. */ + patch: operations["repos/update-release"]; + }; + "/repos/{owner}/{repo}/releases/{release_id}/assets": { + get: operations["repos/list-release-assets"]; + /** + * This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in + * the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. + * + * You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. + * + * Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: + * + * `application/zip` + * + * GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, + * you'll still need to pass your authentication to be able to upload an asset. + * + * When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted. + * + * **Notes:** + * * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" + * endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=rest-api). + * * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. + */ + post: operations["repos/upload-release-asset"]; + }; + "/repos/{owner}/{repo}/releases/{release_id}/reactions": { + /** Create a reaction to a [release](https://docs.github.com/rest/reference/repos#releases). A response with a `Status: 200 OK` means that you already added the reaction type to this release. */ + post: operations["reactions/create-for-release"]; + }; + "/repos/{owner}/{repo}/secret-scanning/alerts": { + /** + * Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. + */ + get: operations["secret-scanning/list-alerts-for-repo"]; + }; + "/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}": { + /** + * Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. + */ + get: operations["secret-scanning/get-alert"]; + /** + * Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` write permission to use this endpoint. + */ + patch: operations["secret-scanning/update-alert"]; + }; + "/repos/{owner}/{repo}/stargazers": { + /** + * Lists the people that have starred the repository. + * + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + get: operations["activity/list-stargazers-for-repo"]; + }; + "/repos/{owner}/{repo}/stats/code_frequency": { + /** Returns a weekly aggregate of the number of additions and deletions pushed to a repository. */ + get: operations["repos/get-code-frequency-stats"]; + }; + "/repos/{owner}/{repo}/stats/commit_activity": { + /** Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. */ + get: operations["repos/get-commit-activity-stats"]; + }; + "/repos/{owner}/{repo}/stats/contributors": { + /** + * Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information: + * + * * `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + * * `a` - Number of additions + * * `d` - Number of deletions + * * `c` - Number of commits + */ + get: operations["repos/get-contributors-stats"]; + }; + "/repos/{owner}/{repo}/stats/participation": { + /** + * Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`. + * + * The array order is oldest week (index 0) to most recent week. + */ + get: operations["repos/get-participation-stats"]; + }; + "/repos/{owner}/{repo}/stats/punch_card": { + /** + * Each array contains the day number, hour number, and number of commits: + * + * * `0-6`: Sunday - Saturday + * * `0-23`: Hour of day + * * Number of commits + * + * For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. + */ + get: operations["repos/get-punch-card-stats"]; + }; + "/repos/{owner}/{repo}/statuses/{sha}": { + /** + * Users with push access in a repository can create commit statuses for a given SHA. + * + * Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. + */ + post: operations["repos/create-commit-status"]; + }; + "/repos/{owner}/{repo}/subscribers": { + /** Lists the people watching the specified repository. */ + get: operations["activity/list-watchers-for-repo"]; + }; + "/repos/{owner}/{repo}/subscription": { + get: operations["activity/get-repo-subscription"]; + /** If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. */ + put: operations["activity/set-repo-subscription"]; + /** This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). */ + delete: operations["activity/delete-repo-subscription"]; + }; + "/repos/{owner}/{repo}/tags": { + get: operations["repos/list-tags"]; + }; + "/repos/{owner}/{repo}/tarball/{ref}": { + /** + * Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually + * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use + * the `Location` header to make a second `GET` request. + * **Note**: For private repositories, these links are temporary and expire after five minutes. + */ + get: operations["repos/download-tarball-archive"]; + }; + "/repos/{owner}/{repo}/teams": { + get: operations["repos/list-teams"]; + }; + "/repos/{owner}/{repo}/topics": { + get: operations["repos/get-all-topics"]; + put: operations["repos/replace-all-topics"]; + }; + "/repos/{owner}/{repo}/traffic/clones": { + /** Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ + get: operations["repos/get-clones"]; + }; + "/repos/{owner}/{repo}/traffic/popular/paths": { + /** Get the top 10 popular contents over the last 14 days. */ + get: operations["repos/get-top-paths"]; + }; + "/repos/{owner}/{repo}/traffic/popular/referrers": { + /** Get the top 10 referrers over the last 14 days. */ + get: operations["repos/get-top-referrers"]; + }; + "/repos/{owner}/{repo}/traffic/views": { + /** Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ + get: operations["repos/get-views"]; + }; + "/repos/{owner}/{repo}/transfer": { + /** A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). */ + post: operations["repos/transfer"]; + }; + "/repos/{owner}/{repo}/vulnerability-alerts": { + /** Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ + get: operations["repos/check-vulnerability-alerts"]; + /** Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ + put: operations["repos/enable-vulnerability-alerts"]; + /** Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ + delete: operations["repos/disable-vulnerability-alerts"]; + }; + "/repos/{owner}/{repo}/zipball/{ref}": { + /** + * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually + * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use + * the `Location` header to make a second `GET` request. + * **Note**: For private repositories, these links are temporary and expire after five minutes. + */ + get: operations["repos/download-zipball-archive"]; + }; + "/repos/{template_owner}/{template_repo}/generate": { + /** + * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. + * + * **OAuth scope requirements** + * + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository + */ + post: operations["repos/create-using-template"]; + }; + "/repositories": { + /** + * Lists all public repositories in the order that they were created. + * + * Note: + * - For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise. + * - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + */ + get: operations["repos/list-public"]; + }; + "/repositories/{repository_id}/environments/{environment_name}/secrets": { + /** Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + get: operations["actions/list-environment-secrets"]; + }; + "/repositories/{repository_id}/environments/{environment_name}/secrets/public-key": { + /** Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + get: operations["actions/get-environment-public-key"]; + }; + "/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": { + /** Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + get: operations["actions/get-environment-secret"]; + /** + * Creates or updates an environment secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use + * this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + put: operations["actions/create-or-update-environment-secret"]; + /** Deletes a secret in an environment using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + delete: operations["actions/delete-environment-secret"]; + }; + "/scim/v2/enterprises/{enterprise}/Groups": { + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + get: operations["enterprise-admin/list-provisioned-groups-enterprise"]; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. + */ + post: operations["enterprise-admin/provision-and-invite-enterprise-group"]; + }; + "/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}": { + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + get: operations["enterprise-admin/get-provisioning-information-for-enterprise-group"]; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. + */ + put: operations["enterprise-admin/set-information-for-provisioned-enterprise-group"]; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + delete: operations["enterprise-admin/delete-scim-group-from-enterprise"]; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + */ + patch: operations["enterprise-admin/update-attribute-for-enterprise-group"]; + }; + "/scim/v2/enterprises/{enterprise}/Users": { + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Retrieves a paginated list of all provisioned enterprise members, including pending invitations. + * + * When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: + * - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. + * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). + * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. + * + * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: + * + * 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. + * + * 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. + * + * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: + * - If the user signs in, their GitHub account is linked to this entry. + * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity `null` entry remains in place. + */ + get: operations["enterprise-admin/list-provisioned-identities-enterprise"]; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Provision enterprise membership for a user, and send organization invitation emails to the email address. + * + * You can optionally include the groups a user will be invited to join. If you do not provide a list of `groups`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. + */ + post: operations["enterprise-admin/provision-and-invite-enterprise-user"]; + }; + "/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}": { + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + get: operations["enterprise-admin/get-provisioning-information-for-enterprise-user"]; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. + * + * You must at least provide the required values for the user: `userName`, `name`, and `emails`. + * + * **Warning:** Setting `active: false` removes the user from the enterprise, deletes the external identity, and deletes the associated `{scim_user_id}`. + */ + put: operations["enterprise-admin/set-information-for-provisioned-enterprise-user"]; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + delete: operations["enterprise-admin/delete-user-from-enterprise"]; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * + * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. + * + * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated `:scim_user_id`. + * + * ``` + * { + * "Operations":[{ + * "op":"replace", + * "value":{ + * "active":false + * } + * }] + * } + * ``` + */ + patch: operations["enterprise-admin/update-attribute-for-enterprise-user"]; + }; + "/scim/v2/organizations/{org}/Users": { + /** + * Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the `filter` parameter, the resources for all matching provisions members are returned. + * + * When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: + * - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. + * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). + * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. + * + * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: + * + * 1. The user is granted access by the IdP and is not a member of the GitHub organization. + * + * 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. + * + * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: + * - If the user signs in, their GitHub account is linked to this entry. + * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity `null` entry remains in place. + */ + get: operations["scim/list-provisioned-identities"]; + /** Provision organization membership for a user, and send an activation email to the email address. */ + post: operations["scim/provision-and-invite-user"]; + }; + "/scim/v2/organizations/{org}/Users/{scim_user_id}": { + get: operations["scim/get-provisioning-information-for-user"]; + /** + * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. + * + * You must at least provide the required values for the user: `userName`, `name`, and `emails`. + * + * **Warning:** Setting `active: false` removes the user from the organization, deletes the external identity, and deletes the associated `{scim_user_id}`. + */ + put: operations["scim/set-information-for-provisioned-user"]; + delete: operations["scim/delete-user-from-org"]; + /** + * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * + * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. + * + * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated `:scim_user_id`. + * + * ``` + * { + * "Operations":[{ + * "op":"replace", + * "value":{ + * "active":false + * } + * }] + * } + * ``` + */ + patch: operations["scim/update-attribute-for-user"]; + }; + "/search/code": { + /** + * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: + * + * `q=addClass+in:file+language:js+repo:jquery/jquery` + * + * This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository. + * + * #### Considerations for code search + * + * Due to the complexity of searching code, there are a few restrictions on how searches are performed: + * + * * Only the _default branch_ is considered. In most cases, this will be the `master` branch. + * * Only files smaller than 384 KB are searchable. + * * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing + * language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + */ + get: operations["search/code"]; + }; + "/search/commits": { + /** + * Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match + * metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: + * + * `q=repo:octocat/Spoon-Knife+css` + */ + get: operations["search/commits"]; + }; + "/search/issues": { + /** + * Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted + * search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. + * + * `q=windows+label:bug+language:python+state:open&sort=created&order=asc` + * + * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + * + * **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + */ + get: operations["search/issues-and-pull-requests"]; + }; + "/search/labels": { + /** + * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this: + * + * `q=bug+defect+enhancement&repository_id=64778136` + * + * The labels that best match the query appear first in the search results. + */ + get: operations["search/labels"]; + }; + "/search/repositories": { + /** + * Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: + * + * `q=tetris+language:assembly&sort=stars&order=desc` + * + * This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. + * + * When you include the `mercy` preview header, you can also search for multiple topics by adding more `topic:` instances. For example, your query might look like this: + * + * `q=topic:ruby+topic:rails` + */ + get: operations["search/repos"]; + }; + "/search/topics": { + /** + * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. + * + * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: + * + * `q=ruby+is:featured` + * + * This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. + */ + get: operations["search/topics"]; + }; + "/search/users": { + /** + * Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you're looking for a list of popular users, you might try this query: + * + * `q=tom+repos:%3E42+followers:%3E1000` + * + * This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers. + */ + get: operations["search/users"]; + }; + "/teams/{team_id}": { + /** **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. */ + get: operations["teams/get-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. + * + * To delete a team, the authenticated user must be an organization owner or team maintainer. + * + * If you are an organization owner, deleting a parent team will delete all of its child teams as well. + */ + delete: operations["teams/delete-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. + * + * To edit a team, the authenticated user must either be an organization owner or a team maintainer. + * + * **Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. + */ + patch: operations["teams/update-legacy"]; + }; + "/teams/{team_id}/discussions": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. + * + * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + get: operations["teams/list-discussions-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. + * + * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["teams/create-discussion-legacy"]; + }; + "/teams/{team_id}/discussions/{discussion_number}": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. + * + * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + get: operations["teams/get-discussion-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. + * + * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + delete: operations["teams/delete-discussion-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. + * + * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + patch: operations["teams/update-discussion-legacy"]; + }; + "/teams/{team_id}/discussions/{discussion_number}/comments": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. + * + * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + get: operations["teams/list-discussion-comments-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. + * + * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + post: operations["teams/create-discussion-comment-legacy"]; + }; + "/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. + * + * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + get: operations["teams/get-discussion-comment-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. + * + * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + delete: operations["teams/delete-discussion-comment-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. + * + * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + patch: operations["teams/update-discussion-comment-legacy"]; + }; + "/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + * + * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + get: operations["reactions/list-for-team-discussion-comment-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + * + * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. + */ + post: operations["reactions/create-for-team-discussion-comment-legacy"]; + }; + "/teams/{team_id}/discussions/{discussion_number}/reactions": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. + * + * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + get: operations["reactions/list-for-team-discussion-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. + * + * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion. + */ + post: operations["reactions/create-for-team-discussion-legacy"]; + }; + "/teams/{team_id}/invitations": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. + * + * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + */ + get: operations["teams/list-pending-invitations-legacy"]; + }; + "/teams/{team_id}/members": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. + * + * Team members will include the members of child teams. + */ + get: operations["teams/list-members-legacy"]; + }; + "/teams/{team_id}/members/{username}": { + /** + * The "Get team member" endpoint (described below) is deprecated. + * + * We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. + * + * To list members in a team, the team must be visible to the authenticated user. + */ + get: operations["teams/get-member-legacy"]; + /** + * The "Add team member" endpoint (described below) is deprecated. + * + * We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + put: operations["teams/add-member-legacy"]; + /** + * The "Remove team member" endpoint (described below) is deprecated. + * + * We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + */ + delete: operations["teams/remove-member-legacy"]; + }; + "/teams/{team_id}/memberships/{username}": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. + * + * Team members will include the members of child teams. + * + * To get a user's membership with a team, the team must be visible to the authenticated user. + * + * **Note:** + * The response contains the `state` of the membership and the member's `role`. + * + * The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + */ + get: operations["teams/get-membership-for-user-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. + * + * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + */ + put: operations["teams/add-or-update-membership-for-user-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + */ + delete: operations["teams/remove-membership-for-user-legacy"]; + }; + "/teams/{team_id}/projects": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. + * + * Lists the organization projects for a team. + */ + get: operations["teams/list-projects-legacy"]; + }; + "/teams/{team_id}/projects/{project_id}": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. + * + * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. + */ + get: operations["teams/check-permissions-for-project-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. + * + * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. + */ + put: operations["teams/add-or-update-project-permissions-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. + * + * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. + */ + delete: operations["teams/remove-project-legacy"]; + }; + "/teams/{team_id}/repos": { + /** **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. */ + get: operations["teams/list-repos-legacy"]; + }; + "/teams/{team_id}/repos/{owner}/{repo}": { + /** + * **Note**: Repositories inherited through a parent team will also be checked. + * + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. + * + * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + get: operations["teams/check-permissions-for-repo-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. + * + * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. + * + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + put: operations["teams/add-or-update-repo-permissions-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. + * + * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + */ + delete: operations["teams/remove-repo-legacy"]; + }; + "/teams/{team_id}/team-sync/group-mappings": { + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List IdP groups for a team`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * List IdP groups connected to a team on GitHub. + */ + get: operations["teams/list-idp-groups-for-legacy"]; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create or update IdP group connections`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. + */ + patch: operations["teams/create-or-update-idp-group-connections-legacy"]; + }; + "/teams/{team_id}/teams": { + /** **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. */ + get: operations["teams/list-child-legacy"]; + }; + "/user": { + /** + * If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information. + * + * If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information. + */ + get: operations["users/get-authenticated"]; + /** **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. */ + patch: operations["users/update-authenticated"]; + }; + "/user/blocks": { + /** List the users you've blocked on your personal account. */ + get: operations["users/list-blocked-by-authenticated"]; + }; + "/user/blocks/{username}": { + get: operations["users/check-blocked"]; + put: operations["users/block"]; + delete: operations["users/unblock"]; + }; + "/user/email/visibility": { + /** Sets the visibility for your primary email addresses. */ + patch: operations["users/set-primary-email-visibility-for-authenticated"]; + }; + "/user/emails": { + /** Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope. */ + get: operations["users/list-emails-for-authenticated"]; + /** This endpoint is accessible with the `user` scope. */ + post: operations["users/add-email-for-authenticated"]; + /** This endpoint is accessible with the `user` scope. */ + delete: operations["users/delete-email-for-authenticated"]; + }; + "/user/followers": { + /** Lists the people following the authenticated user. */ + get: operations["users/list-followers-for-authenticated-user"]; + }; + "/user/following": { + /** Lists the people who the authenticated user follows. */ + get: operations["users/list-followed-by-authenticated"]; + }; + "/user/following/{username}": { + get: operations["users/check-person-is-followed-by-authenticated"]; + /** + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. + */ + put: operations["users/follow"]; + /** Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ + delete: operations["users/unfollow"]; + }; + "/user/gpg_keys": { + /** Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + get: operations["users/list-gpg-keys-for-authenticated"]; + /** Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + post: operations["users/create-gpg-key-for-authenticated"]; + }; + "/user/gpg_keys/{gpg_key_id}": { + /** View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + get: operations["users/get-gpg-key-for-authenticated"]; + /** Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + delete: operations["users/delete-gpg-key-for-authenticated"]; + }; + "/user/installations": { + /** + * Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. + * + * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. + * + * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * + * You can find the permissions for the installation under the `permissions` key. + */ + get: operations["apps/list-installations-for-authenticated-user"]; + }; + "/user/installations/{installation_id}/repositories": { + /** + * List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation. + * + * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * + * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. + * + * The access the user has to each repository is included in the hash under the `permissions` key. + */ + get: operations["apps/list-installation-repos-for-authenticated-user"]; + }; + "/user/installations/{installation_id}/repositories/{repository_id}": { + /** + * Add a single repository to an installation. The authenticated user must have admin access to the repository. + * + * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + */ + put: operations["apps/add-repo-to-installation"]; + /** + * Remove a single repository from an installation. The authenticated user must have admin access to the repository. + * + * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + */ + delete: operations["apps/remove-repo-from-installation"]; + }; + "/user/interaction-limits": { + /** Shows which type of GitHub user can interact with your public repositories and when the restriction expires. */ + get: operations["interactions/get-restrictions-for-authenticated-user"]; + /** Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. */ + put: operations["interactions/set-restrictions-for-authenticated-user"]; + /** Removes any interaction restrictions from your public repositories. */ + delete: operations["interactions/remove-restrictions-for-authenticated-user"]; + }; + "/user/issues": { + /** + * List issues across owned and member repositories assigned to the authenticated user. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + get: operations["issues/list-for-authenticated-user"]; + }; + "/user/keys": { + /** Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + get: operations["users/list-public-ssh-keys-for-authenticated"]; + /** Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + post: operations["users/create-public-ssh-key-for-authenticated"]; + }; + "/user/keys/{key_id}": { + /** View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + get: operations["users/get-public-ssh-key-for-authenticated"]; + /** Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + delete: operations["users/delete-public-ssh-key-for-authenticated"]; + }; + "/user/marketplace_purchases": { + /** Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ + get: operations["apps/list-subscriptions-for-authenticated-user"]; + }; + "/user/marketplace_purchases/stubbed": { + /** Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ + get: operations["apps/list-subscriptions-for-authenticated-user-stubbed"]; + }; + "/user/memberships/orgs": { + get: operations["orgs/list-memberships-for-authenticated-user"]; + }; + "/user/memberships/orgs/{org}": { + get: operations["orgs/get-membership-for-authenticated-user"]; + patch: operations["orgs/update-membership-for-authenticated-user"]; + }; + "/user/migrations": { + /** Lists all migrations a user has started. */ + get: operations["migrations/list-for-authenticated-user"]; + /** Initiates the generation of a user migration archive. */ + post: operations["migrations/start-for-authenticated-user"]; + }; + "/user/migrations/{migration_id}": { + /** + * Fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values: + * + * * `pending` - the migration hasn't started yet. + * * `exporting` - the migration is in progress. + * * `exported` - the migration finished successfully. + * * `failed` - the migration failed. + * + * Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + */ + get: operations["migrations/get-status-for-authenticated-user"]; + }; + "/user/migrations/{migration_id}/archive": { + /** + * Fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: + * + * * attachments + * * bases + * * commit\_comments + * * issue\_comments + * * issue\_events + * * issues + * * milestones + * * organizations + * * projects + * * protected\_branches + * * pull\_request\_reviews + * * pull\_requests + * * releases + * * repositories + * * review\_comments + * * schema + * * users + * + * The archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. + */ + get: operations["migrations/get-archive-for-authenticated-user"]; + /** Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. */ + delete: operations["migrations/delete-archive-for-authenticated-user"]; + }; + "/user/migrations/{migration_id}/repos/{repo_name}/lock": { + /** Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. */ + delete: operations["migrations/unlock-repo-for-authenticated-user"]; + }; + "/user/migrations/{migration_id}/repositories": { + /** Lists all the repositories for this user migration. */ + get: operations["migrations/list-repos-for-user"]; + }; + "/user/orgs": { + /** + * List organizations for the authenticated user. + * + * **OAuth scope requirements** + * + * This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response. + */ + get: operations["orgs/list-for-authenticated-user"]; + }; + "/user/packages/{package_type}/{package_name}": { + /** + * Gets a specific package for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-package-for-authenticated-user"]; + /** + * Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:delete` scopes. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + delete: operations["packages/delete-package-for-authenticated-user"]; + }; + "/user/packages/{package_type}/{package_name}/restore": { + /** + * Restores a package owned by the authenticated user. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scopes. If `package_type` is not `container`, your token must also include the `repo` scope. + */ + post: operations["packages/restore-package-for-authenticated-user"]; + }; + "/user/packages/{package_type}/{package_name}/versions": { + /** + * Returns all package versions for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-all-package-versions-for-package-owned-by-authenticated-user"]; + }; + "/user/packages/{package_type}/{package_name}/versions/{package_version_id}": { + /** + * Gets a specific package version for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-package-version-for-authenticated-user"]; + /** + * Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + delete: operations["packages/delete-package-version-for-authenticated-user"]; + }; + "/user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore": { + /** + * Restores a package version owned by the authenticated user. + * + * You can restore a deleted package version under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scopes. If `package_type` is not `container`, your token must also include the `repo` scope. + */ + post: operations["packages/restore-package-version-for-authenticated-user"]; + }; + "/user/projects": { + post: operations["projects/create-for-authenticated-user"]; + }; + "/user/public_emails": { + /** Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. */ + get: operations["users/list-public-emails-for-authenticated"]; + }; + "/user/repos": { + /** + * Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. + * + * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + */ + get: operations["repos/list-for-authenticated-user"]; + /** + * Creates a new repository for the authenticated user. + * + * **OAuth scope requirements** + * + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository. + */ + post: operations["repos/create-for-authenticated-user"]; + }; + "/user/repository_invitations": { + /** When authenticating as a user, this endpoint will list all currently open repository invitations for that user. */ + get: operations["repos/list-invitations-for-authenticated-user"]; + }; + "/user/repository_invitations/{invitation_id}": { + delete: operations["repos/decline-invitation"]; + patch: operations["repos/accept-invitation"]; + }; + "/user/starred": { + /** + * Lists repositories the authenticated user has starred. + * + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + get: operations["activity/list-repos-starred-by-authenticated-user"]; + }; + "/user/starred/{owner}/{repo}": { + get: operations["activity/check-repo-is-starred-by-authenticated-user"]; + /** Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ + put: operations["activity/star-repo-for-authenticated-user"]; + delete: operations["activity/unstar-repo-for-authenticated-user"]; + }; + "/user/subscriptions": { + /** Lists repositories the authenticated user is watching. */ + get: operations["activity/list-watched-repos-for-authenticated-user"]; + }; + "/user/teams": { + /** List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). */ + get: operations["teams/list-for-authenticated-user"]; + }; + "/users": { + /** + * Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. + * + * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. + */ + get: operations["users/list"]; + }; + "/users/{username}": { + /** + * Provides publicly available information about someone with a GitHub account. + * + * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" + * + * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). + * + * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + */ + get: operations["users/get-by-username"]; + }; + "/users/{username}/events": { + /** If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. */ + get: operations["activity/list-events-for-authenticated-user"]; + }; + "/users/{username}/events/orgs/{org}": { + /** This is the user's organization dashboard. You must be authenticated as the user to view this. */ + get: operations["activity/list-org-events-for-authenticated-user"]; + }; + "/users/{username}/events/public": { + get: operations["activity/list-public-events-for-user"]; + }; + "/users/{username}/followers": { + /** Lists the people following the specified user. */ + get: operations["users/list-followers-for-user"]; + }; + "/users/{username}/following": { + /** Lists the people who the specified user follows. */ + get: operations["users/list-following-for-user"]; + }; + "/users/{username}/following/{target_user}": { + get: operations["users/check-following-for-user"]; + }; + "/users/{username}/gists": { + /** Lists public gists for the specified user: */ + get: operations["gists/list-for-user"]; + }; + "/users/{username}/gpg_keys": { + /** Lists the GPG keys for a user. This information is accessible by anyone. */ + get: operations["users/list-gpg-keys-for-user"]; + }; + "/users/{username}/hovercard": { + /** + * Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. + * + * The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this: + * + * ```shell + * curl -u username:token + * https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 + * ``` + */ + get: operations["users/get-context-for-user"]; + }; + "/users/{username}/installation": { + /** + * Enables an authenticated GitHub App to find the user’s installation information. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + get: operations["apps/get-user-installation"]; + }; + "/users/{username}/keys": { + /** Lists the _verified_ public SSH keys for a user. This is accessible by anyone. */ + get: operations["users/list-public-keys-for-user"]; + }; + "/users/{username}/orgs": { + /** + * List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. + * + * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + */ + get: operations["orgs/list-for-user"]; + }; + "/users/{username}/packages/{package_type}/{package_name}": { + /** + * Gets a specific package metadata for a public package owned by a user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-package-for-user"]; + }; + "/users/{username}/packages/{package_type}/{package_name}/versions": { + /** + * Returns all package versions for a public package owned by a specified user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-all-package-versions-for-package-owned-by-user"]; + }; + "/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}": { + /** + * Gets a specific package version for a public package owned by a specified user. + * + * At this time, to use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + get: operations["packages/get-package-version-for-user"]; + }; + "/users/{username}/projects": { + get: operations["projects/list-for-user"]; + }; + "/users/{username}/received_events": { + /** These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. */ + get: operations["activity/list-received-events-for-user"]; + }; + "/users/{username}/received_events/public": { + get: operations["activity/list-received-public-events-for-user"]; + }; + "/users/{username}/repos": { + /** Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user. */ + get: operations["repos/list-for-user"]; + }; + "/users/{username}/settings/billing/actions": { + /** + * Gets the summary of the free and paid GitHub Actions minutes used. + * + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * Access tokens must have the `user` scope. + */ + get: operations["billing/get-github-actions-billing-user"]; + }; + "/users/{username}/settings/billing/packages": { + /** + * Gets the free and paid storage used for GitHub Packages in gigabytes. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `user` scope. + */ + get: operations["billing/get-github-packages-billing-user"]; + }; + "/users/{username}/settings/billing/shared-storage": { + /** + * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `user` scope. + */ + get: operations["billing/get-shared-storage-billing-user"]; + }; + "/users/{username}/starred": { + /** + * Lists repositories a user has starred. + * + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + get: operations["activity/list-repos-starred-by-user"]; + }; + "/users/{username}/subscriptions": { + /** Lists repositories a user is watching. */ + get: operations["activity/list-repos-watched-by-user"]; + }; + "/zen": { + /** Get a random sentence from the Zen of GitHub */ + get: operations["meta/get-zen"]; + }; + "/repos/{owner}/{repo}/compare/{base}...{head}": { + /** + * **Deprecated**: Use `repos.compareCommitsWithBasehead()` (`GET /repos/{owner}/{repo}/compare/{basehead}`) instead. Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. + * + * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * + * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. + * + * **Working with large comparisons** + * + * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." + * + * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + get: operations["repos/compare-commits"]; + }; + "/content_references/{content_reference_id}/attachments": { + /** + * **Deprecated:** use `apps.createContentAttachmentForRepo()` (`POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments`) instead. Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. + * + * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + post: operations["apps/create-content-attachment"]; + }; +} + +export interface components { + schemas: { + /** Simple User */ + "simple-user": { + name?: string | null; + email?: string | null; + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + starred_at?: string; + } | null; + /** GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. */ + integration: { + /** Unique identifier of the GitHub app */ + id: number; + /** The slug name of the GitHub app */ + slug?: string; + node_id: string; + owner: components["schemas"]["simple-user"] | null; + /** The name of the GitHub app */ + name: string; + description: string | null; + external_url: string; + html_url: string; + created_at: string; + updated_at: string; + /** The set of permissions for the GitHub app */ + permissions: { + issues?: string; + checks?: string; + metadata?: string; + contents?: string; + deployments?: string; + } & { [key: string]: string }; + /** The list of events for the GitHub app */ + events: string[]; + /** The number of installations associated with the GitHub app */ + installations_count?: number; + client_id?: string; + client_secret?: string; + webhook_secret?: string | null; + pem?: string; + } | null; + /** Basic Error */ + "basic-error": { + message?: string; + documentation_url?: string; + url?: string; + status?: string; + }; + /** Validation Error Simple */ + "validation-error-simple": { + message: string; + documentation_url: string; + errors?: string[]; + }; + /** The URL to which the payloads will be delivered. */ + "webhook-config-url": string; + /** The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. */ + "webhook-config-content-type": string; + /** If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers). */ + "webhook-config-secret": string; + "webhook-config-insecure-ssl": string | number; + /** Configuration object of the webhook */ + "webhook-config": { + url?: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + }; + /** Delivery made by a webhook, without request and response information. */ + "hook-delivery-item": { + /** Unique identifier of the webhook delivery. */ + id: number; + /** Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). */ + guid: string; + /** Time when the webhook delivery occurred. */ + delivered_at: string; + /** Whether the webhook delivery is a redelivery. */ + redelivery: boolean; + /** Time spent delivering. */ + duration: number; + /** Describes the response returned after attempting the delivery. */ + status: string; + /** Status code received when delivery was made. */ + status_code: number; + /** The event that triggered the delivery. */ + event: string; + /** The type of activity for the event that triggered the delivery. */ + action: string | null; + /** The id of the GitHub App installation associated with this event. */ + installation_id: number | null; + /** The id of the repository associated with this event. */ + repository_id: number | null; + }; + /** Scim Error */ + "scim-error": { + message?: string | null; + documentation_url?: string | null; + detail?: string | null; + status?: number; + scimType?: string | null; + schemas?: string[]; + }; + /** Validation Error */ + "validation-error": { + message: string; + documentation_url: string; + errors?: { + resource?: string; + field?: string; + message?: string; + code: string; + index?: number; + value?: (string | null) | (number | null) | (string[] | null); + }[]; + }; + /** Delivery made by a webhook. */ + "hook-delivery": { + /** Unique identifier of the delivery. */ + id: number; + /** Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). */ + guid: string; + /** Time when the delivery was delivered. */ + delivered_at: string; + /** Whether the delivery is a redelivery. */ + redelivery: boolean; + /** Time spent delivering. */ + duration: number; + /** Description of the status of the attempted delivery */ + status: string; + /** Status code received when delivery was made. */ + status_code: number; + /** The event that triggered the delivery. */ + event: string; + /** The type of activity for the event that triggered the delivery. */ + action: string | null; + /** The id of the GitHub App installation associated with this event. */ + installation_id: number | null; + /** The id of the repository associated with this event. */ + repository_id: number | null; + request: { + /** The request headers sent with the webhook delivery. */ + headers: { [key: string]: any } | null; + /** The webhook payload. */ + payload: { [key: string]: any } | null; + }; + response: { + /** The response headers received when the delivery was made. */ + headers: { [key: string]: any } | null; + /** The response payload received. */ + payload: string | null; + }; + }; + /** An enterprise account */ + enterprise: { + /** A short description of the enterprise. */ + description?: string | null; + html_url: string; + /** The enterprise's website URL. */ + website_url?: string | null; + /** Unique identifier of the enterprise */ + id: number; + node_id: string; + /** The name of the enterprise. */ + name: string; + /** The slug url identifier for the enterprise. */ + slug: string; + created_at: string | null; + updated_at: string | null; + avatar_url: string; + }; + /** The permissions granted to the user-to-server access token. */ + "app-permissions": { + /** The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. Can be one of: `read` or `write`. */ + actions?: "read" | "write"; + /** The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. Can be one of: `read` or `write`. */ + administration?: "read" | "write"; + /** The level of permission to grant the access token for checks on code. Can be one of: `read` or `write`. */ + checks?: "read" | "write"; + /** The level of permission to grant the access token for notification of content references and creation content attachments. Can be one of: `read` or `write`. */ + content_references?: "read" | "write"; + /** The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. Can be one of: `read` or `write`. */ + contents?: "read" | "write"; + /** The level of permission to grant the access token for deployments and deployment statuses. Can be one of: `read` or `write`. */ + deployments?: "read" | "write"; + /** The level of permission to grant the access token for managing repository environments. Can be one of: `read` or `write`. */ + environments?: "read" | "write"; + /** The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. Can be one of: `read` or `write`. */ + issues?: "read" | "write"; + /** The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. Can be one of: `read` or `write`. */ + metadata?: "read" | "write"; + /** The level of permission to grant the access token for packages published to GitHub Packages. Can be one of: `read` or `write`. */ + packages?: "read" | "write"; + /** The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. Can be one of: `read` or `write`. */ + pages?: "read" | "write"; + /** The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. Can be one of: `read` or `write`. */ + pull_requests?: "read" | "write"; + /** The level of permission to grant the access token to manage the post-receive hooks for a repository. Can be one of: `read` or `write`. */ + repository_hooks?: "read" | "write"; + /** The level of permission to grant the access token to manage repository projects, columns, and cards. Can be one of: `read`, `write`, or `admin`. */ + repository_projects?: "read" | "write" | "admin"; + /** The level of permission to grant the access token to view and manage secret scanning alerts. Can be one of: `read` or `write`. */ + secret_scanning_alerts?: "read" | "write"; + /** The level of permission to grant the access token to manage repository secrets. Can be one of: `read` or `write`. */ + secrets?: "read" | "write"; + /** The level of permission to grant the access token to view and manage security events like code scanning alerts. Can be one of: `read` or `write`. */ + security_events?: "read" | "write"; + /** The level of permission to grant the access token to manage just a single file. Can be one of: `read` or `write`. */ + single_file?: "read" | "write"; + /** The level of permission to grant the access token for commit statuses. Can be one of: `read` or `write`. */ + statuses?: "read" | "write"; + /** The level of permission to grant the access token to retrieve Dependabot alerts. Can be one of: `read`. */ + vulnerability_alerts?: "read"; + /** The level of permission to grant the access token to update GitHub Actions workflow files. Can be one of: `write`. */ + workflows?: "write"; + /** The level of permission to grant the access token for organization teams and members. Can be one of: `read` or `write`. */ + members?: "read" | "write"; + /** The level of permission to grant the access token to manage access to an organization. Can be one of: `read` or `write`. */ + organization_administration?: "read" | "write"; + /** The level of permission to grant the access token to manage the post-receive hooks for an organization. Can be one of: `read` or `write`. */ + organization_hooks?: "read" | "write"; + /** The level of permission to grant the access token for viewing an organization's plan. Can be one of: `read`. */ + organization_plan?: "read"; + /** The level of permission to grant the access token to manage organization projects, columns, and cards. Can be one of: `read`, `write`, or `admin`. */ + organization_projects?: "read" | "write" | "admin"; + /** The level of permission to grant the access token for organization packages published to GitHub Packages. Can be one of: `read` or `write`. */ + organization_packages?: "read" | "write"; + /** The level of permission to grant the access token to manage organization secrets. Can be one of: `read` or `write`. */ + organization_secrets?: "read" | "write"; + /** The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. Can be one of: `read` or `write`. */ + organization_self_hosted_runners?: "read" | "write"; + /** The level of permission to grant the access token to view and manage users blocked by the organization. Can be one of: `read` or `write`. */ + organization_user_blocking?: "read" | "write"; + /** The level of permission to grant the access token to manage team discussions and related comments. Can be one of: `read` or `write`. */ + team_discussions?: "read" | "write"; + }; + /** Installation */ + installation: { + /** The ID of the installation. */ + id: number; + account: + | (Partial & + Partial) + | null; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection: "all" | "selected"; + access_tokens_url: string; + repositories_url: string; + html_url: string; + app_id: number; + /** The ID of the user or organization this token is being scoped to. */ + target_id: number; + target_type: string; + permissions: components["schemas"]["app-permissions"]; + events: string[]; + created_at: string; + updated_at: string; + single_file_name: string | null; + has_multiple_single_files?: boolean; + single_file_paths?: string[]; + app_slug: string; + suspended_by: components["schemas"]["simple-user"] | null; + suspended_at: string | null; + contact_email?: string | null; + }; + /** License Simple */ + "license-simple": { + key: string; + name: string; + url: string | null; + spdx_id: string | null; + node_id: string; + html_url?: string; + }; + /** A git repository */ + repository: { + /** Unique identifier of the repository */ + id: number; + node_id: string; + /** The name of the repository. */ + name: string; + full_name: string; + license: components["schemas"]["license-simple"] | null; + organization?: components["schemas"]["simple-user"] | null; + forks: number; + permissions?: { + admin: boolean; + pull: boolean; + triage?: boolean; + push: boolean; + maintain?: boolean; + }; + owner: components["schemas"]["simple-user"]; + /** Whether the repository is private or public. */ + private: boolean; + html_url: string; + description: string | null; + fork: boolean; + url: string; + archive_url: string; + assignees_url: string; + blobs_url: string; + branches_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + contributors_url: string; + deployments_url: string; + downloads_url: string; + events_url: string; + forks_url: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + languages_url: string; + merges_url: string; + milestones_url: string; + notifications_url: string; + pulls_url: string; + releases_url: string; + ssh_url: string; + stargazers_url: string; + statuses_url: string; + subscribers_url: string; + subscription_url: string; + tags_url: string; + teams_url: string; + trees_url: string; + clone_url: string; + mirror_url: string | null; + hooks_url: string; + svn_url: string; + homepage: string | null; + language: string | null; + forks_count: number; + stargazers_count: number; + watchers_count: number; + size: number; + /** The default branch of the repository. */ + default_branch: string; + open_issues_count: number; + /** Whether this repository acts as a template that can be used to generate new repositories. */ + is_template?: boolean; + topics?: string[]; + /** Whether issues are enabled. */ + has_issues: boolean; + /** Whether projects are enabled. */ + has_projects: boolean; + /** Whether the wiki is enabled. */ + has_wiki: boolean; + has_pages: boolean; + /** Whether downloads are enabled. */ + has_downloads: boolean; + /** Whether the repository is archived. */ + archived: boolean; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** The repository visibility: public, private, or internal. */ + visibility?: string; + pushed_at: string | null; + created_at: string | null; + updated_at: string | null; + /** Whether to allow rebase merges for pull requests. */ + allow_rebase_merge?: boolean; + template_repository?: { + id?: number; + node_id?: string; + name?: string; + full_name?: string; + owner?: { + login?: string; + id?: number; + node_id?: string; + avatar_url?: string; + gravatar_id?: string; + url?: string; + html_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + starred_url?: string; + subscriptions_url?: string; + organizations_url?: string; + repos_url?: string; + events_url?: string; + received_events_url?: string; + type?: string; + site_admin?: boolean; + }; + private?: boolean; + html_url?: string; + description?: string; + fork?: boolean; + url?: string; + archive_url?: string; + assignees_url?: string; + blobs_url?: string; + branches_url?: string; + collaborators_url?: string; + comments_url?: string; + commits_url?: string; + compare_url?: string; + contents_url?: string; + contributors_url?: string; + deployments_url?: string; + downloads_url?: string; + events_url?: string; + forks_url?: string; + git_commits_url?: string; + git_refs_url?: string; + git_tags_url?: string; + git_url?: string; + issue_comment_url?: string; + issue_events_url?: string; + issues_url?: string; + keys_url?: string; + labels_url?: string; + languages_url?: string; + merges_url?: string; + milestones_url?: string; + notifications_url?: string; + pulls_url?: string; + releases_url?: string; + ssh_url?: string; + stargazers_url?: string; + statuses_url?: string; + subscribers_url?: string; + subscription_url?: string; + tags_url?: string; + teams_url?: string; + trees_url?: string; + clone_url?: string; + mirror_url?: string; + hooks_url?: string; + svn_url?: string; + homepage?: string; + language?: string; + forks_count?: number; + stargazers_count?: number; + watchers_count?: number; + size?: number; + default_branch?: string; + open_issues_count?: number; + is_template?: boolean; + topics?: string[]; + has_issues?: boolean; + has_projects?: boolean; + has_wiki?: boolean; + has_pages?: boolean; + has_downloads?: boolean; + archived?: boolean; + disabled?: boolean; + visibility?: string; + pushed_at?: string; + created_at?: string; + updated_at?: string; + permissions?: { + admin?: boolean; + maintain?: boolean; + push?: boolean; + triage?: boolean; + pull?: boolean; + }; + allow_rebase_merge?: boolean; + temp_clone_token?: string; + allow_squash_merge?: boolean; + allow_auto_merge?: boolean; + delete_branch_on_merge?: boolean; + allow_merge_commit?: boolean; + subscribers_count?: number; + network_count?: number; + } | null; + temp_clone_token?: string; + /** Whether to allow squash merges for pull requests. */ + allow_squash_merge?: boolean; + /** Whether to allow Auto-merge to be used on pull requests. */ + allow_auto_merge?: boolean; + /** Whether to delete head branches when pull requests are merged */ + delete_branch_on_merge?: boolean; + /** Whether to allow merge commits for pull requests. */ + allow_merge_commit?: boolean; + subscribers_count?: number; + network_count?: number; + open_issues: number; + watchers: number; + master_branch?: string; + starred_at?: string; + }; + /** Authentication token for a GitHub App installed on a user or org. */ + "installation-token": { + token: string; + expires_at: string; + permissions?: components["schemas"]["app-permissions"]; + repository_selection?: "all" | "selected"; + repositories?: components["schemas"]["repository"][]; + single_file?: string; + has_multiple_single_files?: boolean; + single_file_paths?: string[]; + }; + /** The authorization associated with an OAuth Access. */ + "application-grant": { + id: number; + url: string; + app: { + client_id: string; + name: string; + url: string; + }; + created_at: string; + updated_at: string; + scopes: string[]; + user?: components["schemas"]["simple-user"] | null; + }; + "scoped-installation": { + permissions: components["schemas"]["app-permissions"]; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection: "all" | "selected"; + single_file_name: string | null; + has_multiple_single_files?: boolean; + single_file_paths?: string[]; + repositories_url: string; + account: components["schemas"]["simple-user"]; + }; + /** The authorization for an OAuth app, GitHub App, or a Personal Access Token. */ + authorization: { + id: number; + url: string; + /** A list of scopes that this authorization is in. */ + scopes: string[] | null; + token: string; + token_last_eight: string | null; + hashed_token: string | null; + app: { + client_id: string; + name: string; + url: string; + }; + note: string | null; + note_url: string | null; + updated_at: string; + created_at: string; + fingerprint: string | null; + user?: components["schemas"]["simple-user"] | null; + installation?: components["schemas"]["scoped-installation"] | null; + }; + /** Code Of Conduct */ + "code-of-conduct": { + key: string; + name: string; + url: string; + body?: string; + html_url: string | null; + }; + /** The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ + "enabled-organizations": "all" | "none" | "selected"; + /** The permissions policy that controls the actions that are allowed to run. Can be one of: `all`, `local_only`, or `selected`. */ + "allowed-actions": "all" | "local_only" | "selected"; + /** The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. */ + "selected-actions-url": string; + "actions-enterprise-permissions": { + enabled_organizations: components["schemas"]["enabled-organizations"]; + /** The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`. */ + selected_organizations_url?: string; + allowed_actions?: components["schemas"]["allowed-actions"]; + selected_actions_url?: components["schemas"]["selected-actions-url"]; + }; + /** Organization Simple */ + "organization-simple": { + login: string; + id: number; + node_id: string; + url: string; + repos_url: string; + events_url: string; + hooks_url: string; + issues_url: string; + members_url: string; + public_members_url: string; + avatar_url: string; + description: string | null; + }; + "selected-actions": { + /** Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. */ + github_owned_allowed?: boolean; + /** Whether actions in GitHub Marketplace from verified creators are allowed. Set to `true` to allow all GitHub Marketplace actions by verified creators. */ + verified_allowed?: boolean; + /** Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`." */ + patterns_allowed?: string[]; + }; + "runner-groups-enterprise": { + id: number; + name: string; + visibility: string; + default: boolean; + selected_organizations_url?: string; + runners_url: string; + allows_public_repositories: boolean; + }; + /** A self hosted runner */ + runner: { + /** The id of the runner. */ + id: number; + /** The name of the runner. */ + name: string; + /** The Operating System of the runner. */ + os: string; + /** The status of the runner. */ + status: string; + busy: boolean; + labels: { + /** Unique identifier of the label. */ + id?: number; + /** Name of the label. */ + name?: string; + /** The type of label. Read-only labels are applied automatically when the runner is configured. */ + type?: "read-only" | "custom"; + }[]; + }; + /** Runner Application */ + "runner-application": { + os: string; + architecture: string; + download_url: string; + filename: string; + /** A short lived bearer token used to download the runner, if needed. */ + temp_download_token?: string; + sha256_checksum?: string; + }; + /** Authentication Token */ + "authentication-token": { + /** The token used for authentication */ + token: string; + /** The time this token expires */ + expires_at: string; + permissions?: { [key: string]: unknown }; + /** The repositories this token has access to */ + repositories?: components["schemas"]["repository"][]; + single_file?: string | null; + /** Describe whether all repositories have been selected or there's a selection involved */ + repository_selection?: "all" | "selected"; + }; + "audit-log-event": { + /** The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ + "@timestamp"?: number; + /** The name of the action that was performed, for example `user.login` or `repo.create`. */ + action?: string; + active?: boolean; + active_was?: boolean; + /** The actor who performed the action. */ + actor?: string; + /** The id of the actor who performed the action. */ + actor_id?: number; + actor_location?: { + country_name?: string; + }; + data?: { [key: string]: any }; + org_id?: number; + /** The username of the account being blocked. */ + blocked_user?: string; + business?: string; + config?: any[]; + config_was?: any[]; + content_type?: string; + /** The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). */ + created_at?: number; + deploy_key_fingerprint?: string; + /** A unique identifier for an audit event. */ + _document_id?: string; + emoji?: string; + events?: any[]; + events_were?: any[]; + explanation?: string; + fingerprint?: string; + hook_id?: number; + limited_availability?: boolean; + message?: string; + name?: string; + old_user?: string; + openssh_public_key?: string; + org?: string; + previous_visibility?: string; + read_only?: boolean; + /** The name of the repository. */ + repo?: string; + /** The name of the repository. */ + repository?: string; + repository_public?: boolean; + target_login?: string; + team?: string; + /** The type of protocol (for example, HTTP or SSH) used to transfer Git data. */ + transport_protocol?: number; + /** A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. */ + transport_protocol_name?: string; + /** The user that was affected by the action performed (if available). */ + user?: string; + /** The repository visibility, for example `public` or `private`. */ + visibility?: string; + }; + "actions-billing-usage": { + /** The sum of the free and paid GitHub Actions minutes used. */ + total_minutes_used: number; + /** The total paid GitHub Actions minutes used. */ + total_paid_minutes_used: number; + /** The amount of free GitHub Actions minutes available. */ + included_minutes: number; + minutes_used_breakdown: { + /** Total minutes used on Ubuntu runner machines. */ + UBUNTU?: number; + /** Total minutes used on macOS runner machines. */ + MACOS?: number; + /** Total minutes used on Windows runner machines. */ + WINDOWS?: number; + }; + }; + "packages-billing-usage": { + /** Sum of the free and paid storage space (GB) for GitHuub Packages. */ + total_gigabytes_bandwidth_used: number; + /** Total paid storage space (GB) for GitHuub Packages. */ + total_paid_gigabytes_bandwidth_used: number; + /** Free storage space (GB) for GitHub Packages. */ + included_gigabytes_bandwidth: number; + }; + "combined-billing-usage": { + /** Numbers of days left in billing cycle. */ + days_left_in_billing_cycle: number; + /** Estimated storage space (GB) used in billing cycle. */ + estimated_paid_storage_for_month: number; + /** Estimated sum of free and paid storage space (GB) used in billing cycle. */ + estimated_storage_for_month: number; + }; + /** Actor */ + actor: { + id: number; + login: string; + display_login?: string; + gravatar_id: string | null; + url: string; + avatar_url: string; + }; + /** Color-coded labels help you categorize and filter your issues (just like labels in Gmail). */ + label: { + id: number; + node_id: string; + /** URL for the label */ + url: string; + /** The name of the label. */ + name: string; + description: string | null; + /** 6-character hex code, without the leading #, identifying the color */ + color: string; + default: boolean; + }; + /** A collection of related issues and pull requests. */ + milestone: { + url: string; + html_url: string; + labels_url: string; + id: number; + node_id: string; + /** The number of the milestone. */ + number: number; + /** The state of the milestone. */ + state: "open" | "closed"; + /** The title of the milestone. */ + title: string; + description: string | null; + creator: components["schemas"]["simple-user"] | null; + open_issues: number; + closed_issues: number; + created_at: string; + updated_at: string; + closed_at: string | null; + due_on: string | null; + }; + /** How the author is associated with the repository. */ + author_association: + | "COLLABORATOR" + | "CONTRIBUTOR" + | "FIRST_TIMER" + | "FIRST_TIME_CONTRIBUTOR" + | "MANNEQUIN" + | "MEMBER" + | "NONE" + | "OWNER"; + /** Issue Simple */ + "issue-simple": { + id: number; + node_id: string; + url: string; + repository_url: string; + labels_url: string; + comments_url: string; + events_url: string; + html_url: string; + number: number; + state: string; + title: string; + body?: string; + user: components["schemas"]["simple-user"] | null; + labels: components["schemas"]["label"][]; + assignee: components["schemas"]["simple-user"] | null; + assignees?: components["schemas"]["simple-user"][] | null; + milestone: components["schemas"]["milestone"] | null; + locked: boolean; + active_lock_reason?: string | null; + comments: number; + pull_request?: { + merged_at?: string | null; + diff_url: string | null; + html_url: string | null; + patch_url: string | null; + url: string | null; + }; + closed_at: string | null; + created_at: string; + updated_at: string; + author_association: components["schemas"]["author_association"]; + body_html?: string; + body_text?: string; + timeline_url?: string; + repository?: components["schemas"]["repository"]; + performed_via_github_app?: components["schemas"]["integration"] | null; + }; + "reaction-rollup": { + url: string; + total_count: number; + "+1": number; + "-1": number; + laugh: number; + confused: number; + heart: number; + hooray: number; + eyes: number; + rocket: number; + }; + /** Comments provide a way for people to collaborate on an issue. */ + "issue-comment": { + /** Unique identifier of the issue comment */ + id: number; + node_id: string; + /** URL for the issue comment */ + url: string; + /** Contents of the issue comment */ + body?: string; + body_text?: string; + body_html?: string; + html_url: string; + user: components["schemas"]["simple-user"] | null; + created_at: string; + updated_at: string; + issue_url: string; + author_association: components["schemas"]["author_association"]; + performed_via_github_app?: components["schemas"]["integration"] | null; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** Event */ + event: { + id: string; + type: string | null; + actor: components["schemas"]["actor"]; + repo: { + id: number; + name: string; + url: string; + }; + org?: components["schemas"]["actor"]; + payload: { + action?: string; + issue?: components["schemas"]["issue-simple"]; + comment?: components["schemas"]["issue-comment"]; + pages?: { + page_name?: string; + title?: string; + summary?: string | null; + action?: string; + sha?: string; + html_url?: string; + }[]; + }; + public: boolean; + created_at: string | null; + }; + /** Hypermedia Link with Type */ + "link-with-type": { + href: string; + type: string; + }; + /** Feed */ + feed: { + timeline_url: string; + user_url: string; + current_user_public_url?: string; + current_user_url?: string; + current_user_actor_url?: string; + current_user_organization_url?: string; + current_user_organization_urls?: string[]; + security_advisories_url?: string; + _links: { + timeline: components["schemas"]["link-with-type"]; + user: components["schemas"]["link-with-type"]; + security_advisories?: components["schemas"]["link-with-type"]; + current_user?: components["schemas"]["link-with-type"]; + current_user_public?: components["schemas"]["link-with-type"]; + current_user_actor?: components["schemas"]["link-with-type"]; + current_user_organization?: components["schemas"]["link-with-type"]; + current_user_organizations?: components["schemas"]["link-with-type"][]; + }; + }; + /** Base Gist */ + "base-gist": { + url: string; + forks_url: string; + commits_url: string; + id: string; + node_id: string; + git_pull_url: string; + git_push_url: string; + html_url: string; + files: { + [key: string]: { + filename?: string; + type?: string; + language?: string; + raw_url?: string; + size?: number; + }; + }; + public: boolean; + created_at: string; + updated_at: string; + description: string | null; + comments: number; + user: components["schemas"]["simple-user"] | null; + comments_url: string; + owner?: components["schemas"]["simple-user"] | null; + truncated?: boolean; + forks?: { [key: string]: unknown }[]; + history?: { [key: string]: unknown }[]; + }; + /** Public User */ + "public-user": { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + name: string | null; + company: string | null; + blog: string | null; + location: string | null; + email: string | null; + hireable: boolean | null; + bio: string | null; + twitter_username?: string | null; + public_repos: number; + public_gists: number; + followers: number; + following: number; + created_at: string; + updated_at: string; + plan?: { + collaborators: number; + name: string; + space: number; + private_repos: number; + }; + suspended_at?: string | null; + private_gists?: number; + total_private_repos?: number; + owned_private_repos?: number; + disk_usage?: number; + collaborators?: number; + }; + /** Gist History */ + "gist-history": { + user?: components["schemas"]["simple-user"]; + version?: string; + committed_at?: string; + change_status?: { + total?: number; + additions?: number; + deletions?: number; + }; + url?: string; + }; + /** Gist Simple */ + "gist-simple": { + forks?: + | { + id?: string; + url?: string; + user?: components["schemas"]["public-user"]; + created_at?: string; + updated_at?: string; + }[] + | null; + history?: components["schemas"]["gist-history"][] | null; + /** Gist */ + fork_of?: { + url: string; + forks_url: string; + commits_url: string; + id: string; + node_id: string; + git_pull_url: string; + git_push_url: string; + html_url: string; + files: { + [key: string]: { + filename?: string; + type?: string; + language?: string; + raw_url?: string; + size?: number; + }; + }; + public: boolean; + created_at: string; + updated_at: string; + description: string | null; + comments: number; + user: components["schemas"]["simple-user"] | null; + comments_url: string; + owner?: components["schemas"]["simple-user"] | null; + truncated?: boolean; + forks?: { [key: string]: unknown }[]; + history?: { [key: string]: unknown }[]; + } | null; + url?: string; + forks_url?: string; + commits_url?: string; + id?: string; + node_id?: string; + git_pull_url?: string; + git_push_url?: string; + html_url?: string; + files?: { + [key: string]: { + filename?: string; + type?: string; + language?: string; + raw_url?: string; + size?: number; + truncated?: boolean; + content?: string; + } | null; + }; + public?: boolean; + created_at?: string; + updated_at?: string; + description?: string | null; + comments?: number; + user?: string | null; + comments_url?: string; + owner?: components["schemas"]["simple-user"]; + truncated?: boolean; + }; + /** A comment made to a gist. */ + "gist-comment": { + id: number; + node_id: string; + url: string; + /** The comment text. */ + body: string; + user: components["schemas"]["simple-user"] | null; + created_at: string; + updated_at: string; + author_association: components["schemas"]["author_association"]; + }; + /** Gist Commit */ + "gist-commit": { + url: string; + version: string; + user: components["schemas"]["simple-user"] | null; + change_status: { + total?: number; + additions?: number; + deletions?: number; + }; + committed_at: string; + }; + /** Gitignore Template */ + "gitignore-template": { + name: string; + source: string; + }; + /** Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. */ + issue: { + id: number; + node_id: string; + /** URL for the issue */ + url: string; + repository_url: string; + labels_url: string; + comments_url: string; + events_url: string; + html_url: string; + /** Number uniquely identifying the issue within its repository */ + number: number; + /** State of the issue; either 'open' or 'closed' */ + state: string; + /** Title of the issue */ + title: string; + /** Contents of the issue */ + body?: string | null; + user: components["schemas"]["simple-user"] | null; + /** Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository */ + labels: ( + | string + | { + id?: number; + node_id?: string; + url?: string; + name?: string; + description?: string | null; + color?: string | null; + default?: boolean; + } + )[]; + assignee: components["schemas"]["simple-user"] | null; + assignees?: components["schemas"]["simple-user"][] | null; + milestone: components["schemas"]["milestone"] | null; + locked: boolean; + active_lock_reason?: string | null; + comments: number; + pull_request?: { + merged_at?: string | null; + diff_url: string | null; + html_url: string | null; + patch_url: string | null; + url: string | null; + }; + closed_at: string | null; + created_at: string; + updated_at: string; + closed_by?: components["schemas"]["simple-user"] | null; + body_html?: string; + body_text?: string; + timeline_url?: string; + repository?: components["schemas"]["repository"]; + performed_via_github_app?: components["schemas"]["integration"] | null; + author_association: components["schemas"]["author_association"]; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** License */ + license: { + key: string; + name: string; + spdx_id: string | null; + url: string | null; + node_id: string; + html_url: string; + description: string; + implementation: string; + permissions: string[]; + conditions: string[]; + limitations: string[]; + body: string; + featured: boolean; + }; + /** Marketplace Listing Plan */ + "marketplace-listing-plan": { + url: string; + accounts_url: string; + id: number; + number: number; + name: string; + description: string; + monthly_price_in_cents: number; + yearly_price_in_cents: number; + price_model: string; + has_free_trial: boolean; + unit_name: string | null; + state: string; + bullets: string[]; + }; + /** Marketplace Purchase */ + "marketplace-purchase": { + url: string; + type: string; + id: number; + login: string; + organization_billing_email?: string; + email?: string | null; + marketplace_pending_change?: { + is_installed?: boolean; + effective_date?: string; + unit_count?: number | null; + id?: number; + plan?: components["schemas"]["marketplace-listing-plan"]; + } | null; + marketplace_purchase: { + billing_cycle?: string; + next_billing_date?: string | null; + is_installed?: boolean; + unit_count?: number | null; + on_free_trial?: boolean; + free_trial_ends_on?: string | null; + updated_at?: string; + plan?: components["schemas"]["marketplace-listing-plan"]; + }; + }; + /** Api Overview */ + "api-overview": { + verifiable_password_authentication: boolean; + ssh_key_fingerprints?: { + SHA256_RSA?: string; + SHA256_DSA?: string; + }; + hooks?: string[]; + web?: string[]; + api?: string[]; + git?: string[]; + packages?: string[]; + pages?: string[]; + importer?: string[]; + actions?: string[]; + dependabot?: string[]; + }; + /** Minimal Repository */ + "minimal-repository": { + id: number; + node_id: string; + name: string; + full_name: string; + owner: components["schemas"]["simple-user"]; + private: boolean; + html_url: string; + description: string | null; + fork: boolean; + url: string; + archive_url: string; + assignees_url: string; + blobs_url: string; + branches_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + contributors_url: string; + deployments_url: string; + downloads_url: string; + events_url: string; + forks_url: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url?: string; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + languages_url: string; + merges_url: string; + milestones_url: string; + notifications_url: string; + pulls_url: string; + releases_url: string; + ssh_url?: string; + stargazers_url: string; + statuses_url: string; + subscribers_url: string; + subscription_url: string; + tags_url: string; + teams_url: string; + trees_url: string; + clone_url?: string; + mirror_url?: string | null; + hooks_url: string; + svn_url?: string; + homepage?: string | null; + language?: string | null; + forks_count?: number; + stargazers_count?: number; + watchers_count?: number; + size?: number; + default_branch?: string; + open_issues_count?: number; + is_template?: boolean; + topics?: string[]; + has_issues?: boolean; + has_projects?: boolean; + has_wiki?: boolean; + has_pages?: boolean; + has_downloads?: boolean; + archived?: boolean; + disabled?: boolean; + visibility?: string; + pushed_at?: string | null; + created_at?: string | null; + updated_at?: string | null; + permissions?: { + admin?: boolean; + maintain?: boolean; + push?: boolean; + triage?: boolean; + pull?: boolean; + }; + template_repository?: components["schemas"]["repository"] | null; + temp_clone_token?: string; + delete_branch_on_merge?: boolean; + subscribers_count?: number; + network_count?: number; + code_of_conduct?: components["schemas"]["code-of-conduct"]; + license?: { + key?: string; + name?: string; + spdx_id?: string; + url?: string; + node_id?: string; + } | null; + forks?: number; + open_issues?: number; + watchers?: number; + }; + /** Thread */ + thread: { + id: string; + repository: components["schemas"]["minimal-repository"]; + subject: { + title: string; + url: string; + latest_comment_url: string; + type: string; + }; + reason: string; + unread: boolean; + updated_at: string; + last_read_at: string | null; + url: string; + subscription_url: string; + }; + /** Thread Subscription */ + "thread-subscription": { + subscribed: boolean; + ignored: boolean; + reason: string | null; + created_at: string | null; + url: string; + thread_url?: string; + repository_url?: string; + }; + /** Organization Full */ + "organization-full": { + login: string; + id: number; + node_id: string; + url: string; + repos_url: string; + events_url: string; + hooks_url: string; + issues_url: string; + members_url: string; + public_members_url: string; + avatar_url: string; + description: string | null; + name?: string; + company?: string; + blog?: string; + location?: string; + email?: string; + twitter_username?: string | null; + is_verified?: boolean; + has_organization_projects: boolean; + has_repository_projects: boolean; + public_repos: number; + public_gists: number; + followers: number; + following: number; + html_url: string; + created_at: string; + type: string; + total_private_repos?: number; + owned_private_repos?: number; + private_gists?: number | null; + disk_usage?: number | null; + collaborators?: number | null; + billing_email?: string | null; + plan?: { + name: string; + space: number; + private_repos: number; + filled_seats?: number; + seats?: number; + }; + default_repository_permission?: string | null; + members_can_create_repositories?: boolean | null; + two_factor_requirement_enabled?: boolean | null; + members_allowed_repository_creation_type?: string; + members_can_create_public_repositories?: boolean; + members_can_create_private_repositories?: boolean; + members_can_create_internal_repositories?: boolean; + members_can_create_pages?: boolean; + members_can_create_public_pages?: boolean; + members_can_create_private_pages?: boolean; + updated_at: string; + }; + /** The policy that controls the repositories in the organization that are allowed to run GitHub Actions. Can be one of: `all`, `none`, or `selected`. */ + "enabled-repositories": "all" | "none" | "selected"; + "actions-organization-permissions": { + enabled_repositories: components["schemas"]["enabled-repositories"]; + /** The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. */ + selected_repositories_url?: string; + allowed_actions?: components["schemas"]["allowed-actions"]; + selected_actions_url?: components["schemas"]["selected-actions-url"]; + }; + "runner-groups-org": { + id: number; + name: string; + visibility: string; + default: boolean; + /** Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` */ + selected_repositories_url?: string; + runners_url: string; + inherited: boolean; + inherited_allows_public_repositories?: boolean; + allows_public_repositories: boolean; + }; + /** Secrets for GitHub Actions for an organization. */ + "organization-actions-secret": { + /** The name of the secret. */ + name: string; + created_at: string; + updated_at: string; + /** Visibility of a secret */ + visibility: "all" | "private" | "selected"; + selected_repositories_url?: string; + }; + /** The public key used for setting Actions Secrets. */ + "actions-public-key": { + /** The identifier for the key. */ + key_id: string; + /** The Base64 encoded public key. */ + key: string; + id?: number; + url?: string; + title?: string; + created_at?: string; + }; + /** An object without any properties. */ + "empty-object": { [key: string]: unknown }; + /** Credential Authorization */ + "credential-authorization": { + /** User login that owns the underlying credential. */ + login: string; + /** Unique identifier for the credential. */ + credential_id: number; + /** Human-readable description of the credential type. */ + credential_type: string; + /** Last eight characters of the credential. Only included in responses with credential_type of personal access token. */ + token_last_eight?: string; + /** Date when the credential was authorized for use. */ + credential_authorized_at: string; + /** List of oauth scopes the token has been granted. */ + scopes?: string[]; + /** Unique string to distinguish the credential. Only included in responses with credential_type of SSH Key. */ + fingerprint?: string; + /** Date when the credential was last accessed. May be null if it was never accessed */ + credential_accessed_at?: string | null; + authorized_credential_id?: number | null; + /** The title given to the ssh key. This will only be present when the credential is an ssh key. */ + authorized_credential_title?: string | null; + /** The note given to the token. This will only be present when the credential is a token. */ + authorized_credential_note?: string | null; + }; + /** Organization Invitation */ + "organization-invitation": { + id: number; + login: string | null; + email: string | null; + role: string; + created_at: string; + failed_at?: string | null; + failed_reason?: string | null; + inviter: components["schemas"]["simple-user"]; + team_count: number; + node_id: string; + invitation_teams_url: string; + }; + /** Org Hook */ + "org-hook": { + id: number; + url: string; + ping_url: string; + deliveries_url?: string; + name: string; + events: string[]; + active: boolean; + config: { + url?: string; + insecure_ssl?: string; + content_type?: string; + secret?: string; + }; + updated_at: string; + created_at: string; + type: string; + }; + /** The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: `existing_users`, `contributors_only`, `collaborators_only`. */ + "interaction-group": + | "existing_users" + | "contributors_only" + | "collaborators_only"; + /** Interaction limit settings. */ + "interaction-limit-response": { + limit: components["schemas"]["interaction-group"]; + origin: string; + expires_at: string; + }; + /** The duration of the interaction restriction. Can be one of: `one_day`, `three_days`, `one_week`, `one_month`, `six_months`. Default: `one_day`. */ + "interaction-expiry": + | "one_day" + | "three_days" + | "one_week" + | "one_month" + | "six_months"; + /** Limit interactions to a specific type of user for a specified duration */ + "interaction-limit": { + limit: components["schemas"]["interaction-group"]; + expiry?: components["schemas"]["interaction-expiry"]; + }; + /** Groups of organization members that gives permissions on specified repositories. */ + "team-simple": { + /** Unique identifier of the team */ + id: number; + node_id: string; + /** URL for the team */ + url: string; + members_url: string; + /** Name of the team */ + name: string; + /** Description of the team */ + description: string | null; + /** Permission that the team will have for its repositories */ + permission: string; + /** The level of privacy this team should have */ + privacy?: string; + html_url: string; + repositories_url: string; + slug: string; + /** Distinguished Name (DN) that team maps to within LDAP environment */ + ldap_dn?: string; + } | null; + /** Groups of organization members that gives permissions on specified repositories. */ + team: { + id: number; + node_id: string; + name: string; + slug: string; + description: string | null; + privacy?: string; + permission: string; + permissions?: { + pull: boolean; + triage: boolean; + push: boolean; + maintain: boolean; + admin: boolean; + }; + url: string; + html_url: string; + members_url: string; + repositories_url: string; + parent: components["schemas"]["team-simple"] | null; + }; + /** Org Membership */ + "org-membership": { + url: string; + /** The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. */ + state: "active" | "pending"; + /** The user's membership type in the organization. */ + role: "admin" | "member" | "billing_manager"; + organization_url: string; + organization: components["schemas"]["organization-simple"]; + user: components["schemas"]["simple-user"] | null; + permissions?: { + can_create_repository: boolean; + }; + }; + /** A migration. */ + migration: { + id: number; + owner: components["schemas"]["simple-user"] | null; + guid: string; + state: string; + lock_repositories: boolean; + exclude_attachments: boolean; + repositories: components["schemas"]["repository"][]; + url: string; + created_at: string; + updated_at: string; + node_id: string; + archive_url?: string; + exclude?: { [key: string]: unknown }[]; + }; + /** A software package */ + package: { + /** Unique identifier of the package. */ + id: number; + /** The name of the package. */ + name: string; + package_type: + | "npm" + | "maven" + | "rubygems" + | "docker" + | "nuget" + | "container"; + url: string; + html_url: string; + /** The number of versions of the package. */ + version_count: number; + visibility: "private" | "public"; + owner?: components["schemas"]["simple-user"] | null; + repository?: components["schemas"]["minimal-repository"] | null; + created_at: string; + updated_at: string; + }; + /** A version of a software package */ + "package-version": { + /** Unique identifier of the package version. */ + id: number; + /** The name of the package version. */ + name: string; + url: string; + package_html_url: string; + html_url?: string; + license?: string; + description?: string; + created_at: string; + updated_at: string; + deleted_at?: string; + metadata?: { + package_type: + | "npm" + | "maven" + | "rubygems" + | "docker" + | "nuget" + | "container"; + container?: { + tags: any[]; + }; + docker?: { + tag?: any[]; + } & { + tags: unknown; + }; + }; + }; + /** Projects are a way to organize columns and cards of work. */ + project: { + owner_url: string; + url: string; + html_url: string; + columns_url: string; + id: number; + node_id: string; + /** Name of the project */ + name: string; + /** Body of the project */ + body: string | null; + number: number; + /** State of the project; either 'open' or 'closed' */ + state: string; + creator: components["schemas"]["simple-user"] | null; + created_at: string; + updated_at: string; + /** The baseline permission that all organization members have on this project. Only present if owner is an organization. */ + organization_permission?: "read" | "write" | "admin" | "none"; + /** Whether or not this project can be seen by everyone. Only present if owner is an organization. */ + private?: boolean; + }; + /** External Groups to be mapped to a team for membership */ + "group-mapping": { + /** Array of groups to be mapped to this team */ + groups?: { + /** The ID of the group */ + group_id: string; + /** The name of the group */ + group_name: string; + /** a description of the group */ + group_description: string; + /** synchronization status for this group mapping */ + status?: string; + /** the time of the last sync for this group-mapping */ + synced_at?: string | null; + }[]; + }; + /** Groups of organization members that gives permissions on specified repositories. */ + "team-full": { + /** Unique identifier of the team */ + id: number; + node_id: string; + /** URL for the team */ + url: string; + html_url: string; + /** Name of the team */ + name: string; + slug: string; + description: string | null; + /** The level of privacy this team should have */ + privacy?: "closed" | "secret"; + /** Permission that the team will have for its repositories */ + permission: string; + members_url: string; + repositories_url: string; + parent?: components["schemas"]["team-simple"] | null; + members_count: number; + repos_count: number; + created_at: string; + updated_at: string; + organization: components["schemas"]["organization-full"]; + /** Distinguished Name (DN) that team maps to within LDAP environment */ + ldap_dn?: string; + }; + /** A team discussion is a persistent record of a free-form conversation within a team. */ + "team-discussion": { + author: components["schemas"]["simple-user"] | null; + /** The main text of the discussion. */ + body: string; + body_html: string; + /** The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. */ + body_version: string; + comments_count: number; + comments_url: string; + created_at: string; + last_edited_at: string | null; + html_url: string; + node_id: string; + /** The unique sequence number of a team discussion. */ + number: number; + /** Whether or not this discussion should be pinned for easy retrieval. */ + pinned: boolean; + /** Whether or not this discussion should be restricted to team members and organization administrators. */ + private: boolean; + team_url: string; + /** The title of the discussion. */ + title: string; + updated_at: string; + url: string; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** A reply to a discussion within a team. */ + "team-discussion-comment": { + author: components["schemas"]["simple-user"] | null; + /** The main text of the comment. */ + body: string; + body_html: string; + /** The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. */ + body_version: string; + created_at: string; + last_edited_at: string | null; + discussion_url: string; + html_url: string; + node_id: string; + /** The unique sequence number of a team discussion comment. */ + number: number; + updated_at: string; + url: string; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** Reactions to conversations provide a way to help people express their feelings more simply and effectively. */ + reaction: { + id: number; + node_id: string; + user: components["schemas"]["simple-user"] | null; + /** The reaction to use */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + created_at: string; + }; + /** Team Membership */ + "team-membership": { + url: string; + /** The role of the user in the team. */ + role: "member" | "maintainer"; + /** The state of the user's membership in the team. */ + state: "active" | "pending"; + }; + /** A team's access to a project. */ + "team-project": { + owner_url: string; + url: string; + html_url: string; + columns_url: string; + id: number; + node_id: string; + name: string; + body: string | null; + number: number; + state: string; + creator: components["schemas"]["simple-user"]; + created_at: string; + updated_at: string; + /** The organization permission for this project. Only present when owner is an organization. */ + organization_permission?: string; + /** Whether the project is private or not. Only present when owner is an organization. */ + private?: boolean; + permissions: { + read: boolean; + write: boolean; + admin: boolean; + }; + }; + /** A team's access to a repository. */ + "team-repository": { + /** Unique identifier of the repository */ + id: number; + node_id: string; + /** The name of the repository. */ + name: string; + full_name: string; + license: components["schemas"]["license-simple"] | null; + forks: number; + permissions?: { + admin: boolean; + pull: boolean; + triage?: boolean; + push: boolean; + maintain?: boolean; + }; + owner: components["schemas"]["simple-user"] | null; + /** Whether the repository is private or public. */ + private: boolean; + html_url: string; + description: string | null; + fork: boolean; + url: string; + archive_url: string; + assignees_url: string; + blobs_url: string; + branches_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + contributors_url: string; + deployments_url: string; + downloads_url: string; + events_url: string; + forks_url: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + languages_url: string; + merges_url: string; + milestones_url: string; + notifications_url: string; + pulls_url: string; + releases_url: string; + ssh_url: string; + stargazers_url: string; + statuses_url: string; + subscribers_url: string; + subscription_url: string; + tags_url: string; + teams_url: string; + trees_url: string; + clone_url: string; + mirror_url: string | null; + hooks_url: string; + svn_url: string; + homepage: string | null; + language: string | null; + forks_count: number; + stargazers_count: number; + watchers_count: number; + size: number; + /** The default branch of the repository. */ + default_branch: string; + open_issues_count: number; + /** Whether this repository acts as a template that can be used to generate new repositories. */ + is_template?: boolean; + topics?: string[]; + /** Whether issues are enabled. */ + has_issues: boolean; + /** Whether projects are enabled. */ + has_projects: boolean; + /** Whether the wiki is enabled. */ + has_wiki: boolean; + has_pages: boolean; + /** Whether downloads are enabled. */ + has_downloads: boolean; + /** Whether the repository is archived. */ + archived: boolean; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** The repository visibility: public, private, or internal. */ + visibility?: string; + pushed_at: string | null; + created_at: string | null; + updated_at: string | null; + /** Whether to allow rebase merges for pull requests. */ + allow_rebase_merge?: boolean; + template_repository?: components["schemas"]["repository"] | null; + temp_clone_token?: string; + /** Whether to allow squash merges for pull requests. */ + allow_squash_merge?: boolean; + /** Whether to allow Auto-merge to be used on pull requests. */ + allow_auto_merge?: boolean; + /** Whether to delete head branches when pull requests are merged */ + delete_branch_on_merge?: boolean; + /** Whether to allow merge commits for pull requests. */ + allow_merge_commit?: boolean; + subscribers_count?: number; + network_count?: number; + open_issues: number; + watchers: number; + master_branch?: string; + }; + /** Project cards represent a scope of work. */ + "project-card": { + url: string; + /** The project card's ID */ + id: number; + node_id: string; + note: string | null; + creator: components["schemas"]["simple-user"] | null; + created_at: string; + updated_at: string; + /** Whether or not the card is archived */ + archived?: boolean; + column_name?: string; + project_id?: string; + column_url: string; + content_url?: string; + project_url: string; + }; + /** Project columns contain cards of work. */ + "project-column": { + url: string; + project_url: string; + cards_url: string; + /** The unique identifier of the project column */ + id: number; + node_id: string; + /** Name of the project column */ + name: string; + created_at: string; + updated_at: string; + }; + /** Repository Collaborator Permission */ + "repository-collaborator-permission": { + permission: string; + user: components["schemas"]["simple-user"] | null; + }; + "rate-limit": { + limit: number; + remaining: number; + reset: number; + used: number; + }; + /** Rate Limit Overview */ + "rate-limit-overview": { + resources: { + core: components["schemas"]["rate-limit"]; + graphql?: components["schemas"]["rate-limit"]; + search: components["schemas"]["rate-limit"]; + source_import?: components["schemas"]["rate-limit"]; + integration_manifest?: components["schemas"]["rate-limit"]; + code_scanning_upload?: components["schemas"]["rate-limit"]; + }; + rate: components["schemas"]["rate-limit"]; + }; + /** Code of Conduct Simple */ + "code-of-conduct-simple": { + url: string; + key: string; + name: string; + html_url: string | null; + }; + /** Full Repository */ + "full-repository": { + id: number; + node_id: string; + name: string; + full_name: string; + owner: components["schemas"]["simple-user"]; + private: boolean; + html_url: string; + description: string | null; + fork: boolean; + url: string; + archive_url: string; + assignees_url: string; + blobs_url: string; + branches_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + contributors_url: string; + deployments_url: string; + downloads_url: string; + events_url: string; + forks_url: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + git_url: string; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + languages_url: string; + merges_url: string; + milestones_url: string; + notifications_url: string; + pulls_url: string; + releases_url: string; + ssh_url: string; + stargazers_url: string; + statuses_url: string; + subscribers_url: string; + subscription_url: string; + tags_url: string; + teams_url: string; + trees_url: string; + clone_url: string; + mirror_url: string | null; + hooks_url: string; + svn_url: string; + homepage: string | null; + language: string | null; + forks_count: number; + stargazers_count: number; + watchers_count: number; + size: number; + default_branch: string; + open_issues_count: number; + is_template?: boolean; + topics?: string[]; + has_issues: boolean; + has_projects: boolean; + has_wiki: boolean; + has_pages: boolean; + has_downloads: boolean; + archived: boolean; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + /** The repository visibility: public, private, or internal. */ + visibility?: string; + pushed_at: string; + created_at: string; + updated_at: string; + permissions?: { + admin: boolean; + maintain?: boolean; + push: boolean; + triage?: boolean; + pull: boolean; + }; + allow_rebase_merge?: boolean; + template_repository?: components["schemas"]["repository"] | null; + temp_clone_token?: string | null; + allow_squash_merge?: boolean; + allow_auto_merge?: boolean; + delete_branch_on_merge?: boolean; + allow_merge_commit?: boolean; + subscribers_count: number; + network_count: number; + license: components["schemas"]["license-simple"] | null; + organization?: components["schemas"]["simple-user"] | null; + parent?: components["schemas"]["repository"]; + source?: components["schemas"]["repository"]; + forks: number; + master_branch?: string; + open_issues: number; + watchers: number; + /** Whether anonymous git access is allowed. */ + anonymous_access_enabled?: boolean; + code_of_conduct?: components["schemas"]["code-of-conduct-simple"]; + security_and_analysis?: { + advanced_security?: { + status?: "enabled" | "disabled"; + }; + secret_scanning?: { + status?: "enabled" | "disabled"; + }; + } | null; + }; + /** An artifact */ + artifact: { + id: number; + node_id: string; + /** The name of the artifact. */ + name: string; + /** The size in bytes of the artifact. */ + size_in_bytes: number; + url: string; + archive_download_url: string; + /** Whether or not the artifact has expired. */ + expired: boolean; + created_at: string | null; + expires_at: string | null; + updated_at: string | null; + }; + /** Information of a job execution in a workflow run */ + job: { + /** The id of the job. */ + id: number; + /** The id of the associated workflow run. */ + run_id: number; + run_url: string; + node_id: string; + /** The SHA of the commit that is being run. */ + head_sha: string; + url: string; + html_url: string | null; + /** The phase of the lifecycle that the job is currently in. */ + status: "queued" | "in_progress" | "completed"; + /** The outcome of the job. */ + conclusion: string | null; + /** The time that the job started, in ISO 8601 format. */ + started_at: string; + /** The time that the job finished, in ISO 8601 format. */ + completed_at: string | null; + /** The name of the job. */ + name: string; + /** Steps in this job. */ + steps?: { + /** The phase of the lifecycle that the job is currently in. */ + status: "queued" | "in_progress" | "completed"; + /** The outcome of the job. */ + conclusion: string | null; + /** The name of the job. */ + name: string; + number: number; + /** The time that the step started, in ISO 8601 format. */ + started_at?: string | null; + /** The time that the job finished, in ISO 8601 format. */ + completed_at?: string | null; + }[]; + check_run_url: string; + }; + /** Whether GitHub Actions is enabled on the repository. */ + "actions-enabled": boolean; + "actions-repository-permissions": { + enabled: components["schemas"]["actions-enabled"]; + allowed_actions?: components["schemas"]["allowed-actions"]; + selected_actions_url?: components["schemas"]["selected-actions-url"]; + }; + "pull-request-minimal": { + id: number; + number: number; + url: string; + head: { + ref: string; + sha: string; + repo: { + id: number; + url: string; + name: string; + }; + }; + base: { + ref: string; + sha: string; + repo: { + id: number; + url: string; + name: string; + }; + }; + }; + /** Simple Commit */ + "simple-commit": { + id: string; + tree_id: string; + message: string; + timestamp: string; + author: { + name: string; + email: string; + } | null; + committer: { + name: string; + email: string; + } | null; + }; + /** An invocation of a workflow */ + "workflow-run": { + /** The ID of the workflow run. */ + id: number; + /** The name of the workflow run. */ + name?: string | null; + node_id: string; + /** The ID of the associated check suite. */ + check_suite_id?: number; + /** The node ID of the associated check suite. */ + check_suite_node_id?: string; + head_branch: string | null; + /** The SHA of the head commit that points to the version of the worflow being run. */ + head_sha: string; + /** The auto incrementing run number for the workflow run. */ + run_number: number; + event: string; + status: string | null; + conclusion: string | null; + /** The ID of the parent workflow. */ + workflow_id: number; + /** The URL to the workflow run. */ + url: string; + html_url: string; + pull_requests: components["schemas"]["pull-request-minimal"][] | null; + created_at: string; + updated_at: string; + /** The URL to the jobs for the workflow run. */ + jobs_url: string; + /** The URL to download the logs for the workflow run. */ + logs_url: string; + /** The URL to the associated check suite. */ + check_suite_url: string; + /** The URL to the artifacts for the workflow run. */ + artifacts_url: string; + /** The URL to cancel the workflow run. */ + cancel_url: string; + /** The URL to rerun the workflow run. */ + rerun_url: string; + /** The URL to the workflow. */ + workflow_url: string; + head_commit: components["schemas"]["simple-commit"] | null; + repository: components["schemas"]["minimal-repository"]; + head_repository: components["schemas"]["minimal-repository"]; + head_repository_id?: number; + }; + /** An entry in the reviews log for environment deployments */ + "environment-approvals": { + /** The list of environments that were approved or rejected */ + environments: { + /** The id of the environment. */ + id?: number; + node_id?: string; + /** The name of the environment. */ + name?: string; + url?: string; + html_url?: string; + /** The time that the environment was created, in ISO 8601 format. */ + created_at?: string; + /** The time that the environment was last updated, in ISO 8601 format. */ + updated_at?: string; + }[]; + /** Whether deployment to the environment(s) was approved or rejected */ + state: "approved" | "rejected"; + user: components["schemas"]["simple-user"]; + /** The comment submitted with the deployment review */ + comment: string; + }; + /** The type of reviewer. Must be one of: `User` or `Team` */ + "deployment-reviewer-type": "User" | "Team"; + /** Details of a deployment that is waiting for protection rules to pass */ + "pending-deployment": { + environment: { + /** The id of the environment. */ + id?: number; + node_id?: string; + /** The name of the environment. */ + name?: string; + url?: string; + html_url?: string; + }; + /** The set duration of the wait timer */ + wait_timer: number; + /** The time that the wait timer began. */ + wait_timer_started_at: string | null; + /** Whether the currently authenticated user can approve the deployment */ + current_user_can_approve: boolean; + /** The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ + reviewers: { + type?: components["schemas"]["deployment-reviewer-type"]; + reviewer?: Partial & + Partial; + }[]; + }; + /** A request for a specific ref(branch,sha,tag) to be deployed */ + deployment: { + url: string; + /** Unique identifier of the deployment */ + id: number; + node_id: string; + sha: string; + /** The ref to deploy. This can be a branch, tag, or sha. */ + ref: string; + /** Parameter to specify a task to execute */ + task: string; + payload: { [key: string]: any } | string; + original_environment?: string; + /** Name for the target deployment environment. */ + environment: string; + description: string | null; + creator: components["schemas"]["simple-user"] | null; + created_at: string; + updated_at: string; + statuses_url: string; + repository_url: string; + /** Specifies if the given environment is will no longer exist at some point in the future. Default: false. */ + transient_environment?: boolean; + /** Specifies if the given environment is one that end-users directly interact with. Default: false. */ + production_environment?: boolean; + performed_via_github_app?: components["schemas"]["integration"] | null; + }; + /** Workflow Run Usage */ + "workflow-run-usage": { + billable: { + UBUNTU?: { + total_ms: number; + jobs: number; + }; + MACOS?: { + total_ms: number; + jobs: number; + }; + WINDOWS?: { + total_ms: number; + jobs: number; + }; + }; + run_duration_ms?: number; + }; + /** Set secrets for GitHub Actions. */ + "actions-secret": { + /** The name of the secret. */ + name: string; + created_at: string; + updated_at: string; + }; + /** A GitHub Actions workflow */ + workflow: { + id: number; + node_id: string; + name: string; + path: string; + state: + | "active" + | "deleted" + | "disabled_fork" + | "disabled_inactivity" + | "disabled_manually"; + created_at: string; + updated_at: string; + url: string; + html_url: string; + badge_url: string; + deleted_at?: string; + }; + /** Workflow Usage */ + "workflow-usage": { + billable: { + UBUNTU?: { + total_ms?: number; + }; + MACOS?: { + total_ms?: number; + }; + WINDOWS?: { + total_ms?: number; + }; + }; + }; + /** An autolink reference. */ + autolink: { + id: number; + /** The prefix of a key that is linkified. */ + key_prefix: string; + /** A template for the target URL that is generated if a key was found. */ + url_template: string; + }; + /** Protected Branch Admin Enforced */ + "protected-branch-admin-enforced": { + url: string; + enabled: boolean; + }; + /** Protected Branch Pull Request Review */ + "protected-branch-pull-request-review": { + url?: string; + dismissal_restrictions?: { + /** The list of users with review dismissal access. */ + users?: components["schemas"]["simple-user"][]; + /** The list of teams with review dismissal access. */ + teams?: components["schemas"]["team"][]; + url?: string; + users_url?: string; + teams_url?: string; + }; + dismiss_stale_reviews: boolean; + require_code_owner_reviews: boolean; + required_approving_review_count?: number; + }; + /** Branch Restriction Policy */ + "branch-restriction-policy": { + url: string; + users_url: string; + teams_url: string; + apps_url: string; + users: { + login?: string; + id?: number; + node_id?: string; + avatar_url?: string; + gravatar_id?: string; + url?: string; + html_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + starred_url?: string; + subscriptions_url?: string; + organizations_url?: string; + repos_url?: string; + events_url?: string; + received_events_url?: string; + type?: string; + site_admin?: boolean; + }[]; + teams: { + id?: number; + node_id?: string; + url?: string; + html_url?: string; + name?: string; + slug?: string; + description?: string | null; + privacy?: string; + permission?: string; + members_url?: string; + repositories_url?: string; + parent?: string | null; + }[]; + apps: { + id?: number; + slug?: string; + node_id?: string; + owner?: { + login?: string; + id?: number; + node_id?: string; + url?: string; + repos_url?: string; + events_url?: string; + hooks_url?: string; + issues_url?: string; + members_url?: string; + public_members_url?: string; + avatar_url?: string; + description?: string; + gravatar_id?: string; + html_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + starred_url?: string; + subscriptions_url?: string; + organizations_url?: string; + received_events_url?: string; + type?: string; + site_admin?: boolean; + }; + name?: string; + description?: string; + external_url?: string; + html_url?: string; + created_at?: string; + updated_at?: string; + permissions?: { + metadata?: string; + contents?: string; + issues?: string; + single_file?: string; + }; + events?: string[]; + }[]; + }; + /** Branch Protection */ + "branch-protection": { + url?: string; + enabled?: boolean; + required_status_checks?: { + url?: string; + enforcement_level?: string; + contexts: string[]; + contexts_url?: string; + strict?: boolean; + }; + enforce_admins?: components["schemas"]["protected-branch-admin-enforced"]; + required_pull_request_reviews?: components["schemas"]["protected-branch-pull-request-review"]; + restrictions?: components["schemas"]["branch-restriction-policy"]; + required_linear_history?: { + enabled?: boolean; + }; + allow_force_pushes?: { + enabled?: boolean; + }; + allow_deletions?: { + enabled?: boolean; + }; + required_conversation_resolution?: { + enabled?: boolean; + }; + name?: string; + protection_url?: string; + required_signatures?: { + url: string; + enabled: boolean; + }; + }; + /** Short Branch */ + "short-branch": { + name: string; + commit: { + sha: string; + url: string; + }; + protected: boolean; + protection?: components["schemas"]["branch-protection"]; + protection_url?: string; + }; + /** Metaproperties for Git author/committer information. */ + "git-user": { + name?: string; + email?: string; + date?: string; + }; + verification: { + verified: boolean; + reason: string; + payload: string | null; + signature: string | null; + }; + /** Commit */ + commit: { + url: string; + sha: string; + node_id: string; + html_url: string; + comments_url: string; + commit: { + url: string; + author: components["schemas"]["git-user"] | null; + committer: components["schemas"]["git-user"] | null; + message: string; + comment_count: number; + tree: { + sha: string; + url: string; + }; + verification?: components["schemas"]["verification"]; + }; + author: components["schemas"]["simple-user"] | null; + committer: components["schemas"]["simple-user"] | null; + parents: { + sha: string; + url: string; + html_url?: string; + }[]; + stats?: { + additions?: number; + deletions?: number; + total?: number; + }; + files?: { + filename?: string; + additions?: number; + deletions?: number; + changes?: number; + status?: string; + raw_url?: string; + blob_url?: string; + patch?: string; + sha?: string; + contents_url?: string; + previous_filename?: string; + }[]; + }; + /** Branch With Protection */ + "branch-with-protection": { + name: string; + commit: components["schemas"]["commit"]; + _links: { + html: string; + self: string; + }; + protected: boolean; + protection: components["schemas"]["branch-protection"]; + protection_url: string; + pattern?: string; + required_approving_review_count?: number; + }; + /** Status Check Policy */ + "status-check-policy": { + url: string; + strict: boolean; + contexts: string[]; + contexts_url: string; + }; + /** Branch protections protect branches */ + "protected-branch": { + url: string; + required_status_checks?: components["schemas"]["status-check-policy"]; + required_pull_request_reviews?: { + url: string; + dismiss_stale_reviews?: boolean; + require_code_owner_reviews?: boolean; + required_approving_review_count?: number; + dismissal_restrictions?: { + url: string; + users_url: string; + teams_url: string; + users: components["schemas"]["simple-user"][]; + teams: components["schemas"]["team"][]; + }; + }; + required_signatures?: { + url: string; + enabled: boolean; + }; + enforce_admins?: { + url: string; + enabled: boolean; + }; + required_linear_history?: { + enabled: boolean; + }; + allow_force_pushes?: { + enabled: boolean; + }; + allow_deletions?: { + enabled: boolean; + }; + restrictions?: components["schemas"]["branch-restriction-policy"]; + required_conversation_resolution?: { + enabled?: boolean; + }; + }; + /** A deployment created as the result of an Actions check run from a workflow that references an environment */ + "deployment-simple": { + url: string; + /** Unique identifier of the deployment */ + id: number; + node_id: string; + /** Parameter to specify a task to execute */ + task: string; + original_environment?: string; + /** Name for the target deployment environment. */ + environment: string; + description: string | null; + created_at: string; + updated_at: string; + statuses_url: string; + repository_url: string; + /** Specifies if the given environment is will no longer exist at some point in the future. Default: false. */ + transient_environment?: boolean; + /** Specifies if the given environment is one that end-users directly interact with. Default: false. */ + production_environment?: boolean; + performed_via_github_app?: components["schemas"]["integration"] | null; + }; + /** A check performed on the code of a given code change */ + "check-run": { + /** The id of the check. */ + id: number; + /** The SHA of the commit that is being checked. */ + head_sha: string; + node_id: string; + external_id: string | null; + url: string; + html_url: string | null; + details_url: string | null; + /** The phase of the lifecycle that the check is currently in. */ + status: "queued" | "in_progress" | "completed"; + conclusion: + | ( + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + ) + | null; + started_at: string | null; + completed_at: string | null; + output: { + title: string | null; + summary: string | null; + text: string | null; + annotations_count: number; + annotations_url: string; + }; + /** The name of the check. */ + name: string; + check_suite: { + id: number; + } | null; + app: components["schemas"]["integration"] | null; + pull_requests: components["schemas"]["pull-request-minimal"][]; + deployment?: components["schemas"]["deployment-simple"]; + }; + /** Check Annotation */ + "check-annotation": { + path: string; + start_line: number; + end_line: number; + start_column: number | null; + end_column: number | null; + annotation_level: string | null; + title: string | null; + message: string | null; + raw_details: string | null; + blob_href: string; + }; + /** A suite of checks performed on the code of a given code change */ + "check-suite": { + id: number; + node_id: string; + head_branch: string | null; + /** The SHA of the head commit that is being checked. */ + head_sha: string; + status: ("queued" | "in_progress" | "completed") | null; + conclusion: + | ( + | "success" + | "failure" + | "neutral" + | "cancelled" + | "skipped" + | "timed_out" + | "action_required" + ) + | null; + url: string | null; + before: string | null; + after: string | null; + pull_requests: components["schemas"]["pull-request-minimal"][] | null; + app: components["schemas"]["integration"] | null; + repository: components["schemas"]["minimal-repository"]; + created_at: string | null; + updated_at: string | null; + head_commit: components["schemas"]["simple-commit"]; + latest_check_runs_count: number; + check_runs_url: string; + }; + /** Check suite configuration preferences for a repository. */ + "check-suite-preference": { + preferences: { + auto_trigger_checks?: { + app_id: number; + setting: boolean; + }[]; + }; + repository: components["schemas"]["minimal-repository"]; + }; + /** The name of the tool used to generate the code scanning analysis. */ + "code-scanning-analysis-tool-name": string; + /** The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. */ + "code-scanning-analysis-tool-guid": string | null; + /** + * The full Git reference, formatted as `refs/heads/`, + * `refs/pull//merge`, or `refs/pull//head`. + */ + "code-scanning-ref": string; + /** State of a code scanning alert. */ + "code-scanning-alert-state": "open" | "closed" | "dismissed" | "fixed"; + /** The security alert number. */ + "alert-number": number; + /** The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. */ + "alert-created-at": string; + /** The REST API URL of the alert resource. */ + "alert-url": string; + /** The GitHub URL of the alert resource. */ + "alert-html-url": string; + /** The REST API URL for fetching the list of instances for an alert. */ + "alert-instances-url": string; + /** The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. */ + "code-scanning-alert-dismissed-at": string | null; + /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. */ + "code-scanning-alert-dismissed-reason": + | ("false positive" | "won't fix" | "used in tests") + | null; + "code-scanning-alert-rule-summary": { + /** A unique identifier for the rule used to detect the alert. */ + id?: string | null; + /** The name of the rule used to detect the alert. */ + name?: string; + /** The severity of the alert. */ + severity?: ("none" | "note" | "warning" | "error") | null; + /** A short description of the rule used to detect the alert. */ + description?: string; + }; + /** The version of the tool used to generate the code scanning analysis. */ + "code-scanning-analysis-tool-version": string | null; + "code-scanning-analysis-tool": { + name?: components["schemas"]["code-scanning-analysis-tool-name"]; + version?: components["schemas"]["code-scanning-analysis-tool-version"]; + guid?: components["schemas"]["code-scanning-analysis-tool-guid"]; + }; + /** Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. */ + "code-scanning-analysis-analysis-key": string; + /** Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. */ + "code-scanning-alert-environment": string; + /** Describe a region within a file for the alert. */ + "code-scanning-alert-location": { + path?: string; + start_line?: number; + end_line?: number; + start_column?: number; + end_column?: number; + }; + /** A classification of the file. For example to identify it as generated. */ + "code-scanning-alert-classification": + | ("source" | "generated" | "test" | "library") + | null; + "code-scanning-alert-instance": { + ref?: components["schemas"]["code-scanning-ref"]; + analysis_key?: components["schemas"]["code-scanning-analysis-analysis-key"]; + environment?: components["schemas"]["code-scanning-alert-environment"]; + state?: components["schemas"]["code-scanning-alert-state"]; + commit_sha?: string; + message?: { + text?: string; + }; + location?: components["schemas"]["code-scanning-alert-location"]; + html_url?: string; + /** + * Classifications that have been applied to the file that triggered the alert. + * For example identifying it as documentation, or a generated file. + */ + classifications?: components["schemas"]["code-scanning-alert-classification"][]; + }; + "code-scanning-alert-items": { + number: components["schemas"]["alert-number"]; + created_at: components["schemas"]["alert-created-at"]; + url: components["schemas"]["alert-url"]; + html_url: components["schemas"]["alert-html-url"]; + instances_url: components["schemas"]["alert-instances-url"]; + state: components["schemas"]["code-scanning-alert-state"]; + dismissed_by: components["schemas"]["simple-user"]; + dismissed_at: components["schemas"]["code-scanning-alert-dismissed-at"]; + dismissed_reason: components["schemas"]["code-scanning-alert-dismissed-reason"]; + rule: components["schemas"]["code-scanning-alert-rule-summary"]; + tool: components["schemas"]["code-scanning-analysis-tool"]; + most_recent_instance: components["schemas"]["code-scanning-alert-instance"]; + }; + "code-scanning-alert-rule": { + /** A unique identifier for the rule used to detect the alert. */ + id?: string | null; + /** The name of the rule used to detect the alert. */ + name?: string; + /** The severity of the alert. */ + severity?: ("none" | "note" | "warning" | "error") | null; + /** The security severity of the alert. */ + security_severity_level?: ("low" | "medium" | "high" | "critical") | null; + /** A short description of the rule used to detect the alert. */ + description?: string; + /** description of the rule used to detect the alert. */ + full_description?: string; + /** A set of tags applicable for the rule. */ + tags?: string[] | null; + /** Detailed documentation for the rule as GitHub Flavored Markdown. */ + help?: string | null; + }; + "code-scanning-alert": { + number: components["schemas"]["alert-number"]; + created_at: components["schemas"]["alert-created-at"]; + url: components["schemas"]["alert-url"]; + html_url: components["schemas"]["alert-html-url"]; + instances?: { [key: string]: unknown }; + instances_url: components["schemas"]["alert-instances-url"]; + state: components["schemas"]["code-scanning-alert-state"]; + dismissed_by: components["schemas"]["simple-user"]; + dismissed_at: components["schemas"]["code-scanning-alert-dismissed-at"]; + dismissed_reason: components["schemas"]["code-scanning-alert-dismissed-reason"]; + rule: components["schemas"]["code-scanning-alert-rule"]; + tool: components["schemas"]["code-scanning-analysis-tool"]; + most_recent_instance: components["schemas"]["code-scanning-alert-instance"]; + }; + /** Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. */ + "code-scanning-alert-set-state": "open" | "dismissed"; + /** An identifier for the upload. */ + "code-scanning-analysis-sarif-id": string; + /** The SHA of the commit to which the analysis you are uploading relates. */ + "code-scanning-analysis-commit-sha": string; + /** Identifies the variable values associated with the environment in which this analysis was performed. */ + "code-scanning-analysis-environment": string; + /** Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. */ + "code-scanning-analysis-category": string; + /** The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. */ + "code-scanning-analysis-created-at": string; + /** The REST API URL of the analysis resource. */ + "code-scanning-analysis-url": string; + "code-scanning-analysis": { + ref: components["schemas"]["code-scanning-ref"]; + commit_sha: components["schemas"]["code-scanning-analysis-commit-sha"]; + analysis_key: components["schemas"]["code-scanning-analysis-analysis-key"]; + environment: components["schemas"]["code-scanning-analysis-environment"]; + category?: components["schemas"]["code-scanning-analysis-category"]; + error: string; + created_at: components["schemas"]["code-scanning-analysis-created-at"]; + /** The total number of results in the analysis. */ + results_count: number; + /** The total number of rules used in the analysis. */ + rules_count: number; + /** Unique identifier for this analysis. */ + id: number; + url: components["schemas"]["code-scanning-analysis-url"]; + sarif_id: components["schemas"]["code-scanning-analysis-sarif-id"]; + tool: components["schemas"]["code-scanning-analysis-tool"]; + deletable: boolean; + /** Warning generated when processing the analysis */ + warning: string; + tool_name?: string; + }; + /** Successful deletion of a code scanning analysis */ + "code-scanning-analysis-deletion": { + /** Next deletable analysis in chain, without last analysis deletion confirmation */ + next_analysis_url: string | null; + /** Next deletable analysis in chain, with last analysis deletion confirmation */ + confirm_delete_url: string | null; + }; + /** A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/code-security/secure-coding/sarif-support-for-code-scanning)." */ + "code-scanning-analysis-sarif-file": string; + "code-scanning-sarifs-receipt": { + id?: components["schemas"]["code-scanning-analysis-sarif-id"]; + /** The REST API URL for checking the status of the upload. */ + url?: string; + }; + "code-scanning-sarifs-status": { + /** `pending` files have not yet been processed, while `complete` means all results in the SARIF have been stored. */ + processing_status?: "pending" | "complete"; + /** The REST API URL for getting the analyses associated with the upload. */ + analyses_url?: string | null; + }; + /** Collaborator */ + collaborator: { + login: string; + id: number; + email?: string | null; + name?: string | null; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + permissions?: { + pull: boolean; + triage?: boolean; + push: boolean; + maintain?: boolean; + admin: boolean; + }; + }; + /** Repository invitations let you manage who you collaborate with. */ + "repository-invitation": { + /** Unique identifier of the repository invitation. */ + id: number; + repository: components["schemas"]["minimal-repository"]; + invitee: components["schemas"]["simple-user"] | null; + inviter: components["schemas"]["simple-user"] | null; + /** The permission associated with the invitation. */ + permissions: "read" | "write" | "admin" | "triage" | "maintain"; + created_at: string; + /** Whether or not the invitation has expired */ + expired?: boolean; + /** URL for the repository invitation */ + url: string; + html_url: string; + node_id: string; + }; + /** Commit Comment */ + "commit-comment": { + html_url: string; + url: string; + id: number; + node_id: string; + body: string; + path: string | null; + position: number | null; + line: number | null; + commit_id: string; + user: components["schemas"]["simple-user"] | null; + created_at: string; + updated_at: string; + author_association: components["schemas"]["author_association"]; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** Branch Short */ + "branch-short": { + name: string; + commit: { + sha: string; + url: string; + }; + protected: boolean; + }; + /** Hypermedia Link */ + link: { + href: string; + }; + /** The status of auto merging a pull request. */ + auto_merge: { + enabled_by: components["schemas"]["simple-user"]; + /** The merge method to use. */ + merge_method: "merge" | "squash" | "rebase"; + /** Title for the merge commit message. */ + commit_title: string; + /** Commit message for the merge commit. */ + commit_message: string; + } | null; + /** Pull Request Simple */ + "pull-request-simple": { + url: string; + id: number; + node_id: string; + html_url: string; + diff_url: string; + patch_url: string; + issue_url: string; + commits_url: string; + review_comments_url: string; + review_comment_url: string; + comments_url: string; + statuses_url: string; + number: number; + state: string; + locked: boolean; + title: string; + user: components["schemas"]["simple-user"] | null; + body: string | null; + labels: { + id?: number; + node_id?: string; + url?: string; + name?: string; + description?: string; + color?: string; + default?: boolean; + }[]; + milestone: components["schemas"]["milestone"] | null; + active_lock_reason?: string | null; + created_at: string; + updated_at: string; + closed_at: string | null; + merged_at: string | null; + merge_commit_sha: string | null; + assignee: components["schemas"]["simple-user"] | null; + assignees?: components["schemas"]["simple-user"][] | null; + requested_reviewers?: components["schemas"]["simple-user"][] | null; + requested_teams?: components["schemas"]["team"][] | null; + head: { + label: string; + ref: string; + repo: components["schemas"]["repository"]; + sha: string; + user: components["schemas"]["simple-user"] | null; + }; + base: { + label: string; + ref: string; + repo: components["schemas"]["repository"]; + sha: string; + user: components["schemas"]["simple-user"] | null; + }; + _links: { + comments: components["schemas"]["link"]; + commits: components["schemas"]["link"]; + statuses: components["schemas"]["link"]; + html: components["schemas"]["link"]; + issue: components["schemas"]["link"]; + review_comments: components["schemas"]["link"]; + review_comment: components["schemas"]["link"]; + self: components["schemas"]["link"]; + }; + author_association: components["schemas"]["author_association"]; + auto_merge: components["schemas"]["auto_merge"]; + /** Indicates whether or not the pull request is a draft. */ + draft?: boolean; + }; + "simple-commit-status": { + description: string | null; + id: number; + node_id: string; + state: string; + context: string; + target_url: string; + required?: boolean | null; + avatar_url: string | null; + url: string; + created_at: string; + updated_at: string; + }; + /** Combined Commit Status */ + "combined-commit-status": { + state: string; + statuses: components["schemas"]["simple-commit-status"][]; + sha: string; + total_count: number; + repository: components["schemas"]["minimal-repository"]; + commit_url: string; + url: string; + }; + /** The status of a commit. */ + status: { + url: string; + avatar_url: string | null; + id: number; + node_id: string; + state: string; + description: string; + target_url: string; + context: string; + created_at: string; + updated_at: string; + creator: components["schemas"]["simple-user"]; + }; + "community-health-file": { + url: string; + html_url: string; + }; + /** Community Profile */ + "community-profile": { + health_percentage: number; + description: string | null; + documentation: string | null; + files: { + code_of_conduct: components["schemas"]["code-of-conduct-simple"] | null; + code_of_conduct_file: + | components["schemas"]["community-health-file"] + | null; + license: components["schemas"]["license-simple"] | null; + contributing: components["schemas"]["community-health-file"] | null; + readme: components["schemas"]["community-health-file"] | null; + issue_template: components["schemas"]["community-health-file"] | null; + pull_request_template: + | components["schemas"]["community-health-file"] + | null; + }; + updated_at: string | null; + content_reports_enabled?: boolean; + }; + /** Diff Entry */ + "diff-entry": { + sha: string; + filename: string; + status: string; + additions: number; + deletions: number; + changes: number; + blob_url: string; + raw_url: string; + contents_url: string; + patch?: string; + previous_filename?: string; + }; + /** Commit Comparison */ + "commit-comparison": { + url: string; + html_url: string; + permalink_url: string; + diff_url: string; + patch_url: string; + base_commit: components["schemas"]["commit"]; + merge_base_commit: components["schemas"]["commit"]; + status: "diverged" | "ahead" | "behind" | "identical"; + ahead_by: number; + behind_by: number; + total_commits: number; + commits: components["schemas"]["commit"][]; + files?: components["schemas"]["diff-entry"][]; + }; + /** Content Reference attachments allow you to provide context around URLs posted in comments */ + "content-reference-attachment": { + /** The ID of the attachment */ + id: number; + /** The title of the attachment */ + title: string; + /** The body of the attachment */ + body: string; + /** The node_id of the content attachment */ + node_id?: string; + }; + /** Content Tree */ + "content-tree": { + type: string; + size: number; + name: string; + path: string; + sha: string; + url: string; + git_url: string | null; + html_url: string | null; + download_url: string | null; + entries?: { + type: string; + size: number; + name: string; + path: string; + content?: string; + sha: string; + url: string; + git_url: string | null; + html_url: string | null; + download_url: string | null; + _links: { + git: string | null; + html: string | null; + self: string; + }; + }[]; + _links: { + git: string | null; + html: string | null; + self: string; + }; + } & { + content: unknown; + encoding: unknown; + }; + /** A list of directory items */ + "content-directory": { + type: string; + size: number; + name: string; + path: string; + content?: string; + sha: string; + url: string; + git_url: string | null; + html_url: string | null; + download_url: string | null; + _links: { + git: string | null; + html: string | null; + self: string; + }; + }[]; + /** Content File */ + "content-file": { + type: string; + encoding: string; + size: number; + name: string; + path: string; + content: string; + sha: string; + url: string; + git_url: string | null; + html_url: string | null; + download_url: string | null; + _links: { + git: string | null; + html: string | null; + self: string; + }; + target?: string; + submodule_git_url?: string; + }; + /** An object describing a symlink */ + "content-symlink": { + type: string; + target: string; + size: number; + name: string; + path: string; + sha: string; + url: string; + git_url: string | null; + html_url: string | null; + download_url: string | null; + _links: { + git: string | null; + html: string | null; + self: string; + }; + }; + /** An object describing a symlink */ + "content-submodule": { + type: string; + submodule_git_url: string; + size: number; + name: string; + path: string; + sha: string; + url: string; + git_url: string | null; + html_url: string | null; + download_url: string | null; + _links: { + git: string | null; + html: string | null; + self: string; + }; + }; + /** File Commit */ + "file-commit": { + content: { + name?: string; + path?: string; + sha?: string; + size?: number; + url?: string; + html_url?: string; + git_url?: string; + download_url?: string; + type?: string; + _links?: { + self?: string; + git?: string; + html?: string; + }; + } | null; + commit: { + sha?: string; + node_id?: string; + url?: string; + html_url?: string; + author?: { + date?: string; + name?: string; + email?: string; + }; + committer?: { + date?: string; + name?: string; + email?: string; + }; + message?: string; + tree?: { + url?: string; + sha?: string; + }; + parents?: { + url?: string; + html_url?: string; + sha?: string; + }[]; + verification?: { + verified?: boolean; + reason?: string; + signature?: string | null; + payload?: string | null; + }; + }; + }; + /** Contributor */ + contributor: { + login?: string; + id?: number; + node_id?: string; + avatar_url?: string; + gravatar_id?: string | null; + url?: string; + html_url?: string; + followers_url?: string; + following_url?: string; + gists_url?: string; + starred_url?: string; + subscriptions_url?: string; + organizations_url?: string; + repos_url?: string; + events_url?: string; + received_events_url?: string; + type: string; + site_admin?: boolean; + contributions: number; + email?: string; + name?: string; + }; + /** The status of a deployment. */ + "deployment-status": { + url: string; + id: number; + node_id: string; + /** The state of the status. */ + state: + | "error" + | "failure" + | "inactive" + | "pending" + | "success" + | "queued" + | "in_progress"; + creator: components["schemas"]["simple-user"] | null; + /** A short description of the status. */ + description: string; + /** The environment of the deployment that the status is for. */ + environment?: string; + /** Deprecated: the URL to associate with this status. */ + target_url: string; + created_at: string; + updated_at: string; + deployment_url: string; + repository_url: string; + /** The URL for accessing your environment. */ + environment_url?: string; + /** The URL to associate with this status. */ + log_url?: string; + performed_via_github_app?: components["schemas"]["integration"] | null; + }; + /** The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). */ + "wait-timer": number; + /** The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. */ + deployment_branch_policy: { + /** Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. */ + protected_branches: boolean; + /** Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. */ + custom_branch_policies: boolean; + } | null; + /** Details of a deployment environment */ + environment: { + /** The id of the environment. */ + id: number; + node_id: string; + /** The name of the environment. */ + name: string; + url: string; + html_url: string; + /** The time that the environment was created, in ISO 8601 format. */ + created_at: string; + /** The time that the environment was last updated, in ISO 8601 format. */ + updated_at: string; + protection_rules?: (Partial<{ + id: number; + node_id: string; + type: string; + wait_timer?: components["schemas"]["wait-timer"]; + }> & + Partial<{ + id: number; + node_id: string; + type: string; + /** The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ + reviewers?: { + type?: components["schemas"]["deployment-reviewer-type"]; + reviewer?: Partial & + Partial; + }[]; + }> & + Partial<{ + id: number; + node_id: string; + type: string; + }>)[]; + deployment_branch_policy?: components["schemas"]["deployment_branch_policy"]; + }; + /** Short Blob */ + "short-blob": { + url: string; + sha: string; + }; + /** Blob */ + blob: { + content: string; + encoding: string; + url: string; + sha: string; + size: number | null; + node_id: string; + highlighted_content?: string; + }; + /** Low-level Git commit operations within a repository */ + "git-commit": { + /** SHA for the commit */ + sha: string; + node_id: string; + url: string; + /** Identifying information for the git-user */ + author: { + /** Timestamp of the commit */ + date: string; + /** Git email address of the user */ + email: string; + /** Name of the git user */ + name: string; + }; + /** Identifying information for the git-user */ + committer: { + /** Timestamp of the commit */ + date: string; + /** Git email address of the user */ + email: string; + /** Name of the git user */ + name: string; + }; + /** Message describing the purpose of the commit */ + message: string; + tree: { + /** SHA for the commit */ + sha: string; + url: string; + }; + parents: { + /** SHA for the commit */ + sha: string; + url: string; + html_url: string; + }[]; + verification: { + verified: boolean; + reason: string; + signature: string | null; + payload: string | null; + }; + html_url: string; + }; + /** Git references within a repository */ + "git-ref": { + ref: string; + node_id: string; + url: string; + object: { + type: string; + /** SHA for the reference */ + sha: string; + url: string; + }; + }; + /** Metadata for a Git tag */ + "git-tag": { + node_id: string; + /** Name of the tag */ + tag: string; + sha: string; + /** URL for the tag */ + url: string; + /** Message describing the purpose of the tag */ + message: string; + tagger: { + date: string; + email: string; + name: string; + }; + object: { + sha: string; + type: string; + url: string; + }; + verification?: components["schemas"]["verification"]; + }; + /** The hierarchy between files in a Git repository. */ + "git-tree": { + sha: string; + url: string; + truncated: boolean; + /** Objects specifying a tree structure */ + tree: { + path?: string; + mode?: string; + type?: string; + sha?: string; + size?: number; + url?: string; + }[]; + }; + "hook-response": { + code: number | null; + status: string | null; + message: string | null; + }; + /** Webhooks for repositories. */ + hook: { + type: string; + /** Unique identifier of the webhook. */ + id: number; + /** The name of a valid service, use 'web' for a webhook. */ + name: string; + /** Determines whether the hook is actually triggered on pushes. */ + active: boolean; + /** Determines what events the hook is triggered for. Default: ['push']. */ + events: string[]; + config: { + email?: string; + password?: string; + room?: string; + subdomain?: string; + url?: components["schemas"]["webhook-config-url"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + digest?: string; + secret?: components["schemas"]["webhook-config-secret"]; + token?: string; + }; + updated_at: string; + created_at: string; + url: string; + test_url: string; + ping_url: string; + deliveries_url?: string; + last_response: components["schemas"]["hook-response"]; + }; + /** A repository import from an external source. */ + import: { + vcs: string | null; + use_lfs?: boolean; + /** The URL of the originating repository. */ + vcs_url: string; + svc_root?: string; + tfvc_project?: string; + status: + | "auth" + | "error" + | "none" + | "detecting" + | "choose" + | "auth_failed" + | "importing" + | "mapping" + | "waiting_to_push" + | "pushing" + | "complete" + | "setup" + | "unknown" + | "detection_found_multiple" + | "detection_found_nothing" + | "detection_needs_auth"; + status_text?: string | null; + failed_step?: string | null; + error_message?: string | null; + import_percent?: number | null; + commit_count?: number | null; + push_percent?: number | null; + has_large_files?: boolean; + large_files_size?: number; + large_files_count?: number; + project_choices?: { + vcs?: string; + tfvc_project?: string; + human_name?: string; + }[]; + message?: string; + authors_count?: number | null; + url: string; + html_url: string; + authors_url: string; + repository_url: string; + svn_root?: string; + }; + /** Porter Author */ + "porter-author": { + id: number; + remote_id: string; + remote_name: string; + email: string; + name: string; + url: string; + import_url: string; + }; + /** Porter Large File */ + "porter-large-file": { + ref_name: string; + path: string; + oid: string; + size: number; + }; + /** Issue Event Label */ + "issue-event-label": { + name: string | null; + color: string | null; + }; + "issue-event-dismissed-review": { + state: string; + review_id: number; + dismissal_message: string | null; + dismissal_commit_id?: string | null; + }; + /** Issue Event Milestone */ + "issue-event-milestone": { + title: string; + }; + /** Issue Event Project Card */ + "issue-event-project-card": { + url: string; + id: number; + project_url: string; + project_id: number; + column_name: string; + previous_column_name?: string; + }; + /** Issue Event Rename */ + "issue-event-rename": { + from: string; + to: string; + }; + /** Issue Event */ + "issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"] | null; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + issue?: components["schemas"]["issue-simple"]; + label?: components["schemas"]["issue-event-label"]; + assignee?: components["schemas"]["simple-user"] | null; + assigner?: components["schemas"]["simple-user"] | null; + review_requester?: components["schemas"]["simple-user"] | null; + requested_reviewer?: components["schemas"]["simple-user"] | null; + requested_team?: components["schemas"]["team"]; + dismissed_review?: components["schemas"]["issue-event-dismissed-review"]; + milestone?: components["schemas"]["issue-event-milestone"]; + project_card?: components["schemas"]["issue-event-project-card"]; + rename?: components["schemas"]["issue-event-rename"]; + author_association?: components["schemas"]["author_association"]; + lock_reason?: string | null; + performed_via_github_app?: components["schemas"]["integration"] | null; + }; + /** Labeled Issue Event */ + "labeled-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + label: { + name: string; + color: string; + }; + }; + /** Unlabeled Issue Event */ + "unlabeled-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + label: { + name: string; + color: string; + }; + }; + /** Assigned Issue Event */ + "assigned-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + assignee: components["schemas"]["simple-user"]; + assigner: components["schemas"]["simple-user"]; + }; + /** Unassigned Issue Event */ + "unassigned-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + assignee: components["schemas"]["simple-user"]; + assigner: components["schemas"]["simple-user"]; + }; + /** Milestoned Issue Event */ + "milestoned-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + milestone: { + title: string; + }; + }; + /** Demilestoned Issue Event */ + "demilestoned-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + milestone: { + title: string; + }; + }; + /** Renamed Issue Event */ + "renamed-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + rename: { + from: string; + to: string; + }; + }; + /** Review Requested Issue Event */ + "review-requested-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + review_requester: components["schemas"]["simple-user"]; + requested_team?: components["schemas"]["team"]; + requested_reviewer?: components["schemas"]["simple-user"]; + }; + /** Review Request Removed Issue Event */ + "review-request-removed-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + review_requester: components["schemas"]["simple-user"]; + requested_team?: components["schemas"]["team"]; + requested_reviewer?: components["schemas"]["simple-user"]; + }; + /** Review Dismissed Issue Event */ + "review-dismissed-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + dismissed_review: { + state: string; + review_id: number; + dismissal_message: string | null; + dismissal_commit_id?: string; + }; + }; + /** Locked Issue Event */ + "locked-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + lock_reason: string | null; + }; + /** Added to Project Issue Event */ + "added-to-project-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + project_card?: { + id: number; + url: string; + project_id: number; + project_url: string; + column_name: string; + previous_column_name?: string; + }; + }; + /** Moved Column in Project Issue Event */ + "moved-column-in-project-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + project_card?: { + id: number; + url: string; + project_id: number; + project_url: string; + column_name: string; + previous_column_name?: string; + }; + }; + /** Removed from Project Issue Event */ + "removed-from-project-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + project_card?: { + id: number; + url: string; + project_id: number; + project_url: string; + column_name: string; + previous_column_name?: string; + }; + }; + /** Converted Note to Issue Issue Event */ + "converted-note-to-issue-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + project_card?: { + id: number; + url: string; + project_id: number; + project_url: string; + column_name: string; + previous_column_name?: string; + }; + }; + /** Issue Event for Issue */ + "issue-event-for-issue": Partial< + components["schemas"]["labeled-issue-event"] + > & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial; + /** Timeline Comment Event */ + "timeline-comment-event": { + event: string; + actor: components["schemas"]["simple-user"]; + /** Unique identifier of the issue comment */ + id: number; + node_id: string; + /** URL for the issue comment */ + url: string; + /** Contents of the issue comment */ + body?: string; + body_text?: string; + body_html?: string; + html_url: string; + user: components["schemas"]["simple-user"]; + created_at: string; + updated_at: string; + issue_url: string; + author_association: components["schemas"]["author_association"]; + performed_via_github_app?: components["schemas"]["integration"]; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** Timeline Cross Referenced Event */ + "timeline-cross-referenced-event": { + event: string; + actor?: components["schemas"]["simple-user"]; + created_at: string; + updated_at: string; + source: { + type?: string; + issue?: components["schemas"]["issue-simple"]; + }; + }; + /** Timeline Committed Event */ + "timeline-committed-event": { + event?: string; + /** SHA for the commit */ + sha: string; + node_id: string; + url: string; + /** Identifying information for the git-user */ + author: { + /** Timestamp of the commit */ + date: string; + /** Git email address of the user */ + email: string; + /** Name of the git user */ + name: string; + }; + /** Identifying information for the git-user */ + committer: { + /** Timestamp of the commit */ + date: string; + /** Git email address of the user */ + email: string; + /** Name of the git user */ + name: string; + }; + /** Message describing the purpose of the commit */ + message: string; + tree: { + /** SHA for the commit */ + sha: string; + url: string; + }; + parents: { + /** SHA for the commit */ + sha: string; + url: string; + html_url: string; + }[]; + verification: { + verified: boolean; + reason: string; + signature: string | null; + payload: string | null; + }; + html_url: string; + }; + /** Timeline Reviewed Event */ + "timeline-reviewed-event": { + event: string; + /** Unique identifier of the review */ + id: number; + node_id: string; + user: components["schemas"]["simple-user"]; + /** The text of the review. */ + body: string | null; + state: string; + html_url: string; + pull_request_url: string; + _links: { + html: { + href: string; + }; + pull_request: { + href: string; + }; + }; + submitted_at?: string; + /** A commit SHA for the review. */ + commit_id: string; + body_html?: string; + body_text?: string; + author_association: components["schemas"]["author_association"]; + }; + /** Pull Request Review Comments are comments on a portion of the Pull Request's diff. */ + "pull-request-review-comment": { + /** URL for the pull request review comment */ + url: string; + /** The ID of the pull request review to which the comment belongs. */ + pull_request_review_id: number | null; + /** The ID of the pull request review comment. */ + id: number; + /** The node ID of the pull request review comment. */ + node_id: string; + /** The diff of the line that the comment refers to. */ + diff_hunk: string; + /** The relative path of the file to which the comment applies. */ + path: string; + /** The line index in the diff to which the comment applies. */ + position: number; + /** The index of the original line in the diff to which the comment applies. */ + original_position: number; + /** The SHA of the commit to which the comment applies. */ + commit_id: string; + /** The SHA of the original commit to which the comment applies. */ + original_commit_id: string; + /** The comment ID to reply to. */ + in_reply_to_id?: number; + user: components["schemas"]["simple-user"]; + /** The text of the comment. */ + body: string; + created_at: string; + updated_at: string; + /** HTML URL for the pull request review comment. */ + html_url: string; + /** URL for the pull request that the review comment belongs to. */ + pull_request_url: string; + author_association: components["schemas"]["author_association"]; + _links: { + self: { + href: string; + }; + html: { + href: string; + }; + pull_request: { + href: string; + }; + }; + /** The first line of the range for a multi-line comment. */ + start_line?: number | null; + /** The first line of the range for a multi-line comment. */ + original_start_line?: number | null; + /** The side of the first line of the range for a multi-line comment. */ + start_side?: ("LEFT" | "RIGHT") | null; + /** The line of the blob to which the comment applies. The last line of the range for a multi-line comment */ + line?: number; + /** The line of the blob to which the comment applies. The last line of the range for a multi-line comment */ + original_line?: number; + /** The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment */ + side?: "LEFT" | "RIGHT"; + reactions?: components["schemas"]["reaction-rollup"]; + body_html?: string; + body_text?: string; + }; + /** Timeline Line Commented Event */ + "timeline-line-commented-event": { + event?: string; + node_id?: string; + comments?: components["schemas"]["pull-request-review-comment"][]; + }; + /** Timeline Commit Commented Event */ + "timeline-commit-commented-event": { + event?: string; + node_id?: string; + commit_id?: string; + comments?: components["schemas"]["commit-comment"][]; + }; + /** Timeline Assigned Issue Event */ + "timeline-assigned-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + assignee: components["schemas"]["simple-user"]; + }; + /** Timeline Unassigned Issue Event */ + "timeline-unassigned-issue-event": { + id: number; + node_id: string; + url: string; + actor: components["schemas"]["simple-user"]; + event: string; + commit_id: string | null; + commit_url: string | null; + created_at: string; + performed_via_github_app: components["schemas"]["integration"]; + assignee: components["schemas"]["simple-user"]; + }; + /** Timeline Event */ + "timeline-issue-events": Partial< + components["schemas"]["labeled-issue-event"] + > & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial & + Partial; + /** An SSH key granting access to a single repository. */ + "deploy-key": { + id: number; + key: string; + url: string; + title: string; + verified: boolean; + created_at: string; + read_only: boolean; + }; + /** Language */ + language: { [key: string]: number }; + /** License Content */ + "license-content": { + name: string; + path: string; + sha: string; + size: number; + url: string; + html_url: string | null; + git_url: string | null; + download_url: string | null; + type: string; + content: string; + encoding: string; + _links: { + git: string | null; + html: string | null; + self: string; + }; + license: components["schemas"]["license-simple"] | null; + }; + "pages-source-hash": { + branch: string; + path: string; + }; + "pages-https-certificate": { + state: + | "new" + | "authorization_created" + | "authorization_pending" + | "authorized" + | "authorization_revoked" + | "issued" + | "uploaded" + | "approved" + | "errored" + | "bad_authz" + | "destroy_pending" + | "dns_changed"; + description: string; + /** Array of the domain set and its alternate name (if it is configured) */ + domains: any[]; + expires_at?: string; + }; + /** The configuration for GitHub Pages for a repository. */ + page: { + /** The API address for accessing this Page resource. */ + url: string; + /** The status of the most recent build of the Page. */ + status: ("built" | "building" | "errored") | null; + /** The Pages site's custom domain */ + cname: string | null; + /** Whether the Page has a custom 404 page. */ + custom_404: boolean; + /** The web address the Page can be accessed from. */ + html_url?: string; + source?: components["schemas"]["pages-source-hash"]; + /** Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. */ + public: boolean; + https_certificate?: components["schemas"]["pages-https-certificate"]; + /** Whether https is enabled on the domain */ + https_enforced?: boolean; + }; + /** Page Build */ + "page-build": { + url: string; + status: string; + error: { + message: string | null; + }; + pusher: components["schemas"]["simple-user"] | null; + commit: string; + duration: number; + created_at: string; + updated_at: string; + }; + /** Page Build Status */ + "page-build-status": { + url: string; + status: string; + }; + /** Pages Health Check Status */ + "pages-health-check": { + domain?: { + host?: string; + uri?: string; + nameservers?: string; + dns_resolves?: boolean; + is_proxied?: boolean | null; + is_cloudflare_ip?: boolean | null; + is_fastly_ip?: boolean | null; + is_old_ip_address?: boolean | null; + is_a_record?: boolean | null; + has_cname_record?: boolean | null; + has_mx_records_present?: boolean | null; + is_valid_domain?: boolean; + is_apex_domain?: boolean; + should_be_a_record?: boolean | null; + is_cname_to_github_user_domain?: boolean | null; + is_cname_to_pages_dot_github_dot_com?: boolean | null; + is_cname_to_fastly?: boolean | null; + is_pointed_to_github_pages_ip?: boolean | null; + is_non_github_pages_ip_present?: boolean | null; + is_pages_domain?: boolean; + is_served_by_pages?: boolean | null; + is_valid?: boolean; + reason?: string | null; + responds_to_https?: boolean; + enforces_https?: boolean; + https_error?: string | null; + is_https_eligible?: boolean | null; + caa_error?: string | null; + }; + alt_domain?: { + host?: string; + uri?: string; + nameservers?: string; + dns_resolves?: boolean; + is_proxied?: boolean | null; + is_cloudflare_ip?: boolean | null; + is_fastly_ip?: boolean | null; + is_old_ip_address?: boolean | null; + is_a_record?: boolean | null; + has_cname_record?: boolean | null; + has_mx_records_present?: boolean | null; + is_valid_domain?: boolean; + is_apex_domain?: boolean; + should_be_a_record?: boolean | null; + is_cname_to_github_user_domain?: boolean | null; + is_cname_to_pages_dot_github_dot_com?: boolean | null; + is_cname_to_fastly?: boolean | null; + is_pointed_to_github_pages_ip?: boolean | null; + is_non_github_pages_ip_present?: boolean | null; + is_pages_domain?: boolean; + is_served_by_pages?: boolean | null; + is_valid?: boolean; + reason?: string | null; + responds_to_https?: boolean; + enforces_https?: boolean; + https_error?: string | null; + is_https_eligible?: boolean | null; + caa_error?: string | null; + } | null; + }; + /** Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. */ + "pull-request": { + url: string; + id: number; + node_id: string; + html_url: string; + diff_url: string; + patch_url: string; + issue_url: string; + commits_url: string; + review_comments_url: string; + review_comment_url: string; + comments_url: string; + statuses_url: string; + /** Number uniquely identifying the pull request within its repository. */ + number: number; + /** State of this Pull Request. Either `open` or `closed`. */ + state: "open" | "closed"; + locked: boolean; + /** The title of the pull request. */ + title: string; + user: components["schemas"]["simple-user"] | null; + body: string | null; + labels: { + id?: number; + node_id?: string; + url?: string; + name?: string; + description?: string | null; + color?: string; + default?: boolean; + }[]; + milestone: components["schemas"]["milestone"] | null; + active_lock_reason?: string | null; + created_at: string; + updated_at: string; + closed_at: string | null; + merged_at: string | null; + merge_commit_sha: string | null; + assignee: components["schemas"]["simple-user"] | null; + assignees?: components["schemas"]["simple-user"][] | null; + requested_reviewers?: components["schemas"]["simple-user"][] | null; + requested_teams?: components["schemas"]["team-simple"][] | null; + head: { + label: string; + ref: string; + repo: { + archive_url: string; + assignees_url: string; + blobs_url: string; + branches_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + contributors_url: string; + deployments_url: string; + description: string | null; + downloads_url: string; + events_url: string; + fork: boolean; + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + hooks_url: string; + html_url: string; + id: number; + node_id: string; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + languages_url: string; + merges_url: string; + milestones_url: string; + name: string; + notifications_url: string; + owner: { + avatar_url: string; + events_url: string; + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + html_url: string; + id: number; + node_id: string; + login: string; + organizations_url: string; + received_events_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; + subscriptions_url: string; + type: string; + url: string; + }; + private: boolean; + pulls_url: string; + releases_url: string; + stargazers_url: string; + statuses_url: string; + subscribers_url: string; + subscription_url: string; + tags_url: string; + teams_url: string; + trees_url: string; + url: string; + clone_url: string; + default_branch: string; + forks: number; + forks_count: number; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_projects: boolean; + has_wiki: boolean; + has_pages: boolean; + homepage: string | null; + language: string | null; + master_branch?: string; + archived: boolean; + disabled: boolean; + mirror_url: string | null; + open_issues: number; + open_issues_count: number; + permissions?: { + admin: boolean; + maintain?: boolean; + push: boolean; + triage?: boolean; + pull: boolean; + }; + temp_clone_token?: string; + allow_merge_commit?: boolean; + allow_squash_merge?: boolean; + allow_rebase_merge?: boolean; + license: { + key: string; + name: string; + url: string | null; + spdx_id: string | null; + node_id: string; + } | null; + pushed_at: string; + size: number; + ssh_url: string; + stargazers_count: number; + svn_url: string; + topics?: string[]; + watchers: number; + watchers_count: number; + created_at: string; + updated_at: string; + } | null; + sha: string; + user: { + avatar_url: string; + events_url: string; + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + html_url: string; + id: number; + node_id: string; + login: string; + organizations_url: string; + received_events_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; + subscriptions_url: string; + type: string; + url: string; + }; + }; + base: { + label: string; + ref: string; + repo: { + archive_url: string; + assignees_url: string; + blobs_url: string; + branches_url: string; + collaborators_url: string; + comments_url: string; + commits_url: string; + compare_url: string; + contents_url: string; + contributors_url: string; + deployments_url: string; + description: string | null; + downloads_url: string; + events_url: string; + fork: boolean; + forks_url: string; + full_name: string; + git_commits_url: string; + git_refs_url: string; + git_tags_url: string; + hooks_url: string; + html_url: string; + id: number; + node_id: string; + issue_comment_url: string; + issue_events_url: string; + issues_url: string; + keys_url: string; + labels_url: string; + languages_url: string; + merges_url: string; + milestones_url: string; + name: string; + notifications_url: string; + owner: { + avatar_url: string; + events_url: string; + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + html_url: string; + id: number; + node_id: string; + login: string; + organizations_url: string; + received_events_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; + subscriptions_url: string; + type: string; + url: string; + }; + private: boolean; + pulls_url: string; + releases_url: string; + stargazers_url: string; + statuses_url: string; + subscribers_url: string; + subscription_url: string; + tags_url: string; + teams_url: string; + trees_url: string; + url: string; + clone_url: string; + default_branch: string; + forks: number; + forks_count: number; + git_url: string; + has_downloads: boolean; + has_issues: boolean; + has_projects: boolean; + has_wiki: boolean; + has_pages: boolean; + homepage: string | null; + language: string | null; + master_branch?: string; + archived: boolean; + disabled: boolean; + mirror_url: string | null; + open_issues: number; + open_issues_count: number; + permissions?: { + admin: boolean; + maintain?: boolean; + push: boolean; + triage?: boolean; + pull: boolean; + }; + temp_clone_token?: string; + allow_merge_commit?: boolean; + allow_squash_merge?: boolean; + allow_rebase_merge?: boolean; + license: components["schemas"]["license-simple"] | null; + pushed_at: string; + size: number; + ssh_url: string; + stargazers_count: number; + svn_url: string; + topics?: string[]; + watchers: number; + watchers_count: number; + created_at: string; + updated_at: string; + }; + sha: string; + user: { + avatar_url: string; + events_url: string; + followers_url: string; + following_url: string; + gists_url: string; + gravatar_id: string | null; + html_url: string; + id: number; + node_id: string; + login: string; + organizations_url: string; + received_events_url: string; + repos_url: string; + site_admin: boolean; + starred_url: string; + subscriptions_url: string; + type: string; + url: string; + }; + }; + _links: { + comments: components["schemas"]["link"]; + commits: components["schemas"]["link"]; + statuses: components["schemas"]["link"]; + html: components["schemas"]["link"]; + issue: components["schemas"]["link"]; + review_comments: components["schemas"]["link"]; + review_comment: components["schemas"]["link"]; + self: components["schemas"]["link"]; + }; + author_association: components["schemas"]["author_association"]; + auto_merge: components["schemas"]["auto_merge"]; + /** Indicates whether or not the pull request is a draft. */ + draft?: boolean; + merged: boolean; + mergeable: boolean | null; + rebaseable?: boolean | null; + mergeable_state: string; + merged_by: components["schemas"]["simple-user"] | null; + comments: number; + review_comments: number; + /** Indicates whether maintainers can modify the pull request. */ + maintainer_can_modify: boolean; + commits: number; + additions: number; + deletions: number; + changed_files: number; + }; + /** Pull Request Merge Result */ + "pull-request-merge-result": { + sha: string; + merged: boolean; + message: string; + }; + /** Pull Request Review Request */ + "pull-request-review-request": { + users: components["schemas"]["simple-user"][]; + teams: components["schemas"]["team"][]; + }; + /** Pull Request Reviews are reviews on pull requests. */ + "pull-request-review": { + /** Unique identifier of the review */ + id: number; + node_id: string; + user: components["schemas"]["simple-user"] | null; + /** The text of the review. */ + body: string; + state: string; + html_url: string; + pull_request_url: string; + _links: { + html: { + href: string; + }; + pull_request: { + href: string; + }; + }; + submitted_at?: string; + /** A commit SHA for the review. */ + commit_id: string; + body_html?: string; + body_text?: string; + author_association: components["schemas"]["author_association"]; + }; + /** Legacy Review Comment */ + "review-comment": { + url: string; + pull_request_review_id: number | null; + id: number; + node_id: string; + diff_hunk: string; + path: string; + position: number | null; + original_position: number; + commit_id: string; + original_commit_id: string; + in_reply_to_id?: number; + user: components["schemas"]["simple-user"] | null; + body: string; + created_at: string; + updated_at: string; + html_url: string; + pull_request_url: string; + author_association: components["schemas"]["author_association"]; + _links: { + self: components["schemas"]["link"]; + html: components["schemas"]["link"]; + pull_request: components["schemas"]["link"]; + }; + body_text?: string; + body_html?: string; + reactions?: components["schemas"]["reaction-rollup"]; + /** The side of the first line of the range for a multi-line comment. */ + side?: "LEFT" | "RIGHT"; + /** The side of the first line of the range for a multi-line comment. */ + start_side?: ("LEFT" | "RIGHT") | null; + /** The line of the blob to which the comment applies. The last line of the range for a multi-line comment */ + line?: number; + /** The original line of the blob to which the comment applies. The last line of the range for a multi-line comment */ + original_line?: number; + /** The first line of the range for a multi-line comment. */ + start_line?: number | null; + /** The original first line of the range for a multi-line comment. */ + original_start_line?: number | null; + }; + /** Data related to a release. */ + "release-asset": { + url: string; + browser_download_url: string; + id: number; + node_id: string; + /** The file name of the asset. */ + name: string; + label: string | null; + /** State of the release asset. */ + state: "uploaded" | "open"; + content_type: string; + size: number; + download_count: number; + created_at: string; + updated_at: string; + uploader: components["schemas"]["simple-user"] | null; + }; + /** A release. */ + release: { + url: string; + html_url: string; + assets_url: string; + upload_url: string; + tarball_url: string | null; + zipball_url: string | null; + id: number; + node_id: string; + /** The name of the tag. */ + tag_name: string; + /** Specifies the commitish value that determines where the Git tag is created from. */ + target_commitish: string; + name: string | null; + body?: string | null; + /** true to create a draft (unpublished) release, false to create a published one. */ + draft: boolean; + /** Whether to identify the release as a prerelease or a full release. */ + prerelease: boolean; + created_at: string; + published_at: string | null; + author: components["schemas"]["simple-user"]; + assets: components["schemas"]["release-asset"][]; + body_html?: string; + body_text?: string; + mentions_count?: number; + /** The URL of the release discussion. */ + discussion_url?: string; + reactions?: components["schemas"]["reaction-rollup"]; + }; + /** Sets the state of the secret scanning alert. Can be either `open` or `resolved`. You must provide `resolution` when you set the state to `resolved`. */ + "secret-scanning-alert-state": "open" | "resolved"; + /** **Required when the `state` is `resolved`.** The reason for resolving the alert. Can be one of `false_positive`, `wont_fix`, `revoked`, or `used_in_tests`. */ + "secret-scanning-alert-resolution": + | ("false_positive" | "wont_fix" | "revoked" | "used_in_tests") + | null; + "secret-scanning-alert": { + number?: components["schemas"]["alert-number"]; + created_at?: components["schemas"]["alert-created-at"]; + url?: components["schemas"]["alert-url"]; + html_url?: components["schemas"]["alert-html-url"]; + state?: components["schemas"]["secret-scanning-alert-state"]; + resolution?: components["schemas"]["secret-scanning-alert-resolution"]; + /** The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. */ + resolved_at?: string | null; + resolved_by?: components["schemas"]["simple-user"]; + /** The type of secret that secret scanning detected. */ + secret_type?: string; + /** The secret that was detected. */ + secret?: string; + }; + /** Stargazer */ + stargazer: { + starred_at: string; + user: components["schemas"]["simple-user"] | null; + }; + /** Code Frequency Stat */ + "code-frequency-stat": number[]; + /** Commit Activity */ + "commit-activity": { + days: number[]; + total: number; + week: number; + }; + /** Contributor Activity */ + "contributor-activity": { + author: components["schemas"]["simple-user"] | null; + total: number; + weeks: { + w?: number; + a?: number; + d?: number; + c?: number; + }[]; + }; + "participation-stats": { + all: number[]; + owner: number[]; + }; + /** Repository invitations let you manage who you collaborate with. */ + "repository-subscription": { + /** Determines if notifications should be received from this repository. */ + subscribed: boolean; + /** Determines if all notifications should be blocked from this repository. */ + ignored: boolean; + reason: string | null; + created_at: string; + url: string; + repository_url: string; + }; + /** Tag */ + tag: { + name: string; + commit: { + sha: string; + url: string; + }; + zipball_url: string; + tarball_url: string; + node_id: string; + }; + /** A topic aggregates entities that are related to a subject. */ + topic: { + names: string[]; + }; + traffic: { + timestamp: string; + uniques: number; + count: number; + }; + /** Clone Traffic */ + "clone-traffic": { + count: number; + uniques: number; + clones: components["schemas"]["traffic"][]; + }; + /** Content Traffic */ + "content-traffic": { + path: string; + title: string; + count: number; + uniques: number; + }; + /** Referrer Traffic */ + "referrer-traffic": { + referrer: string; + count: number; + uniques: number; + }; + /** View Traffic */ + "view-traffic": { + count: number; + uniques: number; + views: components["schemas"]["traffic"][]; + }; + "scim-group-list-enterprise": { + schemas: string[]; + totalResults: number; + itemsPerPage: number; + startIndex: number; + Resources: { + schemas: string[]; + id: string; + externalId?: string | null; + displayName?: string; + members?: { + value?: string; + $ref?: string; + display?: string; + }[]; + meta?: { + resourceType?: string; + created?: string; + lastModified?: string; + location?: string; + }; + }[]; + }; + "scim-enterprise-group": { + schemas: string[]; + id: string; + externalId?: string | null; + displayName?: string; + members?: { + value?: string; + $ref?: string; + display?: string; + }[]; + meta?: { + resourceType?: string; + created?: string; + lastModified?: string; + location?: string; + }; + }; + "scim-user-list-enterprise": { + schemas: string[]; + totalResults: number; + itemsPerPage: number; + startIndex: number; + Resources: { + schemas: string[]; + id: string; + externalId?: string; + userName?: string; + name?: { + givenName?: string; + familyName?: string; + }; + emails?: { + value?: string; + primary?: boolean; + type?: string; + }[]; + groups?: { + value?: string; + }[]; + active?: boolean; + meta?: { + resourceType?: string; + created?: string; + lastModified?: string; + location?: string; + }; + }[]; + }; + "scim-enterprise-user": { + schemas: string[]; + id: string; + externalId?: string; + userName?: string; + name?: { + givenName?: string; + familyName?: string; + }; + emails?: { + value?: string; + type?: string; + primary?: boolean; + }[]; + groups?: { + value?: string; + }[]; + active?: boolean; + meta?: { + resourceType?: string; + created?: string; + lastModified?: string; + location?: string; + }; + }; + /** SCIM /Users provisioning endpoints */ + "scim-user": { + /** SCIM schema used. */ + schemas: string[]; + /** Unique identifier of an external identity */ + id: string; + /** The ID of the User. */ + externalId: string | null; + /** Configured by the admin. Could be an email, login, or username */ + userName: string | null; + /** The name of the user, suitable for display to end-users */ + displayName?: string | null; + name: { + givenName: string | null; + familyName: string | null; + formatted?: string | null; + }; + /** user emails */ + emails: { + value: string; + primary?: boolean; + }[]; + /** The active status of the User. */ + active: boolean; + meta: { + resourceType?: string; + created?: string; + lastModified?: string; + location?: string; + }; + /** The ID of the organization. */ + organization_id?: number; + /** Set of operations to be performed */ + operations?: { + op: "add" | "remove" | "replace"; + path?: string; + value?: + | string + | { [key: string]: unknown } + | { [key: string]: unknown }[]; + }[]; + /** associated groups */ + groups?: { + value?: string; + display?: string; + }[]; + }; + /** SCIM User List */ + "scim-user-list": { + /** SCIM schema used. */ + schemas: string[]; + totalResults: number; + itemsPerPage: number; + startIndex: number; + Resources: components["schemas"]["scim-user"][]; + }; + "search-result-text-matches": { + object_url?: string; + object_type?: string | null; + property?: string; + fragment?: string; + matches?: { + text?: string; + indices?: number[]; + }[]; + }[]; + /** Code Search Result Item */ + "code-search-result-item": { + name: string; + path: string; + sha: string; + url: string; + git_url: string; + html_url: string; + repository: components["schemas"]["minimal-repository"]; + score: number; + file_size?: number; + language?: string | null; + last_modified_at?: string; + line_numbers?: string[]; + text_matches?: components["schemas"]["search-result-text-matches"]; + }; + /** Commit Search Result Item */ + "commit-search-result-item": { + url: string; + sha: string; + html_url: string; + comments_url: string; + commit: { + author: { + name: string; + email: string; + date: string; + }; + committer: components["schemas"]["git-user"] | null; + comment_count: number; + message: string; + tree: { + sha: string; + url: string; + }; + url: string; + verification?: components["schemas"]["verification"]; + }; + author: components["schemas"]["simple-user"] | null; + committer: components["schemas"]["git-user"] | null; + parents: { + url?: string; + html_url?: string; + sha?: string; + }[]; + repository: components["schemas"]["minimal-repository"]; + score: number; + node_id: string; + text_matches?: components["schemas"]["search-result-text-matches"]; + }; + /** Issue Search Result Item */ + "issue-search-result-item": { + url: string; + repository_url: string; + labels_url: string; + comments_url: string; + events_url: string; + html_url: string; + id: number; + node_id: string; + number: number; + title: string; + locked: boolean; + active_lock_reason?: string | null; + assignees?: components["schemas"]["simple-user"][] | null; + user: components["schemas"]["simple-user"] | null; + labels: { + id?: number; + node_id?: string; + url?: string; + name?: string; + color?: string; + default?: boolean; + description?: string | null; + }[]; + state: string; + assignee: components["schemas"]["simple-user"] | null; + milestone: components["schemas"]["milestone"] | null; + comments: number; + created_at: string; + updated_at: string; + closed_at: string | null; + text_matches?: components["schemas"]["search-result-text-matches"]; + pull_request?: { + merged_at?: string | null; + diff_url: string | null; + html_url: string | null; + patch_url: string | null; + url: string | null; + }; + body?: string; + score: number; + author_association: components["schemas"]["author_association"]; + draft?: boolean; + repository?: components["schemas"]["repository"]; + body_html?: string; + body_text?: string; + timeline_url?: string; + performed_via_github_app?: components["schemas"]["integration"] | null; + }; + /** Label Search Result Item */ + "label-search-result-item": { + id: number; + node_id: string; + url: string; + name: string; + color: string; + default: boolean; + description: string | null; + score: number; + text_matches?: components["schemas"]["search-result-text-matches"]; + }; + /** Repo Search Result Item */ + "repo-search-result-item": { + id: number; + node_id: string; + name: string; + full_name: string; + owner: components["schemas"]["simple-user"] | null; + private: boolean; + html_url: string; + description: string | null; + fork: boolean; + url: string; + created_at: string; + updated_at: string; + pushed_at: string; + homepage: string | null; + size: number; + stargazers_count: number; + watchers_count: number; + language: string | null; + forks_count: number; + open_issues_count: number; + master_branch?: string; + default_branch: string; + score: number; + forks_url: string; + keys_url: string; + collaborators_url: string; + teams_url: string; + hooks_url: string; + issue_events_url: string; + events_url: string; + assignees_url: string; + branches_url: string; + tags_url: string; + blobs_url: string; + git_tags_url: string; + git_refs_url: string; + trees_url: string; + statuses_url: string; + languages_url: string; + stargazers_url: string; + contributors_url: string; + subscribers_url: string; + subscription_url: string; + commits_url: string; + git_commits_url: string; + comments_url: string; + issue_comment_url: string; + contents_url: string; + compare_url: string; + merges_url: string; + archive_url: string; + downloads_url: string; + issues_url: string; + pulls_url: string; + milestones_url: string; + notifications_url: string; + labels_url: string; + releases_url: string; + deployments_url: string; + git_url: string; + ssh_url: string; + clone_url: string; + svn_url: string; + forks: number; + open_issues: number; + watchers: number; + topics?: string[]; + mirror_url: string | null; + has_issues: boolean; + has_projects: boolean; + has_pages: boolean; + has_wiki: boolean; + has_downloads: boolean; + archived: boolean; + /** Returns whether or not this repository disabled. */ + disabled: boolean; + license: components["schemas"]["license-simple"] | null; + permissions?: { + admin: boolean; + maintain?: boolean; + push: boolean; + triage?: boolean; + pull: boolean; + }; + text_matches?: components["schemas"]["search-result-text-matches"]; + temp_clone_token?: string; + allow_merge_commit?: boolean; + allow_squash_merge?: boolean; + allow_rebase_merge?: boolean; + allow_auto_merge?: boolean; + delete_branch_on_merge?: boolean; + }; + /** Topic Search Result Item */ + "topic-search-result-item": { + name: string; + display_name: string | null; + short_description: string | null; + description: string | null; + created_by: string | null; + released: string | null; + created_at: string; + updated_at: string; + featured: boolean; + curated: boolean; + score: number; + repository_count?: number | null; + logo_url?: string | null; + text_matches?: components["schemas"]["search-result-text-matches"]; + related?: + | { + topic_relation?: { + id?: number; + name?: string; + topic_id?: number; + relation_type?: string; + }; + }[] + | null; + aliases?: + | { + topic_relation?: { + id?: number; + name?: string; + topic_id?: number; + relation_type?: string; + }; + }[] + | null; + }; + /** User Search Result Item */ + "user-search-result-item": { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + received_events_url: string; + type: string; + score: number; + following_url: string; + gists_url: string; + starred_url: string; + events_url: string; + public_repos?: number; + public_gists?: number; + followers?: number; + following?: number; + created_at?: string; + updated_at?: string; + name?: string | null; + bio?: string | null; + email?: string | null; + location?: string | null; + site_admin: boolean; + hireable?: boolean | null; + text_matches?: components["schemas"]["search-result-text-matches"]; + blog?: string | null; + company?: string | null; + suspended_at?: string | null; + }; + /** Private User */ + "private-user": { + login: string; + id: number; + node_id: string; + avatar_url: string; + gravatar_id: string | null; + url: string; + html_url: string; + followers_url: string; + following_url: string; + gists_url: string; + starred_url: string; + subscriptions_url: string; + organizations_url: string; + repos_url: string; + events_url: string; + received_events_url: string; + type: string; + site_admin: boolean; + name: string | null; + company: string | null; + blog: string | null; + location: string | null; + email: string | null; + hireable: boolean | null; + bio: string | null; + twitter_username?: string | null; + public_repos: number; + public_gists: number; + followers: number; + following: number; + created_at: string; + updated_at: string; + private_gists: number; + total_private_repos: number; + owned_private_repos: number; + disk_usage: number; + collaborators: number; + two_factor_authentication: boolean; + plan?: { + collaborators: number; + name: string; + space: number; + private_repos: number; + }; + suspended_at?: string | null; + business_plus?: boolean; + ldap_dn?: string; + }; + /** Email */ + email: { + email: string; + primary: boolean; + verified: boolean; + visibility: string | null; + }; + /** A unique encryption key */ + "gpg-key": { + id: number; + primary_key_id: number | null; + key_id: string; + public_key: string; + emails: { + email?: string; + verified?: boolean; + }[]; + subkeys: { + id?: number; + primary_key_id?: number; + key_id?: string; + public_key?: string; + emails?: { [key: string]: unknown }[]; + subkeys?: { [key: string]: unknown }[]; + can_sign?: boolean; + can_encrypt_comms?: boolean; + can_encrypt_storage?: boolean; + can_certify?: boolean; + created_at?: string; + expires_at?: string | null; + raw_key?: string | null; + }[]; + can_sign: boolean; + can_encrypt_comms: boolean; + can_encrypt_storage: boolean; + can_certify: boolean; + created_at: string; + expires_at: string | null; + raw_key: string | null; + }; + /** Key */ + key: { + key: string; + id: number; + url: string; + title: string; + created_at: string; + verified: boolean; + read_only: boolean; + }; + "marketplace-account": { + url: string; + id: number; + type: string; + node_id?: string; + login: string; + email?: string | null; + organization_billing_email?: string | null; + }; + /** User Marketplace Purchase */ + "user-marketplace-purchase": { + billing_cycle: string; + next_billing_date: string | null; + unit_count: number | null; + on_free_trial: boolean; + free_trial_ends_on: string | null; + updated_at: string | null; + account: components["schemas"]["marketplace-account"]; + plan: components["schemas"]["marketplace-listing-plan"]; + }; + /** Starred Repository */ + "starred-repository": { + starred_at: string; + repo: components["schemas"]["repository"]; + }; + /** Hovercard */ + hovercard: { + contexts: { + message: string; + octicon: string; + }[]; + }; + /** Key Simple */ + "key-simple": { + id: number; + key: string; + }; + }; + responses: { + /** Resource not found */ + not_found: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Validation failed */ + validation_failed_simple: { + content: { + "application/json": components["schemas"]["validation-error-simple"]; + }; + }; + /** Bad Request */ + bad_request: { + content: { + "application/json": components["schemas"]["basic-error"]; + "application/scim+json": components["schemas"]["scim-error"]; + }; + }; + /** Validation failed */ + validation_failed: { + content: { + "application/json": components["schemas"]["validation-error"]; + }; + }; + /** Accepted */ + accepted: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + /** Preview header missing */ + preview_header_missing: { + content: { + "application/json": { + message: string; + documentation_url: string; + }; + }; + }; + /** Forbidden */ + forbidden: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Requires authentication */ + requires_authentication: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Not modified */ + not_modified: unknown; + /** Gone */ + gone: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Service unavailable */ + service_unavailable: { + content: { + "application/json": { + code?: string; + message?: string; + documentation_url?: string; + }; + }; + }; + /** Forbidden Gist */ + forbidden_gist: { + content: { + "application/json": { + block?: { + reason?: string; + created_at?: string; + html_url?: string | null; + }; + message?: string; + documentation_url?: string; + }; + }; + }; + /** Moved permanently */ + moved_permanently: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Conflict */ + conflict: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Temporary Redirect */ + temporary_redirect: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Response if GitHub Advanced Security is not enabled for this repository */ + code_scanning_forbidden_read: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Response if the repository is archived or if github advanced security is not enabled for this repository */ + code_scanning_forbidden_write: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Internal Error */ + internal_error: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + /** Found */ + found: unknown; + /** A header with no content is returned. */ + no_content: unknown; + /** Resource not found */ + scim_not_found: { + content: { + "application/json": components["schemas"]["scim-error"]; + "application/scim+json": components["schemas"]["scim-error"]; + }; + }; + /** Forbidden */ + scim_forbidden: { + content: { + "application/json": components["schemas"]["scim-error"]; + "application/scim+json": components["schemas"]["scim-error"]; + }; + }; + /** Bad Request */ + scim_bad_request: { + content: { + "application/json": components["schemas"]["scim-error"]; + "application/scim+json": components["schemas"]["scim-error"]; + }; + }; + /** Internal Error */ + scim_internal_error: { + content: { + "application/json": components["schemas"]["scim-error"]; + "application/scim+json": components["schemas"]["scim-error"]; + }; + }; + /** Conflict */ + scim_conflict: { + content: { + "application/json": components["schemas"]["scim-error"]; + "application/scim+json": components["schemas"]["scim-error"]; + }; + }; + }; + parameters: { + /** Results per page (max 100) */ + "per-page": number; + /** Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. */ + cursor: string; + "delivery-id": number; + /** Page number of the results to fetch. */ + page: number; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since: string; + /** installation_id parameter */ + "installation-id": number; + /** grant_id parameter */ + "grant-id": number; + /** The client ID of your GitHub app. */ + "client-id": string; + "access-token": string; + "app-slug": string; + /** authorization_id parameter */ + "authorization-id": number; + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: string; + /** Unique identifier of an organization. */ + "org-id": number; + /** Unique identifier of the self-hosted runner group. */ + "runner-group-id": number; + /** Unique identifier of the self-hosted runner. */ + "runner-id": number; + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + "audit-log-phrase": string; + /** + * The event types to include: + * + * - `web` - returns web (non-Git) events + * - `git` - returns Git events + * - `all` - returns both web and Git events + * + * The default is `web`. + */ + "audit-log-include": "web" | "git" | "all"; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + "audit-log-after": string; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + "audit-log-before": string; + /** + * The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. + * + * The default is `desc`. + */ + "audit-log-order": "desc" | "asc"; + /** gist_id parameter */ + "gist-id": string; + /** comment_id parameter */ + "comment-id": number; + /** A list of comma separated label names. Example: `bug,ui,@high` */ + labels: string; + /** One of `asc` (ascending) or `desc` (descending). */ + direction: "asc" | "desc"; + /** account_id parameter */ + "account-id": number; + /** plan_id parameter */ + "plan-id": number; + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort: "created" | "updated"; + owner: string; + repo: string; + /** If `true`, show notifications marked as read. */ + all: boolean; + /** If `true`, only shows notifications in which the user is directly participating or mentioned. */ + participating: boolean; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + before: string; + /** thread_id parameter */ + "thread-id": number; + /** An organization ID. Only return organizations with an ID greater than this ID. */ + "since-org": number; + org: string; + "repository-id": number; + /** secret_name parameter */ + "secret-name": string; + username: string; + "hook-id": number; + /** invitation_id parameter */ + "invitation-id": number; + /** migration_id parameter */ + "migration-id": number; + /** repo_name parameter */ + "repo-name": string; + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + "package-type": + | "npm" + | "maven" + | "rubygems" + | "docker" + | "nuget" + | "container"; + /** The name of the package. */ + "package-name": string; + /** Unique identifier of the package version. */ + "package-version-id": number; + /** team_slug parameter */ + "team-slug": string; + "discussion-number": number; + "comment-number": number; + "reaction-id": number; + "project-id": number; + /** card_id parameter */ + "card-id": number; + /** column_id parameter */ + "column-id": number; + /** artifact_id parameter */ + "artifact-id": number; + /** job_id parameter */ + "job-id": number; + /** Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. */ + actor: string; + /** Returns workflow runs associated with a branch. Use the name of the branch of the `push`. */ + "workflow-run-branch": string; + /** Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event: string; + /** Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + "workflow-run-status": + | "completed" + | "action_required" + | "cancelled" + | "failure" + | "neutral" + | "skipped" + | "stale" + | "success" + | "timed_out" + | "in_progress" + | "queued" + | "requested" + | "waiting"; + created: string; + /** The id of the workflow run. */ + "run-id": number; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + "workflow-id": number | string; + /** autolink_id parameter */ + "autolink-id": number; + /** The name of the branch. */ + branch: string; + /** check_run_id parameter */ + "check-run-id": number; + /** check_suite_id parameter */ + "check-suite-id": number; + /** Returns check runs with the specified `name`. */ + "check-name": string; + /** Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. */ + status: "queued" | "in_progress" | "completed"; + /** The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ + "tool-name": components["schemas"]["code-scanning-analysis-tool-name"]; + /** The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ + "tool-guid": components["schemas"]["code-scanning-analysis-tool-guid"]; + /** The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ + "git-ref": components["schemas"]["code-scanning-ref"]; + /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ + "alert-number": components["schemas"]["alert-number"]; + /** commit_sha parameter */ + "commit-sha": string; + /** deployment_id parameter */ + "deployment-id": number; + /** The name of the environment */ + "environment-name": string; + /** A user ID. Only return users with an ID greater than this ID. */ + "since-user": number; + /** issue_number parameter */ + "issue-number": number; + /** key_id parameter */ + "key-id": number; + /** milestone_number parameter */ + "milestone-number": number; + "pull-number": number; + /** review_id parameter */ + "review-id": number; + /** asset_id parameter */ + "asset-id": number; + /** release_id parameter */ + "release-id": number; + /** Must be one of: `day`, `week`. */ + per: "" | "day" | "week"; + /** A repository ID. Only return repositories with an ID greater than this ID. */ + "since-repo": number; + /** Used for pagination: the index of the first result to return. */ + "start-index": number; + /** Used for pagination: the number of results to return. */ + count: number; + /** Identifier generated by the GitHub SCIM endpoint. */ + "scim-group-id": string; + /** scim_user_id parameter */ + "scim-user-id": string; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order: "desc" | "asc"; + "team-id": number; + /** gpg_key_id parameter */ + "gpg-key-id": number; + }; + headers: { + link?: string; + "content-type"?: string; + "x-common-marker-version"?: string; + "x-rate-limit-limit"?: number; + "x-rate-limit-remaining"?: number; + "x-rate-limit-reset"?: number; + location?: string; + }; +} + +export interface operations { + /** Get Hypermedia links to resources accessible in GitHub's REST API */ + "meta/root": { + responses: { + /** Response */ + 200: { + content: { + "application/json": { + current_user_url: string; + current_user_authorizations_html_url: string; + authorizations_url: string; + code_search_url: string; + commit_search_url: string; + emails_url: string; + emojis_url: string; + events_url: string; + feeds_url: string; + followers_url: string; + following_url: string; + gists_url: string; + hub_url: string; + issue_search_url: string; + issues_url: string; + keys_url: string; + label_search_url: string; + notifications_url: string; + organization_url: string; + organization_repositories_url: string; + organization_teams_url: string; + public_gists_url: string; + rate_limit_url: string; + repository_url: string; + repository_search_url: string; + current_user_repositories_url: string; + starred_url: string; + starred_gists_url: string; + topic_search_url?: string; + user_url: string; + user_organizations_url: string; + user_repositories_url: string; + user_search_url: string; + }; + }; + }; + }; + }; + /** + * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-authenticated": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["integration"]; + }; + }; + }; + }; + /** Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. */ + "apps/create-from-manifest": { + parameters: { + path: { + code: string; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["integration"] & + ({ + client_id: string; + client_secret: string; + webhook_secret: string | null; + pem: string; + } & { [key: string]: any }); + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + }; + /** + * Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-webhook-config-for-app": { + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["webhook-config"]; + }; + }; + }; + }; + /** + * Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/update-webhook-config-for-app": { + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["webhook-config"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + url?: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + }; + }; + }; + }; + /** + * Returns a list of webhook deliveries for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/list-webhook-deliveries": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. */ + cursor?: components["parameters"]["cursor"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook-delivery-item"][]; + }; + }; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Returns a delivery for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-webhook-delivery": { + parameters: { + path: { + delivery_id: components["parameters"]["delivery-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook-delivery"]; + }; + }; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Redeliver a delivery for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/redeliver-webhook-delivery": { + parameters: { + path: { + delivery_id: components["parameters"]["delivery-id"]; + }; + }; + responses: { + 202: components["responses"]["accepted"]; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * + * The permissions the installation has are included under the `permissions` key. + */ + "apps/list-installations": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + outdated?: string; + }; + }; + responses: { + /** The permissions the installation has are included under the `permissions` key. */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["installation"][]; + }; + }; + }; + }; + /** + * Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (`target_type`) will be either an organization or a user account, depending which account the repository belongs to. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-installation": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["installation"]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/reference/apps/#suspend-an-app-installation)" endpoint. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/delete-installation": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/create-installation-access-token": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["installation-token"]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** List of repository names that the token should have access to */ + repositories?: string[]; + /** List of repository IDs that the token should have access to */ + repository_ids?: number[]; + permissions?: components["schemas"]["app-permissions"]; + }; + }; + }; + }; + /** + * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/suspend-installation": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Removes a GitHub App installation suspension. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/unsuspend-installation": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. + */ + "oauth-authorizations/list-grants": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** The client ID of your GitHub app. */ + client_id?: string; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["application-grant"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + "oauth-authorizations/get-grant": { + parameters: { + path: { + /** grant_id parameter */ + grant_id: components["parameters"]["grant-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["application-grant"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). + */ + "oauth-authorizations/delete-grant": { + parameters: { + path: { + /** grant_id parameter */ + grant_id: components["parameters"]["grant-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. + * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). + */ + "apps/delete-authorization": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token?: string; + }; + }; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid token as `:access_token` and the grant for the token's owner will be deleted. + * + * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the Applications settings page under "Authorized OAuth Apps" on GitHub](https://github.com/settings/applications#authorized). + */ + "apps/revoke-grant-for-application": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + access_token: components["parameters"]["access-token"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. */ + "apps/check-token": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The access_token of the OAuth application. */ + access_token: string; + }; + }; + }; + }; + /** OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ + "apps/delete-token": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token: string; + }; + }; + }; + }; + /** OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ + "apps/reset-token": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The access_token of the OAuth application. */ + access_token: string; + }; + }; + }; + }; + /** Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ + "apps/scope-token": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The OAuth access token used to authenticate to the GitHub API. */ + access_token: string; + /** The name of the user or organization to scope the user-to-server access token to. **Required** unless `target_id` is specified. */ + target?: string; + /** The ID of the user or organization to scope the user-to-server access token to. **Required** unless `target` is specified. */ + target_id?: number; + /** The list of repository names to scope the user-to-server access token to. `repositories` may not be specified if `repository_ids` is specified. */ + repositories?: string[]; + /** The list of repository IDs to scope the user-to-server access token to. `repository_ids` may not be specified if `repositories` is specified. */ + repository_ids?: number[]; + permissions?: components["schemas"]["app-permissions"]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. + */ + "apps/check-authorization": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + access_token: components["parameters"]["access-token"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"] | null; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. + */ + "apps/reset-authorization": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + access_token: components["parameters"]["access-token"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue OAuth endpoints that contain `access_token` in the path parameter. We have introduced new endpoints that allow you to securely manage tokens for OAuth Apps by moving `access_token` to the request body. For more information, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-app-endpoint/). + * + * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. + */ + "apps/revoke-authorization-for-application": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + access_token: components["parameters"]["access-token"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). + * + * If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + "apps/get-by-slug": { + parameters: { + path: { + app_slug: components["parameters"]["app-slug"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["integration"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + "oauth-authorizations/list-authorizations": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** The client ID of your GitHub app. */ + client_id?: string; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["authorization"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). + * + * Creates OAuth tokens using [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * + * To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them. + * + * You can also create tokens on GitHub from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://help.github.com/articles/creating-an-access-token-for-command-line-use). + * + * Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in [the GitHub Help documentation](https://help.github.com/articles/about-identity-and-access-management-with-saml-single-sign-on). + */ + "oauth-authorizations/create-authorization": { + parameters: {}; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A list of scopes that this authorization is in. */ + scopes?: string[] | null; + /** A note to remind you what the OAuth token is for. */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** The OAuth app client key for which to create the token. */ + client_id?: string; + /** The OAuth app client secret for which to create the token. */ + client_secret?: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + }; + }; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). + * + * Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. + * + * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + */ + "oauth-authorizations/get-or-create-authorization-for-app": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + }; + }; + responses: { + /** if returning an existing token */ + 200: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The OAuth app client secret for which to create the token. */ + client_secret: string; + /** A list of scopes that this authorization is in. */ + scopes?: string[] | null; + /** A note to remind you what the OAuth token is for. */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + }; + }; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * **Warning:** Apps must use the [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api). + * + * This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one. + * + * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + */ + "oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint": { + parameters: { + path: { + /** The client ID of your GitHub app. */ + client_id: components["parameters"]["client-id"]; + fingerprint: string; + }; + }; + responses: { + /** if returning an existing token */ + 200: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + /** Response if returning a new token */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The OAuth app client secret for which to create the token. */ + client_secret: string; + /** A list of scopes that this authorization is in. */ + scopes?: string[] | null; + /** A note to remind you what the OAuth token is for. */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + }; + }; + }; + }; + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + "oauth-authorizations/get-authorization": { + parameters: { + path: { + /** authorization_id parameter */ + authorization_id: components["parameters"]["authorization-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). */ + "oauth-authorizations/delete-authorization": { + parameters: { + path: { + /** authorization_id parameter */ + authorization_id: components["parameters"]["authorization-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * **Deprecation Notice:** GitHub will discontinue the [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/rest/reference/oauth-authorizations) will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). + * + * If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." + * + * You can only send one of these scope keys at a time. + */ + "oauth-authorizations/update-authorization": { + parameters: { + path: { + /** authorization_id parameter */ + authorization_id: components["parameters"]["authorization-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["authorization"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A list of scopes that this authorization is in. */ + scopes?: string[] | null; + /** A list of scopes to add to this authorization. */ + add_scopes?: string[]; + /** A list of scopes to remove from this authorization. */ + remove_scopes?: string[]; + /** A note to remind you what the OAuth token is for. */ + note?: string; + /** A URL to remind you what app the OAuth token is for. */ + note_url?: string; + /** A unique string to distinguish an authorization from others created for the same client ID and user. */ + fingerprint?: string; + }; + }; + }; + }; + "codes-of-conduct/get-all-codes-of-conduct": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-of-conduct"][]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + "codes-of-conduct/get-conduct-code": { + parameters: { + path: { + key: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-of-conduct"]; + }; + }; + 304: components["responses"]["not_modified"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists all the emojis available to use on GitHub. */ + "emojis/get": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": { [key: string]: string }; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + /** + * Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/get-github-actions-permissions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-enterprise-permissions"]; + }; + }; + }; + }; + /** + * Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/set-github-actions-permissions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + enabled_organizations: components["schemas"]["enabled-organizations"]; + allowed_actions?: components["schemas"]["allowed-actions"]; + }; + }; + }; + }; + /** + * Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/list-selected-organizations-enabled-github-actions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + organizations: components["schemas"]["organization-simple"][]; + }; + }; + }; + }; + }; + /** + * Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/set-selected-organizations-enabled-github-actions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** List of organization IDs to enable for GitHub Actions. */ + selected_organization_ids: number[]; + }; + }; + }; + }; + /** + * Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/enable-selected-organization-github-actions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of an organization. */ + org_id: components["parameters"]["org-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/disable-selected-organization-github-actions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of an organization. */ + org_id: components["parameters"]["org-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/get-allowed-actions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["selected-actions"]; + }; + }; + }; + }; + /** + * Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/set-allowed-actions-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["selected-actions"]; + }; + }; + }; + /** + * Lists all self-hosted runner groups for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/list-self-hosted-runner-groups-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + runner_groups: components["schemas"]["runner-groups-enterprise"][]; + }; + }; + }; + }; + }; + /** + * Creates a new self-hosted runner group for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/create-self-hosted-runner-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["runner-groups-enterprise"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Name of the runner group. */ + name: string; + /** Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: `all` or `selected` */ + visibility?: "selected" | "all"; + /** List of organization IDs that can access the runner group. */ + selected_organization_ids?: number[]; + /** List of runner IDs to add to the runner group. */ + runners?: number[]; + }; + }; + }; + }; + /** + * Gets a specific self-hosted runner group for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/get-self-hosted-runner-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-groups-enterprise"]; + }; + }; + }; + }; + /** + * Deletes a self-hosted runner group for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/delete-self-hosted-runner-group-from-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Updates the `name` and `visibility` of a self-hosted runner group in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/update-self-hosted-runner-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-groups-enterprise"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Name of the runner group. */ + name?: string; + /** Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: `all` or `selected` */ + visibility?: "selected" | "all"; + }; + }; + }; + }; + /** + * Lists the organizations with access to a self-hosted runner group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/list-org-access-to-self-hosted-runner-group-in-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + organizations: components["schemas"]["organization-simple"][]; + }; + }; + }; + }; + }; + /** + * Replaces the list of organizations that have access to a self-hosted runner configured in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/set-org-access-to-self-hosted-runner-group-in-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** List of organization IDs that can access the runner group. */ + selected_organization_ids: number[]; + }; + }; + }; + }; + /** + * Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/add-org-access-to-self-hosted-runner-group-in-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + /** Unique identifier of an organization. */ + org_id: components["parameters"]["org-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/remove-org-access-to-self-hosted-runner-group-in-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + /** Unique identifier of an organization. */ + org_id: components["parameters"]["org-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Lists the self-hosted runners that are in a specific enterprise group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/list-self-hosted-runners-in-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + runners: components["schemas"]["runner"][]; + }; + }; + }; + }; + }; + /** + * Replaces the list of self-hosted runners that are part of an enterprise runner group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/set-self-hosted-runners-in-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** List of runner IDs to add to the runner group. */ + runners: number[]; + }; + }; + }; + }; + /** + * Adds a self-hosted runner to a runner group configured in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` + * scope to use this endpoint. + */ + "enterprise-admin/add-self-hosted-runner-to-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/remove-self-hosted-runner-from-group-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Lists all self-hosted runners configured for an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/list-self-hosted-runners-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count?: number; + runners?: components["schemas"]["runner"][]; + }; + }; + }; + }; + }; + /** + * Lists binaries for the runner application that you can download and run. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/list-runner-applications-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-application"][]; + }; + }; + }; + }; + /** + * Returns a token that you can pass to the `config` script. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + * + * #### Example using registration token + * + * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. + * + * ``` + * ./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN + * ``` + */ + "enterprise-admin/create-registration-token-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["authentication-token"]; + }; + }; + }; + }; + /** + * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + * + * #### Example using remove token + * + * To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by this + * endpoint. + * + * ``` + * ./config.sh remove --token TOKEN + * ``` + */ + "enterprise-admin/create-remove-token-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["authentication-token"]; + }; + }; + }; + }; + /** + * Gets a specific self-hosted runner configured in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/get-self-hosted-runner-for-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner"]; + }; + }; + }; + }; + /** + * Forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + "enterprise-admin/delete-self-hosted-runner-from-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the `admin:enterprise` scope. */ + "enterprise-admin/get-audit-log": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + query: { + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: components["parameters"]["audit-log-phrase"]; + /** + * The event types to include: + * + * - `web` - returns web (non-Git) events + * - `git` - returns Git events + * - `all` - returns both web and Git events + * + * The default is `web`. + */ + include?: components["parameters"]["audit-log-include"]; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: components["parameters"]["audit-log-after"]; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: components["parameters"]["audit-log-before"]; + /** + * The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. + * + * The default is `desc`. + */ + order?: components["parameters"]["audit-log-order"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["audit-log-event"][]; + }; + }; + }; + }; + /** + * Gets the summary of the free and paid GitHub Actions minutes used. + * + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * The authenticated user must be an enterprise admin. + */ + "billing/get-github-actions-billing-ghe": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-billing-usage"]; + }; + }; + }; + }; + /** + * Gets the free and paid storage used for GitHub Packages in gigabytes. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * The authenticated user must be an enterprise admin. + */ + "billing/get-github-packages-billing-ghe": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["packages-billing-usage"]; + }; + }; + }; + }; + /** + * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * The authenticated user must be an enterprise admin. + */ + "billing/get-shared-storage-billing-ghe": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["combined-billing-usage"]; + }; + }; + }; + }; + /** We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago. */ + "activity/list-public-events": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: + * + * * **Timeline**: The GitHub global public timeline + * * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) + * * **Current user public**: The public timeline for the authenticated user + * * **Current user**: The private timeline for the authenticated user + * * **Current user actor**: The private timeline for activity created by the authenticated user + * * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. + * * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. + * + * **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. + */ + "activity/get-feeds": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["feed"]; + }; + }; + }; + }; + /** Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: */ + "gists/list": { + parameters: { + query: { + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["base-gist"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * Allows you to add a new gist with one or more files. + * + * **Note:** Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. + */ + "gists/create": { + parameters: {}; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["gist-simple"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Description of the gist */ + description?: string; + /** Names and content for the files that make up the gist */ + files: { + [key: string]: { + /** Content of the file */ + content: string; + }; + }; + public?: boolean | ("true" | "false"); + }; + }; + }; + }; + /** + * List public gists sorted by most recently updated to least recently updated. + * + * Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. + */ + "gists/list-public": { + parameters: { + query: { + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["base-gist"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** List the authenticated user's starred gists: */ + "gists/list-starred": { + parameters: { + query: { + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["base-gist"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "gists/get": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gist-simple"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden_gist"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/delete": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren't explicitly changed during an edit are unchanged. */ + "gists/update": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gist-simple"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Description of the gist */ + description?: string; + /** Names of files to be updated */ + files?: { [key: string]: Partial<{ [key: string]: unknown }> }; + } | null; + }; + }; + }; + "gists/list-comments": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["gist-comment"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/create-comment": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["gist-comment"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + requestBody: { + content: { + "application/json": { + /** The comment text. */ + body: string; + }; + }; + }; + }; + "gists/get-comment": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gist-comment"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden_gist"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/delete-comment": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/update-comment": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gist-comment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + requestBody: { + content: { + "application/json": { + /** The comment text. */ + body: string; + }; + }; + }; + }; + "gists/list-commits": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: { + Link?: string; + }; + content: { + "application/json": components["schemas"]["gist-commit"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/list-forks": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["gist-simple"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** **Note**: This was previously `/gists/:gist_id/fork`. */ + "gists/fork": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["base-gist"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "gists/check-is-starred": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response if gist is starred */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + /** Not Found if gist is not starred */ + 404: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + }; + }; + /** Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ + "gists/star": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/unstar": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "gists/get-revision": { + parameters: { + path: { + /** gist_id parameter */ + gist_id: components["parameters"]["gist-id"]; + sha: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gist-simple"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). */ + "gitignore/get-all-templates": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": string[]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + /** + * The API also allows fetching the source of a single template. + * Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. + */ + "gitignore/get-template": { + parameters: { + path: { + name: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gitignore-template"]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + /** + * List repositories that an app installation can access. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + "apps/list-repos-accessible-to-installation": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + repositories: components["schemas"]["repository"][]; + repository_selection?: string; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * Revokes the installation token you're using to authenticate as an installation and access this endpoint. + * + * Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + "apps/revoke-installation-access-token": { + parameters: {}; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * List issues assigned to the authenticated user across all visible repositories including owned repositories, member + * repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not + * necessarily assigned to you. + * + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + "issues/list": { + parameters: { + query: { + /** + * Indicates which sorts of issues to return. Can be one of: + * \* `assigned`: Issues assigned to you + * \* `created`: Issues created by you + * \* `mentioned`: Issues mentioning you + * \* `subscribed`: Issues you're subscribed to updates for + * \* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation + */ + filter?: + | "assigned" + | "created" + | "mentioned" + | "subscribed" + | "repos" + | "all"; + /** Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** A list of comma separated label names. Example: `bug,ui,@high` */ + labels?: components["parameters"]["labels"]; + /** What to sort results by. Can be either `created`, `updated`, `comments`. */ + sort?: "created" | "updated" | "comments"; + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + collab?: boolean; + orgs?: boolean; + owned?: boolean; + pulls?: boolean; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "licenses/get-all-commonly-used": { + parameters: { + query: { + featured?: boolean; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["license-simple"][]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + "licenses/get": { + parameters: { + path: { + license: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["license"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "markdown/render": { + parameters: {}; + responses: { + /** Response */ + 200: { + headers: { + "Content-Length"?: string; + }; + content: { + "text/html": string; + }; + }; + 304: components["responses"]["not_modified"]; + }; + requestBody: { + content: { + "application/json": { + /** The Markdown text to render in HTML. */ + text: string; + /** The rendering mode. */ + mode?: "markdown" | "gfm"; + /** The repository context to use when creating references in `gfm` mode. */ + context?: string; + }; + }; + }; + }; + /** You must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. */ + "markdown/render-raw": { + parameters: {}; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "text/html": string; + }; + }; + 304: components["responses"]["not_modified"]; + }; + requestBody: { + content: { + "text/plain": string; + "text/x-markdown": string; + }; + }; + }; + /** + * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + "apps/get-subscription-plan-for-account": { + parameters: { + path: { + /** account_id parameter */ + account_id: components["parameters"]["account-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["marketplace-purchase"]; + }; + }; + 401: components["responses"]["requires_authentication"]; + /** Not Found when the account has not purchased the listing */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + }; + /** + * Lists all plans that are part of your GitHub Marketplace listing. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + "apps/list-plans": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["marketplace-listing-plan"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + "apps/list-accounts-for-plan": { + parameters: { + path: { + /** plan_id parameter */ + plan_id: components["parameters"]["plan-id"]; + }; + query: { + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort?: components["parameters"]["sort"]; + /** To return the oldest accounts first, set to `asc`. Can be one of `asc` or `desc`. Ignored without the `sort` parameter. */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["marketplace-purchase"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + "apps/get-subscription-plan-for-account-stubbed": { + parameters: { + path: { + /** account_id parameter */ + account_id: components["parameters"]["account-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["marketplace-purchase"]; + }; + }; + 401: components["responses"]["requires_authentication"]; + /** Not Found when the account has not purchased the listing */ + 404: unknown; + }; + }; + /** + * Lists all plans that are part of your GitHub Marketplace listing. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + "apps/list-plans-stubbed": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["marketplace-listing-plan"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + }; + }; + /** + * Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. + * + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. + */ + "apps/list-accounts-for-plan-stubbed": { + parameters: { + path: { + /** plan_id parameter */ + plan_id: components["parameters"]["plan-id"]; + }; + query: { + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort?: components["parameters"]["sort"]; + /** To return the oldest accounts first, set to `asc`. Can be one of `asc` or `desc`. Ignored without the `sort` parameter. */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["marketplace-purchase"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + }; + }; + /** + * Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." + * + * **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. + */ + "meta/get": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["api-overview"]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + "activity/list-public-events-for-repo-network": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** List all notifications for the current user, sorted by most recently updated. */ + "activity/list-notifications-for-authenticated-user": { + parameters: { + query: { + /** If `true`, show notifications marked as read. */ + all?: components["parameters"]["all"]; + /** If `true`, only shows notifications in which the user is directly participating or mentioned. */ + participating?: components["parameters"]["participating"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + before?: components["parameters"]["before"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["thread"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ + "activity/mark-notifications-as-read": { + parameters: {}; + responses: { + /** Response */ + 202: { + content: { + "application/json": { + message?: string; + }; + }; + }; + /** Reset Content */ + 205: unknown; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + requestBody: { + content: { + "application/json": { + /** Describes the last point that notifications were checked. */ + last_read_at?: string; + /** Whether the notification has been read. */ + read?: boolean; + }; + }; + }; + }; + "activity/get-thread": { + parameters: { + path: { + /** thread_id parameter */ + thread_id: components["parameters"]["thread-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["thread"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "activity/mark-thread-as-read": { + parameters: { + path: { + /** thread_id parameter */ + thread_id: components["parameters"]["thread-id"]; + }; + }; + responses: { + /** Reset Content */ + 205: unknown; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). + * + * Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. + */ + "activity/get-thread-subscription-for-authenticated-user": { + parameters: { + path: { + /** thread_id parameter */ + thread_id: components["parameters"]["thread-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["thread-subscription"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**. + * + * You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. + * + * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. + */ + "activity/set-thread-subscription": { + parameters: { + path: { + /** thread_id parameter */ + thread_id: components["parameters"]["thread-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["thread-subscription"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + requestBody: { + content: { + "application/json": { + /** Whether to block all notifications from a thread. */ + ignored?: boolean; + }; + }; + }; + }; + /** Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`. */ + "activity/delete-thread-subscription": { + parameters: { + path: { + /** thread_id parameter */ + thread_id: components["parameters"]["thread-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** Get the octocat as ASCII art */ + "meta/get-octocat": { + parameters: { + query: { + /** The words to show in Octocat's speech bubble */ + s?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/octocat-stream": string; + }; + }; + }; + }; + /** + * Lists all organizations, in the order that they were created on GitHub. + * + * **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. + */ + "orgs/list": { + parameters: { + query: { + /** An organization ID. Only return organizations with an ID greater than this ID. */ + since?: components["parameters"]["since-org"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: { + Link?: string; + }; + content: { + "application/json": components["schemas"]["organization-simple"][]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + /** + * To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + * + * GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." + */ + "orgs/get": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["organization-full"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Parameter Deprecation Notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes). + * + * Enables an authenticated organization owner with the `admin:org` scope to update the organization's profile and member privileges. + */ + "orgs/update": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["organization-full"]; + }; + }; + 409: components["responses"]["conflict"]; + 415: components["responses"]["preview_header_missing"]; + /** Validation failed */ + 422: { + content: { + "application/json": + | components["schemas"]["validation-error"] + | components["schemas"]["validation-error-simple"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Billing email address. This address is not publicized. */ + billing_email?: string; + /** The company name. */ + company?: string; + /** The publicly visible email address. */ + email?: string; + /** The Twitter username of the company. */ + twitter_username?: string; + /** The location. */ + location?: string; + /** The shorthand name of the company. */ + name?: string; + /** The description of the company. */ + description?: string; + /** Toggles whether an organization can use organization projects. */ + has_organization_projects?: boolean; + /** Toggles whether repositories that belong to the organization can use repository projects. */ + has_repository_projects?: boolean; + /** + * Default permission level members have for organization repositories: + * \* `read` - can pull, but not push to or administer this repository. + * \* `write` - can pull and push, but not administer this repository. + * \* `admin` - can pull, push, and administer this repository. + * \* `none` - no permissions granted by default. + */ + default_repository_permission?: "read" | "write" | "admin" | "none"; + /** + * Toggles the ability of non-admin organization members to create repositories. Can be one of: + * \* `true` - all organization members can create repositories. + * \* `false` - only organization owners can create repositories. + * Default: `true` + * **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + */ + members_can_create_repositories?: boolean; + /** + * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: + * \* `true` - all organization members can create internal repositories. + * \* `false` - only organization owners can create internal repositories. + * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + */ + members_can_create_internal_repositories?: boolean; + /** + * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: + * \* `true` - all organization members can create private repositories. + * \* `false` - only organization owners can create private repositories. + * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + */ + members_can_create_private_repositories?: boolean; + /** + * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: + * \* `true` - all organization members can create public repositories. + * \* `false` - only organization owners can create public repositories. + * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://help.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + */ + members_can_create_public_repositories?: boolean; + /** + * Specifies which types of repositories non-admin organization members can create. Can be one of: + * \* `all` - all organization members can create public and private repositories. + * \* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. + * \* `none` - only admin members can create repositories. + * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. + */ + members_allowed_repository_creation_type?: "all" | "private" | "none"; + /** + * Toggles whether organization members can create GitHub Pages sites. Can be one of: + * \* `true` - all organization members can create GitHub Pages sites. + * \* `false` - no organization members can create GitHub Pages sites. Existing published sites will not be impacted. + */ + members_can_create_pages?: boolean; + /** + * Toggles whether organization members can create public GitHub Pages sites. Can be one of: + * \* `true` - all organization members can create public GitHub Pages sites. + * \* `false` - no organization members can create public GitHub Pages sites. Existing published sites will not be impacted. + */ + members_can_create_public_pages?: boolean; + /** + * Toggles whether organization members can create private GitHub Pages sites. Can be one of: + * \* `true` - all organization members can create private GitHub Pages sites. + * \* `false` - no organization members can create private GitHub Pages sites. Existing published sites will not be impacted. + */ + members_can_create_private_pages?: boolean; + blog?: string; + }; + }; + }; + }; + /** + * Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/get-github-actions-permissions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-organization-permissions"]; + }; + }; + }; + }; + /** + * Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. + * + * If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/set-github-actions-permissions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + enabled_repositories: components["schemas"]["enabled-repositories"]; + allowed_actions?: components["schemas"]["allowed-actions"]; + }; + }; + }; + }; + /** + * Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/list-selected-repositories-enabled-github-actions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + repositories: components["schemas"]["repository"][]; + }; + }; + }; + }; + }; + /** + * Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/set-selected-repositories-enabled-github-actions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** List of repository IDs to enable for GitHub Actions. */ + selected_repository_ids: number[]; + }; + }; + }; + }; + /** + * Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/enable-selected-repository-github-actions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + repository_id: components["parameters"]["repository-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/disable-selected-repository-github-actions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + repository_id: components["parameters"]["repository-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/get-allowed-actions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["selected-actions"]; + }; + }; + }; + }; + /** + * Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. + * + * To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + "actions/set-allowed-actions-organization": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["selected-actions"]; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Lists all self-hosted runner groups configured in an organization and inherited from an enterprise. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/list-self-hosted-runner-groups-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + runner_groups: components["schemas"]["runner-groups-org"][]; + }; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Creates a new self-hosted runner group for an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/create-self-hosted-runner-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["runner-groups-org"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Name of the runner group. */ + name: string; + /** Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: `all`, `selected`, or `private`. */ + visibility?: "selected" | "all" | "private"; + /** List of repository IDs that can access the runner group. */ + selected_repository_ids?: number[]; + /** List of runner IDs to add to the runner group. */ + runners?: number[]; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Gets a specific self-hosted runner group for an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/get-self-hosted-runner-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-groups-org"]; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Deletes a self-hosted runner group for an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/delete-self-hosted-runner-group-from-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Updates the `name` and `visibility` of a self-hosted runner group in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/update-self-hosted-runner-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-groups-org"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Name of the runner group. */ + name?: string; + /** Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: `all`, `selected`, or `private`. */ + visibility?: "selected" | "all" | "private"; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud and GitHub Enterprise Server. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Lists the repositories with access to a self-hosted runner group configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/list-repo-access-to-self-hosted-runner-group-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + repositories: components["schemas"]["minimal-repository"][]; + }; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Replaces the list of repositories that have access to a self-hosted runner group configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/set-repo-access-to-self-hosted-runner-group-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** List of repository IDs that can access the runner group. */ + selected_repository_ids: number[]; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Adds a repository to the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` + * scope to use this endpoint. + */ + "actions/add-repo-access-to-self-hosted-runner-group-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + repository_id: components["parameters"]["repository-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/remove-repo-access-to-self-hosted-runner-group-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + repository_id: components["parameters"]["repository-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Lists self-hosted runners that are in a specific organization group. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/list-self-hosted-runners-in-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + runners: components["schemas"]["runner"][]; + }; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * Replaces the list of self-hosted runners that are part of an organization runner group. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/set-self-hosted-runners-in-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** List of runner IDs to add to the runner group. */ + runners: number[]; + }; + }; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Adds a self-hosted runner to a runner group configured in an organization. + * + * You must authenticate using an access token with the `admin:org` + * scope to use this endpoint. + */ + "actions/add-self-hosted-runner-to-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * The self-hosted runner groups REST API is available with GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products)." + * + * + * Removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/remove-self-hosted-runner-from-group-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner group. */ + runner_group_id: components["parameters"]["runner-group-id"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Lists all self-hosted runners configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/list-self-hosted-runners-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + runners: components["schemas"]["runner"][]; + }; + }; + }; + }; + }; + /** + * Lists binaries for the runner application that you can download and run. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/list-runner-applications-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-application"][]; + }; + }; + }; + }; + /** + * Returns a token that you can pass to the `config` script. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + * + * #### Example using registration token + * + * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. + * + * ``` + * ./config.sh --url https://github.com/octo-org --token TOKEN + * ``` + */ + "actions/create-registration-token-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["authentication-token"]; + }; + }; + }; + }; + /** + * Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + * + * #### Example using remove token + * + * To remove your self-hosted runner from an organization, replace `TOKEN` with the remove token provided by this + * endpoint. + * + * ``` + * ./config.sh remove --token TOKEN + * ``` + */ + "actions/create-remove-token-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["authentication-token"]; + }; + }; + }; + }; + /** + * Gets a specific self-hosted runner configured in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/get-self-hosted-runner-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner"]; + }; + }; + }; + }; + /** + * Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. + */ + "actions/delete-self-hosted-runner-from-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Lists all secrets available in an organization without revealing their encrypted values. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/list-org-secrets": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + secrets: components["schemas"]["organization-actions-secret"][]; + }; + }; + }; + }; + }; + /** Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/get-org-public-key": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-public-key"]; + }; + }; + }; + }; + /** Gets a single organization secret without revealing its encrypted value. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/get-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["organization-actions-secret"]; + }; + }; + }; + }; + /** + * Creates or updates an organization secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to + * use this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + "actions/create-or-update-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response when creating a secret */ + 201: { + content: { + "application/json": components["schemas"]["empty-object"]; + }; + }; + /** Response when updating a secret */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/rest/reference/actions#get-an-organization-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; + /** + * Configures the access that repositories have to the organization secret. Can be one of: + * \- `all` - All repositories in an organization can access the secret. + * \- `private` - Private repositories in an organization can access the secret. + * \- `selected` - Only specific repositories can access the secret. + */ + visibility: "all" | "private" | "selected"; + /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ + selected_repository_ids?: string[]; + }; + }; + }; + }; + /** Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/delete-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/list-selected-repos-for-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + repositories: components["schemas"]["minimal-repository"][]; + }; + }; + }; + }; + }; + /** Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/set-selected-repos-for-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints. */ + selected_repository_ids?: number[]; + }; + }; + }; + }; + /** Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/add-selected-repo-to-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + repository_id: number; + }; + }; + responses: { + /** No Content when repository was added to the selected list */ + 204: never; + /** Conflict when visibility type is not set to selected */ + 409: unknown; + }; + }; + /** Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ + "actions/remove-selected-repo-from-org-secret": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + repository_id: number; + }; + }; + responses: { + /** Response when repository was removed from the selected list */ + 204: never; + /** Conflict when visibility type not set to selected */ + 409: unknown; + }; + }; + /** + * Gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)." + * + * To use this endpoint, you must be an organization owner, and you must use an access token with the `admin:org` scope. GitHub Apps must have the `organization_administration` read permission to use this endpoint. + */ + "orgs/get-audit-log": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** A search phrase. For more information, see [Searching the audit log](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). */ + phrase?: components["parameters"]["audit-log-phrase"]; + /** + * The event types to include: + * + * - `web` - returns web (non-Git) events + * - `git` - returns Git events + * - `all` - returns both web and Git events + * + * The default is `web`. + */ + include?: components["parameters"]["audit-log-include"]; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events after this cursor. */ + after?: components["parameters"]["audit-log-after"]; + /** A cursor, as given in the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header). If specified, the query only searches for events before this cursor. */ + before?: components["parameters"]["audit-log-before"]; + /** + * The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`. + * + * The default is `desc`. + */ + order?: components["parameters"]["audit-log-order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["audit-log-event"][]; + }; + }; + }; + }; + /** List the users blocked by an organization. */ + "orgs/list-blocked-users": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + }; + }; + "orgs/check-blocked-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** If the user is blocked: */ + 204: never; + /** If the user is not blocked: */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + }; + "orgs/block-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 422: components["responses"]["validation_failed"]; + }; + }; + "orgs/unblock-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). + * + * An authenticated organization owner with the `read:org` scope can list all credential authorizations for an organization that uses SAML single sign-on (SSO). The credentials are either personal access tokens or SSH keys that organization members have authorized for the organization. For more information, see [About authentication with SAML single sign-on](https://help.github.com/en/articles/about-authentication-with-saml-single-sign-on). + */ + "orgs/list-saml-sso-authorizations": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["credential-authorization"][]; + }; + }; + }; + }; + /** + * Listing and deleting credential authorizations is available to organizations with GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products). + * + * An authenticated organization owner with the `admin:org` scope can remove a credential authorization for an organization that uses SAML SSO. Once you remove someone's credential authorization, they will need to create a new personal access token or SSH key and authorize it for the organization they want to access. + */ + "orgs/remove-saml-sso-authorization": { + parameters: { + path: { + org: components["parameters"]["org"]; + credential_id: number; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + "activity/list-public-org-events": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + /** The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. */ + "orgs/list-failed-invitations": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["organization-invitation"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "orgs/list-webhooks": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["org-hook"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Here's how you can create a hook that posts payloads in JSON format: */ + "orgs/create-webhook": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["org-hook"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Must be passed as "web". */ + name: string; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#create-hook-config-params). */ + config: { + url: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + username?: string; + password?: string; + }; + /** Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. */ + events?: string[]; + /** Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. */ + active?: boolean; + }; + }; + }; + }; + /** Returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." */ + "orgs/get-webhook": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["org-hook"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "orgs/delete-webhook": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." */ + "orgs/update-webhook": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["org-hook"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/orgs#update-hook-config-params). */ + config?: { + url: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + }; + /** Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. */ + events?: string[]; + /** Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. */ + active?: boolean; + name?: string; + }; + }; + }; + }; + /** + * Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." + * + * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission. + */ + "orgs/get-webhook-config-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["webhook-config"]; + }; + }; + }; + }; + /** + * Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." + * + * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission. + */ + "orgs/update-webhook-config-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["webhook-config"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + url?: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + }; + }; + }; + }; + /** Returns a list of webhook deliveries for a webhook configured in an organization. */ + "orgs/list-webhook-deliveries": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. */ + cursor?: components["parameters"]["cursor"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook-delivery-item"][]; + }; + }; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Returns a delivery for a webhook configured in an organization. */ + "orgs/get-webhook-delivery": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + delivery_id: components["parameters"]["delivery-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook-delivery"]; + }; + }; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Redeliver a delivery for a webhook configured in an organization. */ + "orgs/redeliver-webhook-delivery": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + delivery_id: components["parameters"]["delivery-id"]; + }; + }; + responses: { + 202: components["responses"]["accepted"]; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ + "orgs/ping-webhook": { + parameters: { + path: { + org: components["parameters"]["org"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Enables an authenticated GitHub App to find the organization's installation information. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-org-installation": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["installation"]; + }; + }; + }; + }; + /** Lists all GitHub Apps in an organization. The installation count includes all GitHub Apps installed on repositories in the organization. You must be an organization owner with `admin:read` scope to use this endpoint. */ + "orgs/list-app-installations": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + installations: components["schemas"]["installation"][]; + }; + }; + }; + }; + }; + /** Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. */ + "interactions/get-restrictions-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": Partial< + components["schemas"]["interaction-limit-response"] + > & + Partial<{ [key: string]: unknown }>; + }; + }; + }; + }; + /** Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. */ + "interactions/set-restrictions-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["interaction-limit-response"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": components["schemas"]["interaction-limit"]; + }; + }; + }; + /** Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. */ + "interactions/remove-restrictions-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. */ + "orgs/list-pending-invitations": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["organization-invitation"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "orgs/create-invitation": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["organization-invitation"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** **Required unless you provide `email`**. GitHub user ID for the person you are inviting. */ + invitee_id?: number; + /** **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. */ + email?: string; + /** + * Specify role for new member. Can be one of: + * \* `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. + * \* `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. + * \* `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. + */ + role?: "admin" | "direct_member" | "billing_manager"; + /** Specify IDs for the teams you want to invite new members to. */ + team_ids?: number[]; + }; + }; + }; + }; + /** + * Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). + */ + "orgs/cancel-invitation": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** invitation_id parameter */ + invitation_id: components["parameters"]["invitation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner. */ + "orgs/list-invitation-teams": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** invitation_id parameter */ + invitation_id: components["parameters"]["invitation-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * List issues in an organization assigned to the authenticated user. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + "issues/list-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** + * Indicates which sorts of issues to return. Can be one of: + * \* `assigned`: Issues assigned to you + * \* `created`: Issues created by you + * \* `mentioned`: Issues mentioning you + * \* `subscribed`: Issues you're subscribed to updates for + * \* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation + */ + filter?: + | "assigned" + | "created" + | "mentioned" + | "subscribed" + | "repos" + | "all"; + /** Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** A list of comma separated label names. Example: `bug,ui,@high` */ + labels?: components["parameters"]["labels"]; + /** What to sort results by. Can be either `created`, `updated`, `comments`. */ + sort?: "created" | "updated" | "comments"; + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. */ + "orgs/list-members": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** + * Filter members returned in the list. Can be one of: + * \* `2fa_disabled` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. + * \* `all` - All members the authenticated user can see. + */ + filter?: "2fa_disabled" | "all"; + /** + * Filter members returned by their role. Can be one of: + * \* `all` - All members of the organization, regardless of role. + * \* `admin` - Organization owners. + * \* `member` - Non-owner organization members. + */ + role?: "all" | "admin" | "member"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + /** Response if requester is not an organization member */ + 302: never; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Check if a user is, publicly or privately, a member of the organization. */ + "orgs/check-membership-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response if requester is an organization member and user is a member */ + 204: never; + /** Response if requester is not an organization member */ + 302: never; + /** Not Found if requester is an organization member and user is not a member */ + 404: unknown; + }; + }; + /** Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. */ + "orgs/remove-member": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + }; + }; + /** In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. */ + "orgs/get-membership-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["org-membership"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Only authenticated organization owners can add a member to the organization or update the member's role. + * + * * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. + * + * * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. + * + * **Rate limits** + * + * To prevent abuse, the authenticated user is limited to 50 organization invitations per 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. + */ + "orgs/set-membership-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["org-membership"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** + * The role to give the user in the organization. Can be one of: + * \* `admin` - The user will become an owner of the organization. + * \* `member` - The user will become a non-owner member of the organization. + */ + role?: "admin" | "member"; + }; + }; + }; + }; + /** + * In order to remove a user's membership with an organization, the authenticated user must be an organization owner. + * + * If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. + */ + "orgs/remove-membership-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists the most recent migrations. */ + "migrations/list-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Exclude attributes from the API response to improve performance */ + exclude?: "repositories"[]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["migration"][]; + }; + }; + }; + }; + /** Initiates the generation of a migration archive. */ + "migrations/start-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["migration"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A list of arrays indicating which repositories should be migrated. */ + repositories: string[]; + /** Indicates whether repositories should be locked (to prevent manipulation) while migrating data. */ + lock_repositories?: boolean; + /** Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). */ + exclude_attachments?: boolean; + exclude?: "repositories"[]; + }; + }; + }; + }; + /** + * Fetches the status of a migration. + * + * The `state` of a migration can be one of the following values: + * + * * `pending`, which means the migration hasn't started yet. + * * `exporting`, which means the migration is in progress. + * * `exported`, which means the migration finished successfully. + * * `failed`, which means the migration failed. + */ + "migrations/get-status-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + query: { + /** Exclude attributes from the API response to improve performance */ + exclude?: "repositories"[]; + }; + }; + responses: { + /** + * * `pending`, which means the migration hasn't started yet. + * * `exporting`, which means the migration is in progress. + * * `exported`, which means the migration finished successfully. + * * `failed`, which means the migration failed. + */ + 200: { + content: { + "application/json": components["schemas"]["migration"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Fetches the URL to a migration archive. */ + "migrations/download-archive-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + }; + responses: { + /** Response */ + 302: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Deletes a previous migration archive. Migration archives are automatically deleted after seven days. */ + "migrations/delete-archive-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. */ + "migrations/unlock-repo-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + /** repo_name parameter */ + repo_name: components["parameters"]["repo-name"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** List all the repositories for this organization migration. */ + "migrations/list-repos-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** List all users who are outside collaborators of an organization. */ + "orgs/list-outside-collaborators": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** + * Filter the list of outside collaborators. Can be one of: + * \* `2fa_disabled`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. + * \* `all`: All outside collaborators. + */ + filter?: "2fa_disabled" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + }; + }; + /** When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". */ + "orgs/convert-member-to-outside-collaborator": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** User is getting converted asynchronously */ + 202: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + /** User was converted */ + 204: never; + /** Forbidden if user is the last owner of the organization or not a member of the organization */ + 403: unknown; + 404: components["responses"]["not_found"]; + }; + }; + /** Removing a user from this list will remove them from all the organization's repositories. */ + "orgs/remove-outside-collaborator": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** Unprocessable Entity if user is a member of the organization */ + 422: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + }; + }; + }; + }; + }; + /** + * Gets a specific package in an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-package-for-organization": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package"]; + }; + }; + }; + }; + /** + * Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. + */ + "packages/delete-package-for-org": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Restores an entire package in an organization. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. + */ + "packages/restore-package-for-org": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + }; + query: { + /** package token */ + token?: string; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Returns all package versions for a package owned by an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-all-package-versions-for-package-owned-by-org": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** The state of the package, either active or deleted. */ + state?: "active" | "deleted"; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package-version"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Gets a specific package version in an organization. + * + * You must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-package-version-for-organization": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package-version"]; + }; + }; + }; + }; + /** + * Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. + */ + "packages/delete-package-version-for-org": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Restores a specific package version in an organization. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. + */ + "packages/restore-package-version-for-org": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + org: components["parameters"]["org"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + "projects/list-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["project"][]; + }; + }; + 422: components["responses"]["validation_failed_simple"]; + }; + }; + /** Creates an organization project board. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + "projects/create-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["project"]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the project. */ + name: string; + /** The description of the project. */ + body?: string; + }; + }; + }; + }; + /** Members of an organization can choose to have their membership publicized or not. */ + "orgs/list-public-members": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + }; + }; + "orgs/check-public-membership-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response if user is a public member */ + 204: never; + /** Not Found if user is not a public member */ + 404: unknown; + }; + }; + /** + * The user can publicize their own membership. (A user cannot publicize the membership for another user.) + * + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + "orgs/set-public-membership-for-authenticated-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + }; + }; + "orgs/remove-public-membership-for-authenticated-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Lists repositories for the specified organization. */ + "repos/list-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Specifies the types of repositories you want returned. Can be one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`. Note: For GitHub AE, can be one of `all`, `private`, `forks`, `sources`, `member`, `internal`. Default: `all`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. However, the `internal` value is not yet supported when a GitHub App calls this API with an installation access token. */ + type?: + | "all" + | "public" + | "private" + | "forks" + | "sources" + | "member" + | "internal"; + /** Can be one of `created`, `updated`, `pushed`, `full_name`. */ + sort?: "created" | "updated" | "pushed" | "full_name"; + /** Can be one of `asc` or `desc`. Default: when using `full_name`: `asc`, otherwise `desc` */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + }; + }; + /** + * Creates a new repository in the specified organization. The authenticated user must be a member of the organization. + * + * **OAuth scope requirements** + * + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository + */ + "repos/create-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["repository"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the repository. */ + name: string; + /** A short description of the repository. */ + description?: string; + /** A URL with more information about the repository. */ + homepage?: string; + /** Whether the repository is private. */ + private?: boolean; + /** + * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. Note: For GitHub Enterprise Server and GitHub AE, this endpoint will only list repositories available to all users on the enterprise. For more information, see "[Creating an internal repository](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. + * The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. + */ + visibility?: "public" | "private" | "visibility" | "internal"; + /** Either `true` to enable issues for this repository or `false` to disable them. */ + has_issues?: boolean; + /** Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. */ + has_projects?: boolean; + /** Either `true` to enable the wiki for this repository or `false` to disable it. */ + has_wiki?: boolean; + /** Either `true` to make this repo available as a template repository or `false` to prevent it. */ + is_template?: boolean; + /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ + team_id?: number; + /** Pass `true` to create an initial commit with empty README. */ + auto_init?: boolean; + /** Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". */ + gitignore_template?: string; + /** Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://help.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". */ + license_template?: string; + /** Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. */ + allow_squash_merge?: boolean; + /** Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. */ + allow_merge_commit?: boolean; + /** Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. */ + allow_rebase_merge?: boolean; + /** Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. */ + allow_auto_merge?: boolean; + /** Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. */ + delete_branch_on_merge?: boolean; + }; + }; + }; + }; + /** + * Gets the summary of the free and paid GitHub Actions minutes used. + * + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * Access tokens must have the `repo` or `admin:org` scope. + */ + "billing/get-github-actions-billing-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-billing-usage"]; + }; + }; + }; + }; + /** + * Gets the free and paid storage used for GitHub Packages in gigabytes. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `repo` or `admin:org` scope. + */ + "billing/get-github-packages-billing-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["packages-billing-usage"]; + }; + }; + }; + }; + /** + * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `repo` or `admin:org` scope. + */ + "billing/get-shared-storage-billing-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["combined-billing-usage"]; + }; + }; + }; + }; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * List IdP groups available in an organization. You can limit your page results using the `per_page` parameter. GitHub generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)." + * + * The `per_page` parameter provides pagination for a list of IdP groups the authenticated user can access in an organization. For example, if the user `octocat` wants to see two groups per page in `octo-org` via cURL, it would look like this: + */ + "teams/list-idp-groups-for-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page token */ + page?: string; + }; + }; + responses: { + /** Response */ + 200: { + headers: { + Link?: string; + }; + content: { + "application/json": components["schemas"]["group-mapping"]; + }; + }; + }; + }; + /** Lists all teams in an organization that are visible to the authenticated user. */ + "teams/list": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." + * + * When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". + */ + "teams/create": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-full"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the team. */ + name: string; + /** The description of the team. */ + description?: string; + /** List GitHub IDs for organization members who will become team maintainers. */ + maintainers?: string[]; + /** The full name (e.g., "organization-name/repository-name") of repositories to add the team to. */ + repo_names?: string[]; + /** + * The level of privacy this team should have. The options are: + * **For a non-nested team:** + * \* `secret` - only visible to organization owners and members of this team. + * \* `closed` - visible to all members of this organization. + * Default: `secret` + * **For a parent or child team:** + * \* `closed` - visible to all members of this organization. + * Default for child team: `closed` + */ + privacy?: "secret" | "closed"; + /** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \* `pull` - team members can pull, but not push to or administer newly-added repositories. + * \* `push` - team members can pull and push, but not administer newly-added repositories. + * \* `admin` - team members can pull, push and administer newly-added repositories. + */ + permission?: "pull" | "push" | "admin"; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number; + }; + }; + }; + }; + /** + * Gets a team using the team's `slug`. GitHub generates the `slug` from the team `name`. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. + */ + "teams/get-by-name": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-full"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * To delete a team, the authenticated user must be an organization owner or team maintainer. + * + * If you are an organization owner, deleting a parent team will delete all of its child teams as well. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. + */ + "teams/delete-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * To edit a team, the authenticated user must either be an organization owner or a team maintainer. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. + */ + "teams/update-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-full"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The name of the team. */ + name?: string; + /** The description of the team. */ + description?: string; + /** + * The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: + * **For a non-nested team:** + * \* `secret` - only visible to organization owners and members of this team. + * \* `closed` - visible to all members of this organization. + * **For a parent or child team:** + * \* `closed` - visible to all members of this organization. + */ + privacy?: "secret" | "closed"; + /** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \* `pull` - team members can pull, but not push to or administer newly-added repositories. + * \* `push` - team members can pull and push, but not administer newly-added repositories. + * \* `admin` - team members can pull, push and administer newly-added repositories. + */ + permission?: "pull" | "push" | "admin"; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number | null; + }; + }; + }; + }; + /** + * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. + */ + "teams/list-discussions-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + query: { + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Pinned discussions only filter */ + pinned?: string; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-discussion"][]; + }; + }; + }; + }; + /** + * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. + */ + "teams/create-discussion-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-discussion"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion post's title. */ + title: string; + /** The discussion post's body text. */ + body: string; + /** Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. */ + private?: boolean; + }; + }; + }; + }; + /** + * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + */ + "teams/get-discussion-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion"]; + }; + }; + }; + }; + /** + * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + */ + "teams/delete-discussion-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. + */ + "teams/update-discussion-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion post's title. */ + title?: string; + /** The discussion post's body text. */ + body?: string; + }; + }; + }; + }; + /** + * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. + */ + "teams/list-discussion-comments-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + query: { + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-discussion-comment"][]; + }; + }; + }; + }; + /** + * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. + */ + "teams/create-discussion-comment-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-discussion-comment"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion comment's body text. */ + body: string; + }; + }; + }; + }; + /** + * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + */ + "teams/get-discussion-comment-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion-comment"]; + }; + }; + }; + }; + /** + * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + */ + "teams/delete-discussion-comment-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. + */ + "teams/update-discussion-comment-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion-comment"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion comment's body text. */ + body: string; + }; + }; + }; + }; + /** + * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + */ + "reactions/list-for-team-discussion-comment-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + }; + }; + /** + * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. + */ + "reactions/create-for-team-discussion-comment-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. + * + * Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "reactions/delete-for-team-discussion-comment": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + */ + "reactions/list-for-team-discussion-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + }; + }; + /** + * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. + */ + "reactions/create-for-team-discussion-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. + * + * Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "reactions/delete-for-team-discussion": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + discussion_number: components["parameters"]["discussion-number"]; + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`. + */ + "teams/list-pending-invitations-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["organization-invitation"][]; + }; + }; + }; + }; + /** + * Team members will include the members of child teams. + * + * To list members in a team, the team must be visible to the authenticated user. + */ + "teams/list-members-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + query: { + /** + * Filters members returned by their role in the team. Can be one of: + * \* `member` - normal members of the team. + * \* `maintainer` - team maintainers. + * \* `all` - all members of the team. + */ + role?: "member" | "maintainer" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + }; + }; + /** + * Team members will include the members of child teams. + * + * To get a user's membership with a team, the team must be visible to the authenticated user. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. + * + * **Note:** + * The response contains the `state` of the membership and the member's `role`. + * + * The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + */ + "teams/get-membership-for-user-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-membership"]; + }; + }; + /** if user has no team membership */ + 404: unknown; + }; + }; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. + * + * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. + */ + "teams/add-or-update-membership-for-user-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-membership"]; + }; + }; + /** Forbidden if team synchronization is set up */ + 403: unknown; + /** Unprocessable Entity if you attempt to add an organization to a team */ + 422: unknown; + }; + requestBody: { + content: { + "application/json": { + /** + * The role that this user should have in the team. Can be one of: + * \* `member` - a normal member of the team. + * \* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + */ + role?: "member" | "maintainer"; + }; + }; + }; + }; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. + */ + "teams/remove-membership-for-user-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** Forbidden if team synchronization is set up */ + 403: unknown; + }; + }; + /** + * Lists the organization projects for a team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. + */ + "teams/list-projects-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-project"][]; + }; + }; + }; + }; + /** + * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + */ + "teams/check-permissions-for-project-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-project"]; + }; + }; + /** Not Found if project is not managed by this team */ + 404: unknown; + }; + }; + /** + * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + */ + "teams/add-or-update-project-permissions-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** Forbidden if the project is not owned by the organization */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + }; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** + * The permission to grant to the team for this project. Can be one of: + * \* `read` - team members can read, but not write to or administer this project. + * \* `write` - team members can read and write, but not administer this project. + * \* `admin` - team members can read, write and administer this project. + * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + permission?: "read" | "write" | "admin"; + } | null; + }; + }; + }; + /** + * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. + */ + "teams/remove-project-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Lists a team's repositories visible to the authenticated user. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. + */ + "teams/list-repos-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + }; + }; + /** + * Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. + * + * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header. + * + * If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + */ + "teams/check-permissions-for-repo-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Alternative response with repository permissions */ + 200: { + content: { + "application/json": components["schemas"]["team-repository"]; + }; + }; + /** Response if team has permission for the repository. This is the response when the repository media type hasn't been provded in the Accept header. */ + 204: never; + /** Not Found if team does not have permission for the repository */ + 404: unknown; + }; + }; + /** + * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + * + * For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + */ + "teams/add-or-update-repo-permissions-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** + * The permission to grant the team on this repository. Can be one of: + * \* `pull` - team members can pull, but not push to or administer this repository. + * \* `push` - team members can pull and push, but not administer this repository. + * \* `admin` - team members can pull, push and administer this repository. + * \* `maintain` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. + * \* `triage` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. + * + * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + */ + permission?: "pull" | "push" | "admin" | "maintain" | "triage"; + }; + }; + }; + }; + /** + * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. + */ + "teams/remove-repo-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * List IdP groups connected to a team on GitHub. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. + */ + "teams/list-idp-groups-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["group-mapping"]; + }; + }; + }; + }; + /** + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/team-sync/group-mappings`. + */ + "teams/create-or-update-idp-group-connections-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["group-mapping"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The IdP groups you want to connect to a GitHub team. When updating, the new `groups` object will replace the original one. You must include any existing groups that you don't want to remove. */ + groups?: { + /** ID of the IdP group. */ + group_id: string; + /** Name of the IdP group. */ + group_name: string; + /** Description of the IdP group. */ + group_description: string; + }[]; + }; + }; + }; + }; + /** + * Lists the child teams of the team specified by `{team_slug}`. + * + * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. + */ + "teams/list-child-in-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** team_slug parameter */ + team_slug: components["parameters"]["team-slug"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** if child teams exist */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + }; + }; + "projects/get-card": { + parameters: { + path: { + /** card_id parameter */ + card_id: components["parameters"]["card-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["project-card"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "projects/delete-card": { + parameters: { + path: { + /** card_id parameter */ + card_id: components["parameters"]["card-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + /** Forbidden */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + errors?: string[]; + }; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "projects/update-card": { + parameters: { + path: { + /** card_id parameter */ + card_id: components["parameters"]["card-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["project-card"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The project card's note */ + note?: string | null; + /** Whether or not the card is archived */ + archived?: boolean; + }; + }; + }; + }; + "projects/move-card": { + parameters: { + path: { + /** card_id parameter */ + card_id: components["parameters"]["card-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + /** Forbidden */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + resource?: string; + field?: string; + }[]; + }; + }; + }; + 422: components["responses"]["validation_failed"]; + /** Response */ + 503: { + content: { + "application/json": { + code?: string; + message?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + }; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. */ + position: string; + /** The unique identifier of the column the card should be moved to */ + column_id?: number; + }; + }; + }; + }; + "projects/get-column": { + parameters: { + path: { + /** column_id parameter */ + column_id: components["parameters"]["column-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["project-column"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "projects/delete-column": { + parameters: { + path: { + /** column_id parameter */ + column_id: components["parameters"]["column-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "projects/update-column": { + parameters: { + path: { + /** column_id parameter */ + column_id: components["parameters"]["column-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["project-column"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + requestBody: { + content: { + "application/json": { + /** Name of the project column */ + name: string; + }; + }; + }; + }; + "projects/list-cards": { + parameters: { + path: { + /** column_id parameter */ + column_id: components["parameters"]["column-id"]; + }; + query: { + /** Filters the project cards that are returned by the card's state. Can be one of `all`,`archived`, or `not_archived`. */ + archived_state?: "all" | "archived" | "not_archived"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["project-card"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "projects/create-card": { + parameters: { + path: { + /** column_id parameter */ + column_id: components["parameters"]["column-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["project-card"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + /** Validation failed */ + 422: { + content: { + "application/json": + | components["schemas"]["validation-error"] + | components["schemas"]["validation-error-simple"]; + }; + }; + /** Response */ + 503: { + content: { + "application/json": { + code?: string; + message?: string; + documentation_url?: string; + errors?: { + code?: string; + message?: string; + }[]; + }; + }; + }; + }; + requestBody: { + content: { + "application/json": + | { + /** The project card's note */ + note: string | null; + } + | { + /** The unique identifier of the content associated with the card */ + content_id: number; + /** The piece of content associated with the card */ + content_type: string; + }; + }; + }; + }; + "projects/move-column": { + parameters: { + path: { + /** column_id parameter */ + column_id: components["parameters"]["column-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. */ + position: string; + }; + }; + }; + }; + /** Gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + "projects/get": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["project"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** Deletes a project board. Returns a `404 Not Found` status if projects are disabled. */ + "projects/delete": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Delete Success */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + /** Forbidden */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + errors?: string[]; + }; + }; + }; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + }; + }; + /** Updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + "projects/update": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["project"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + /** Forbidden */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + errors?: string[]; + }; + }; + }; + /** Not Found if the authenticated user does not have access to the project */ + 404: unknown; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** Name of the project */ + name?: string; + /** Body of the project */ + body?: string | null; + /** State of the project; either 'open' or 'closed' */ + state?: string; + /** The baseline permission that all organization members have on this project */ + organization_permission?: "read" | "write" | "admin" | "none"; + /** Whether or not this project can be seen by everyone. */ + private?: boolean; + }; + }; + }; + }; + /** Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. */ + "projects/list-collaborators": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + }; + query: { + /** + * Filters the collaborators by their affiliation. Can be one of: + * \* `outside`: Outside collaborators of a project that are not a member of the project's organization. + * \* `direct`: Collaborators with permissions to a project, regardless of organization membership status. + * \* `all`: All collaborators the authenticated user can see. + */ + affiliation?: "outside" | "direct" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. */ + "projects/add-collaborator": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The permission to grant the collaborator. */ + permission?: "read" | "write" | "admin"; + } | null; + }; + }; + }; + /** Removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. */ + "projects/remove-collaborator": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. */ + "projects/get-permission-for-user": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["repository-collaborator-permission"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "projects/list-columns": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["project-column"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "projects/create-column": { + parameters: { + path: { + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["project-column"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** Name of the project column */ + name: string; + }; + }; + }; + }; + /** + * **Note:** Accessing this endpoint does not count against your REST API rate limit. + * + * **Note:** The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. + */ + "rate-limit/get": { + parameters: {}; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["rate-limit-overview"]; + }; + }; + 304: components["responses"]["not_modified"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). + * + * OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). + */ + "reactions/delete-legacy": { + parameters: { + path: { + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 410: components["responses"]["gone"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * When you pass the `scarlet-witch-preview` media type, requests to get a repository will also return the repository's code of conduct if it can be detected from the repository's code of conduct file. + * + * The `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network. + */ + "repos/get": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["full-repository"]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Deleting a repository requires admin access. If OAuth is used, the `delete_repo` scope is required. + * + * If an organization owner has configured the organization to prevent members from deleting organization-owned + * repositories, you will get a `403 Forbidden` response. + */ + "repos/delete": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 307: components["responses"]["temporary_redirect"]; + /** If an organization owner has configured the organization to prevent members from deleting organization-owned repositories, a member will get this response: */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + }; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. */ + "repos/update": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["full-repository"]; + }; + }; + 307: components["responses"]["temporary_redirect"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the repository. */ + name?: string; + /** A short description of the repository. */ + description?: string; + /** A URL with more information about the repository. */ + homepage?: string; + /** + * Either `true` to make the repository private or `false` to make it public. Default: `false`. + * **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://help.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + */ + private?: boolean; + /** Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. The `visibility` parameter overrides the `private` parameter when you use both along with the `nebula-preview` preview header. */ + visibility?: "public" | "private" | "visibility" | "internal"; + /** Specify which security and analysis features to enable or disable. For example, to enable GitHub Advanced Security, use this data in the body of the PATCH request: `{"security_and_analysis": {"advanced_security": {"status": "enabled"}}}`. If you have admin permissions for a private repository covered by an Advanced Security license, you can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. */ + security_and_analysis?: { + /** Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." */ + advanced_security?: { + /** Can be `enabled` or `disabled`. */ + status?: string; + }; + /** Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." */ + secret_scanning?: { + /** Can be `enabled` or `disabled`. */ + status?: string; + }; + } | null; + /** Either `true` to enable issues for this repository or `false` to disable them. */ + has_issues?: boolean; + /** Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. */ + has_projects?: boolean; + /** Either `true` to enable the wiki for this repository or `false` to disable it. */ + has_wiki?: boolean; + /** Either `true` to make this repo available as a template repository or `false` to prevent it. */ + is_template?: boolean; + /** Updates the default branch for this repository. */ + default_branch?: string; + /** Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. */ + allow_squash_merge?: boolean; + /** Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. */ + allow_merge_commit?: boolean; + /** Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. */ + allow_rebase_merge?: boolean; + /** Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. */ + allow_auto_merge?: boolean; + /** Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. */ + delete_branch_on_merge?: boolean; + /** `true` to archive this repository. **Note**: You cannot unarchive repositories through the API. */ + archived?: boolean; + }; + }; + }; + }; + /** Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/list-artifacts-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + artifacts: components["schemas"]["artifact"][]; + }; + }; + }; + }; + }; + /** Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/get-artifact": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** artifact_id parameter */ + artifact_id: components["parameters"]["artifact-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["artifact"]; + }; + }; + }; + }; + /** Deletes an artifact for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + "actions/delete-artifact": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** artifact_id parameter */ + artifact_id: components["parameters"]["artifact-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in + * the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to + * the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. + * GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + "actions/download-artifact": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** artifact_id parameter */ + artifact_id: components["parameters"]["artifact-id"]; + archive_format: string; + }; + }; + responses: { + /** Response */ + 302: never; + }; + }; + /** Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/get-job-for-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** job_id parameter */ + job_id: components["parameters"]["job-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["job"]; + }; + }; + }; + }; + /** + * Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look + * for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can + * use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must + * have the `actions:read` permission to use this endpoint. + */ + "actions/download-job-logs-for-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** job_id parameter */ + job_id: components["parameters"]["job-id"]; + }; + }; + responses: { + /** Response */ + 302: never; + }; + }; + /** + * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. + * + * You must authenticate using an access token with the `repo` scope to use this + * endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + "actions/get-github-actions-permissions-repository": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-repository-permissions"]; + }; + }; + }; + }; + /** + * Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. + * + * If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + "actions/set-github-actions-permissions-repository": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + enabled: components["schemas"]["actions-enabled"]; + allowed_actions?: components["schemas"]["allowed-actions"]; + }; + }; + }; + }; + /** + * Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + "actions/get-allowed-actions-repository": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["selected-actions"]; + }; + }; + }; + }; + /** + * Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + * + * If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. + * + * To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + "actions/set-allowed-actions-repository": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["selected-actions"]; + }; + }; + }; + /** Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. */ + "actions/list-self-hosted-runners-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + runners: components["schemas"]["runner"][]; + }; + }; + }; + }; + }; + /** + * Lists binaries for the runner application that you can download and run. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. + */ + "actions/list-runner-applications-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner-application"][]; + }; + }; + }; + }; + /** + * Returns a token that you can pass to the `config` script. The token expires after one hour. You must authenticate + * using an access token with the `repo` scope to use this endpoint. + * + * #### Example using registration token + * + * Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint. + * + * ``` + * ./config.sh --url https://github.com/octo-org/octo-repo-artifacts --token TOKEN + * ``` + */ + "actions/create-registration-token-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["authentication-token"]; + }; + }; + }; + }; + /** + * Returns a token that you can pass to remove a self-hosted runner from a repository. The token expires after one hour. + * You must authenticate using an access token with the `repo` scope to use this endpoint. + * + * #### Example using remove token + * + * To remove your self-hosted runner from a repository, replace TOKEN with the remove token provided by this endpoint. + * + * ``` + * ./config.sh remove --token TOKEN + * ``` + */ + "actions/create-remove-token-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["authentication-token"]; + }; + }; + }; + }; + /** + * Gets a specific self-hosted runner configured in a repository. + * + * You must authenticate using an access token with the `repo` scope to use this + * endpoint. + */ + "actions/get-self-hosted-runner-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["runner"]; + }; + }; + }; + }; + /** + * Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. + * + * You must authenticate using an access token with the `repo` + * scope to use this endpoint. + */ + "actions/delete-self-hosted-runner-from-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** Unique identifier of the self-hosted runner. */ + runner_id: components["parameters"]["runner-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * + * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + "actions/list-workflow-runs-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. */ + actor?: components["parameters"]["actor"]; + /** Returns workflow runs associated with a branch. Use the name of the branch of the `push`. */ + branch?: components["parameters"]["workflow-run-branch"]; + /** Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: components["parameters"]["event"]; + /** Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: components["parameters"]["workflow-run-status"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + created?: components["parameters"]["created"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + workflow_runs: components["schemas"]["workflow-run"][]; + }; + }; + }; + }; + }; + /** Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/get-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["workflow-run"]; + }; + }; + }; + }; + /** + * Delete a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is + * private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:write` permission to use + * this endpoint. + */ + "actions/delete-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/get-reviews-for-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["environment-approvals"][]; + }; + }; + }; + }; + /** + * Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + "actions/approve-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["empty-object"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/list-workflow-run-artifacts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + artifacts: components["schemas"]["artifact"][]; + }; + }; + }; + }; + }; + /** Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + "actions/cancel-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 202: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + }; + }; + /** Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). */ + "actions/list-jobs-for-workflow-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + query: { + /** + * Filters jobs by their `completed_at` timestamp. Can be one of: + * \* `latest`: Returns jobs from the most recent execution of the workflow run. + * \* `all`: Returns all jobs for a workflow run, including from old executions of the workflow run. + */ + filter?: "latest" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + jobs: components["schemas"]["job"][]; + }; + }; + }; + }; + }; + /** + * Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for + * `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use + * this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have + * the `actions:read` permission to use this endpoint. + */ + "actions/download-workflow-run-logs": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 302: never; + }; + }; + /** Deletes all logs for a workflow run. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + "actions/delete-workflow-run-logs": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Get all deployment environments for a workflow run that are waiting for protection rules to pass. + * + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + "actions/get-pending-deployments-for-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pending-deployment"][]; + }; + }; + }; + }; + /** + * Approve or reject pending deployments that are waiting on approval by a required reviewer. + * + * Anyone with read access to the repository contents and deployments can use this endpoint. + */ + "actions/review-pending-deployments-for-run": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["deployment"][]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The list of environment ids to approve or reject */ + environment_ids: number[]; + /** Whether to approve or reject deployment to the specified environments. Must be one of: `approved` or `rejected` */ + state: "approved" | "rejected"; + /** A comment to accompany the deployment review */ + comment: string; + }; + }; + }; + }; + /** Re-runs your workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ + "actions/re-run-workflow": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + }; + }; + /** + * Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + "actions/get-workflow-run-usage": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The id of the workflow run. */ + run_id: components["parameters"]["run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["workflow-run-usage"]; + }; + }; + }; + }; + /** Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/list-repo-secrets": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + secrets: components["schemas"]["actions-secret"][]; + }; + }; + }; + }; + }; + /** Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/get-repo-public-key": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-public-key"]; + }; + }; + }; + }; + /** Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/get-repo-secret": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-secret"]; + }; + }; + }; + }; + /** + * Creates or updates a repository secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use + * this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + "actions/create-or-update-repo-secret": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response when creating a secret */ + 201: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + /** Response when updating a secret */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/actions#get-a-repository-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; + }; + }; + }; + }; + /** Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/delete-repo-secret": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/list-repo-workflows": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + workflows: components["schemas"]["workflow"][]; + }; + }; + }; + }; + }; + /** Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "actions/get-workflow": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflow_id: components["parameters"]["workflow-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["workflow"]; + }; + }; + }; + }; + /** + * Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + "actions/disable-workflow": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflow_id: components["parameters"]["workflow-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." + */ + "actions/create-workflow-dispatch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflow_id: components["parameters"]["workflow-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** The git reference for the workflow. The reference can be a branch or tag name. */ + ref: string; + /** Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. */ + inputs?: { [key: string]: string }; + }; + }; + }; + }; + /** + * Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + "actions/enable-workflow": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflow_id: components["parameters"]["workflow-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). + * + * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. + */ + "actions/list-workflow-runs": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflow_id: components["parameters"]["workflow-id"]; + }; + query: { + /** Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. */ + actor?: components["parameters"]["actor"]; + /** Returns workflow runs associated with a branch. Use the name of the branch of the `push`. */ + branch?: components["parameters"]["workflow-run-branch"]; + /** Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." */ + event?: components["parameters"]["event"]; + /** Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub can set a status of `waiting` or `requested`. For a list of the possible `status` and `conclusion` options, see "[Create a check run](https://docs.github.com/rest/reference/checks#create-a-check-run)." */ + status?: components["parameters"]["workflow-run-status"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + created?: components["parameters"]["created"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + workflow_runs: components["schemas"]["workflow-run"][]; + }; + }; + }; + }; + }; + /** + * Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + "actions/get-workflow-usage": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the workflow. You can also pass the workflow file name as a string. */ + workflow_id: components["parameters"]["workflow-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["workflow-usage"]; + }; + }; + }; + }; + /** Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. */ + "issues/list-assignees": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Checks if a user has permission to be assigned to an issue in this repository. + * + * If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. + * + * Otherwise a `404` status code is returned. + */ + "issues/check-user-can-be-assigned": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + assignee: string; + }; + }; + responses: { + /** If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned. */ + 204: never; + /** Otherwise a `404` status code is returned. */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + }; + /** + * This returns a list of autolinks configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + "repos/list-autolinks": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["autolink"][]; + }; + }; + }; + }; + /** Users with admin access to the repository can create an autolink. */ + "repos/create-autolink": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["autolink"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The prefix appended by a number will generate a link any time it is found in an issue, pull request, or commit. */ + key_prefix: string; + /** The URL must contain for the reference number. */ + url_template: string; + }; + }; + }; + }; + /** + * This returns a single autolink reference by ID that was configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + "repos/get-autolink": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** autolink_id parameter */ + autolink_id: components["parameters"]["autolink-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["autolink"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * This deletes a single autolink reference by ID that was configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + "repos/delete-autolink": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** autolink_id parameter */ + autolink_id: components["parameters"]["autolink-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ + "repos/enable-automated-security-fixes": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ + "repos/disable-automated-security-fixes": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "repos/list-branches": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches. */ + protected?: boolean; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["short-branch"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "repos/get-branch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["branch-with-protection"]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/get-branch-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["branch-protection"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Protecting a branch requires admin or owner permissions to the repository. + * + * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. + * + * **Note**: The list of users, apps, and teams in total is limited to 100 items. + */ + "repos/update-branch-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** Require status checks to pass before merging. Set to `null` to disable. */ + required_status_checks: { + /** Require branches to be up to date before merging. */ + strict: boolean; + /** The list of status checks to require in order to merge into this branch */ + contexts: string[]; + } | null; + /** Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. */ + enforce_admins: boolean | null; + /** Require at least one approving review on a pull request, before merging. Set to `null` to disable. */ + required_pull_request_reviews: { + /** Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ + dismissal_restrictions?: { + /** The list of user `login`s with dismissal access */ + users?: string[]; + /** The list of team `slug`s with dismissal access */ + teams?: string[]; + }; + /** Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ + dismiss_stale_reviews?: boolean; + /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) review them. */ + require_code_owner_reviews?: boolean; + /** Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ + required_approving_review_count?: number; + } | null; + /** Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. */ + restrictions: { + /** The list of user `login`s with push access */ + users: string[]; + /** The list of team `slug`s with push access */ + teams: string[]; + /** The list of app `slug`s with push access */ + apps?: string[]; + } | null; + /** Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://help.github.com/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. */ + required_linear_history?: boolean; + /** Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." */ + allow_force_pushes?: boolean | null; + /** Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. */ + allow_deletions?: boolean; + /** Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. */ + required_conversation_resolution?: boolean; + }; + }; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/delete-branch-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/get-admin-branch-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch-admin-enforced"]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + */ + "repos/set-admin-branch-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch-admin-enforced"]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + */ + "repos/delete-admin-branch-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/get-pull-request-review-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch-pull-request-review"]; + }; + }; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/delete-pull-request-review-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. + * + * **Note**: Passing new arrays of `users` and `teams` replaces their previous values. + */ + "repos/update-pull-request-review-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch-pull-request-review"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. */ + dismissal_restrictions?: { + /** The list of user `login`s with dismissal access */ + users?: string[]; + /** The list of team `slug`s with dismissal access */ + teams?: string[]; + }; + /** Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. */ + dismiss_stale_reviews?: boolean; + /** Blocks merging pull requests until [code owners](https://help.github.com/articles/about-code-owners/) have reviewed. */ + require_code_owner_reviews?: boolean; + /** Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. */ + required_approving_review_count?: number; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. + * + * **Note**: You must enable branch protection to require signed commits. + */ + "repos/get-commit-signature-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch-admin-enforced"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. + */ + "repos/create-commit-signature-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["protected-branch-admin-enforced"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. + */ + "repos/delete-commit-signature-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/get-status-checks-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["status-check-policy"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/remove-status-check-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + */ + "repos/update-status-check-protection": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["status-check-policy"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Require branches to be up to date before merging. */ + strict?: boolean; + /** The list of status checks to require in order to merge into this branch */ + contexts?: string[]; + }; + }; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/get-all-status-check-contexts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": string[]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/set-status-check-contexts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": string[]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** contexts parameter */ + contexts: string[]; + }; + }; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/add-status-check-contexts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": string[]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** contexts parameter */ + contexts: string[]; + }; + }; + }; + }; + /** Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "repos/remove-status-check-contexts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": string[]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** contexts parameter */ + contexts: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists who has access to this protected branch. + * + * **Note**: Users, apps, and teams `restrictions` are only available for organization-owned repositories. + */ + "repos/get-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["branch-restriction-policy"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Disables the ability to restrict who can push to this branch. + */ + "repos/delete-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + */ + "repos/get-apps-with-access-to-protected-branch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["integration"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + * + * | Type | Description | + * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/set-app-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["integration"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** apps parameter */ + apps: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + * + * | Type | Description | + * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/add-app-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["integration"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** apps parameter */ + apps: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removes the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. + * + * | Type | Description | + * | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | The GitHub Apps that have push access to this branch. Use the app's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/remove-app-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["integration"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** apps parameter */ + apps: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists the teams who have push access to this branch. The list includes child teams. + */ + "repos/get-teams-with-access-to-protected-branch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. + * + * | Type | Description | + * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | + * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/set-team-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** teams parameter */ + teams: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Grants the specified teams push access for this branch. You can also give push access to child teams. + * + * | Type | Description | + * | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | + * | `array` | The teams that can have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/add-team-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** teams parameter */ + teams: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removes the ability of a team to push to this branch. You can also remove push access for child teams. + * + * | Type | Description | + * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Teams that should no longer have push access. Use the team's `slug`. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/remove-team-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** teams parameter */ + teams: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists the people who have push access to this branch. + */ + "repos/get-users-with-access-to-protected-branch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. + * + * | Type | Description | + * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/set-user-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** users parameter */ + users: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Grants the specified people push access for this branch. + * + * | Type | Description | + * | ------- | ----------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/add-user-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** users parameter */ + users: string[]; + }; + }; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Removes the ability of a user to push to this branch. + * + * | Type | Description | + * | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | + * | `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | + */ + "repos/remove-user-access-restrictions": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** users parameter */ + users: string[]; + }; + }; + }; + }; + /** + * Renames a branch in a repository. + * + * **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". + * + * The permissions required to use this endpoint depends on whether you are renaming the default branch. + * + * To rename a non-default branch: + * + * * Users must have push access. + * * GitHub Apps must have the `contents:write` repository permission. + * + * To rename the default branch: + * + * * Users must have admin or owner permissions. + * * GitHub Apps must have the `administration:write` repository permission. + */ + "repos/rename-branch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the branch. */ + branch: components["parameters"]["branch"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["branch-with-protection"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The new name of the branch. */ + new_name: string; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs. + * + * In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. + */ + "checks/create": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["check-run"]; + }; + }; + }; + requestBody: { + content: { + "application/json": ( + | ({ + status: "completed"; + } & { + conclusion: unknown; + } & { [key: string]: any }) + | ({ + status?: "queued" | "in_progress"; + } & { [key: string]: any }) + ) & { + /** The name of the check. For example, "code-coverage". */ + name: string; + /** The SHA of the commit. */ + head_sha: string; + /** The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. */ + details_url?: string; + /** A reference for the run on the integrator's system. */ + external_id?: string; + /** The current status. Can be one of `queued`, `in_progress`, or `completed`. */ + status?: "queued" | "in_progress" | "completed"; + /** The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + started_at?: string; + /** + * **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`. When the conclusion is `action_required`, additional details should be provided on the site specified by `details_url`. + * **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this. + */ + conclusion?: + | "action_required" + | "cancelled" + | "failure" + | "neutral" + | "success" + | "skipped" + | "stale" + | "timed_out"; + /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + completed_at?: string; + /** Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/rest/reference/checks#output-object) description. */ + output?: { + /** The title of the check run. */ + title: string; + /** The summary of the check run. This parameter supports Markdown. */ + summary: string; + /** The details of the check run. This parameter supports Markdown. */ + text?: string; + /** Adds information from your analysis to specific lines of code. Annotations are visible on GitHub in the **Checks** and **Files changed** tab of the pull request. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about how you can view annotations on GitHub, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [`annotations` object](https://docs.github.com/rest/reference/checks#annotations-object) description for details about how to use this parameter. */ + annotations?: { + /** The path of the file to add an annotation to. For example, `assets/css/main.css`. */ + path: string; + /** The start line of the annotation. */ + start_line: number; + /** The end line of the annotation. */ + end_line: number; + /** The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values. */ + start_column?: number; + /** The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values. */ + end_column?: number; + /** The level of the annotation. Can be one of `notice`, `warning`, or `failure`. */ + annotation_level: "notice" | "warning" | "failure"; + /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ + message: string; + /** The title that represents the annotation. The maximum size is 255 characters. */ + title?: string; + /** Details about this annotation. The maximum size is 64 KB. */ + raw_details?: string; + }[]; + /** Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/rest/reference/checks#images-object) description for details. */ + images?: { + /** The alternative text for the image. */ + alt: string; + /** The full URL of the image. */ + image_url: string; + /** A short image description. */ + caption?: string; + }[]; + }; + /** Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [`check_run.requested_action` webhook](https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." */ + actions?: { + /** The text to be displayed on a button in the web UI. The maximum size is 20 characters. */ + label: string; + /** A short explanation of what this action would do. The maximum size is 40 characters. */ + description: string; + /** A reference for the action on the integrator's system. The maximum size is 20 characters. */ + identifier: string; + }[]; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Gets a single check run using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. + */ + "checks/get": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** check_run_id parameter */ + check_run_id: components["parameters"]["check-run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["check-run"]; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Updates a check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to edit check runs. + */ + "checks/update": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** check_run_id parameter */ + check_run_id: components["parameters"]["check-run-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["check-run"]; + }; + }; + }; + requestBody: { + content: { + "application/json": (Partial< + { + status?: "completed"; + } & { + conclusion: unknown; + } & { [key: string]: any } + > & + Partial< + { + status?: "queued" | "in_progress"; + } & { [key: string]: any } + >) & { + /** The name of the check. For example, "code-coverage". */ + name?: string; + /** The URL of the integrator's site that has the full details of the check. */ + details_url?: string; + /** A reference for the run on the integrator's system. */ + external_id?: string; + /** This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + started_at?: string; + /** The current status. Can be one of `queued`, `in_progress`, or `completed`. */ + status?: "queued" | "in_progress" | "completed"; + /** + * **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, or `timed_out`. + * **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this. + */ + conclusion?: + | "action_required" + | "cancelled" + | "failure" + | "neutral" + | "success" + | "skipped" + | "stale" + | "timed_out"; + /** The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + completed_at?: string; + /** Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://docs.github.com/rest/reference/checks#output-object-1) description. */ + output?: { + /** **Required**. */ + title?: string; + /** Can contain Markdown. */ + summary: string; + /** Can contain Markdown. */ + text?: string; + /** Adds information from your analysis to specific lines of code. Annotations are visible in GitHub's pull request UI. Annotations are visible in GitHub's pull request UI. The Checks API limits the number of annotations to a maximum of 50 per API request. To create more than 50 annotations, you have to make multiple requests to the [Update a check run](https://docs.github.com/rest/reference/checks#update-a-check-run) endpoint. Each time you update the check run, annotations are appended to the list of annotations that already exist for the check run. For details about annotations in the UI, see "[About status checks](https://help.github.com/articles/about-status-checks#checks)". See the [`annotations` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. */ + annotations?: { + /** The path of the file to add an annotation to. For example, `assets/css/main.css`. */ + path: string; + /** The start line of the annotation. */ + start_line: number; + /** The end line of the annotation. */ + end_line: number; + /** The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values. */ + start_column?: number; + /** The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values. */ + end_column?: number; + /** The level of the annotation. Can be one of `notice`, `warning`, or `failure`. */ + annotation_level: "notice" | "warning" | "failure"; + /** A short description of the feedback for these lines of code. The maximum size is 64 KB. */ + message: string; + /** The title that represents the annotation. The maximum size is 255 characters. */ + title?: string; + /** Details about this annotation. The maximum size is 64 KB. */ + raw_details?: string; + }[]; + /** Adds images to the output displayed in the GitHub pull request UI. See the [`images` object](https://docs.github.com/rest/reference/checks#annotations-object-1) description for details. */ + images?: { + /** The alternative text for the image. */ + alt: string; + /** The full URL of the image. */ + image_url: string; + /** A short image description. */ + caption?: string; + }[]; + }; + /** Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://docs.github.com/rest/reference/checks#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://docs.github.com/rest/reference/checks#check-runs-and-requested-actions)." */ + actions?: { + /** The text to be displayed on a button in the web UI. The maximum size is 20 characters. */ + label: string; + /** A short explanation of what this action would do. The maximum size is 40 characters. */ + description: string; + /** A reference for the action on the integrator's system. The maximum size is 20 characters. */ + identifier: string; + }[]; + }; + }; + }; + }; + /** Lists annotations for a check run using the annotation `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the `repo` scope to get annotations for a check run in a private repository. */ + "checks/list-annotations": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** check_run_id parameter */ + check_run_id: components["parameters"]["check-run-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["check-annotation"][]; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. + * + * By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the `checks:write` permission to create check suites. + */ + "checks/create-suite": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** when the suite already existed */ + 200: { + content: { + "application/json": components["schemas"]["check-suite"]; + }; + }; + /** Response when the suite was created */ + 201: { + content: { + "application/json": components["schemas"]["check-suite"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The sha of the head commit. */ + head_sha: string; + }; + }; + }; + }; + /** Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. */ + "checks/set-suites-preferences": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["check-suite-preference"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [`auto_trigger_checks` object](https://docs.github.com/rest/reference/checks#auto_trigger_checks-object) description for details. */ + auto_trigger_checks?: { + /** The `id` of the GitHub App. */ + app_id: number; + /** Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. */ + setting: boolean; + }[]; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. + * + * Gets a single check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. + */ + "checks/get-suite": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** check_suite_id parameter */ + check_suite_id: components["parameters"]["check-suite-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["check-suite"]; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Lists check runs for a check suite using its `id`. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. + */ + "checks/list-for-suite": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** check_suite_id parameter */ + check_suite_id: components["parameters"]["check-suite-id"]; + }; + query: { + /** Returns check runs with the specified `name`. */ + check_name?: components["parameters"]["check-name"]; + /** Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. */ + status?: components["parameters"]["status"]; + /** Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`. */ + filter?: "latest" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + check_runs: components["schemas"]["check-run"][]; + }; + }; + }; + }; + }; + /** + * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + * + * To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository. + */ + "checks/rerequest-suite": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** check_suite_id parameter */ + check_suite_id: components["parameters"]["check-suite-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + }; + }; + /** + * Lists all open code scanning alerts for the default branch (usually `main` + * or `master`). You must use an access token with the `security_events` scope to use + * this endpoint. GitHub Apps must have the `security_events` read permission to use + * this endpoint. + * + * The response includes a `most_recent_instance` object. + * This provides details of the most recent instance of this alert + * for the default branch or for the specified Git reference + * (if you used `ref` in the request). + */ + "code-scanning/list-alerts-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ + tool_name?: components["parameters"]["tool-name"]; + /** The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ + tool_guid?: components["parameters"]["tool-guid"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ + ref?: components["parameters"]["git-ref"]; + /** Set to `open`, `fixed`, or `dismissed` to list code scanning alerts in a specific state. */ + state?: components["schemas"]["code-scanning-alert-state"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-alert-items"][]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_read"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * **Deprecation notice**: + * The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`. + */ + "code-scanning/get-alert": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ + alert_number: components["parameters"]["alert-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-alert"]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_read"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ + "code-scanning/update-alert": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ + alert_number: components["parameters"]["alert-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-alert"]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_write"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + requestBody: { + content: { + "application/json": { + state: components["schemas"]["code-scanning-alert-set-state"]; + dismissed_reason?: components["schemas"]["code-scanning-alert-dismissed-reason"]; + }; + }; + }; + }; + /** Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ + "code-scanning/list-alert-instances": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ + alert_number: components["parameters"]["alert-number"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ + ref?: components["parameters"]["git-ref"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-alert-instance"][]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_read"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Lists the details of all code scanning analyses for a repository, + * starting with the most recent. + * The response is paginated and you can use the `page` and `per_page` parameters + * to list the analyses you're interested in. + * By default 30 analyses are listed per page. + * + * The `rules_count` field in the response give the number of rules + * that were run in the analysis. + * For very old analyses this data is not available, + * and `0` is returned in this field. + * + * You must use an access token with the `security_events` scope to use this endpoint. + * GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * **Deprecation notice**: + * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + */ + "code-scanning/list-recent-analyses": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ + tool_name?: components["parameters"]["tool-name"]; + /** The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ + tool_guid?: components["parameters"]["tool-guid"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ + ref?: components["schemas"]["code-scanning-ref"]; + /** Filter analyses belonging to the same SARIF upload. */ + sarif_id?: components["schemas"]["code-scanning-analysis-sarif-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-analysis"][]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_read"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Gets a specified code scanning analysis for a repository. + * You must use an access token with the `security_events` scope to use this endpoint. + * GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * The default JSON response contains fields that describe the analysis. + * This includes the Git reference and commit SHA to which the analysis relates, + * the datetime of the analysis, the name of the code scanning tool, + * and the number of alerts. + * + * The `rules_count` field in the default response give the number of rules + * that were run in the analysis. + * For very old analyses this data is not available, + * and `0` is returned in this field. + * + * If you use the Accept header `application/sarif+json`, + * the response contains the analysis data that was uploaded. + * This is formatted as + * [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). + * + * **Deprecation notice**: + * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + */ + "code-scanning/get-analysis": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation. */ + analysis_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json+sarif": string; + "application/json": components["schemas"]["code-scanning-analysis"]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_read"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Deletes a specified code scanning analysis from a repository. For + * private repositories, you must use an access token with the `repo` scope. For public repositories, + * you must use an access token with `public_repo` and `repo:security_events` scopes. + * GitHub Apps must have the `security_events` write permission to use this endpoint. + * + * You can delete one analysis at a time. + * To delete a series of analyses, start with the most recent analysis and work backwards. + * Conceptually, the process is similar to the undo function in a text editor. + * + * When you list the analyses for a repository, + * one or more will be identified as deletable in the response: + * + * ``` + * "deletable": true + * ``` + * + * An analysis is deletable when it's the most recent in a set of analyses. + * Typically, a repository will have multiple sets of analyses + * for each enabled code scanning tool, + * where a set is determined by a unique combination of analysis values: + * + * * `ref` + * * `tool` + * * `analysis_key` + * * `environment` + * + * If you attempt to delete an analysis that is not the most recent in a set, + * you'll get a 400 response with the message: + * + * ``` + * Analysis specified is not deletable. + * ``` + * + * The response from a successful `DELETE` operation provides you with + * two alternative URLs for deleting the next analysis in the set + * (see the example default response below). + * Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis + * in the set. This is a useful option if you want to preserve at least one analysis + * for the specified tool in your repository. + * Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. + * When you delete the last analysis in a set the value of `next_analysis_url` and `confirm_delete_url` + * in the 200 response is `null`. + * + * As an example of the deletion process, + * let's imagine that you added a workflow that configured a particular code scanning tool + * to analyze the code in a repository. This tool has added 15 analyses: + * 10 on the default branch, and another 5 on a topic branch. + * You therefore have two separate sets of analyses for this tool. + * You've now decided that you want to remove all of the analyses for the tool. + * To do this you must make 15 separate deletion requests. + * To start, you must find the deletable analysis for one of the sets, + * step through deleting the analyses in that set, + * and then repeat the process for the second set. + * The procedure therefore consists of a nested loop: + * + * **Outer loop**: + * * List the analyses for the repository, filtered by tool. + * * Parse this list to find a deletable analysis. If found: + * + * **Inner loop**: + * * Delete the identified analysis. + * * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration. + * + * The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely. + */ + "code-scanning/delete-analysis": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation. */ + analysis_id: number; + }; + query: { + /** Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.` */ + confirm_delete?: string | null; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-analysis-deletion"]; + }; + }; + 400: components["responses"]["bad_request"]; + 403: components["responses"]["code_scanning_forbidden_write"]; + 404: components["responses"]["not_found"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. + * + * There are two places where you can upload code scanning results. + * - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." + * - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)." + * + * You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example: + * + * ``` + * gzip -c analysis-data.sarif | base64 -w0 + * ``` + * + * SARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries. + * + * The `202 Accepted`, response includes an `id` value. + * You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint. + * For more information, see "[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload)." + */ + "code-scanning/upload-sarif": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 202: { + content: { + "application/json": components["schemas"]["code-scanning-sarifs-receipt"]; + }; + }; + /** Bad Request if the sarif field is invalid */ + 400: unknown; + 403: components["responses"]["code_scanning_forbidden_write"]; + 404: components["responses"]["not_found"]; + /** Payload Too Large if the sarif field is too large */ + 413: unknown; + 503: components["responses"]["service_unavailable"]; + }; + requestBody: { + content: { + "application/json": { + commit_sha: components["schemas"]["code-scanning-analysis-commit-sha"]; + ref: components["schemas"]["code-scanning-ref"]; + sarif: components["schemas"]["code-scanning-analysis-sarif-file"]; + /** + * The base directory used in the analysis, as it appears in the SARIF file. + * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. + */ + checkout_uri?: string; + /** The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + started_at?: string; + /** The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. */ + tool_name?: string; + }; + }; + }; + }; + /** Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository)." You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. */ + "code-scanning/get-sarif": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The SARIF ID obtained after uploading. */ + sarif_id: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-scanning-sarifs-status"]; + }; + }; + 403: components["responses"]["code_scanning_forbidden_read"]; + /** Not Found if the sarif id does not match any upload */ + 404: unknown; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. + * + * Team members will include the members of child teams. + */ + "repos/list-collaborators": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** + * Filter collaborators returned by their affiliation. Can be one of: + * \* `outside`: All outside collaborators of an organization-owned repository. + * \* `direct`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. + * \* `all`: All collaborators the authenticated user can see. + */ + affiliation?: "outside" | "direct" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["collaborator"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * For organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. + * + * Team members will include the members of child teams. + */ + "repos/check-collaborator": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response if user is a collaborator */ + 204: never; + /** Not Found if user is not a collaborator */ + 404: unknown; + }; + }; + /** + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + * + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). + * + * **Rate limits** + * + * You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. + */ + "repos/add-collaborator": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response when a new invitation is created */ + 201: { + content: { + "application/json": components["schemas"]["repository-invitation"]; + }; + }; + /** Response when person is already a collaborator */ + 204: never; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** + * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: + * \* `pull` - can pull, but not push to or administer this repository. + * \* `push` - can pull and push, but not administer this repository. + * \* `admin` - can pull, push and administer this repository. + * \* `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. + * \* `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access. + */ + permission?: "pull" | "push" | "admin" | "maintain" | "triage"; + permissions?: string; + }; + }; + }; + }; + "repos/remove-collaborator": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Checks the repository permission of a collaborator. The possible repository permissions are `admin`, `write`, `read`, and `none`. */ + "repos/get-collaborator-permission-level": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** if user has admin permissions */ + 200: { + content: { + "application/json": components["schemas"]["repository-collaborator-permission"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). + * + * Comments are ordered by ascending ID. + */ + "repos/list-commit-comments-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["commit-comment"][]; + }; + }; + }; + }; + "repos/get-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["commit-comment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "repos/delete-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + "repos/update-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["commit-comment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + requestBody: { + content: { + "application/json": { + /** The contents of the comment */ + body: string; + }; + }; + }; + }; + /** List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ + "reactions/list-for-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a commit comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. */ + "reactions/create-for-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Reaction exists */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Reaction created */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the commit comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. + * + * Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). + */ + "reactions/delete-for-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "repos/list-commits": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** SHA or branch to start listing commits from. Default: the repository’s default branch (usually `master`). */ + sha?: string; + /** Only commits containing this file path will be returned. */ + path?: string; + /** GitHub login or email address by which to filter by commit author. */ + author?: string; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + until?: string; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["commit"][]; + }; + }; + 400: components["responses"]["bad_request"]; + 404: components["responses"]["not_found"]; + 409: components["responses"]["conflict"]; + 500: components["responses"]["internal_error"]; + }; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. + */ + "repos/list-branches-for-head-commit": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** commit_sha parameter */ + commit_sha: components["parameters"]["commit-sha"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["branch-short"][]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Use the `:commit_sha` to specify the commit that will have its comments listed. */ + "repos/list-comments-for-commit": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** commit_sha parameter */ + commit_sha: components["parameters"]["commit-sha"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["commit-comment"][]; + }; + }; + }; + }; + /** + * Create a comment for a commit using its `:commit_sha`. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "repos/create-commit-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** commit_sha parameter */ + commit_sha: components["parameters"]["commit-sha"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["commit-comment"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The contents of the comment. */ + body: string; + /** Relative path of the file to comment on. */ + path?: string; + /** Line index in the diff to comment on. */ + position?: number; + /** **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. */ + line?: number; + }; + }; + }; + }; + /** Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. */ + "repos/list-pull-requests-associated-with-commit": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** commit_sha parameter */ + commit_sha: components["parameters"]["commit-sha"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["pull-request-simple"][]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * Returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint. + * + * **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. + * + * You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property. + * + * To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "repos/get-commit": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["commit"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + 500: components["responses"]["internal_error"]; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. + * + * Lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the `repo` scope to get check runs in a private repository. + */ + "checks/list-for-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + query: { + /** Returns check runs with the specified `name`. */ + check_name?: components["parameters"]["check-name"]; + /** Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. */ + status?: components["parameters"]["status"]; + /** Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`. */ + filter?: "latest" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + app_id?: number; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + check_runs: components["schemas"]["check-run"][]; + }; + }; + }; + }; + }; + /** + * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. + * + * Lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name. GitHub Apps must have the `checks:read` permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the `repo` scope to get check suites in a private repository. + */ + "checks/list-suites-for-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + query: { + /** Filters check suites by GitHub App `id`. */ + app_id?: number; + /** Returns check runs with the specified `name`. */ + check_name?: components["parameters"]["check-name"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + check_suites: components["schemas"]["check-suite"][]; + }; + }; + }; + }; + }; + /** + * Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. + * + * The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. + * + * Additionally, a combined `state` is returned. The `state` is one of: + * + * * **failure** if any of the contexts report as `error` or `failure` + * * **pending** if there are no statuses or a context is `pending` + * * **success** if the latest status for all contexts is `success` + */ + "repos/get-combined-status-for-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["combined-commit-status"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one. + * + * This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. + */ + "repos/list-commit-statuses-for-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["status"][]; + }; + }; + 301: components["responses"]["moved_permanently"]; + }; + }; + /** + * Returns the contents of the repository's code of conduct file, if one is detected. + * + * A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. + */ + "codes-of-conduct/get-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["code-of-conduct"]; + }; + }; + }; + }; + /** + * This endpoint will return all community profile metrics, including an + * overall health score, repository description, the presence of documentation, detected + * code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, + * README, and CONTRIBUTING files. + * + * The `health_percentage` score is defined as a percentage of how many of + * these four documents are present: README, CONTRIBUTING, LICENSE, and + * CODE_OF_CONDUCT. For example, if all four documents are present, then + * the `health_percentage` is `100`. If only one is present, then the + * `health_percentage` is `25`. + * + * `content_reports_enabled` is only returned for organization-owned repositories. + */ + "repos/get-community-profile-metrics": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["community-profile"]; + }; + }; + }; + }; + /** + * The `basehead` param is comprised of two parts: `base` and `head`. Both must be branch names in `repo`. To compare branches across other repositories in the same network as `repo`, use the format `:branch`. + * + * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * + * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. + * + * **Working with large comparisons** + * + * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." + * + * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "repos/compare-commits-with-basehead": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The base branch and head branch to compare. This parameter expects the format `{base}...{head}`. */ + basehead: string; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["commit-comparison"]; + }; + }; + 404: components["responses"]["not_found"]; + 500: components["responses"]["internal_error"]; + }; + }; + /** + * Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. + * + * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + "apps/create-content-attachment-for-repo": { + parameters: { + path: { + /** The owner of the repository. Determined from the `repository` `full_name` of the `content_reference` event. */ + owner: string; + /** The name of the repository. Determined from the `repository` `full_name` of the `content_reference` event. */ + repo: string; + /** The `id` of the `content_reference` event. */ + content_reference_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["content-reference-attachment"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the attachment */ + title: string; + /** The body of the attachment */ + body: string; + }; + }; + }; + }; + /** + * Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit + * `:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. + * + * Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for + * retrieving the raw content or rendered HTML (when supported). All content types support [a custom media + * type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent + * object format. + * + * **Note**: + * * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). + * * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees + * API](https://docs.github.com/rest/reference/git#get-a-tree). + * * This API supports files up to 1 megabyte in size. + * + * #### If the content is a directory + * The response will be an array of objects, one object for each item in the directory. + * When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value + * _should_ be "submodule". This behavior exists in API v3 [for backwards compatibility purposes](https://git.io/v1YCW). + * In the next major version of the API, the type will be returned as "submodule". + * + * #### If the content is a symlink + * If the requested `:path` points to a symlink, and the symlink's target is a normal file in the repository, then the + * API responds with the content of the file (in the format shown in the example. Otherwise, the API responds with an object + * describing the symlink itself. + * + * #### If the content is a submodule + * The `submodule_git_url` identifies the location of the submodule repository, and the `sha` identifies a specific + * commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out + * the submodule at that specific commit. + * + * If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the + * github.com URLs (`html_url` and `_links["html"]`) will have null values. + */ + "repos/get-content": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** path parameter */ + path: string; + }; + query: { + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */ + ref?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/vnd.github.v3.object": components["schemas"]["content-tree"]; + "application/json": + | components["schemas"]["content-directory"] + | components["schemas"]["content-file"] + | components["schemas"]["content-symlink"] + | components["schemas"]["content-submodule"]; + }; + }; + 302: components["responses"]["found"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Creates a new file or replaces an existing file in a repository. */ + "repos/create-or-update-file-contents": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** path parameter */ + path: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["file-commit"]; + }; + }; + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["file-commit"]; + }; + }; + 404: components["responses"]["not_found"]; + 409: components["responses"]["conflict"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The commit message. */ + message: string; + /** The new file content, using Base64 encoding. */ + content: string; + /** **Required if you are updating a file**. The blob SHA of the file being replaced. */ + sha?: string; + /** The branch name. Default: the repository’s default branch (usually `master`) */ + branch?: string; + /** The person that committed the file. Default: the authenticated user. */ + committer?: { + /** The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. */ + name: string; + /** The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. */ + email: string; + date?: string; + }; + /** The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. */ + author?: { + /** The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. */ + name: string; + /** The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. */ + email: string; + date?: string; + }; + }; + }; + }; + }; + /** + * Deletes a file in a repository. + * + * You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author. + * + * The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used. + * + * You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code. + */ + "repos/delete-file": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** path parameter */ + path: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["file-commit"]; + }; + }; + 404: components["responses"]["not_found"]; + 409: components["responses"]["conflict"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + requestBody: { + content: { + "application/json": { + /** The commit message. */ + message: string; + /** The blob SHA of the file being replaced. */ + sha: string; + /** The branch name. Default: the repository’s default branch (usually `master`) */ + branch?: string; + /** object containing information about the committer. */ + committer?: { + /** The name of the author (or committer) of the commit */ + name?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + }; + /** object containing information about the author. */ + author?: { + /** The name of the author (or committer) of the commit */ + name?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + }; + }; + }; + }; + }; + /** + * Lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API v3 caches contributor data to improve performance. + * + * GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. + */ + "repos/list-contributors": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Set to `1` or `true` to include anonymous contributors in results. */ + anon?: string; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** if repository contains content */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["contributor"][]; + }; + }; + /** Response if repository is empty */ + 204: never; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Simple filtering of deployments is available via query parameters: */ + "repos/list-deployments": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** The SHA recorded at creation time. */ + sha?: string; + /** The name of the ref. This can be a branch, tag, or SHA. */ + ref?: string; + /** The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`). */ + task?: string; + /** The name of the environment that was deployed to (e.g., `staging` or `production`). */ + environment?: string | null; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["deployment"][]; + }; + }; + }; + }; + /** + * Deployments offer a few configurable parameters with certain defaults. + * + * The `ref` parameter can be any named branch, tag, or SHA. At GitHub we often deploy branches and verify them + * before we merge a pull request. + * + * The `environment` parameter allows deployments to be issued to different runtime environments. Teams often have + * multiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parameter + * makes it easier to track which environments have requested deployments. The default environment is `production`. + * + * The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. If + * the ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds, + * the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will + * return a failure response. + * + * By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a `success` + * state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to + * specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do + * not require any contexts or create any commit statuses, the deployment will always succeed. + * + * The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON text + * field that will be passed on when a deployment event is dispatched. + * + * The `task` parameter is used by the deployment system to allow different execution paths. In the web world this might + * be `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile an + * application with debugging enabled. + * + * Users with `repo` or `repo_deployment` scopes can create a deployment for a given ref. + * + * #### Merged branch response + * You will see this response when GitHub automatically merges the base branch into the topic branch instead of creating + * a deployment. This auto-merge happens when: + * * Auto-merge option is enabled in the repository + * * Topic branch does not include the latest changes on the base branch, which is `master` in the response example + * * There are no merge conflicts + * + * If there are no new commits in the base branch, a new request to create a deployment should give a successful + * response. + * + * #### Merge conflict response + * This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can't + * be merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts. + * + * #### Failed commit status checks + * This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success` + * status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`. + */ + "repos/create-deployment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["deployment"]; + }; + }; + /** Merged branch response */ + 202: { + content: { + "application/json": { + message?: string; + }; + }; + }; + /** Conflict when there is a merge conflict or the commit's status checks failed */ + 409: unknown; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The ref to deploy. This can be a branch, tag, or SHA. */ + ref: string; + /** Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). */ + task?: string; + /** Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. */ + auto_merge?: boolean; + /** The [status](https://docs.github.com/rest/reference/repos#statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. */ + required_contexts?: string[]; + payload?: { [key: string]: any } | string; + /** Name for the target deployment environment (e.g., `production`, `staging`, `qa`). */ + environment?: string; + /** Short description of the deployment. */ + description?: string | null; + /** + * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` + * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + transient_environment?: boolean; + /** + * Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. + * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + production_environment?: boolean; + }; + }; + }; + }; + "repos/get-deployment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** deployment_id parameter */ + deployment_id: components["parameters"]["deployment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["deployment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * To ensure there can always be an active deployment, you can only delete an _inactive_ deployment. Anyone with `repo` or `repo_deployment` scopes can delete an inactive deployment. + * + * To set a deployment as inactive, you must: + * + * * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. + * * Mark the active deployment as inactive by adding any non-successful deployment status. + * + * For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." + */ + "repos/delete-deployment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** deployment_id parameter */ + deployment_id: components["parameters"]["deployment-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed_simple"]; + }; + }; + /** Users with pull access can view deployment statuses for a deployment: */ + "repos/list-deployment-statuses": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** deployment_id parameter */ + deployment_id: components["parameters"]["deployment-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["deployment-status"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Users with `push` access can create deployment statuses for a given deployment. + * + * GitHub Apps require `read & write` access to "Deployments" and `read-only` access to "Repo contents" (for private repos). OAuth Apps require the `repo_deployment` scope. + */ + "repos/create-deployment-status": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** deployment_id parameter */ + deployment_id: components["parameters"]["deployment-id"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["deployment-status"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The state of the status. Can be one of `error`, `failure`, `inactive`, `in_progress`, `queued` `pending`, or `success`. **Note:** To use the `inactive` state, you must provide the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. To use the `in_progress` and `queued` states, you must provide the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. When you set a transient deployment to `inactive`, the deployment will be shown as `destroyed` in GitHub. */ + state: + | "error" + | "failure" + | "inactive" + | "in_progress" + | "queued" + | "pending" + | "success"; + /** The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. */ + target_url?: string; + /** + * The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` + * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + log_url?: string; + /** A short description of the status. The maximum description length is 140 characters. */ + description?: string; + /** Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. **Note:** This parameter requires you to use the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. */ + environment?: "production" | "staging" | "qa"; + /** + * Sets the URL for accessing your environment. Default: `""` + * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + environment_url?: string; + /** + * Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` + * **Note:** To add an `inactive` status to `production` environments, you must use the [`application/vnd.github.flash-preview+json`](https://docs.github.com/rest/overview/api-previews#deployment-statuses) custom media type. + * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://docs.github.com/rest/overview/api-previews#enhanced-deployments) custom media type. + */ + auto_inactive?: boolean; + }; + }; + }; + }; + /** Users with pull access can view a deployment status for a deployment: */ + "repos/get-deployment-status": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** deployment_id parameter */ + deployment_id: components["parameters"]["deployment-id"]; + status_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["deployment-status"]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." + * + * The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. + * + * This endpoint requires write access to the repository by providing either: + * + * - Personal access tokens with `repo` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. + * - GitHub Apps with both `metadata:read` and `contents:read&write` permissions. + * + * This input example shows how you can use the `client_payload` as a test to debug your workflow. + */ + "repos/create-dispatch-event": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A custom webhook event name. */ + event_type: string; + /** JSON payload with extra information about the webhook event that your action or worklow may use. */ + client_payload?: { [key: string]: any }; + }; + }; + }; + }; + /** + * Get all environments for a repository. + * + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + "repos/get-all-environments": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + /** The number of environments in this repository */ + total_count?: number; + environments?: components["schemas"]["environment"][]; + }; + }; + }; + }; + }; + /** Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ + "repos/get-environment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["environment"]; + }; + }; + }; + }; + /** + * Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)." + * + * **Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see "[Environments](/actions/reference/environments#deployment-branches)." + * + * **Note:** To create or update secrets for an environment, see "[Secrets](/rest/reference/actions#secrets)." + * + * You must authenticate using an access token with the repo scope to use this endpoint. + */ + "repos/create-or-update-environment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["environment"]; + }; + }; + /** Validation error when the environment name is invalid or when `protected_branches` and `custom_branch_policies` in `deployment_branch_policy` are set to the same value */ + 422: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + wait_timer?: components["schemas"]["wait-timer"]; + /** The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. */ + reviewers?: + | { + type?: components["schemas"]["deployment-reviewer-type"]; + /** The id of the user or team who can review the deployment */ + id?: number; + }[] + | null; + deployment_branch_policy?: components["schemas"]["deployment_branch_policy"]; + } | null; + }; + }; + }; + /** You must authenticate using an access token with the repo scope to use this endpoint. */ + "repos/delete-an-environment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + }; + }; + responses: { + /** Default response */ + 204: never; + }; + }; + "activity/list-repo-events": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + "repos/list-forks": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** The sort order. Can be either `newest`, `oldest`, or `stargazers`. */ + sort?: "newest" | "oldest" | "stargazers" | "watchers"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + 400: components["responses"]["bad_request"]; + }; + }; + /** + * Create a fork for the authenticated user. + * + * **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=rest-api). + */ + "repos/create-fork": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 202: { + content: { + "application/json": components["schemas"]["full-repository"]; + }; + }; + 400: components["responses"]["bad_request"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Optional parameter to specify the organization name if forking into an organization. */ + organization?: string; + } | null; + }; + }; + }; + "git/create-blob": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["short-blob"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 409: components["responses"]["conflict"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The new blob's content. */ + content: string; + /** The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. */ + encoding?: string; + }; + }; + }; + }; + /** + * The `content` in the response will always be Base64 encoded. + * + * _Note_: This API supports blobs up to 100 megabytes in size. + */ + "git/get-blob": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + file_sha: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["blob"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Creates a new Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "git/create-commit": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["git-commit"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The commit message */ + message: string; + /** The SHA of the tree object this commit points to */ + tree: string; + /** The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. */ + parents?: string[]; + /** Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. */ + author?: { + /** The name of the author (or committer) of the commit */ + name: string; + /** The email of the author (or committer) of the commit */ + email: string; + /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + date?: string; + }; + /** Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. */ + committer?: { + /** The name of the author (or committer) of the commit */ + name?: string; + /** The email of the author (or committer) of the commit */ + email?: string; + /** Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + date?: string; + }; + /** The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. */ + signature?: string; + }; + }; + }; + }; + /** + * Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "git/get-commit": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** commit_sha parameter */ + commit_sha: components["parameters"]["commit-sha"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["git-commit"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array. + * + * When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`. + * + * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * + * If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. + */ + "git/list-matching-refs": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["git-ref"][]; + }; + }; + }; + }; + /** + * Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned. + * + * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + */ + "git/get-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["git-ref"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. */ + "git/create-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["git-ref"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. */ + ref: string; + /** The SHA1 value for this reference. */ + sha: string; + key?: string; + }; + }; + }; + }; + "git/delete-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + }; + responses: { + /** Response */ + 204: never; + 422: components["responses"]["validation_failed"]; + }; + }; + "git/update-ref": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** ref parameter */ + ref: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["git-ref"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The SHA1 value to set this reference to */ + sha: string; + /** Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. */ + force?: boolean; + }; + }; + }; + }; + /** + * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "git/create-tag": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["git-tag"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The tag's name. This is typically a version (e.g., "v0.0.1"). */ + tag: string; + /** The tag message. */ + message: string; + /** The SHA of the git object this is tagging. */ + object: string; + /** The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`. */ + type: "commit" | "tree" | "blob"; + /** An object with information about the individual creating the tag. */ + tagger?: { + /** The name of the author of the tag */ + name: string; + /** The email of the author of the tag */ + email: string; + /** When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + date?: string; + }; + }; + }; + }; + }; + /** + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "git/get-tag": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + tag_sha: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["git-tag"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. + * + * If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." + */ + "git/create-tree": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["git-tree"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. */ + tree: { + /** The file referenced in the tree. */ + path?: string; + /** The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink. */ + mode?: "100644" | "100755" | "040000" | "160000" | "120000"; + /** Either `blob`, `tree`, or `commit`. */ + type?: "blob" | "tree" | "commit"; + /** + * The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. + * + * **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. + */ + sha?: string | null; + /** + * The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. + * + * **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. + */ + content?: string; + }[]; + /** + * The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on. + * If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. + */ + base_tree?: string; + }; + }; + }; + }; + /** + * Returns a single tree using the SHA1 value for that tree. + * + * If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time. + */ + "git/get-tree": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + tree_sha: string; + }; + query: { + /** Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `"true"`, and `"false"`. Omit this parameter to prevent recursively returning objects or subtrees. */ + recursive?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["git-tree"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "repos/list-webhooks": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["hook"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks can + * share the same `config` as long as those webhooks do not have any `events` that overlap. + */ + "repos/create-webhook": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["hook"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. */ + name?: string; + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ + config?: { + url?: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + token?: string; + digest?: string; + }; + /** Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. */ + events?: string[]; + /** Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. */ + active?: boolean; + } | null; + }; + }; + }; + /** Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." */ + "repos/get-webhook": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "repos/delete-webhook": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." */ + "repos/update-webhook": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Key/value pairs to provide settings for this webhook. [These are defined below](https://docs.github.com/rest/reference/repos#create-hook-config-params). */ + config?: { + url: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + address?: string; + room?: string; + }; + /** Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. */ + events?: string[]; + /** Determines a list of events to be added to the list of events that the Hook triggers for. */ + add_events?: string[]; + /** Determines a list of events to be removed from the list of events that the Hook triggers for. */ + remove_events?: string[]; + /** Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. */ + active?: boolean; + }; + }; + }; + }; + /** + * Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." + * + * Access tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission. + */ + "repos/get-webhook-config-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["webhook-config"]; + }; + }; + }; + }; + /** + * Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." + * + * Access tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission. + */ + "repos/update-webhook-config-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["webhook-config"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + url?: components["schemas"]["webhook-config-url"]; + content_type?: components["schemas"]["webhook-config-content-type"]; + secret?: components["schemas"]["webhook-config-secret"]; + insecure_ssl?: components["schemas"]["webhook-config-insecure-ssl"]; + }; + }; + }; + }; + /** Returns a list of webhook deliveries for a webhook configured in a repository. */ + "repos/list-webhook-deliveries": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. */ + cursor?: components["parameters"]["cursor"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook-delivery-item"][]; + }; + }; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Returns a delivery for a webhook configured in a repository. */ + "repos/get-webhook-delivery": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + delivery_id: components["parameters"]["delivery-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hook-delivery"]; + }; + }; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Redeliver a webhook delivery for a webhook configured in a repository. */ + "repos/redeliver-webhook-delivery": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + delivery_id: components["parameters"]["delivery-id"]; + }; + }; + responses: { + 202: components["responses"]["accepted"]; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ + "repos/ping-webhook": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated. + * + * **Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test` + */ + "repos/test-push-webhook": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + hook_id: components["parameters"]["hook-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** + * View the progress of an import. + * + * **Import status** + * + * This section includes details about the possible values of the `status` field of the Import Progress response. + * + * An import that does not have errors will progress through these steps: + * + * * `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL. + * * `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import). + * * `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information. + * * `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects". + * * `complete` - the import is complete, and the repository is ready on GitHub. + * + * If there are problems, you will see one of these in the `status` field: + * + * * `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * * `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=rest-api) for more information. + * * `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * * `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. + * * `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * + * **The project_choices field** + * + * When multiple projects are found at the provided URL, the response hash will include a `project_choices` field, the value of which is an array of hashes each representing a project choice. The exact key/value pairs of the project hashes will differ depending on the version control type. + * + * **Git LFS related fields** + * + * This section includes details about Git LFS related fields that may be present in the Import Progress response. + * + * * `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken. + * * `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step. + * * `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository. + * * `large_files_count` - the total number of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request. + */ + "migrations/get-import-status": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["import"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Start a source import to a GitHub repository using GitHub Importer. */ + "migrations/start-import": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["import"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The URL of the originating repository. */ + vcs_url: string; + /** The originating VCS type. Can be one of `subversion`, `git`, `mercurial`, or `tfvc`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. */ + vcs?: "subversion" | "git" | "mercurial" | "tfvc"; + /** If authentication is required, the username to provide to `vcs_url`. */ + vcs_username?: string; + /** If authentication is required, the password to provide to `vcs_url`. */ + vcs_password?: string; + /** For a tfvc import, the name of the project that is being imported. */ + tfvc_project?: string; + }; + }; + }; + }; + /** Stop an import for a repository. */ + "migrations/cancel-import": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * An import can be updated with credentials or a project choice by passing in the appropriate parameters in this API + * request. If no parameters are provided, the import will be restarted. + */ + "migrations/update-import": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["import"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The username to provide to the originating repository. */ + vcs_username?: string; + /** The password to provide to the originating repository. */ + vcs_password?: string; + vcs?: string; + tfvc_project?: string; + } | null; + }; + }; + }; + /** + * Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `. + * + * This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. + */ + "migrations/get-commit-authors": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** A user ID. Only return users with an ID greater than this ID. */ + since?: components["parameters"]["since-user"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["porter-author"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository. */ + "migrations/map-commit-author": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + author_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["porter-author"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The new Git author email. */ + email?: string; + /** The new Git author name. */ + name?: string; + }; + }; + }; + }; + /** List files larger than 100MB found during the import */ + "migrations/get-large-files": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["porter-large-file"][]; + }; + }; + }; + }; + /** You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). */ + "migrations/set-lfs-preference": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["import"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). */ + use_lfs: "opt_in" | "opt_out"; + }; + }; + }; + }; + /** + * Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-repo-installation": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["installation"]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. */ + "interactions/get-restrictions-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": Partial< + components["schemas"]["interaction-limit-response"] + > & + Partial<{ [key: string]: unknown }>; + }; + }; + }; + }; + /** Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ + "interactions/set-restrictions-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["interaction-limit-response"]; + }; + }; + /** Response */ + 409: unknown; + }; + requestBody: { + content: { + "application/json": components["schemas"]["interaction-limit"]; + }; + }; + }; + /** Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ + "interactions/remove-restrictions-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** Response */ + 409: unknown; + }; + }; + /** When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. */ + "repos/list-invitations": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["repository-invitation"][]; + }; + }; + }; + }; + "repos/delete-invitation": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** invitation_id parameter */ + invitation_id: components["parameters"]["invitation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "repos/update-invitation": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** invitation_id parameter */ + invitation_id: components["parameters"]["invitation-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["repository-invitation"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The permissions that the associated user will have on the repository. Valid values are `read`, `write`, `maintain`, `triage`, and `admin`. */ + permissions?: "read" | "write" | "maintain" | "triage" | "admin"; + }; + }; + }; + }; + /** + * List issues in a repository. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + "issues/list-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. */ + milestone?: string; + /** Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. */ + assignee?: string; + /** The user that created the issue. */ + creator?: string; + /** A user that's mentioned in the issue. */ + mentioned?: string; + /** A list of comma separated label names. Example: `bug,ui,@high` */ + labels?: components["parameters"]["labels"]; + /** What to sort results by. Can be either `created`, `updated`, `comments`. */ + sort?: "created" | "updated" | "comments"; + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue-simple"][]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "issues/create": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["issue"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the issue. */ + title: string | number; + /** The contents of the issue. */ + body?: string; + /** Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ */ + assignee?: string | null; + milestone?: (string | number) | null; + /** Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ */ + labels?: ( + | string + | { + id?: number; + name?: string; + description?: string | null; + color?: string | null; + } + )[]; + /** Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ + assignees?: string[]; + }; + }; + }; + }; + /** By default, Issue Comments are ordered by ascending ID. */ + "issues/list-comments-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort?: components["parameters"]["sort"]; + /** Either `asc` or `desc`. Ignored without the `sort` parameter. */ + direction?: "asc" | "desc"; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue-comment"][]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "issues/get-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["issue-comment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "issues/delete-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "issues/update-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["issue-comment"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The contents of the comment. */ + body: string; + }; + }; + }; + }; + /** List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ + "reactions/list-for-issue-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. */ + "reactions/create-for-issue-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Reaction exists */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Reaction created */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. + * + * Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). + */ + "reactions/delete-for-issue-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "issues/list-events-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue-event"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + }; + "issues/get-event": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + event_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["issue-event"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + }; + }; + /** + * The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was + * [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If + * the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API + * returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read + * access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe + * to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + "issues/get": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["issue"]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 304: components["responses"]["not_modified"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + }; + }; + /** Issue owners and users with push access can edit an issue. */ + "issues/update": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["issue"]; + }; + }; + 301: components["responses"]["moved_permanently"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the issue. */ + title?: (string | number) | null; + /** The contents of the issue. */ + body?: string | null; + /** Login for the user that this issue should be assigned to. **This field is deprecated.** */ + assignee?: string | null; + /** State of the issue. Either `open` or `closed`. */ + state?: "open" | "closed"; + milestone?: (string | number) | null; + /** Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (`[]`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ */ + labels?: ( + | string + | { + id?: number; + name?: string; + description?: string | null; + color?: string | null; + } + )[]; + /** Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (`[]`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ */ + assignees?: string[]; + }; + }; + }; + }; + /** Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. */ + "issues/add-assignees": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["issue-simple"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ */ + assignees?: string[]; + }; + }; + }; + }; + /** Removes one or more assignees from an issue. */ + "issues/remove-assignees": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["issue-simple"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ */ + assignees?: string[]; + }; + }; + }; + }; + /** Issue Comments are ordered by ascending ID. */ + "issues/list-comments": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + query: { + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue-comment"][]; + }; + }; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + }; + }; + /** This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ + "issues/create-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["issue-comment"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The contents of the comment. */ + body: string; + }; + }; + }; + }; + "issues/list-events": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue-event-for-issue"][]; + }; + }; + 410: components["responses"]["gone"]; + }; + }; + "issues/list-labels-on-issue": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["label"][]; + }; + }; + 410: components["responses"]["gone"]; + }; + }; + /** Removes any previous labels and sets the new labels for an issue. */ + "issues/set-labels": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["label"][]; + }; + }; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": Partial<{ + /** The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. */ + labels?: string[]; + }> & + Partial<{ + labels?: { + name: string; + }[]; + }>; + }; + }; + }; + "issues/add-labels": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["label"][]; + }; + }; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": + | { + /** The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. */ + labels?: string[]; + } + | { + labels?: { + name: string; + }[]; + }; + }; + }; + }; + "issues/remove-all-labels": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + 410: components["responses"]["gone"]; + }; + }; + /** Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. */ + "issues/remove-label": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + name: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["label"][]; + }; + }; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + }; + }; + /** + * Users with push access can lock an issue or pull request's conversation. + * + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + "issues/lock": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** + * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: + * \* `off-topic` + * \* `too heated` + * \* `resolved` + * \* `spam` + */ + lock_reason?: "off-topic" | "too heated" | "resolved" | "spam"; + } | null; + }; + }; + }; + /** Users with push access can unlock an issue's conversation. */ + "issues/unlock": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** List the reactions to an [issue](https://docs.github.com/rest/reference/issues). */ + "reactions/list-for-issue": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to an issue. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with an HTTP `200` status means that you already added the reaction type to this issue. */ + "reactions/create-for-issue": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the issue. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. + * + * Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). + */ + "reactions/delete-for-issue": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "issues/list-events-for-timeline": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** issue_number parameter */ + issue_number: components["parameters"]["issue-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["timeline-issue-events"][]; + }; + }; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + "repos/list-deploy-keys": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["deploy-key"][]; + }; + }; + }; + }; + /** You can create a read-only deploy key. */ + "repos/create-deploy-key": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["deploy-key"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A name for the key. */ + title?: string; + /** The contents of the key. */ + key: string; + /** + * If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. + * + * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://help.github.com/articles/permission-levels-for-a-user-account-repository/)." + */ + read_only?: boolean; + }; + }; + }; + }; + "repos/get-deploy-key": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** key_id parameter */ + key_id: components["parameters"]["key-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["deploy-key"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. */ + "repos/delete-deploy-key": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** key_id parameter */ + key_id: components["parameters"]["key-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "issues/list-labels-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["label"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "issues/create-label": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["label"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." */ + name: string; + /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. */ + color?: string; + /** A short description of the label. */ + description?: string; + }; + }; + }; + }; + "issues/get-label": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + name: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["label"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "issues/delete-label": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + name: string; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "issues/update-label": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + name: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["label"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." */ + new_name?: string; + /** The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. */ + color?: string; + /** A short description of the label. */ + description?: string; + }; + }; + }; + }; + /** Lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. */ + "repos/list-languages": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["language"]; + }; + }; + }; + }; + /** + * This method returns the contents of the repository's license file, if one is detected. + * + * Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. + */ + "licenses/get-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["license-content"]; + }; + }; + }; + }; + "repos/merge": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Successful Response (The resulting merge commit) */ + 201: { + content: { + "application/json": components["schemas"]["commit"]; + }; + }; + /** Response when already merged */ + 204: never; + 403: components["responses"]["forbidden"]; + /** Not Found when the base or head does not exist */ + 404: unknown; + /** Conflict when there is a merge conflict */ + 409: unknown; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the base branch that the head will be merged into. */ + base: string; + /** The head to merge. This can be a branch name or a commit SHA1. */ + head: string; + /** Commit message to use for the merge commit. If omitted, a default message will be used. */ + commit_message?: string; + }; + }; + }; + }; + "issues/list-milestones": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** The state of the milestone. Either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** What to sort results by. Either `due_on` or `completeness`. */ + sort?: "due_on" | "completeness"; + /** The direction of the sort. Either `asc` or `desc`. */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["milestone"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "issues/create-milestone": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["milestone"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the milestone. */ + title: string; + /** The state of the milestone. Either `open` or `closed`. */ + state?: "open" | "closed"; + /** A description of the milestone. */ + description?: string; + /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + due_on?: string; + }; + }; + }; + }; + "issues/get-milestone": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** milestone_number parameter */ + milestone_number: components["parameters"]["milestone-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["milestone"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + "issues/delete-milestone": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** milestone_number parameter */ + milestone_number: components["parameters"]["milestone-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + "issues/update-milestone": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** milestone_number parameter */ + milestone_number: components["parameters"]["milestone-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["milestone"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The title of the milestone. */ + title?: string; + /** The state of the milestone. Either `open` or `closed`. */ + state?: "open" | "closed"; + /** A description of the milestone. */ + description?: string; + /** The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + due_on?: string; + }; + }; + }; + }; + "issues/list-labels-for-milestone": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** milestone_number parameter */ + milestone_number: components["parameters"]["milestone-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["label"][]; + }; + }; + }; + }; + /** List all notifications for the current user. */ + "activity/list-repo-notifications-for-authenticated-user": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** If `true`, show notifications marked as read. */ + all?: components["parameters"]["all"]; + /** If `true`, only shows notifications in which the user is directly participating or mentioned. */ + participating?: components["parameters"]["participating"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + before?: components["parameters"]["before"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["thread"][]; + }; + }; + }; + }; + /** Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ + "activity/mark-repo-notifications-as-read": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 202: { + content: { + "application/json": { + message?: string; + url?: string; + }; + }; + }; + /** Reset Content */ + 205: unknown; + }; + requestBody: { + content: { + "application/json": { + /** Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. */ + last_read_at?: string; + }; + }; + }; + }; + "repos/get-pages": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["page"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Updates information for a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages). */ + "repos/update-information-about-pages-site": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 400: components["responses"]["bad_request"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://help.github.com/articles/using-a-custom-domain-with-github-pages/)." */ + cname?: string | null; + /** Specify whether HTTPS should be enforced for the repository. */ + https_enforced?: boolean; + /** Configures access controls for the GitHub Pages site. If public is set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. This includes anyone in your Enterprise if the repository is set to `internal` visibility. This feature is only available to repositories in an organization on an Enterprise plan. */ + public?: boolean; + source?: Partial<"gh-pages" | "master" | "master /docs"> & + Partial<{ + /** The repository branch used to publish your site's source files. */ + branch: string; + /** The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. */ + path: "/" | "/docs"; + }>; + }; + }; + }; + }; + /** Configures a GitHub Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)." */ + "repos/create-pages-site": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["page"]; + }; + }; + 409: components["responses"]["conflict"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The source branch and directory used to publish your Pages site. */ + source: { + /** The repository branch used to publish your site's source files. */ + branch: string; + /** The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/` */ + path?: "/" | "/docs"; + }; + } | null; + }; + }; + }; + "repos/delete-pages-site": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "repos/list-pages-builds": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["page-build"][]; + }; + }; + }; + }; + /** + * You can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures. + * + * Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. + */ + "repos/request-pages-build": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["page-build-status"]; + }; + }; + }; + }; + "repos/get-latest-pages-build": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["page-build"]; + }; + }; + }; + }; + "repos/get-pages-build": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + build_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["page-build"]; + }; + }; + }; + }; + /** + * Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages. + * + * The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response. + * + * Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint. + */ + "repos/get-pages-health-check": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pages-health-check"]; + }; + }; + /** Empty response */ + 202: { + content: { + "application/json": components["schemas"]["empty-object"]; + }; + }; + /** Custom domains are not available for GitHub Pages */ + 400: unknown; + 404: components["responses"]["not_found"]; + /** There isn't a CNAME for this page */ + 422: unknown; + }; + }; + /** Lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + "projects/list-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["project"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed_simple"]; + }; + }; + /** Creates a repository project board. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. */ + "projects/create-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["project"]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the project. */ + name: string; + /** The description of the project. */ + body?: string; + }; + }; + }; + }; + /** Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ + "pulls/list": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Either `open`, `closed`, or `all` to filter by state. */ + state?: "open" | "closed" | "all"; + /** Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`. */ + head?: string; + /** Filter pulls by base branch name. Example: `gh-pages`. */ + base?: string; + /** What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month). */ + sort?: "created" | "updated" | "popularity" | "long-running"; + /** The direction of the sort. Can be either `asc` or `desc`. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`. */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["pull-request-simple"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + * + * You can create a new pull request. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. + */ + "pulls/create": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["pull-request"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the new pull request. */ + title?: string; + /** The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. */ + head: string; + /** The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. */ + base: string; + /** The contents of the pull request. */ + body?: string; + /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ + maintainer_can_modify?: boolean; + /** Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. */ + draft?: boolean; + issue?: number; + }; + }; + }; + }; + /** Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. */ + "pulls/list-review-comments-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + sort?: "created" | "updated" | "created_at"; + /** Can be either `asc` or `desc`. Ignored without `sort` parameter. */ + direction?: "asc" | "desc"; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["pull-request-review-comment"][]; + }; + }; + }; + }; + /** Provides details for a review comment. */ + "pulls/get-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review-comment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Deletes a review comment. */ + "pulls/delete-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + }; + }; + /** Enables you to edit a review comment. */ + "pulls/update-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review-comment"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The text of the reply to the review comment. */ + body: string; + }; + }; + }; + }; + /** List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ + "reactions/list-for-pull-request-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a pull request review comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. */ + "reactions/create-for-pull-request-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Reaction exists */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Reaction created */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the pull request review comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` + * + * Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). + */ + "reactions/delete-for-pull-request-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + reaction_id: components["parameters"]["reaction-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Lists details of a pull request by providing its number. + * + * When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". + * + * The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit. + * + * The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request: + * + * * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. + * * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. + * * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to. + * + * Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + */ + "pulls/get": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. */ + 200: { + content: { + "application/json": components["schemas"]["pull-request"]; + }; + }; + 304: components["responses"]["not_modified"]; + 404: components["responses"]["not_found"]; + 500: components["responses"]["internal_error"]; + }; + }; + /** + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. + */ + "pulls/update": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the pull request. */ + title?: string; + /** The contents of the pull request. */ + body?: string; + /** State of this Pull Request. Either `open` or `closed`. */ + state?: "open" | "closed"; + /** The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. */ + base?: string; + /** Indicates whether [maintainers can modify](https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. */ + maintainer_can_modify?: boolean; + }; + }; + }; + }; + /** Lists all review comments for a pull request. By default, review comments are in ascending order by ID. */ + "pulls/list-review-comments": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + query: { + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort?: components["parameters"]["sort"]; + /** Can be either `asc` or `desc`. Ignored without `sort` parameter. */ + direction?: "asc" | "desc"; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["pull-request-review-comment"][]; + }; + }; + }; + }; + /** + * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. + * + * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). + * + * **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "pulls/create-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["pull-request-review-comment"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The text of the review comment. */ + body: string; + /** The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. */ + commit_id?: string; + /** The relative path to the file that necessitates a comment. */ + path?: string; + /** **Required without `comfort-fade` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. */ + position?: number; + /** **Required with `comfort-fade` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://help.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. */ + side?: "LEFT" | "RIGHT"; + /** **Required with `comfort-fade` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. */ + line?: number; + /** **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. */ + start_line?: number; + /** **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://help.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See `side` in this table for additional context. */ + start_side?: "LEFT" | "RIGHT" | "side"; + in_reply_to?: number; + }; + }; + }; + }; + /** + * Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "pulls/create-reply-for-review-comment": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** comment_id parameter */ + comment_id: components["parameters"]["comment-id"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["pull-request-review-comment"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + requestBody: { + content: { + "application/json": { + /** The text of the review comment. */ + body: string; + }; + }; + }; + }; + /** Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. */ + "pulls/list-commits": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["commit"][]; + }; + }; + }; + }; + /** **Note:** Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default. */ + "pulls/list-files": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["diff-entry"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + 500: components["responses"]["internal_error"]; + }; + }; + "pulls/check-if-merged": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response if pull request has been merged */ + 204: never; + /** Not Found if pull request has not been merged */ + 404: unknown; + }; + }; + /** This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ + "pulls/merge": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** if merge was successful */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-merge-result"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + /** Method Not Allowed if merge cannot be performed */ + 405: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + }; + }; + }; + /** Conflict if sha was provided and pull request head did not match */ + 409: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + }; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Title for the automatic commit message. */ + commit_title?: string; + /** Extra detail to append to automatic commit message. */ + commit_message?: string; + /** SHA that pull request head must match to allow merge. */ + sha?: string; + /** Merge method to use. Possible values are `merge`, `squash` or `rebase`. Default is `merge`. */ + merge_method?: "merge" | "squash" | "rebase"; + } | null; + }; + }; + }; + "pulls/list-requested-reviewers": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["pull-request-review-request"]; + }; + }; + }; + }; + /** This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ + "pulls/request-reviewers": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["pull-request-simple"]; + }; + }; + 403: components["responses"]["forbidden"]; + /** Unprocessable Entity if user is not a collaborator */ + 422: unknown; + }; + requestBody: { + content: { + "application/json": { + /** An array of user `login`s that will be requested. */ + reviewers?: string[]; + /** An array of team `slug`s that will be requested. */ + team_reviewers?: string[]; + }; + }; + }; + }; + "pulls/remove-requested-reviewers": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-simple"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** An array of user `login`s that will be removed. */ + reviewers: string[]; + /** An array of team `slug`s that will be removed. */ + team_reviewers?: string[]; + }; + }; + }; + }; + /** The list of reviews returns in chronological order. */ + "pulls/list-reviews": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** The list of reviews returns in chronological order. */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["pull-request-review"][]; + }; + }; + }; + }; + /** + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + * + * Pull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response. + * + * **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. + * + * The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + */ + "pulls/create-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. */ + commit_id?: string; + /** **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. */ + body?: string; + /** The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request) when you are ready. */ + event?: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; + /** Use the following table to specify the location, destination, and contents of the draft review comment. */ + comments?: { + /** The relative path to the file that necessitates a review comment. */ + path: string; + /** The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note below. */ + position?: number; + /** Text of the review comment. */ + body: string; + line?: number; + side?: string; + start_line?: number; + start_side?: string; + }[]; + }; + }; + }; + }; + "pulls/get-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** review_id parameter */ + review_id: components["parameters"]["review-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Update the review summary comment with new text. */ + "pulls/update-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** review_id parameter */ + review_id: components["parameters"]["review-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review"]; + }; + }; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The body text of the pull request review. */ + body: string; + }; + }; + }; + }; + "pulls/delete-pending-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** review_id parameter */ + review_id: components["parameters"]["review-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed_simple"]; + }; + }; + /** List comments for a specific pull request review. */ + "pulls/list-comments-for-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** review_id parameter */ + review_id: components["parameters"]["review-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["review-comment"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. */ + "pulls/dismiss-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** review_id parameter */ + review_id: components["parameters"]["review-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The message for the pull request review dismissal */ + message: string; + event?: string; + }; + }; + }; + }; + "pulls/submit-review": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + /** review_id parameter */ + review_id: components["parameters"]["review-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["pull-request-review"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** The body text of the pull request review */ + body?: string; + /** The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action. */ + event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; + }; + }; + }; + }; + /** Updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. */ + "pulls/update-branch": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + pull_number: components["parameters"]["pull-number"]; + }; + }; + responses: { + /** Response */ + 202: { + content: { + "application/json": { + message?: string; + url?: string; + }; + }; + }; + 403: components["responses"]["forbidden"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/rest/reference/repos#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. */ + expected_head_sha?: string; + } | null; + }; + }; + }; + /** + * Gets the preferred README for a repository. + * + * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + */ + "repos/get-readme": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */ + ref?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["content-file"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Gets the README from a repository directory. + * + * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + */ + "repos/get-readme-in-directory": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The alternate path to look for a README file */ + dir: string; + }; + query: { + /** The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) */ + ref?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["content-file"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). + * + * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. + */ + "repos/list-releases": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["release"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Users with push access to the repository can create a release. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "repos/create-release": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["release"]; + }; + }; + /** Not Found if the discussion category name is invalid */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the tag. */ + tag_name: string; + /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`). */ + target_commitish?: string; + /** The name of the release. */ + name?: string; + /** Text describing the contents of the tag. */ + body?: string; + /** `true` to create a draft (unpublished) release, `false` to create a published one. */ + draft?: boolean; + /** `true` to identify the release as a prerelease. `false` to identify the release as a full release. */ + prerelease?: boolean; + /** If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." */ + discussion_category_name?: string; + }; + }; + }; + }; + /** To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. */ + "repos/get-release-asset": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** asset_id parameter */ + asset_id: components["parameters"]["asset-id"]; + }; + }; + responses: { + /** To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. */ + 200: { + content: { + "application/json": components["schemas"]["release-asset"]; + }; + }; + 302: components["responses"]["found"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + "repos/delete-release-asset": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** asset_id parameter */ + asset_id: components["parameters"]["asset-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Users with push access to the repository can edit a release asset. */ + "repos/update-release-asset": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** asset_id parameter */ + asset_id: components["parameters"]["asset-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["release-asset"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The file name of the asset. */ + name?: string; + /** An alternate short description of the asset. Used in place of the filename. */ + label?: string; + state?: string; + }; + }; + }; + }; + /** + * View the latest published full release for the repository. + * + * The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. + */ + "repos/get-latest-release": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["release"]; + }; + }; + }; + }; + /** Get a published release with the specified tag. */ + "repos/get-release-by-tag": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** tag parameter */ + tag: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["release"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). */ + "repos/get-release": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** release_id parameter */ + release_id: components["parameters"]["release-id"]; + }; + }; + responses: { + /** **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). */ + 200: { + content: { + "application/json": components["schemas"]["release"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** Users with push access to the repository can delete a release. */ + "repos/delete-release": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** release_id parameter */ + release_id: components["parameters"]["release-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Users with push access to the repository can edit a release. */ + "repos/update-release": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** release_id parameter */ + release_id: components["parameters"]["release-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["release"]; + }; + }; + /** Not Found if the discussion category name is invalid */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The name of the tag. */ + tag_name?: string; + /** Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`). */ + target_commitish?: string; + /** The name of the release. */ + name?: string; + /** Text describing the contents of the tag. */ + body?: string; + /** `true` makes the release a draft, and `false` publishes the release. */ + draft?: boolean; + /** `true` to identify the release as a prerelease, `false` to identify the release as a full release. */ + prerelease?: boolean; + /** If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored. For more information, see "[Managing categories for discussions in your repository](https://docs.github.com/discussions/managing-discussions-for-your-community/managing-categories-for-discussions-in-your-repository)." */ + discussion_category_name?: string; + }; + }; + }; + }; + "repos/list-release-assets": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** release_id parameter */ + release_id: components["parameters"]["release-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["release-asset"][]; + }; + }; + }; + }; + /** + * This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in + * the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. + * + * You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. + * + * Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: + * + * `application/zip` + * + * GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, + * you'll still need to pass your authentication to be able to upload an asset. + * + * When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted. + * + * **Notes:** + * * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" + * endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=rest-api). + * * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. + */ + "repos/upload-release-asset": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** release_id parameter */ + release_id: components["parameters"]["release-id"]; + }; + query: { + name: string; + label?: string; + }; + }; + responses: { + /** Response for successful upload */ + 201: { + content: { + "application/json": components["schemas"]["release-asset"]; + }; + }; + }; + requestBody: { + content: { + "*/*": string; + }; + }; + }; + /** Create a reaction to a [release](https://docs.github.com/rest/reference/repos#releases). A response with a `Status: 200 OK` means that you already added the reaction type to this release. */ + "reactions/create-for-release": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** release_id parameter */ + release_id: components["parameters"]["release-id"]; + }; + }; + responses: { + /** Reaction exists */ + 200: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + /** Reaction created */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the release. */ + content: "+1" | "laugh" | "heart" | "hooray" | "rocket" | "eyes"; + }; + }; + }; + }; + /** + * Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. + */ + "secret-scanning/list-alerts-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Set to `open` or `resolved` to only list secret scanning alerts in a specific state. */ + state?: "open" | "resolved"; + /** A comma separated list of secret types to return. By default all secret types are returned. See "[About secret scanning for private repositories](https://docs.github.com/code-security/secret-security/about-secret-scanning#about-secret-scanning-for-private-repositories)" for a complete list of secret types (API slug). */ + secret_type?: string; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["secret-scanning-alert"][]; + }; + }; + /** Repository is public or secret scanning is disabled for the repository */ + 404: unknown; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. + */ + "secret-scanning/get-alert": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ + alert_number: components["parameters"]["alert-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["secret-scanning-alert"]; + }; + }; + /** Repository is public, or secret scanning is disabled for the repository, or the resource is not found */ + 404: unknown; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` write permission to use this endpoint. + */ + "secret-scanning/update-alert": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ + alert_number: components["parameters"]["alert-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["secret-scanning-alert"]; + }; + }; + /** Repository is public, or secret scanning is disabled for the repository, or the resource is not found */ + 404: unknown; + /** State does not match the resolution */ + 422: unknown; + 503: components["responses"]["service_unavailable"]; + }; + requestBody: { + content: { + "application/json": { + state: components["schemas"]["secret-scanning-alert-state"]; + resolution?: components["schemas"]["secret-scanning-alert-resolution"]; + }; + }; + }; + }; + /** + * Lists the people that have starred the repository. + * + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + "activity/list-stargazers-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": Partial & + Partial; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Returns a weekly aggregate of the number of additions and deletions pushed to a repository. */ + "repos/get-code-frequency-stats": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Returns a weekly aggregate of the number of additions and deletions pushed to a repository. */ + 200: { + content: { + "application/json": components["schemas"]["code-frequency-stat"][]; + }; + }; + 202: components["responses"]["accepted"]; + 204: components["responses"]["no_content"]; + }; + }; + /** Returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. */ + "repos/get-commit-activity-stats": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["commit-activity"][]; + }; + }; + 202: components["responses"]["accepted"]; + 204: components["responses"]["no_content"]; + }; + }; + /** + * Returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information: + * + * * `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + * * `a` - Number of additions + * * `d` - Number of deletions + * * `c` - Number of commits + */ + "repos/get-contributors-stats": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** + * * `w` - Start of the week, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + * * `a` - Number of additions + * * `d` - Number of deletions + * * `c` - Number of commits + */ + 200: { + content: { + "application/json": components["schemas"]["contributor-activity"][]; + }; + }; + 202: components["responses"]["accepted"]; + 204: components["responses"]["no_content"]; + }; + }; + /** + * Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`. + * + * The array order is oldest week (index 0) to most recent week. + */ + "repos/get-participation-stats": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** The array order is oldest week (index 0) to most recent week. */ + 200: { + content: { + "application/json": components["schemas"]["participation-stats"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Each array contains the day number, hour number, and number of commits: + * + * * `0-6`: Sunday - Saturday + * * `0-23`: Hour of day + * * Number of commits + * + * For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. + */ + "repos/get-punch-card-stats": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** For example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. */ + 200: { + content: { + "application/json": components["schemas"]["code-frequency-stat"][]; + }; + }; + 204: components["responses"]["no_content"]; + }; + }; + /** + * Users with push access in a repository can create commit statuses for a given SHA. + * + * Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. + */ + "repos/create-commit-status": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + sha: string; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["status"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The state of the status. Can be one of `error`, `failure`, `pending`, or `success`. */ + state: "error" | "failure" | "pending" | "success"; + /** + * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. + * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: + * `http://ci.example.com/user/repo/build/sha` + */ + target_url?: string; + /** A short description of the status. */ + description?: string; + /** A string label to differentiate this status from the status of other systems. This field is case-insensitive. */ + context?: string; + }; + }; + }; + }; + /** Lists the people watching the specified repository. */ + "activity/list-watchers-for-repo": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + }; + }; + "activity/get-repo-subscription": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** if you subscribe to the repository */ + 200: { + content: { + "application/json": components["schemas"]["repository-subscription"]; + }; + }; + 403: components["responses"]["forbidden"]; + /** Not Found if you don't subscribe to the repository */ + 404: unknown; + }; + }; + /** If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. */ + "activity/set-repo-subscription": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["repository-subscription"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** Determines if notifications should be received from this repository. */ + subscribed?: boolean; + /** Determines if all notifications should be blocked from this repository. */ + ignored?: boolean; + }; + }; + }; + }; + /** This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). */ + "activity/delete-repo-subscription": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + "repos/list-tags": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["tag"][]; + }; + }; + }; + }; + /** + * Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually + * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use + * the `Location` header to make a second `GET` request. + * **Note**: For private repositories, these links are temporary and expire after five minutes. + */ + "repos/download-tarball-archive": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + ref: string; + }; + }; + responses: { + /** Response */ + 302: never; + }; + }; + "repos/list-teams": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + }; + }; + "repos/get-all-topics": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["topic"]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + "repos/replace-all-topics": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["topic"]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. */ + names: string[]; + }; + }; + }; + }; + /** Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ + "repos/get-clones": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Must be one of: `day`, `week`. */ + per?: components["parameters"]["per"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["clone-traffic"]; + }; + }; + 403: components["responses"]["forbidden"]; + }; + }; + /** Get the top 10 popular contents over the last 14 days. */ + "repos/get-top-paths": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["content-traffic"][]; + }; + }; + 403: components["responses"]["forbidden"]; + }; + }; + /** Get the top 10 referrers over the last 14 days. */ + "repos/get-top-referrers": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["referrer-traffic"][]; + }; + }; + 403: components["responses"]["forbidden"]; + }; + }; + /** Get the total number of views and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. */ + "repos/get-views": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + query: { + /** Must be one of: `day`, `week`. */ + per?: components["parameters"]["per"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["view-traffic"]; + }; + }; + 403: components["responses"]["forbidden"]; + }; + }; + /** A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). */ + "repos/transfer": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 202: { + content: { + "application/json": components["schemas"]["minimal-repository"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The username or organization name the repository will be transferred to. */ + new_owner: string; + /** ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. */ + team_ids?: number[]; + }; + }; + }; + }; + /** Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ + "repos/check-vulnerability-alerts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response if repository is enabled with vulnerability alerts */ + 204: never; + /** Not Found if repository is not enabled with vulnerability alerts */ + 404: unknown; + }; + }; + /** Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ + "repos/enable-vulnerability-alerts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ + "repos/disable-vulnerability-alerts": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually + * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use + * the `Location` header to make a second `GET` request. + * **Note**: For private repositories, these links are temporary and expire after five minutes. + */ + "repos/download-zipball-archive": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + ref: string; + }; + }; + responses: { + /** Response */ + 302: never; + }; + }; + /** + * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. + * + * **OAuth scope requirements** + * + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository + */ + "repos/create-using-template": { + parameters: { + path: { + template_owner: string; + template_repo: string; + }; + }; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["repository"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. */ + owner?: string; + /** The name of the new repository. */ + name: string; + /** A short description of the new repository. */ + description?: string; + /** Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. */ + include_all_branches?: boolean; + /** Either `true` to create a new private repository or `false` to create a new public one. */ + private?: boolean; + }; + }; + }; + }; + /** + * Lists all public repositories in the order that they were created. + * + * Note: + * - For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise. + * - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. + */ + "repos/list-public": { + parameters: { + query: { + /** A repository ID. Only return repositories with an ID greater than this ID. */ + since?: components["parameters"]["since-repo"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: { + Link?: string; + }; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/list-environment-secrets": { + parameters: { + path: { + repository_id: components["parameters"]["repository-id"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + secrets: components["schemas"]["actions-secret"][]; + }; + }; + }; + }; + }; + /** Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/get-environment-public-key": { + parameters: { + path: { + repository_id: components["parameters"]["repository-id"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-public-key"]; + }; + }; + }; + }; + /** Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/get-environment-secret": { + parameters: { + path: { + repository_id: components["parameters"]["repository-id"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-secret"]; + }; + }; + }; + }; + /** + * Creates or updates an environment secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use + * this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + "actions/create-or-update-environment-secret": { + parameters: { + path: { + repository_id: components["parameters"]["repository-id"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Response when creating a secret */ + 201: { + content: { + "application/json": components["schemas"]["empty-object"]; + }; + }; + /** Response when updating a secret */ + 204: never; + }; + requestBody: { + content: { + "application/json": { + /** Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/rest/reference/actions#get-an-environment-public-key) endpoint. */ + encrypted_value?: string; + /** ID of the key you used to encrypt the secret. */ + key_id?: string; + }; + }; + }; + }; + /** Deletes a secret in an environment using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ + "actions/delete-environment-secret": { + parameters: { + path: { + repository_id: components["parameters"]["repository-id"]; + /** The name of the environment */ + environment_name: components["parameters"]["environment-name"]; + /** secret_name parameter */ + secret_name: components["parameters"]["secret-name"]; + }; + }; + responses: { + /** Default response */ + 204: never; + }; + }; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + "enterprise-admin/list-provisioned-groups-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + query: { + /** Used for pagination: the index of the first result to return. */ + startIndex?: components["parameters"]["start-index"]; + /** Used for pagination: the number of results to return. */ + count?: components["parameters"]["count"]; + /** filter results */ + filter?: string; + /** attributes to exclude */ + excludedAttributes?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-group-list-enterprise"]; + }; + }; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to. + */ + "enterprise-admin/provision-and-invite-enterprise-group": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["scim-enterprise-group"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The SCIM schema URIs. */ + schemas: string[]; + /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ + displayName: string; + members?: { + /** The SCIM user ID for a user. */ + value: string; + }[]; + }; + }; + }; + }; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + "enterprise-admin/get-provisioning-information-for-enterprise-group": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Identifier generated by the GitHub SCIM endpoint. */ + scim_group_id: components["parameters"]["scim-group-id"]; + }; + query: { + /** Attributes to exclude. */ + excludedAttributes?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-enterprise-group"]; + }; + }; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Replaces an existing provisioned group’s information. You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. + */ + "enterprise-admin/set-information-for-provisioned-enterprise-group": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Identifier generated by the GitHub SCIM endpoint. */ + scim_group_id: components["parameters"]["scim-group-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-enterprise-group"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The SCIM schema URIs. */ + schemas: string[]; + /** The name of the SCIM group. This must match the GitHub organization that the group maps to. */ + displayName: string; + members?: { + /** The SCIM user ID for a user. */ + value: string; + }[]; + }; + }; + }; + }; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + "enterprise-admin/delete-scim-group-from-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Identifier generated by the GitHub SCIM endpoint. */ + scim_group_id: components["parameters"]["scim-group-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Allows you to change a provisioned group’s individual attributes. To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + */ + "enterprise-admin/update-attribute-for-enterprise-group": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** Identifier generated by the GitHub SCIM endpoint. */ + scim_group_id: components["parameters"]["scim-group-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-enterprise-group"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The SCIM schema URIs. */ + schemas: string[]; + /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ + Operations: { + op: "add" | "Add" | "remove" | "Remove" | "replace" | "Replace"; + path?: string; + value?: string | { [key: string]: unknown } | any[]; + }[]; + }; + }; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Retrieves a paginated list of all provisioned enterprise members, including pending invitations. + * + * When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: + * - When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future. + * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). + * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. + * + * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: + * + * 1. The user is granted access by the IdP and is not a member of the GitHub enterprise. + * + * 1. The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account. + * + * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: + * - If the user signs in, their GitHub account is linked to this entry. + * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity `null` entry remains in place. + */ + "enterprise-admin/list-provisioned-identities-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + query: { + /** Used for pagination: the index of the first result to return. */ + startIndex?: components["parameters"]["start-index"]; + /** Used for pagination: the number of results to return. */ + count?: components["parameters"]["count"]; + /** filter results */ + filter?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-user-list-enterprise"]; + }; + }; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Provision enterprise membership for a user, and send organization invitation emails to the email address. + * + * You can optionally include the groups a user will be invited to join. If you do not provide a list of `groups`, the user is provisioned for the enterprise, but no organization invitation emails will be sent. + */ + "enterprise-admin/provision-and-invite-enterprise-user": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["scim-enterprise-user"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The SCIM schema URIs. */ + schemas: string[]; + /** The username for the user. */ + userName: string; + name: { + /** The first name of the user. */ + givenName: string; + /** The last name of the user. */ + familyName: string; + }; + /** List of user emails. */ + emails: { + /** The email address. */ + value: string; + /** The type of email address. */ + type: string; + /** Whether this email address is the primary address. */ + primary: boolean; + }[]; + /** List of SCIM group IDs the user is a member of. */ + groups?: { + value?: string; + }[]; + }; + }; + }; + }; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + "enterprise-admin/get-provisioning-information-for-enterprise-user": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-enterprise-user"]; + }; + }; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-an-enterprise-scim-user) endpoint instead. + * + * You must at least provide the required values for the user: `userName`, `name`, and `emails`. + * + * **Warning:** Setting `active: false` removes the user from the enterprise, deletes the external identity, and deletes the associated `{scim_user_id}`. + */ + "enterprise-admin/set-information-for-provisioned-enterprise-user": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-enterprise-user"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The SCIM schema URIs. */ + schemas: string[]; + /** The username for the user. */ + userName: string; + name: { + /** The first name of the user. */ + givenName: string; + /** The last name of the user. */ + familyName: string; + }; + /** List of user emails. */ + emails: { + /** The email address. */ + value: string; + /** The type of email address. */ + type: string; + /** Whether this email address is the primary address. */ + primary: boolean; + }[]; + /** List of SCIM group IDs the user is a member of. */ + groups?: { + value?: string; + }[]; + }; + }; + }; + }; + /** **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. */ + "enterprise-admin/delete-user-from-enterprise": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Note:** The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change. + * + * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * + * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. + * + * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated `:scim_user_id`. + * + * ``` + * { + * "Operations":[{ + * "op":"replace", + * "value":{ + * "active":false + * } + * }] + * } + * ``` + */ + "enterprise-admin/update-attribute-for-enterprise-user": { + parameters: { + path: { + /** The slug version of the enterprise name. You can also substitute this value with the enterprise id. */ + enterprise: components["parameters"]["enterprise"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["scim-enterprise-user"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The SCIM schema URIs. */ + schemas: string[]; + /** Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). */ + Operations: { [key: string]: unknown }[]; + }; + }; + }; + }; + /** + * Retrieves a paginated list of all provisioned organization members, including pending invitations. If you provide the `filter` parameter, the resources for all matching provisions members are returned. + * + * When a user with a SAML-provisioned external identity leaves (or is removed from) an organization, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member: + * - When a user with a SCIM-provisioned external identity is removed from an organization, the account's metadata is preserved to allow the user to re-join the organization in the future. + * - When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted). + * - When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO. + * + * The returned list of external identities can include an entry for a `null` user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO: + * + * 1. The user is granted access by the IdP and is not a member of the GitHub organization. + * + * 1. The user attempts to access the GitHub organization and initiates the SAML SSO process, and is not currently signed in to their GitHub account. + * + * 1. After successfully authenticating with the SAML SSO IdP, the `null` external identity entry is created and the user is prompted to sign in to their GitHub account: + * - If the user signs in, their GitHub account is linked to this entry. + * - If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub organization, and the external identity `null` entry remains in place. + */ + "scim/list-provisioned-identities": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + query: { + /** Used for pagination: the index of the first result to return. */ + startIndex?: number; + /** Used for pagination: the number of results to return. */ + count?: number; + /** + * Filters results using the equals query parameter operator (`eq`). You can filter results that are equal to `id`, `userName`, `emails`, and `external_id`. For example, to search for an identity with the `userName` Octocat, you would use this query: + * + * `?filter=userName%20eq%20\"Octocat\"`. + * + * To filter results for the identity with the email `octocat@github.com`, you would use this query: + * + * `?filter=emails%20eq%20\"octocat@github.com\"`. + */ + filter?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/scim+json": components["schemas"]["scim-user-list"]; + }; + }; + 304: components["responses"]["not_modified"]; + 400: components["responses"]["scim_bad_request"]; + 403: components["responses"]["scim_forbidden"]; + 404: components["responses"]["scim_not_found"]; + }; + }; + /** Provision organization membership for a user, and send an activation email to the email address. */ + "scim/provision-and-invite-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/scim+json": components["schemas"]["scim-user"]; + }; + }; + 304: components["responses"]["not_modified"]; + 400: components["responses"]["scim_bad_request"]; + 403: components["responses"]["scim_forbidden"]; + 404: components["responses"]["scim_not_found"]; + 409: components["responses"]["scim_conflict"]; + 500: components["responses"]["scim_internal_error"]; + }; + requestBody: { + content: { + "application/json": { + /** Configured by the admin. Could be an email, login, or username */ + userName: string; + /** The name of the user, suitable for display to end-users */ + displayName?: string; + name: { + givenName: string; + familyName: string; + formatted?: string; + }; + /** user emails */ + emails: { + value: string; + primary?: boolean; + type?: string; + }[]; + schemas?: string[]; + externalId?: string; + groups?: string[]; + active?: boolean; + }; + }; + }; + }; + "scim/get-provisioning-information-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/scim+json": components["schemas"]["scim-user"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["scim_forbidden"]; + 404: components["responses"]["scim_not_found"]; + }; + }; + /** + * Replaces an existing provisioned user's information. You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user) endpoint instead. + * + * You must at least provide the required values for the user: `userName`, `name`, and `emails`. + * + * **Warning:** Setting `active: false` removes the user from the organization, deletes the external identity, and deletes the associated `{scim_user_id}`. + */ + "scim/set-information-for-provisioned-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/scim+json": components["schemas"]["scim-user"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["scim_forbidden"]; + 404: components["responses"]["scim_not_found"]; + }; + requestBody: { + content: { + "application/json": { + schemas?: string[]; + /** The name of the user, suitable for display to end-users */ + displayName?: string; + externalId?: string; + groups?: string[]; + active?: boolean; + /** Configured by the admin. Could be an email, login, or username */ + userName: string; + name: { + givenName: string; + familyName: string; + formatted?: string; + }; + /** user emails */ + emails: { + type?: string; + value: string; + primary?: boolean; + }[]; + }; + }; + }; + }; + "scim/delete-user-from-org": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["scim_forbidden"]; + 404: components["responses"]["scim_not_found"]; + }; + }; + /** + * Allows you to change a provisioned user's individual attributes. To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). + * + * **Note:** Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work. + * + * **Warning:** If you set `active:false` using the `replace` operation (as shown in the JSON example below), it removes the user from the organization, deletes the external identity, and deletes the associated `:scim_user_id`. + * + * ``` + * { + * "Operations":[{ + * "op":"replace", + * "value":{ + * "active":false + * } + * }] + * } + * ``` + */ + "scim/update-attribute-for-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + /** scim_user_id parameter */ + scim_user_id: components["parameters"]["scim-user-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/scim+json": components["schemas"]["scim-user"]; + }; + }; + 304: components["responses"]["not_modified"]; + 400: components["responses"]["scim_bad_request"]; + 403: components["responses"]["scim_forbidden"]; + 404: components["responses"]["scim_not_found"]; + /** Response */ + 429: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + schemas?: string[]; + /** Set of operations to be performed */ + Operations: { + op: "add" | "remove" | "replace"; + path?: string; + value?: + | { + active?: boolean | null; + userName?: string | null; + externalId?: string | null; + givenName?: string | null; + familyName?: string | null; + } + | { + value?: string; + primary?: boolean; + }[] + | string; + }[]; + }; + }; + }; + }; + /** + * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: + * + * `q=addClass+in:file+language:js+repo:jquery/jquery` + * + * This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository. + * + * #### Considerations for code search + * + * Due to the complexity of searching code, there are a few restrictions on how searches are performed: + * + * * Only the _default branch_ is considered. In most cases, this will be the `master` branch. + * * Only files smaller than 384 KB are searchable. + * * You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazing + * language:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. + */ + "search/code": { + parameters: { + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "indexed"; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order?: components["parameters"]["order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["code-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match + * metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: + * + * `q=repo:octocat/Spoon-Knife+css` + */ + "search/commits": { + parameters: { + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "author-date" | "committer-date"; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order?: components["parameters"]["order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["commit-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted + * search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. + * + * `q=windows+label:bug+language:python+state:open&sort=created&order=asc` + * + * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + * + * **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." + */ + "search/issues-and-pull-requests": { + parameters: { + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: + | "comments" + | "reactions" + | "reactions-+1" + | "reactions--1" + | "reactions-smile" + | "reactions-thinking_face" + | "reactions-heart" + | "reactions-tada" + | "interactions" + | "created" + | "updated"; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order?: components["parameters"]["order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["issue-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this: + * + * `q=bug+defect+enhancement&repository_id=64778136` + * + * The labels that best match the query appear first in the search results. + */ + "search/labels": { + parameters: { + query: { + /** The id of the repository. */ + repository_id: number; + /** The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; + /** Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "created" | "updated"; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order?: components["parameters"]["order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["label-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: + * + * `q=tetris+language:assembly&sort=stars&order=desc` + * + * This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. + * + * When you include the `mercy` preview header, you can also search for multiple topics by adding more `topic:` instances. For example, your query might look like this: + * + * `q=topic:ruby+topic:rails` + */ + "search/repos": { + parameters: { + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "stars" | "forks" | "help-wanted-issues" | "updated"; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order?: components["parameters"]["order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["repo-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** + * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. + * + * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: + * + * `q=ruby+is:featured` + * + * This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. + */ + "search/topics": { + parameters: { + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). */ + q: string; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["topic-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). + * + * When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). + * + * For example, if you're looking for a list of popular users, you might try this query: + * + * `q=tom+repos:%3E42+followers:%3E1000` + * + * This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers. + */ + "search/users": { + parameters: { + query: { + /** The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/rest/reference/search#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ + q: string; + /** Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://docs.github.com/rest/reference/search#ranking-search-results) */ + sort?: "followers" | "repositories" | "joined"; + /** Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ + order?: components["parameters"]["order"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": { + total_count: number; + incomplete_results: boolean; + items: components["schemas"]["user-search-result-item"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 422: components["responses"]["validation_failed"]; + 503: components["responses"]["service_unavailable"]; + }; + }; + /** **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/reference/teams#get-a-team-by-name) endpoint. */ + "teams/get-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-full"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/reference/teams#delete-a-team) endpoint. + * + * To delete a team, the authenticated user must be an organization owner or team maintainer. + * + * If you are an organization owner, deleting a parent team will delete all of its child teams as well. + */ + "teams/delete-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/reference/teams#update-a-team) endpoint. + * + * To edit a team, the authenticated user must either be an organization owner or a team maintainer. + * + * **Note:** With nested teams, the `privacy` for parent teams cannot be `secret`. + */ + "teams/update-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-full"]; + }; + }; + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-full"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the team. */ + name: string; + /** The description of the team. */ + description?: string; + /** + * The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: + * **For a non-nested team:** + * \* `secret` - only visible to organization owners and members of this team. + * \* `closed` - visible to all members of this organization. + * **For a parent or child team:** + * \* `closed` - visible to all members of this organization. + */ + privacy?: "secret" | "closed"; + /** + * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: + * \* `pull` - team members can pull, but not push to or administer newly-added repositories. + * \* `push` - team members can pull and push, but not administer newly-added repositories. + * \* `admin` - team members can pull, push and administer newly-added repositories. + */ + permission?: "pull" | "push" | "admin"; + /** The ID of a team to set as the parent team. */ + parent_team_id?: number | null; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/reference/teams#list-discussions) endpoint. + * + * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/list-discussions-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + query: { + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-discussion"][]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/reference/teams#create-a-discussion) endpoint. + * + * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "teams/create-discussion-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-discussion"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion post's title. */ + title: string; + /** The discussion post's body text. */ + body: string; + /** Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. */ + private?: boolean; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/reference/teams#get-a-discussion) endpoint. + * + * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/get-discussion-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion"]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/reference/teams#delete-a-discussion) endpoint. + * + * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/delete-discussion-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/reference/teams#update-a-discussion) endpoint. + * + * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/update-discussion-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion post's title. */ + title?: string; + /** The discussion post's body text. */ + body?: string; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/reference/teams#list-discussion-comments) endpoint. + * + * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/list-discussion-comments-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + query: { + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-discussion-comment"][]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/reference/teams#create-a-discussion-comment) endpoint. + * + * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. + */ + "teams/create-discussion-comment-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["team-discussion-comment"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion comment's body text. */ + body: string; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/reference/teams#get-a-discussion-comment) endpoint. + * + * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/get-discussion-comment-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion-comment"]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/reference/teams#delete-a-discussion-comment) endpoint. + * + * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/delete-discussion-comment-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/reference/teams#update-a-discussion-comment) endpoint. + * + * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "teams/update-discussion-comment-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-discussion-comment"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The discussion comment's body text. */ + body: string; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment) endpoint. + * + * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "reactions/list-for-team-discussion-comment-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion comment. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment)" endpoint. + * + * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. + */ + "reactions/create-for-team-discussion-comment-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + comment_number: components["parameters"]["comment-number"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion comment. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion) endpoint. + * + * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + */ + "reactions/list-for-team-discussion-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + query: { + /** Returns a single [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types). Omit this parameter to list all reactions to a team discussion. */ + content?: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["reaction"][]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion) endpoint. + * + * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion. + */ + "reactions/create-for-team-discussion-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + discussion_number: components["parameters"]["discussion-number"]; + }; + }; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["reaction"]; + }; + }; + }; + requestBody: { + content: { + "application/json": { + /** The [reaction type](https://docs.github.com/rest/reference/reactions#reaction-types) to add to the team discussion. */ + content: + | "+1" + | "-1" + | "laugh" + | "confused" + | "heart" + | "hooray" + | "rocket" + | "eyes"; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/reference/teams#list-pending-team-invitations) endpoint. + * + * The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`. + */ + "teams/list-pending-invitations-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["organization-invitation"][]; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/reference/teams#list-team-members) endpoint. + * + * Team members will include the members of child teams. + */ + "teams/list-members-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + query: { + /** + * Filters members returned by their role in the team. Can be one of: + * \* `member` - normal members of the team. + * \* `maintainer` - team maintainers. + * \* `all` - all members of the team. + */ + role?: "member" | "maintainer" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * The "Get team member" endpoint (described below) is deprecated. + * + * We recommend using the [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships. + * + * To list members in a team, the team must be visible to the authenticated user. + */ + "teams/get-member-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** if user is a member */ + 204: never; + /** if user is not a member */ + 404: unknown; + }; + }; + /** + * The "Add team member" endpoint (described below) is deprecated. + * + * We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + "teams/add-member-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + /** Not Found if team synchronization is set up */ + 404: unknown; + /** Unprocessable Entity if you attempt to add an organization to a team or you attempt to add a user to a team when they are not a member of at least one other team in the same organization */ + 422: unknown; + }; + }; + /** + * The "Remove team member" endpoint (described below) is deprecated. + * + * We recommend using the [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + */ + "teams/remove-member-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** Not Found if team synchronization is setup */ + 404: unknown; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user) endpoint. + * + * Team members will include the members of child teams. + * + * To get a user's membership with a team, the team must be visible to the authenticated user. + * + * **Note:** + * The response contains the `state` of the membership and the member's `role`. + * + * The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). + */ + "teams/get-membership-for-user-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-membership"]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * + * If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner. + * + * If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. + */ + "teams/add-or-update-membership-for-user-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-membership"]; + }; + }; + /** Forbidden if team synchronization is set up */ + 403: unknown; + 404: components["responses"]["not_found"]; + /** Unprocessable Entity if you attempt to add an organization to a team */ + 422: unknown; + }; + requestBody: { + content: { + "application/json": { + /** + * The role that this user should have in the team. Can be one of: + * \* `member` - a normal member of the team. + * \* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. + */ + role?: "member" | "maintainer"; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. + * + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + */ + "teams/remove-membership-for-user-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** if team synchronization is set up */ + 403: unknown; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/rest/reference/teams#list-team-projects) endpoint. + * + * Lists the organization projects for a team. + */ + "teams/list-projects-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-project"][]; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project) endpoint. + * + * Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. + */ + "teams/check-permissions-for-project-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["team-project"]; + }; + }; + /** Not Found if project is not managed by this team */ + 404: unknown; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions) endpoint. + * + * Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. + */ + "teams/add-or-update-project-permissions-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + /** Forbidden if the project is not owned by the organization */ + 403: { + content: { + "application/json": { + message?: string; + documentation_url?: string; + }; + }; + }; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** + * The permission to grant to the team for this project. Can be one of: + * \* `read` - team members can read, but not write to or administer this project. + * \* `write` - team members can read and write, but not administer this project. + * \* `admin` - team members can read, write and administer this project. + * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + permission?: "read" | "write" | "admin"; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team) endpoint. + * + * Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. + */ + "teams/remove-project-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + project_id: components["parameters"]["project-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/reference/teams#list-team-repositories) endpoint. */ + "teams/list-repos-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Note**: Repositories inherited through a parent team will also be checked. + * + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-repository) endpoint. + * + * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + "teams/check-permissions-for-repo-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Alternative response with extra repository information */ + 200: { + content: { + "application/json": components["schemas"]["team-repository"]; + }; + }; + /** Response if repository is managed by this team */ + 204: never; + /** Not Found if repository is not managed by this team */ + 404: unknown; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/reference/teams#add-or-update-team-repository-permissions)" endpoint. + * + * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. + * + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + */ + "teams/add-or-update-repo-permissions-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** + * The permission to grant the team on this repository. Can be one of: + * \* `pull` - team members can pull, but not push to or administer this repository. + * \* `push` - team members can pull and push, but not administer this repository. + * \* `admin` - team members can pull, push and administer this repository. + * + * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + */ + permission?: "pull" | "push" | "admin"; + }; + }; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/reference/teams#remove-a-repository-from-a-team) endpoint. + * + * If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. + */ + "teams/remove-repo-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List IdP groups for a team`](https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * List IdP groups connected to a team on GitHub. + */ + "teams/list-idp-groups-for-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["group-mapping"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create or update IdP group connections`](https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections) endpoint. + * + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Creates, updates, or removes a connection between a team and an IdP group. When adding groups to a team, you must include all new and existing groups to avoid replacing existing groups with the new ones. Specifying an empty `groups` array will remove all connections for a team. + */ + "teams/create-or-update-idp-group-connections-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["group-mapping"]; + }; + }; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The IdP groups you want to connect to a GitHub team. When updating, the new `groups` object will replace the original one. You must include any existing groups that you don't want to remove. */ + groups: { + /** ID of the IdP group. */ + group_id: string; + /** Name of the IdP group. */ + group_name: string; + /** Description of the IdP group. */ + group_description: string; + id?: string; + name?: string; + description?: string; + }[]; + synced_at?: string; + }; + }; + }; + }; + /** **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/reference/teams#list-child-teams) endpoint. */ + "teams/list-child-legacy": { + parameters: { + path: { + team_id: components["parameters"]["team-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** if child teams exist */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team"][]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * If the authenticated user is authenticated through basic authentication or OAuth with the `user` scope, then the response lists public and private profile information. + * + * If the authenticated user is authenticated through OAuth without the `user` scope, then the response lists only public profile information. + */ + "users/get-authenticated": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": + | components["schemas"]["private-user"] + | components["schemas"]["public-user"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. */ + "users/update-authenticated": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["private-user"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The new name of the user. */ + name?: string; + /** The publicly visible email address of the user. */ + email?: string; + /** The new blog URL of the user. */ + blog?: string; + /** The new Twitter username of the user. */ + twitter_username?: string | null; + /** The new company of the user. */ + company?: string; + /** The new location of the user. */ + location?: string; + /** The new hiring availability of the user. */ + hireable?: boolean; + /** The new short biography of the user. */ + bio?: string; + }; + }; + }; + }; + /** List the users you've blocked on your personal account. */ + "users/list-blocked-by-authenticated": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + "users/check-blocked": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** If the user is blocked: */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + /** If the user is not blocked: */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + }; + "users/block": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "users/unblock": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Sets the visibility for your primary email addresses. */ + "users/set-primary-email-visibility-for-authenticated": { + parameters: {}; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["email"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Denotes whether an email is publicly visible. */ + visibility: "public" | "private"; + }; + }; + }; + }; + /** Lists all of your email addresses, and specifies which one is visible to the public. This endpoint is accessible with the `user:email` scope. */ + "users/list-emails-for-authenticated": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["email"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** This endpoint is accessible with the `user` scope. */ + "users/add-email-for-authenticated": { + parameters: {}; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["email"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. */ + emails: string[]; + }; + }; + }; + }; + /** This endpoint is accessible with the `user` scope. */ + "users/delete-email-for-authenticated": { + parameters: {}; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Email addresses associated with the GitHub user account. */ + emails: string[]; + }; + }; + }; + }; + /** Lists the people following the authenticated user. */ + "users/list-followers-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** Lists the people who the authenticated user follows. */ + "users/list-followed-by-authenticated": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "users/check-person-is-followed-by-authenticated": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** if the person is followed by the authenticated user */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + /** if the person is not followed by the authenticated user */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + }; + /** + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." + * + * Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. + */ + "users/follow": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Unfollowing a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ + "users/unfollow": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/list-gpg-keys-for-authenticated": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["gpg-key"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/create-gpg-key-for-authenticated": { + parameters: {}; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["gpg-key"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A GPG key in ASCII-armored format. */ + armored_public_key: string; + }; + }; + }; + }; + /** View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/get-gpg-key-for-authenticated": { + parameters: { + path: { + /** gpg_key_id parameter */ + gpg_key_id: components["parameters"]["gpg-key-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["gpg-key"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/delete-gpg-key-for-authenticated": { + parameters: { + path: { + /** gpg_key_id parameter */ + gpg_key_id: components["parameters"]["gpg-key-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. + * + * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. + * + * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * + * You can find the permissions for the installation under the `permissions` key. + */ + "apps/list-installations-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** You can find the permissions for the installation under the `permissions` key. */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + installations: components["schemas"]["installation"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 415: components["responses"]["preview_header_missing"]; + }; + }; + /** + * List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation. + * + * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + * + * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. + * + * The access the user has to each repository is included in the hash under the `permissions` key. + */ + "apps/list-installation-repos-for-authenticated-user": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** The access the user has to each repository is included in the hash under the `permissions` key. */ + 200: { + headers: {}; + content: { + "application/json": { + total_count: number; + repository_selection?: string; + repositories: components["schemas"]["repository"][]; + }; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Add a single repository to an installation. The authenticated user must have admin access to the repository. + * + * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + */ + "apps/add-repo-to-installation": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + repository_id: components["parameters"]["repository-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Remove a single repository from an installation. The authenticated user must have admin access to the repository. + * + * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. + */ + "apps/remove-repo-from-installation": { + parameters: { + path: { + /** installation_id parameter */ + installation_id: components["parameters"]["installation-id"]; + repository_id: components["parameters"]["repository-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Shows which type of GitHub user can interact with your public repositories and when the restriction expires. */ + "interactions/get-restrictions-for-authenticated-user": { + responses: { + /** Default response */ + 200: { + content: { + "application/json": Partial< + components["schemas"]["interaction-limit-response"] + > & + Partial<{ [key: string]: unknown }>; + }; + }; + /** Response when there are no restrictions */ + 204: never; + }; + }; + /** Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. */ + "interactions/set-restrictions-for-authenticated-user": { + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["interaction-limit-response"]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": components["schemas"]["interaction-limit"]; + }; + }; + }; + /** Removes any interaction restrictions from your public repositories. */ + "interactions/remove-restrictions-for-authenticated-user": { + responses: { + /** Response */ + 204: never; + }; + }; + /** + * List issues across owned and member repositories assigned to the authenticated user. + * + * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this + * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by + * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. + */ + "issues/list-for-authenticated-user": { + parameters: { + query: { + /** + * Indicates which sorts of issues to return. Can be one of: + * \* `assigned`: Issues assigned to you + * \* `created`: Issues created by you + * \* `mentioned`: Issues mentioning you + * \* `subscribed`: Issues you're subscribed to updates for + * \* `all` or `repos`: All issues the authenticated user can see, regardless of participation or creation + */ + filter?: + | "assigned" + | "created" + | "mentioned" + | "subscribed" + | "repos" + | "all"; + /** Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** A list of comma separated label names. Example: `bug,ui,@high` */ + labels?: components["parameters"]["labels"]; + /** What to sort results by. Can be either `created`, `updated`, `comments`. */ + sort?: "created" | "updated" | "comments"; + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["issue"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/list-public-ssh-keys-for-authenticated": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["key"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/create-public-ssh-key-for-authenticated": { + parameters: {}; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["key"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** A descriptive name for the new key. */ + title?: string; + /** The public SSH key to add to your GitHub account. */ + key: string; + }; + }; + }; + }; + /** View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/get-public-ssh-key-for-authenticated": { + parameters: { + path: { + /** key_id parameter */ + key_id: components["parameters"]["key-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["key"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ + "users/delete-public-ssh-key-for-authenticated": { + parameters: { + path: { + /** key_id parameter */ + key_id: components["parameters"]["key-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ + "apps/list-subscriptions-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["user-marketplace-purchase"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ + "apps/list-subscriptions-for-authenticated-user-stubbed": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["user-marketplace-purchase"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + }; + }; + "orgs/list-memberships-for-authenticated-user": { + parameters: { + query: { + /** Indicates the state of the memberships to return. Can be either `active` or `pending`. If not specified, the API returns both active and pending memberships. */ + state?: "active" | "pending"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["org-membership"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + }; + "orgs/get-membership-for-authenticated-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["org-membership"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "orgs/update-membership-for-authenticated-user": { + parameters: { + path: { + org: components["parameters"]["org"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["org-membership"]; + }; + }; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The state that the membership should be in. Only `"active"` will be accepted. */ + state: "active"; + }; + }; + }; + }; + /** Lists all migrations a user has started. */ + "migrations/list-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["migration"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** Initiates the generation of a user migration archive. */ + "migrations/start-for-authenticated-user": { + parameters: {}; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["migration"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** Lock the repositories being migrated at the start of the migration */ + lock_repositories?: boolean; + /** Do not include attachments in the migration */ + exclude_attachments?: boolean; + /** Exclude attributes from the API response to improve performance */ + exclude?: "repositories"[]; + repositories: string[]; + }; + }; + }; + }; + /** + * Fetches a single user migration. The response includes the `state` of the migration, which can be one of the following values: + * + * * `pending` - the migration hasn't started yet. + * * `exporting` - the migration is in progress. + * * `exported` - the migration finished successfully. + * * `failed` - the migration failed. + * + * Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). + */ + "migrations/get-status-for-authenticated-user": { + parameters: { + path: { + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + query: { + exclude?: string[]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["migration"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects: + * + * * attachments + * * bases + * * commit\_comments + * * issue\_comments + * * issue\_events + * * issues + * * milestones + * * organizations + * * projects + * * protected\_branches + * * pull\_request\_reviews + * * pull\_requests + * * releases + * * repositories + * * review\_comments + * * schema + * * users + * + * The archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. + */ + "migrations/get-archive-for-authenticated-user": { + parameters: { + path: { + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + }; + responses: { + /** Response */ + 302: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. */ + "migrations/delete-archive-for-authenticated-user": { + parameters: { + path: { + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. */ + "migrations/unlock-repo-for-authenticated-user": { + parameters: { + path: { + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + /** repo_name parameter */ + repo_name: components["parameters"]["repo-name"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists all the repositories for this user migration. */ + "migrations/list-repos-for-user": { + parameters: { + path: { + /** migration_id parameter */ + migration_id: components["parameters"]["migration-id"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + 404: components["responses"]["not_found"]; + }; + }; + /** + * List organizations for the authenticated user. + * + * **OAuth scope requirements** + * + * This only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope. OAuth requests with insufficient scope receive a `403 Forbidden` response. + */ + "orgs/list-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["organization-simple"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** + * Gets a specific package for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-package-for-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package"]; + }; + }; + }; + }; + /** + * Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:delete` scopes. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/delete-package-for-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Restores a package owned by the authenticated user. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scopes. If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/restore-package-for-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + }; + query: { + /** package token */ + token?: string; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Returns all package versions for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-all-package-versions-for-package-owned-by-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + }; + query: { + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** The state of the package, either active or deleted. */ + state?: "active" | "deleted"; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package-version"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Gets a specific package version for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-package-version-for-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package-version"]; + }; + }; + }; + }; + /** + * Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/delete-package-version-for-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Restores a package version owned by the authenticated user. + * + * You can restore a deleted package version under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scopes. If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/restore-package-version-for-authenticated-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "projects/create-for-authenticated-user": { + parameters: {}; + responses: { + /** Response */ + 201: { + content: { + "application/json": components["schemas"]["project"]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed_simple"]; + }; + requestBody: { + content: { + "application/json": { + /** Name of the project */ + name: string; + /** Body of the project */ + body?: string | null; + }; + }; + }; + }; + /** Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. */ + "users/list-public-emails-for-authenticated": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["email"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. + * + * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. + */ + "repos/list-for-authenticated-user": { + parameters: { + query: { + /** Can be one of `all`, `public`, or `private`. Note: For GitHub AE, can be one of `all`, `internal`, or `private`. */ + visibility?: "all" | "public" | "private"; + /** + * Comma-separated list of values. Can include: + * \* `owner`: Repositories that are owned by the authenticated user. + * \* `collaborator`: Repositories that the user has been added to as a collaborator. + * \* `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + */ + affiliation?: string; + /** + * Can be one of `all`, `owner`, `public`, `private`, `member`. Note: For GitHub AE, can be one of `all`, `owner`, `internal`, `private`, `member`. Default: `all` + * + * Will cause a `422` error if used in the same request as **visibility** or **affiliation**. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. + */ + type?: "all" | "owner" | "public" | "private" | "member"; + /** Can be one of `created`, `updated`, `pushed`, `full_name`. */ + sort?: "created" | "updated" | "pushed" | "full_name"; + /** Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc` */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + before?: components["parameters"]["before"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["repository"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Creates a new repository for the authenticated user. + * + * **OAuth scope requirements** + * + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository. + */ + "repos/create-for-authenticated-user": { + parameters: {}; + responses: { + /** Response */ + 201: { + headers: { + Location?: string; + }; + content: { + "application/json": components["schemas"]["repository"]; + }; + }; + 304: components["responses"]["not_modified"]; + 400: components["responses"]["bad_request"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The name of the repository. */ + name: string; + /** A short description of the repository. */ + description?: string; + /** A URL with more information about the repository. */ + homepage?: string; + /** Whether the repository is private. */ + private?: boolean; + /** Whether issues are enabled. */ + has_issues?: boolean; + /** Whether projects are enabled. */ + has_projects?: boolean; + /** Whether the wiki is enabled. */ + has_wiki?: boolean; + /** The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. */ + team_id?: number; + /** Whether the repository is initialized with a minimal README. */ + auto_init?: boolean; + /** The desired language or platform to apply to the .gitignore. */ + gitignore_template?: string; + /** The license keyword of the open source license for this repository. */ + license_template?: string; + /** Whether to allow squash merges for pull requests. */ + allow_squash_merge?: boolean; + /** Whether to allow merge commits for pull requests. */ + allow_merge_commit?: boolean; + /** Whether to allow rebase merges for pull requests. */ + allow_rebase_merge?: boolean; + /** Whether to allow Auto-merge to be used on pull requests. */ + allow_auto_merge?: boolean; + /** Whether to delete head branches when pull requests are merged */ + delete_branch_on_merge?: boolean; + /** Whether downloads are enabled. */ + has_downloads?: boolean; + /** Whether this repository acts as a template that can be used to generate new repositories. */ + is_template?: boolean; + }; + }; + }; + }; + /** When authenticating as a user, this endpoint will list all currently open repository invitations for that user. */ + "repos/list-invitations-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["repository-invitation"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "repos/decline-invitation": { + parameters: { + path: { + /** invitation_id parameter */ + invitation_id: components["parameters"]["invitation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 409: components["responses"]["conflict"]; + }; + }; + "repos/accept-invitation": { + parameters: { + path: { + /** invitation_id parameter */ + invitation_id: components["parameters"]["invitation-id"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 409: components["responses"]["conflict"]; + }; + }; + /** + * Lists repositories the authenticated user has starred. + * + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + "activity/list-repos-starred-by-authenticated-user": { + parameters: { + query: { + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort?: components["parameters"]["sort"]; + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["repository"][]; + "application/vnd.github.v3.star+json": components["schemas"]["starred-repository"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + "activity/check-repo-is-starred-by-authenticated-user": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response if this repository is starred by you */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + /** Not Found if this repository is not starred by you */ + 404: { + content: { + "application/json": components["schemas"]["basic-error"]; + }; + }; + }; + }; + /** Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ + "activity/star-repo-for-authenticated-user": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + "activity/unstar-repo-for-authenticated-user": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + }; + }; + responses: { + /** Response */ + 204: never; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** Lists repositories the authenticated user is watching. */ + "activity/list-watched-repos-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + }; + }; + /** List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). */ + "teams/list-for-authenticated-user": { + parameters: { + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["team-full"][]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. + * + * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. + */ + "users/list": { + parameters: { + query: { + /** A user ID. Only return users with an ID greater than this ID. */ + since?: components["parameters"]["since-user"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: { + Link?: string; + }; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + 304: components["responses"]["not_modified"]; + }; + }; + /** + * Provides publicly available information about someone with a GitHub account. + * + * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" + * + * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). + * + * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". + */ + "users/get-by-username": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": + | components["schemas"]["private-user"] + | components["schemas"]["public-user"]; + }; + }; + 202: components["responses"]["accepted"]; + 404: components["responses"]["not_found"]; + }; + }; + /** If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events. */ + "activity/list-events-for-authenticated-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + /** This is the user's organization dashboard. You must be authenticated as the user to view this. */ + "activity/list-org-events-for-authenticated-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + org: components["parameters"]["org"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + "activity/list-public-events-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + /** Lists the people following the specified user. */ + "users/list-followers-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + }; + }; + /** Lists the people who the specified user follows. */ + "users/list-following-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["simple-user"][]; + }; + }; + }; + }; + "users/check-following-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + target_user: string; + }; + }; + responses: { + /** if the user follows the target user */ + 204: never; + /** if the user does not follow the target user */ + 404: unknown; + }; + }; + /** Lists public gists for the specified user: */ + "gists/list-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ + since?: components["parameters"]["since"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["base-gist"][]; + }; + }; + 422: components["responses"]["validation_failed"]; + }; + }; + /** Lists the GPG keys for a user. This information is accessible by anyone. */ + "users/list-gpg-keys-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["gpg-key"][]; + }; + }; + }; + }; + /** + * Provides hovercard information when authenticated through basic auth or OAuth with the `repo` scope. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. + * + * The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository via cURL, it would look like this: + * + * ```shell + * curl -u username:token + * https://api.github.com/users/octocat/hovercard?subject_type=repository&subject_id=1300192 + * ``` + */ + "users/get-context-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. */ + subject_type?: "organization" | "repository" | "issue" | "pull_request"; + /** Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`. */ + subject_id?: string; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["hovercard"]; + }; + }; + 404: components["responses"]["not_found"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** + * Enables an authenticated GitHub App to find the user’s installation information. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + "apps/get-user-installation": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["installation"]; + }; + }; + }; + }; + /** Lists the _verified_ public SSH keys for a user. This is accessible by anyone. */ + "users/list-public-keys-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["key-simple"][]; + }; + }; + }; + }; + /** + * List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. + * + * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. + */ + "orgs/list-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["organization-simple"][]; + }; + }; + }; + }; + /** + * Gets a specific package metadata for a public package owned by a user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-package-for-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package"]; + }; + }; + }; + }; + /** + * Returns all package versions for a public package owned by a specified user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-all-package-versions-for-package-owned-by-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package-version"][]; + }; + }; + 401: components["responses"]["requires_authentication"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + }; + }; + /** + * Gets a specific package version for a public package owned by a specified user. + * + * At this time, to use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + "packages/get-package-version-for-user": { + parameters: { + path: { + /** The type of supported package. Can be one of `npm`, `maven`, `rubygems`, `nuget`, `docker`, or `container`. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. */ + package_type: components["parameters"]["package-type"]; + /** The name of the package. */ + package_name: components["parameters"]["package-name"]; + /** Unique identifier of the package version. */ + package_version_id: components["parameters"]["package-version-id"]; + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["package-version"]; + }; + }; + }; + }; + "projects/list-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. */ + state?: "open" | "closed" | "all"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["project"][]; + }; + }; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + }; + /** These are events that you've received by watching repos and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events. */ + "activity/list-received-events-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + "activity/list-received-public-events-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["event"][]; + }; + }; + }; + }; + /** Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user. */ + "repos/list-for-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Can be one of `all`, `owner`, `member`. */ + type?: "all" | "owner" | "member"; + /** Can be one of `created`, `updated`, `pushed`, `full_name`. */ + sort?: "created" | "updated" | "pushed" | "full_name"; + /** Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc` */ + direction?: "asc" | "desc"; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + }; + }; + /** + * Gets the summary of the free and paid GitHub Actions minutes used. + * + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * + * Access tokens must have the `user` scope. + */ + "billing/get-github-actions-billing-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["actions-billing-usage"]; + }; + }; + }; + }; + /** + * Gets the free and paid storage used for GitHub Packages in gigabytes. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `user` scope. + */ + "billing/get-github-packages-billing-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["packages-billing-usage"]; + }; + }; + }; + }; + /** + * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. + * + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * + * Access tokens must have the `user` scope. + */ + "billing/get-shared-storage-billing-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["combined-billing-usage"]; + }; + }; + }; + }; + /** + * Lists repositories a user has starred. + * + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: + */ + "activity/list-repos-starred-by-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** One of `created` (when the repository was starred) or `updated` (when it was last pushed to). */ + sort?: components["parameters"]["sort"]; + /** One of `asc` (ascending) or `desc` (descending). */ + direction?: components["parameters"]["direction"]; + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": Partial< + components["schemas"]["starred-repository"][] + > & + Partial; + }; + }; + }; + }; + /** Lists repositories a user is watching. */ + "activity/list-repos-watched-by-user": { + parameters: { + path: { + username: components["parameters"]["username"]; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + headers: {}; + content: { + "application/json": components["schemas"]["minimal-repository"][]; + }; + }; + }; + }; + /** Get a random sentence from the Zen of GitHub */ + "meta/get-zen": { + responses: { + /** Response */ + 200: { + content: { + "text/plain": string; + }; + }; + }; + }; + /** + * **Deprecated**: Use `repos.compareCommitsWithBasehead()` (`GET /repos/{owner}/{repo}/compare/{basehead}`) instead. Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. + * + * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * + * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. + * + * **Working with large comparisons** + * + * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." + * + * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + "repos/compare-commits": { + parameters: { + path: { + owner: components["parameters"]["owner"]; + repo: components["parameters"]["repo"]; + base: string; + head: string; + }; + query: { + /** Results per page (max 100) */ + per_page?: components["parameters"]["per-page"]; + /** Page number of the results to fetch. */ + page?: components["parameters"]["page"]; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["commit-comparison"]; + }; + }; + 404: components["responses"]["not_found"]; + 500: components["responses"]["internal_error"]; + }; + }; + /** + * **Deprecated:** use `apps.createContentAttachmentForRepo()` (`POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments`) instead. Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. + * + * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + "apps/create-content-attachment": { + parameters: { + path: { + content_reference_id: number; + }; + }; + responses: { + /** Response */ + 200: { + content: { + "application/json": components["schemas"]["content-reference-attachment"]; + }; + }; + 304: components["responses"]["not_modified"]; + 403: components["responses"]["forbidden"]; + 404: components["responses"]["not_found"]; + 410: components["responses"]["gone"]; + 415: components["responses"]["preview_header_missing"]; + 422: components["responses"]["validation_failed"]; + }; + requestBody: { + content: { + "application/json": { + /** The title of the attachment */ + title: string; + /** The body of the attachment */ + body: string; + }; + }; + }; + }; +} + +export interface external {} diff --git a/node_modules/@octokit/plugin-paginate-rest/README.md b/node_modules/@octokit/plugin-paginate-rest/README.md index 3c3e2ae..ddd5f7d 100644 --- a/node_modules/@octokit/plugin-paginate-rest/README.md +++ b/node_modules/@octokit/plugin-paginate-rest/README.md @@ -13,12 +13,15 @@ Browsers -Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev) +Load `@octokit/plugin-paginate-rest` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev) ```html ``` @@ -31,7 +34,10 @@ Install with `npm install @octokit/core @octokit/plugin-paginate-rest`. Optional ```js const { Octokit } = require("@octokit/core"); -const { paginateRest } = require("@octokit/plugin-paginate-rest"); +const { + paginateRest, + composePaginateRest, +} = require("@octokit/plugin-paginate-rest"); ``` @@ -43,7 +49,7 @@ const MyOctokit = Octokit.plugin(paginateRest); const octokit = new MyOctokit({ auth: "secret123" }); // See https://developer.github.com/v3/issues/#list-issues-for-a-repository -const issues = await octokit.paginate("GET /repos/:owner/:repo/issues", { +const issues = await octokit.paginate("GET /repos/{owner}/{repo}/issues", { owner: "octocat", repo: "hello-world", since: "2010-10-01", @@ -51,6 +57,22 @@ const issues = await octokit.paginate("GET /repos/:owner/:repo/issues", { }); ``` +If you want to utilize the pagination methods in another plugin, use `composePaginateRest`. + +```js +function myPlugin(octokit, options) { + return { + allStars({owner, repo}) => { + return composePaginateRest( + octokit, + "GET /repos/{owner}/{repo}/stargazers", + {owner, repo } + ) + } + } +} +``` + ## `octokit.paginate()` The `paginateRest` plugin adds a new `octokit.paginate()` method which accepts the same parameters as [`octokit.request`](https://github.com/octokit/request.js#request). Only "List ..." endpoints such as [List issues for a repository](https://developer.github.com/v3/issues/#list-issues-for-a-repository) are supporting pagination. Their [response includes a Link header](https://developer.github.com/v3/issues/#response-1). For other endpoints, `octokit.paginate()` behaves the same as `octokit.request()`. @@ -61,7 +83,7 @@ An optional `mapFunction` can be passed to map each page response to a new value ```js const issueTitles = await octokit.paginate( - "GET /repos/:owner/:repo/issues", + "GET /repos/{owner}/{repo}/issues", { owner: "octocat", repo: "hello-world", @@ -76,7 +98,7 @@ The `mapFunction` gets a 2nd argument `done` which can be called to end the pagi ```js const issues = await octokit.paginate( - "GET /repos/:owner/:repo/issues", + "GET /repos/{owner}/{repo}/issues", { owner: "octocat", repo: "hello-world", @@ -95,7 +117,7 @@ const issues = await octokit.paginate( Alternatively you can pass a `request` method as first argument. This is great when using in combination with [`@octokit/plugin-rest-endpoint-methods`](https://github.com/octokit/plugin-rest-endpoint-methods.js/): ```js -const issues = await octokit.paginate(octokit.issues.listForRepo, { +const issues = await octokit.paginate(octokit.rest.issues.listForRepo, { owner: "octocat", repo: "hello-world", since: "2010-10-01", @@ -115,11 +137,12 @@ const parameters = { per_page: 100, }; for await (const response of octokit.paginate.iterator( - "GET /repos/:owner/:repo/issues", + "GET /repos/{owner}/{repo}/issues", parameters )) { // do whatever you want with each response, break out of the loop, etc. - console.log(response.data.title); + const issues = response.data; + console.log("%d issues found", issues.length); } ``` @@ -133,14 +156,19 @@ const parameters = { per_page: 100, }; for await (const response of octokit.paginate.iterator( - octokit.issues.listForRepo, + octokit.rest.issues.listForRepo, parameters )) { // do whatever you want with each response, break out of the loop, etc. - console.log(response.data.title); + const issues = response.data; + console.log("%d issues found", issues.length); } ``` +## `composePaginateRest` and `composePaginateRest.iterator` + +The `compose*` methods work just like their `octokit.*` counterparts described above, with the differenct that both methods require an `octokit` instance to be passed as first argument + ## How it works `octokit.paginate()` wraps `octokit.request()`. As long as a `rel="next"` link value is present in the response's `Link` header, it sends another request for that URL, and so on. @@ -157,6 +185,81 @@ Most of GitHub's paginating REST API endpoints return an array, but there are a If a response is lacking the `Link` header, `octokit.paginate()` still resolves with an array, even if the response returns a single object. +## Types + +The plugin also exposes some types and runtime type guards for TypeScript projects. + + + + + + +
+Types + + +```typescript +import { + PaginateInterface, + PaginatingEndpoints, +} from "@octokit/plugin-paginate-rest"; +``` + +
+Guards + + +```typescript +import { isPaginatingEndpoint } from "@octokit/plugin-paginate-rest"; +``` + +
+ +### PaginateInterface + +An `interface` that declares all the overloads of the `.paginate` method. + +### PaginatingEndpoints + +An `interface` which describes all API endpoints supported by the plugin. Some overloads of `.paginate()` method and `composePaginateRest()` function depend on `PaginatingEndpoints`, using the `keyof PaginatingEndpoints` as a type for one of its arguments. + +```typescript +import { Octokit } from "@octokit/core"; +import { + PaginatingEndpoints, + composePaginateRest, +} from "@octokit/plugin-paginate-rest"; + +type DataType = "data" extends keyof T ? T["data"] : unknown; + +async function myPaginatePlugin( + octokit: Octokit, + endpoint: E, + parameters?: PaginatingEndpoints[E]["parameters"] +): Promise> { + return await composePaginateRest(octokit, endpoint, parameters); +} +``` + +### isPaginatingEndpoint + +A type guard, `isPaginatingEndpoint(arg)` returns `true` if `arg` is one of the keys in `PaginatingEndpoints` (is `keyof PaginatingEndpoints`). + +```typescript +import { Octokit } from "@octokit/core"; +import { + isPaginatingEndpoint, + composePaginateRest, +} from "@octokit/plugin-paginate-rest"; + +async function myPlugin(octokit: Octokit, arg: unknown) { + if (isPaginatingEndpoint(arg)) { + return await composePaginateRest(octokit, arg); + } + // ... +} +``` + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js b/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js index 8f4233b..a1ca2da 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js @@ -2,7 +2,60 @@ Object.defineProperty(exports, '__esModule', { value: true }); -const VERSION = "2.4.0"; +const VERSION = "2.15.1"; + +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; +} /** * Some “list” response that can be paginated have a different response structure @@ -21,6 +74,13 @@ const VERSION = "2.4.0"; * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref */ function normalizePaginatedListResponse(response) { + // endpoints can respond with 204 if repository is empty + if (!response.data) { + return _objectSpread2(_objectSpread2({}, response), {}, { + data: [] + }); + } + const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way // to retrieve the same information. @@ -55,26 +115,36 @@ function iterator(octokit, route, parameters) { let url = options.url; return { [Symbol.asyncIterator]: () => ({ - next() { - if (!url) { - return Promise.resolve({ - done: true + async next() { + if (!url) return { + done: true + }; + + try { + const response = await requestMethod({ + method, + url, + headers }); - } - - return requestMethod({ - method, - url, - headers - }).then(normalizePaginatedListResponse).then(response => { - // `response.headers.link` format: + const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: // '; rel="next", ; rel="last"' // sets `url` to undefined if "next" URL is not present or `link` header is not set - url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + + url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; return { - value: response + value: normalizedResponse }; - }); + } catch (error) { + if (error.status !== 409) throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [] + } + }; + } } }) @@ -112,6 +182,20 @@ function gather(octokit, results, iterator, mapFn) { }); } +const composePaginateRest = Object.assign(paginate, { + iterator +}); + +const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/actions/runners/downloads", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/runners/downloads", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/blocks", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/events", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runners/downloads", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/autolinks", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /scim/v2/enterprises/{enterprise}/Groups", "GET /scim/v2/enterprises/{enterprise}/Users", "GET /scim/v2/organizations/{org}/Users", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/team-sync/group-mappings", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; + +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } else { + return false; + } +} + /** * @param octokit Octokit instance * @param options Options passed to Octokit constructor @@ -126,5 +210,8 @@ function paginateRest(octokit) { } paginateRest.VERSION = VERSION; +exports.composePaginateRest = composePaginateRest; +exports.isPaginatingEndpoint = isPaginatingEndpoint; exports.paginateRest = paginateRest; +exports.paginatingEndpoints = paginatingEndpoints; //# sourceMappingURL=index.js.map diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map b/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map index fe36674..e69e9ee 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map +++ b/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/normalize-paginated-list-response.js","../dist-src/iterator.js","../dist-src/paginate.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"2.4.0\";\n","/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nexport function normalizePaginatedListResponse(response) {\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization)\n return response;\n // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n","import { normalizePaginatedListResponse } from \"./normalize-paginated-list-response\";\nexport function iterator(octokit, route, parameters) {\n const options = typeof route === \"function\"\n ? route.endpoint(parameters)\n : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n next() {\n if (!url) {\n return Promise.resolve({ done: true });\n }\n return requestMethod({ method, url, headers })\n .then(normalizePaginatedListResponse)\n .then((response) => {\n // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n url = ((response.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return { value: response };\n });\n },\n }),\n };\n}\n","import { iterator } from \"./iterator\";\nexport function paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then((result) => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator, mapFn);\n });\n}\n","import { VERSION } from \"./version\";\nimport { paginate } from \"./paginate\";\nimport { iterator } from \"./iterator\";\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nexport function paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit),\n }),\n };\n}\npaginateRest.VERSION = VERSION;\n"],"names":["VERSION","normalizePaginatedListResponse","response","responseNeedsNormalization","data","incompleteResults","incomplete_results","repositorySelection","repository_selection","totalCount","total_count","namespaceKey","Object","keys","iterator","octokit","route","parameters","options","endpoint","request","requestMethod","method","headers","url","Symbol","asyncIterator","next","Promise","resolve","done","then","link","match","value","paginate","mapFn","undefined","gather","results","result","earlyExit","concat","paginateRest","assign","bind"],"mappings":";;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAP;;;;;;;;;;;;;;;;AAgBA,AAAO,SAASC,8BAAT,CAAwCC,QAAxC,EAAkD;AACrD,QAAMC,0BAA0B,GAAG,iBAAiBD,QAAQ,CAACE,IAA1B,IAAkC,EAAE,SAASF,QAAQ,CAACE,IAApB,CAArE;AACA,MAAI,CAACD,0BAAL,EACI,OAAOD,QAAP,CAHiD;AAKrD;;AACA,QAAMG,iBAAiB,GAAGH,QAAQ,CAACE,IAAT,CAAcE,kBAAxC;AACA,QAAMC,mBAAmB,GAAGL,QAAQ,CAACE,IAAT,CAAcI,oBAA1C;AACA,QAAMC,UAAU,GAAGP,QAAQ,CAACE,IAAT,CAAcM,WAAjC;AACA,SAAOR,QAAQ,CAACE,IAAT,CAAcE,kBAArB;AACA,SAAOJ,QAAQ,CAACE,IAAT,CAAcI,oBAArB;AACA,SAAON,QAAQ,CAACE,IAAT,CAAcM,WAArB;AACA,QAAMC,YAAY,GAAGC,MAAM,CAACC,IAAP,CAAYX,QAAQ,CAACE,IAArB,EAA2B,CAA3B,CAArB;AACA,QAAMA,IAAI,GAAGF,QAAQ,CAACE,IAAT,CAAcO,YAAd,CAAb;AACAT,EAAAA,QAAQ,CAACE,IAAT,GAAgBA,IAAhB;;AACA,MAAI,OAAOC,iBAAP,KAA6B,WAAjC,EAA8C;AAC1CH,IAAAA,QAAQ,CAACE,IAAT,CAAcE,kBAAd,GAAmCD,iBAAnC;AACH;;AACD,MAAI,OAAOE,mBAAP,KAA+B,WAAnC,EAAgD;AAC5CL,IAAAA,QAAQ,CAACE,IAAT,CAAcI,oBAAd,GAAqCD,mBAArC;AACH;;AACDL,EAAAA,QAAQ,CAACE,IAAT,CAAcM,WAAd,GAA4BD,UAA5B;AACA,SAAOP,QAAP;AACH;;ACtCM,SAASY,QAAT,CAAkBC,OAAlB,EAA2BC,KAA3B,EAAkCC,UAAlC,EAA8C;AACjD,QAAMC,OAAO,GAAG,OAAOF,KAAP,KAAiB,UAAjB,GACVA,KAAK,CAACG,QAAN,CAAeF,UAAf,CADU,GAEVF,OAAO,CAACK,OAAR,CAAgBD,QAAhB,CAAyBH,KAAzB,EAAgCC,UAAhC,CAFN;AAGA,QAAMI,aAAa,GAAG,OAAOL,KAAP,KAAiB,UAAjB,GAA8BA,KAA9B,GAAsCD,OAAO,CAACK,OAApE;AACA,QAAME,MAAM,GAAGJ,OAAO,CAACI,MAAvB;AACA,QAAMC,OAAO,GAAGL,OAAO,CAACK,OAAxB;AACA,MAAIC,GAAG,GAAGN,OAAO,CAACM,GAAlB;AACA,SAAO;AACH,KAACC,MAAM,CAACC,aAAR,GAAwB,OAAO;AAC3BC,MAAAA,IAAI,GAAG;AACH,YAAI,CAACH,GAAL,EAAU;AACN,iBAAOI,OAAO,CAACC,OAAR,CAAgB;AAAEC,YAAAA,IAAI,EAAE;AAAR,WAAhB,CAAP;AACH;;AACD,eAAOT,aAAa,CAAC;AAAEC,UAAAA,MAAF;AAAUE,UAAAA,GAAV;AAAeD,UAAAA;AAAf,SAAD,CAAb,CACFQ,IADE,CACG9B,8BADH,EAEF8B,IAFE,CAEI7B,QAAD,IAAc;AACpB;AACA;AACA;AACAsB,UAAAA,GAAG,GAAG,CAAC,CAACtB,QAAQ,CAACqB,OAAT,CAAiBS,IAAjB,IAAyB,EAA1B,EAA8BC,KAA9B,CAAoC,yBAApC,KAAkE,EAAnE,EAAuE,CAAvE,CAAN;AACA,iBAAO;AAAEC,YAAAA,KAAK,EAAEhC;AAAT,WAAP;AACH,SARM,CAAP;AASH;;AAd0B,KAAP;AADrB,GAAP;AAkBH;;AC1BM,SAASiC,QAAT,CAAkBpB,OAAlB,EAA2BC,KAA3B,EAAkCC,UAAlC,EAA8CmB,KAA9C,EAAqD;AACxD,MAAI,OAAOnB,UAAP,KAAsB,UAA1B,EAAsC;AAClCmB,IAAAA,KAAK,GAAGnB,UAAR;AACAA,IAAAA,UAAU,GAAGoB,SAAb;AACH;;AACD,SAAOC,MAAM,CAACvB,OAAD,EAAU,EAAV,EAAcD,QAAQ,CAACC,OAAD,EAAUC,KAAV,EAAiBC,UAAjB,CAAR,CAAqCQ,MAAM,CAACC,aAA5C,GAAd,EAA4EU,KAA5E,CAAb;AACH;;AACD,SAASE,MAAT,CAAgBvB,OAAhB,EAAyBwB,OAAzB,EAAkCzB,QAAlC,EAA4CsB,KAA5C,EAAmD;AAC/C,SAAOtB,QAAQ,CAACa,IAAT,GAAgBI,IAAhB,CAAsBS,MAAD,IAAY;AACpC,QAAIA,MAAM,CAACV,IAAX,EAAiB;AACb,aAAOS,OAAP;AACH;;AACD,QAAIE,SAAS,GAAG,KAAhB;;AACA,aAASX,IAAT,GAAgB;AACZW,MAAAA,SAAS,GAAG,IAAZ;AACH;;AACDF,IAAAA,OAAO,GAAGA,OAAO,CAACG,MAAR,CAAeN,KAAK,GAAGA,KAAK,CAACI,MAAM,CAACN,KAAR,EAAeJ,IAAf,CAAR,GAA+BU,MAAM,CAACN,KAAP,CAAa9B,IAAhE,CAAV;;AACA,QAAIqC,SAAJ,EAAe;AACX,aAAOF,OAAP;AACH;;AACD,WAAOD,MAAM,CAACvB,OAAD,EAAUwB,OAAV,EAAmBzB,QAAnB,EAA6BsB,KAA7B,CAAb;AACH,GAbM,CAAP;AAcH;;ACpBD;;;;;AAIA,AAAO,SAASO,YAAT,CAAsB5B,OAAtB,EAA+B;AAClC,SAAO;AACHoB,IAAAA,QAAQ,EAAEvB,MAAM,CAACgC,MAAP,CAAcT,QAAQ,CAACU,IAAT,CAAc,IAAd,EAAoB9B,OAApB,CAAd,EAA4C;AAClDD,MAAAA,QAAQ,EAAEA,QAAQ,CAAC+B,IAAT,CAAc,IAAd,EAAoB9B,OAApB;AADwC,KAA5C;AADP,GAAP;AAKH;AACD4B,YAAY,CAAC3C,OAAb,GAAuBA,OAAvB;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/normalize-paginated-list-response.js","../dist-src/iterator.js","../dist-src/paginate.js","../dist-src/compose-paginate.js","../dist-src/generated/paginating-endpoints.js","../dist-src/paginating-endpoints.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"2.15.1\";\n","/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nexport function normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return {\n ...response,\n data: [],\n };\n }\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization)\n return response;\n // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n","import { normalizePaginatedListResponse } from \"./normalize-paginated-list-response\";\nexport function iterator(octokit, route, parameters) {\n const options = typeof route === \"function\"\n ? route.endpoint(parameters)\n : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url)\n return { done: true };\n try {\n const response = await requestMethod({ method, url, headers });\n const normalizedResponse = normalizePaginatedListResponse(response);\n // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return { value: normalizedResponse };\n }\n catch (error) {\n if (error.status !== 409)\n throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: [],\n },\n };\n }\n },\n }),\n };\n}\n","import { iterator } from \"./iterator\";\nexport function paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then((result) => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator, mapFn);\n });\n}\n","import { paginate } from \"./paginate\";\nimport { iterator } from \"./iterator\";\nexport const composePaginateRest = Object.assign(paginate, {\n iterator,\n});\n","export const paginatingEndpoints = [\n \"GET /app/hook/deliveries\",\n \"GET /app/installations\",\n \"GET /applications/grants\",\n \"GET /authorizations\",\n \"GET /enterprises/{enterprise}/actions/permissions/organizations\",\n \"GET /enterprises/{enterprise}/actions/runner-groups\",\n \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\",\n \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\",\n \"GET /enterprises/{enterprise}/actions/runners\",\n \"GET /enterprises/{enterprise}/actions/runners/downloads\",\n \"GET /events\",\n \"GET /gists\",\n \"GET /gists/public\",\n \"GET /gists/starred\",\n \"GET /gists/{gist_id}/comments\",\n \"GET /gists/{gist_id}/commits\",\n \"GET /gists/{gist_id}/forks\",\n \"GET /installation/repositories\",\n \"GET /issues\",\n \"GET /marketplace_listing/plans\",\n \"GET /marketplace_listing/plans/{plan_id}/accounts\",\n \"GET /marketplace_listing/stubbed/plans\",\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"GET /networks/{owner}/{repo}/events\",\n \"GET /notifications\",\n \"GET /organizations\",\n \"GET /orgs/{org}/actions/permissions/repositories\",\n \"GET /orgs/{org}/actions/runner-groups\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\",\n \"GET /orgs/{org}/actions/runners\",\n \"GET /orgs/{org}/actions/runners/downloads\",\n \"GET /orgs/{org}/actions/secrets\",\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/blocks\",\n \"GET /orgs/{org}/credential-authorizations\",\n \"GET /orgs/{org}/events\",\n \"GET /orgs/{org}/failed_invitations\",\n \"GET /orgs/{org}/hooks\",\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries\",\n \"GET /orgs/{org}/installations\",\n \"GET /orgs/{org}/invitations\",\n \"GET /orgs/{org}/invitations/{invitation_id}/teams\",\n \"GET /orgs/{org}/issues\",\n \"GET /orgs/{org}/members\",\n \"GET /orgs/{org}/migrations\",\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n \"GET /orgs/{org}/outside_collaborators\",\n \"GET /orgs/{org}/projects\",\n \"GET /orgs/{org}/public_members\",\n \"GET /orgs/{org}/repos\",\n \"GET /orgs/{org}/team-sync/groups\",\n \"GET /orgs/{org}/teams\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n \"GET /orgs/{org}/teams/{team_slug}/members\",\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n \"GET /orgs/{org}/teams/{team_slug}/repos\",\n \"GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\",\n \"GET /orgs/{org}/teams/{team_slug}/teams\",\n \"GET /projects/columns/{column_id}/cards\",\n \"GET /projects/{project_id}/collaborators\",\n \"GET /projects/{project_id}/columns\",\n \"GET /repos/{owner}/{repo}/actions/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/runners\",\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n \"GET /repos/{owner}/{repo}/actions/runs\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n \"GET /repos/{owner}/{repo}/actions/secrets\",\n \"GET /repos/{owner}/{repo}/actions/workflows\",\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n \"GET /repos/{owner}/{repo}/assignees\",\n \"GET /repos/{owner}/{repo}/autolinks\",\n \"GET /repos/{owner}/{repo}/branches\",\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n \"GET /repos/{owner}/{repo}/code-scanning/analyses\",\n \"GET /repos/{owner}/{repo}/collaborators\",\n \"GET /repos/{owner}/{repo}/comments\",\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/commits\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n \"GET /repos/{owner}/{repo}/contributors\",\n \"GET /repos/{owner}/{repo}/deployments\",\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n \"GET /repos/{owner}/{repo}/events\",\n \"GET /repos/{owner}/{repo}/forks\",\n \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\",\n \"GET /repos/{owner}/{repo}/hooks\",\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n \"GET /repos/{owner}/{repo}/invitations\",\n \"GET /repos/{owner}/{repo}/issues\",\n \"GET /repos/{owner}/{repo}/issues/comments\",\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n \"GET /repos/{owner}/{repo}/keys\",\n \"GET /repos/{owner}/{repo}/labels\",\n \"GET /repos/{owner}/{repo}/milestones\",\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n \"GET /repos/{owner}/{repo}/notifications\",\n \"GET /repos/{owner}/{repo}/pages/builds\",\n \"GET /repos/{owner}/{repo}/projects\",\n \"GET /repos/{owner}/{repo}/pulls\",\n \"GET /repos/{owner}/{repo}/pulls/comments\",\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n \"GET /repos/{owner}/{repo}/releases\",\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/stargazers\",\n \"GET /repos/{owner}/{repo}/subscribers\",\n \"GET /repos/{owner}/{repo}/tags\",\n \"GET /repos/{owner}/{repo}/teams\",\n \"GET /repositories\",\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\",\n \"GET /scim/v2/enterprises/{enterprise}/Groups\",\n \"GET /scim/v2/enterprises/{enterprise}/Users\",\n \"GET /scim/v2/organizations/{org}/Users\",\n \"GET /search/code\",\n \"GET /search/commits\",\n \"GET /search/issues\",\n \"GET /search/labels\",\n \"GET /search/repositories\",\n \"GET /search/topics\",\n \"GET /search/users\",\n \"GET /teams/{team_id}/discussions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\",\n \"GET /teams/{team_id}/invitations\",\n \"GET /teams/{team_id}/members\",\n \"GET /teams/{team_id}/projects\",\n \"GET /teams/{team_id}/repos\",\n \"GET /teams/{team_id}/team-sync/group-mappings\",\n \"GET /teams/{team_id}/teams\",\n \"GET /user/blocks\",\n \"GET /user/emails\",\n \"GET /user/followers\",\n \"GET /user/following\",\n \"GET /user/gpg_keys\",\n \"GET /user/installations\",\n \"GET /user/installations/{installation_id}/repositories\",\n \"GET /user/issues\",\n \"GET /user/keys\",\n \"GET /user/marketplace_purchases\",\n \"GET /user/marketplace_purchases/stubbed\",\n \"GET /user/memberships/orgs\",\n \"GET /user/migrations\",\n \"GET /user/migrations/{migration_id}/repositories\",\n \"GET /user/orgs\",\n \"GET /user/public_emails\",\n \"GET /user/repos\",\n \"GET /user/repository_invitations\",\n \"GET /user/starred\",\n \"GET /user/subscriptions\",\n \"GET /user/teams\",\n \"GET /users\",\n \"GET /users/{username}/events\",\n \"GET /users/{username}/events/orgs/{org}\",\n \"GET /users/{username}/events/public\",\n \"GET /users/{username}/followers\",\n \"GET /users/{username}/following\",\n \"GET /users/{username}/gists\",\n \"GET /users/{username}/gpg_keys\",\n \"GET /users/{username}/keys\",\n \"GET /users/{username}/orgs\",\n \"GET /users/{username}/projects\",\n \"GET /users/{username}/received_events\",\n \"GET /users/{username}/received_events/public\",\n \"GET /users/{username}/repos\",\n \"GET /users/{username}/starred\",\n \"GET /users/{username}/subscriptions\",\n];\n","import { paginatingEndpoints, } from \"./generated/paginating-endpoints\";\nexport { paginatingEndpoints } from \"./generated/paginating-endpoints\";\nexport function isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n }\n else {\n return false;\n }\n}\n","import { VERSION } from \"./version\";\nimport { paginate } from \"./paginate\";\nimport { iterator } from \"./iterator\";\nexport { composePaginateRest } from \"./compose-paginate\";\nexport { isPaginatingEndpoint, paginatingEndpoints, } from \"./paginating-endpoints\";\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nexport function paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit),\n }),\n };\n}\npaginateRest.VERSION = VERSION;\n"],"names":["VERSION","normalizePaginatedListResponse","response","data","responseNeedsNormalization","incompleteResults","incomplete_results","repositorySelection","repository_selection","totalCount","total_count","namespaceKey","Object","keys","iterator","octokit","route","parameters","options","endpoint","request","requestMethod","method","headers","url","Symbol","asyncIterator","next","done","normalizedResponse","link","match","value","error","status","paginate","mapFn","undefined","gather","results","then","result","earlyExit","concat","composePaginateRest","assign","paginatingEndpoints","isPaginatingEndpoint","arg","includes","paginateRest","bind"],"mappings":";;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AAAO,SAASC,8BAAT,CAAwCC,QAAxC,EAAkD;AACrD;AACA,MAAI,CAACA,QAAQ,CAACC,IAAd,EAAoB;AAChB,6CACOD,QADP;AAEIC,MAAAA,IAAI,EAAE;AAFV;AAIH;;AACD,QAAMC,0BAA0B,GAAG,iBAAiBF,QAAQ,CAACC,IAA1B,IAAkC,EAAE,SAASD,QAAQ,CAACC,IAApB,CAArE;AACA,MAAI,CAACC,0BAAL,EACI,OAAOF,QAAP,CAViD;AAYrD;;AACA,QAAMG,iBAAiB,GAAGH,QAAQ,CAACC,IAAT,CAAcG,kBAAxC;AACA,QAAMC,mBAAmB,GAAGL,QAAQ,CAACC,IAAT,CAAcK,oBAA1C;AACA,QAAMC,UAAU,GAAGP,QAAQ,CAACC,IAAT,CAAcO,WAAjC;AACA,SAAOR,QAAQ,CAACC,IAAT,CAAcG,kBAArB;AACA,SAAOJ,QAAQ,CAACC,IAAT,CAAcK,oBAArB;AACA,SAAON,QAAQ,CAACC,IAAT,CAAcO,WAArB;AACA,QAAMC,YAAY,GAAGC,MAAM,CAACC,IAAP,CAAYX,QAAQ,CAACC,IAArB,EAA2B,CAA3B,CAArB;AACA,QAAMA,IAAI,GAAGD,QAAQ,CAACC,IAAT,CAAcQ,YAAd,CAAb;AACAT,EAAAA,QAAQ,CAACC,IAAT,GAAgBA,IAAhB;;AACA,MAAI,OAAOE,iBAAP,KAA6B,WAAjC,EAA8C;AAC1CH,IAAAA,QAAQ,CAACC,IAAT,CAAcG,kBAAd,GAAmCD,iBAAnC;AACH;;AACD,MAAI,OAAOE,mBAAP,KAA+B,WAAnC,EAAgD;AAC5CL,IAAAA,QAAQ,CAACC,IAAT,CAAcK,oBAAd,GAAqCD,mBAArC;AACH;;AACDL,EAAAA,QAAQ,CAACC,IAAT,CAAcO,WAAd,GAA4BD,UAA5B;AACA,SAAOP,QAAP;AACH;;AC7CM,SAASY,QAAT,CAAkBC,OAAlB,EAA2BC,KAA3B,EAAkCC,UAAlC,EAA8C;AACjD,QAAMC,OAAO,GAAG,OAAOF,KAAP,KAAiB,UAAjB,GACVA,KAAK,CAACG,QAAN,CAAeF,UAAf,CADU,GAEVF,OAAO,CAACK,OAAR,CAAgBD,QAAhB,CAAyBH,KAAzB,EAAgCC,UAAhC,CAFN;AAGA,QAAMI,aAAa,GAAG,OAAOL,KAAP,KAAiB,UAAjB,GAA8BA,KAA9B,GAAsCD,OAAO,CAACK,OAApE;AACA,QAAME,MAAM,GAAGJ,OAAO,CAACI,MAAvB;AACA,QAAMC,OAAO,GAAGL,OAAO,CAACK,OAAxB;AACA,MAAIC,GAAG,GAAGN,OAAO,CAACM,GAAlB;AACA,SAAO;AACH,KAACC,MAAM,CAACC,aAAR,GAAwB,OAAO;AAC3B,YAAMC,IAAN,GAAa;AACT,YAAI,CAACH,GAAL,EACI,OAAO;AAAEI,UAAAA,IAAI,EAAE;AAAR,SAAP;;AACJ,YAAI;AACA,gBAAM1B,QAAQ,GAAG,MAAMmB,aAAa,CAAC;AAAEC,YAAAA,MAAF;AAAUE,YAAAA,GAAV;AAAeD,YAAAA;AAAf,WAAD,CAApC;AACA,gBAAMM,kBAAkB,GAAG5B,8BAA8B,CAACC,QAAD,CAAzD,CAFA;AAIA;AACA;;AACAsB,UAAAA,GAAG,GAAG,CAAC,CAACK,kBAAkB,CAACN,OAAnB,CAA2BO,IAA3B,IAAmC,EAApC,EAAwCC,KAAxC,CAA8C,yBAA9C,KAA4E,EAA7E,EAAiF,CAAjF,CAAN;AACA,iBAAO;AAAEC,YAAAA,KAAK,EAAEH;AAAT,WAAP;AACH,SARD,CASA,OAAOI,KAAP,EAAc;AACV,cAAIA,KAAK,CAACC,MAAN,KAAiB,GAArB,EACI,MAAMD,KAAN;AACJT,UAAAA,GAAG,GAAG,EAAN;AACA,iBAAO;AACHQ,YAAAA,KAAK,EAAE;AACHE,cAAAA,MAAM,EAAE,GADL;AAEHX,cAAAA,OAAO,EAAE,EAFN;AAGHpB,cAAAA,IAAI,EAAE;AAHH;AADJ,WAAP;AAOH;AACJ;;AAzB0B,KAAP;AADrB,GAAP;AA6BH;;ACrCM,SAASgC,QAAT,CAAkBpB,OAAlB,EAA2BC,KAA3B,EAAkCC,UAAlC,EAA8CmB,KAA9C,EAAqD;AACxD,MAAI,OAAOnB,UAAP,KAAsB,UAA1B,EAAsC;AAClCmB,IAAAA,KAAK,GAAGnB,UAAR;AACAA,IAAAA,UAAU,GAAGoB,SAAb;AACH;;AACD,SAAOC,MAAM,CAACvB,OAAD,EAAU,EAAV,EAAcD,QAAQ,CAACC,OAAD,EAAUC,KAAV,EAAiBC,UAAjB,CAAR,CAAqCQ,MAAM,CAACC,aAA5C,GAAd,EAA4EU,KAA5E,CAAb;AACH;;AACD,SAASE,MAAT,CAAgBvB,OAAhB,EAAyBwB,OAAzB,EAAkCzB,QAAlC,EAA4CsB,KAA5C,EAAmD;AAC/C,SAAOtB,QAAQ,CAACa,IAAT,GAAgBa,IAAhB,CAAsBC,MAAD,IAAY;AACpC,QAAIA,MAAM,CAACb,IAAX,EAAiB;AACb,aAAOW,OAAP;AACH;;AACD,QAAIG,SAAS,GAAG,KAAhB;;AACA,aAASd,IAAT,GAAgB;AACZc,MAAAA,SAAS,GAAG,IAAZ;AACH;;AACDH,IAAAA,OAAO,GAAGA,OAAO,CAACI,MAAR,CAAeP,KAAK,GAAGA,KAAK,CAACK,MAAM,CAACT,KAAR,EAAeJ,IAAf,CAAR,GAA+Ba,MAAM,CAACT,KAAP,CAAa7B,IAAhE,CAAV;;AACA,QAAIuC,SAAJ,EAAe;AACX,aAAOH,OAAP;AACH;;AACD,WAAOD,MAAM,CAACvB,OAAD,EAAUwB,OAAV,EAAmBzB,QAAnB,EAA6BsB,KAA7B,CAAb;AACH,GAbM,CAAP;AAcH;;MCrBYQ,mBAAmB,GAAGhC,MAAM,CAACiC,MAAP,CAAcV,QAAd,EAAwB;AACvDrB,EAAAA;AADuD,CAAxB,CAA5B;;MCFMgC,mBAAmB,GAAG,CAC/B,0BAD+B,EAE/B,wBAF+B,EAG/B,0BAH+B,EAI/B,qBAJ+B,EAK/B,iEAL+B,EAM/B,qDAN+B,EAO/B,qFAP+B,EAQ/B,+EAR+B,EAS/B,+CAT+B,EAU/B,yDAV+B,EAW/B,aAX+B,EAY/B,YAZ+B,EAa/B,mBAb+B,EAc/B,oBAd+B,EAe/B,+BAf+B,EAgB/B,8BAhB+B,EAiB/B,4BAjB+B,EAkB/B,gCAlB+B,EAmB/B,aAnB+B,EAoB/B,gCApB+B,EAqB/B,mDArB+B,EAsB/B,wCAtB+B,EAuB/B,2DAvB+B,EAwB/B,qCAxB+B,EAyB/B,oBAzB+B,EA0B/B,oBA1B+B,EA2B/B,kDA3B+B,EA4B/B,uCA5B+B,EA6B/B,sEA7B+B,EA8B/B,iEA9B+B,EA+B/B,iCA/B+B,EAgC/B,2CAhC+B,EAiC/B,iCAjC+B,EAkC/B,4DAlC+B,EAmC/B,wBAnC+B,EAoC/B,2CApC+B,EAqC/B,wBArC+B,EAsC/B,oCAtC+B,EAuC/B,uBAvC+B,EAwC/B,4CAxC+B,EAyC/B,+BAzC+B,EA0C/B,6BA1C+B,EA2C/B,mDA3C+B,EA4C/B,wBA5C+B,EA6C/B,yBA7C+B,EA8C/B,4BA9C+B,EA+C/B,wDA/C+B,EAgD/B,uCAhD+B,EAiD/B,0BAjD+B,EAkD/B,gCAlD+B,EAmD/B,uBAnD+B,EAoD/B,kCApD+B,EAqD/B,uBArD+B,EAsD/B,+CAtD+B,EAuD/B,4EAvD+B,EAwD/B,uGAxD+B,EAyD/B,6EAzD+B,EA0D/B,+CA1D+B,EA2D/B,2CA3D+B,EA4D/B,4CA5D+B,EA6D/B,yCA7D+B,EA8D/B,4DA9D+B,EA+D/B,yCA/D+B,EAgE/B,yCAhE+B,EAiE/B,0CAjE+B,EAkE/B,oCAlE+B,EAmE/B,6CAnE+B,EAoE/B,2CApE+B,EAqE/B,qDArE+B,EAsE/B,wCAtE+B,EAuE/B,2DAvE+B,EAwE/B,sDAxE+B,EAyE/B,2CAzE+B,EA0E/B,6CA1E+B,EA2E/B,gEA3E+B,EA4E/B,qCA5E+B,EA6E/B,qCA7E+B,EA8E/B,oCA9E+B,EA+E/B,iEA/E+B,EAgF/B,oEAhF+B,EAiF/B,gDAjF+B,EAkF/B,yEAlF+B,EAmF/B,kDAnF+B,EAoF/B,yCApF+B,EAqF/B,oCArF+B,EAsF/B,2DAtF+B,EAuF/B,mCAvF+B,EAwF/B,oEAxF+B,EAyF/B,yDAzF+B,EA0F/B,sDA1F+B,EA2F/B,oDA3F+B,EA4F/B,sDA5F+B,EA6F/B,kDA7F+B,EA8F/B,wCA9F+B,EA+F/B,uCA/F+B,EAgG/B,gEAhG+B,EAiG/B,kCAjG+B,EAkG/B,iCAlG+B,EAmG/B,mDAnG+B,EAoG/B,iCApG+B,EAqG/B,sDArG+B,EAsG/B,uCAtG+B,EAuG/B,kCAvG+B,EAwG/B,2CAxG+B,EAyG/B,kEAzG+B,EA0G/B,yCA1G+B,EA2G/B,0DA3G+B,EA4G/B,wDA5G+B,EA6G/B,wDA7G+B,EA8G/B,2DA9G+B,EA+G/B,0DA/G+B,EAgH/B,gCAhH+B,EAiH/B,kCAjH+B,EAkH/B,sCAlH+B,EAmH/B,gEAnH+B,EAoH/B,yCApH+B,EAqH/B,wCArH+B,EAsH/B,oCAtH+B,EAuH/B,iCAvH+B,EAwH/B,0CAxH+B,EAyH/B,iEAzH+B,EA0H/B,wDA1H+B,EA2H/B,uDA3H+B,EA4H/B,qDA5H+B,EA6H/B,mEA7H+B,EA8H/B,uDA9H+B,EA+H/B,4EA/H+B,EAgI/B,oCAhI+B,EAiI/B,wDAjI+B,EAkI/B,kDAlI+B,EAmI/B,sCAnI+B,EAoI/B,uCApI+B,EAqI/B,gCArI+B,EAsI/B,iCAtI+B,EAuI/B,mBAvI+B,EAwI/B,2EAxI+B,EAyI/B,8CAzI+B,EA0I/B,6CA1I+B,EA2I/B,wCA3I+B,EA4I/B,kBA5I+B,EA6I/B,qBA7I+B,EA8I/B,oBA9I+B,EA+I/B,oBA/I+B,EAgJ/B,0BAhJ+B,EAiJ/B,oBAjJ+B,EAkJ/B,mBAlJ+B,EAmJ/B,kCAnJ+B,EAoJ/B,+DApJ+B,EAqJ/B,0FArJ+B,EAsJ/B,gEAtJ+B,EAuJ/B,kCAvJ+B,EAwJ/B,8BAxJ+B,EAyJ/B,+BAzJ+B,EA0J/B,4BA1J+B,EA2J/B,+CA3J+B,EA4J/B,4BA5J+B,EA6J/B,kBA7J+B,EA8J/B,kBA9J+B,EA+J/B,qBA/J+B,EAgK/B,qBAhK+B,EAiK/B,oBAjK+B,EAkK/B,yBAlK+B,EAmK/B,wDAnK+B,EAoK/B,kBApK+B,EAqK/B,gBArK+B,EAsK/B,iCAtK+B,EAuK/B,yCAvK+B,EAwK/B,4BAxK+B,EAyK/B,sBAzK+B,EA0K/B,kDA1K+B,EA2K/B,gBA3K+B,EA4K/B,yBA5K+B,EA6K/B,iBA7K+B,EA8K/B,kCA9K+B,EA+K/B,mBA/K+B,EAgL/B,yBAhL+B,EAiL/B,iBAjL+B,EAkL/B,YAlL+B,EAmL/B,8BAnL+B,EAoL/B,yCApL+B,EAqL/B,qCArL+B,EAsL/B,iCAtL+B,EAuL/B,iCAvL+B,EAwL/B,6BAxL+B,EAyL/B,gCAzL+B,EA0L/B,4BA1L+B,EA2L/B,4BA3L+B,EA4L/B,gCA5L+B,EA6L/B,uCA7L+B,EA8L/B,8CA9L+B,EA+L/B,6BA/L+B,EAgM/B,+BAhM+B,EAiM/B,qCAjM+B,CAA5B;;ACEA,SAASC,oBAAT,CAA8BC,GAA9B,EAAmC;AACtC,MAAI,OAAOA,GAAP,KAAe,QAAnB,EAA6B;AACzB,WAAOF,mBAAmB,CAACG,QAApB,CAA6BD,GAA7B,CAAP;AACH,GAFD,MAGK;AACD,WAAO,KAAP;AACH;AACJ;;ACJD;AACA;AACA;AACA;;AACA,AAAO,SAASE,YAAT,CAAsBnC,OAAtB,EAA+B;AAClC,SAAO;AACHoB,IAAAA,QAAQ,EAAEvB,MAAM,CAACiC,MAAP,CAAcV,QAAQ,CAACgB,IAAT,CAAc,IAAd,EAAoBpC,OAApB,CAAd,EAA4C;AAClDD,MAAAA,QAAQ,EAAEA,QAAQ,CAACqC,IAAT,CAAc,IAAd,EAAoBpC,OAApB;AADwC,KAA5C;AADP,GAAP;AAKH;AACDmC,YAAY,CAAClD,OAAb,GAAuBA,OAAvB;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/compose-paginate.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/compose-paginate.js new file mode 100644 index 0000000..09ca53f --- /dev/null +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/compose-paginate.js @@ -0,0 +1,5 @@ +import { paginate } from "./paginate"; +import { iterator } from "./iterator"; +export const composePaginateRest = Object.assign(paginate, { + iterator, +}); diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js index cb0ff5c..934b6b9 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js @@ -1 +1,195 @@ -export {}; +export const paginatingEndpoints = [ + "GET /app/hook/deliveries", + "GET /app/installations", + "GET /applications/grants", + "GET /authorizations", + "GET /enterprises/{enterprise}/actions/permissions/organizations", + "GET /enterprises/{enterprise}/actions/runner-groups", + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", + "GET /enterprises/{enterprise}/actions/runners", + "GET /enterprises/{enterprise}/actions/runners/downloads", + "GET /events", + "GET /gists", + "GET /gists/public", + "GET /gists/starred", + "GET /gists/{gist_id}/comments", + "GET /gists/{gist_id}/commits", + "GET /gists/{gist_id}/forks", + "GET /installation/repositories", + "GET /issues", + "GET /marketplace_listing/plans", + "GET /marketplace_listing/plans/{plan_id}/accounts", + "GET /marketplace_listing/stubbed/plans", + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", + "GET /networks/{owner}/{repo}/events", + "GET /notifications", + "GET /organizations", + "GET /orgs/{org}/actions/permissions/repositories", + "GET /orgs/{org}/actions/runner-groups", + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", + "GET /orgs/{org}/actions/runners", + "GET /orgs/{org}/actions/runners/downloads", + "GET /orgs/{org}/actions/secrets", + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", + "GET /orgs/{org}/blocks", + "GET /orgs/{org}/credential-authorizations", + "GET /orgs/{org}/events", + "GET /orgs/{org}/failed_invitations", + "GET /orgs/{org}/hooks", + "GET /orgs/{org}/hooks/{hook_id}/deliveries", + "GET /orgs/{org}/installations", + "GET /orgs/{org}/invitations", + "GET /orgs/{org}/invitations/{invitation_id}/teams", + "GET /orgs/{org}/issues", + "GET /orgs/{org}/members", + "GET /orgs/{org}/migrations", + "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/outside_collaborators", + "GET /orgs/{org}/projects", + "GET /orgs/{org}/public_members", + "GET /orgs/{org}/repos", + "GET /orgs/{org}/team-sync/groups", + "GET /orgs/{org}/teams", + "GET /orgs/{org}/teams/{team_slug}/discussions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/invitations", + "GET /orgs/{org}/teams/{team_slug}/members", + "GET /orgs/{org}/teams/{team_slug}/projects", + "GET /orgs/{org}/teams/{team_slug}/repos", + "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings", + "GET /orgs/{org}/teams/{team_slug}/teams", + "GET /projects/columns/{column_id}/cards", + "GET /projects/{project_id}/collaborators", + "GET /projects/{project_id}/columns", + "GET /repos/{owner}/{repo}/actions/artifacts", + "GET /repos/{owner}/{repo}/actions/runners", + "GET /repos/{owner}/{repo}/actions/runners/downloads", + "GET /repos/{owner}/{repo}/actions/runs", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", + "GET /repos/{owner}/{repo}/actions/secrets", + "GET /repos/{owner}/{repo}/actions/workflows", + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", + "GET /repos/{owner}/{repo}/assignees", + "GET /repos/{owner}/{repo}/autolinks", + "GET /repos/{owner}/{repo}/branches", + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", + "GET /repos/{owner}/{repo}/code-scanning/alerts", + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + "GET /repos/{owner}/{repo}/code-scanning/analyses", + "GET /repos/{owner}/{repo}/collaborators", + "GET /repos/{owner}/{repo}/comments", + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/commits", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", + "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", + "GET /repos/{owner}/{repo}/commits/{ref}/statuses", + "GET /repos/{owner}/{repo}/contributors", + "GET /repos/{owner}/{repo}/deployments", + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", + "GET /repos/{owner}/{repo}/events", + "GET /repos/{owner}/{repo}/forks", + "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", + "GET /repos/{owner}/{repo}/hooks", + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", + "GET /repos/{owner}/{repo}/invitations", + "GET /repos/{owner}/{repo}/issues", + "GET /repos/{owner}/{repo}/issues/comments", + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/issues/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", + "GET /repos/{owner}/{repo}/issues/{issue_number}/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", + "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", + "GET /repos/{owner}/{repo}/keys", + "GET /repos/{owner}/{repo}/labels", + "GET /repos/{owner}/{repo}/milestones", + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", + "GET /repos/{owner}/{repo}/notifications", + "GET /repos/{owner}/{repo}/pages/builds", + "GET /repos/{owner}/{repo}/projects", + "GET /repos/{owner}/{repo}/pulls", + "GET /repos/{owner}/{repo}/pulls/comments", + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", + "GET /repos/{owner}/{repo}/releases", + "GET /repos/{owner}/{repo}/releases/{release_id}/assets", + "GET /repos/{owner}/{repo}/secret-scanning/alerts", + "GET /repos/{owner}/{repo}/stargazers", + "GET /repos/{owner}/{repo}/subscribers", + "GET /repos/{owner}/{repo}/tags", + "GET /repos/{owner}/{repo}/teams", + "GET /repositories", + "GET /repositories/{repository_id}/environments/{environment_name}/secrets", + "GET /scim/v2/enterprises/{enterprise}/Groups", + "GET /scim/v2/enterprises/{enterprise}/Users", + "GET /scim/v2/organizations/{org}/Users", + "GET /search/code", + "GET /search/commits", + "GET /search/issues", + "GET /search/labels", + "GET /search/repositories", + "GET /search/topics", + "GET /search/users", + "GET /teams/{team_id}/discussions", + "GET /teams/{team_id}/discussions/{discussion_number}/comments", + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /teams/{team_id}/discussions/{discussion_number}/reactions", + "GET /teams/{team_id}/invitations", + "GET /teams/{team_id}/members", + "GET /teams/{team_id}/projects", + "GET /teams/{team_id}/repos", + "GET /teams/{team_id}/team-sync/group-mappings", + "GET /teams/{team_id}/teams", + "GET /user/blocks", + "GET /user/emails", + "GET /user/followers", + "GET /user/following", + "GET /user/gpg_keys", + "GET /user/installations", + "GET /user/installations/{installation_id}/repositories", + "GET /user/issues", + "GET /user/keys", + "GET /user/marketplace_purchases", + "GET /user/marketplace_purchases/stubbed", + "GET /user/memberships/orgs", + "GET /user/migrations", + "GET /user/migrations/{migration_id}/repositories", + "GET /user/orgs", + "GET /user/public_emails", + "GET /user/repos", + "GET /user/repository_invitations", + "GET /user/starred", + "GET /user/subscriptions", + "GET /user/teams", + "GET /users", + "GET /users/{username}/events", + "GET /users/{username}/events/orgs/{org}", + "GET /users/{username}/events/public", + "GET /users/{username}/followers", + "GET /users/{username}/following", + "GET /users/{username}/gists", + "GET /users/{username}/gpg_keys", + "GET /users/{username}/keys", + "GET /users/{username}/orgs", + "GET /users/{username}/projects", + "GET /users/{username}/received_events", + "GET /users/{username}/received_events/public", + "GET /users/{username}/repos", + "GET /users/{username}/starred", + "GET /users/{username}/subscriptions", +]; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js index ef1bdb0..5ba74de 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js @@ -1,6 +1,8 @@ import { VERSION } from "./version"; import { paginate } from "./paginate"; import { iterator } from "./iterator"; +export { composePaginateRest } from "./compose-paginate"; +export { isPaginatingEndpoint, paginatingEndpoints, } from "./paginating-endpoints"; /** * @param octokit Octokit instance * @param options Options passed to Octokit constructor diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js index 092fabc..7f9ee64 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js @@ -9,19 +9,30 @@ export function iterator(octokit, route, parameters) { let url = options.url; return { [Symbol.asyncIterator]: () => ({ - next() { - if (!url) { - return Promise.resolve({ done: true }); - } - return requestMethod({ method, url, headers }) - .then(normalizePaginatedListResponse) - .then((response) => { + async next() { + if (!url) + return { done: true }; + try { + const response = await requestMethod({ method, url, headers }); + const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: // '; rel="next", ; rel="last"' // sets `url` to undefined if "next" URL is not present or `link` header is not set - url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { value: response }; - }); + url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { value: normalizedResponse }; + } + catch (error) { + if (error.status !== 409) + throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [], + }, + }; + } }, }), }; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js index d29c677..a87028b 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js @@ -15,6 +15,13 @@ * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref */ export function normalizePaginatedListResponse(response) { + // endpoints can respond with 204 if repository is empty + if (!response.data) { + return { + ...response, + data: [], + }; + } const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); if (!responseNeedsNormalization) return response; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/paginating-endpoints.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/paginating-endpoints.js new file mode 100644 index 0000000..1e52899 --- /dev/null +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/paginating-endpoints.js @@ -0,0 +1,10 @@ +import { paginatingEndpoints, } from "./generated/paginating-endpoints"; +export { paginatingEndpoints } from "./generated/paginating-endpoints"; +export function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } + else { + return false; + } +} diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js b/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js index 48b74ba..4fc3458 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js @@ -1 +1 @@ -export const VERSION = "2.4.0"; +export const VERSION = "2.15.1"; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/compose-paginate.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/compose-paginate.d.ts new file mode 100644 index 0000000..38a7432 --- /dev/null +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/compose-paginate.d.ts @@ -0,0 +1,2 @@ +import { ComposePaginateInterface } from "./types"; +export declare const composePaginateRest: ComposePaginateInterface; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts index 8e7e635..3374b01 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts @@ -1,113 +1,136 @@ import { Endpoints } from "@octokit/types"; export interface PaginatingEndpoints { /** - * @see https://developer.github.com/v3/apps/#list-installations-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/apps#list-deliveries-for-an-app-webhook + */ + "GET /app/hook/deliveries": { + parameters: Endpoints["GET /app/hook/deliveries"]["parameters"]; + response: Endpoints["GET /app/hook/deliveries"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app */ "GET /app/installations": { parameters: Endpoints["GET /app/installations"]["parameters"]; response: Endpoints["GET /app/installations"]["response"]; }; /** - * @see https://developer.github.com/v3/oauth_authorizations/#list-your-grants + * @see https://docs.github.com/rest/reference/oauth-authorizations#list-your-grants */ "GET /applications/grants": { parameters: Endpoints["GET /applications/grants"]["parameters"]; response: Endpoints["GET /applications/grants"]["response"]; }; /** - * @see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations + * @see https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations */ "GET /authorizations": { parameters: Endpoints["GET /authorizations"]["parameters"]; response: Endpoints["GET /authorizations"]["response"]; }; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-self-hosted-runner-groups-for-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#list-selected-organizations-enabled-for-github-actions-in-an-enterprise */ - "GET /enterprises/:enterprise/actions/runner-groups": { - parameters: Endpoints["GET /enterprises/:enterprise/actions/runner-groups"]["parameters"]; - response: Endpoints["GET /enterprises/:enterprise/actions/runner-groups"]["response"] & { - data: Endpoints["GET /enterprises/:enterprise/actions/runner-groups"]["response"]["data"]["runner_groups"]; + "GET /enterprises/{enterprise}/actions/permissions/organizations": { + parameters: Endpoints["GET /enterprises/{enterprise}/actions/permissions/organizations"]["parameters"]; + response: Endpoints["GET /enterprises/{enterprise}/actions/permissions/organizations"]["response"] & { + data: Endpoints["GET /enterprises/{enterprise}/actions/permissions/organizations"]["response"]["data"]["organizations"]; }; }; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#list-self-hosted-runner-groups-for-an-enterprise */ - "GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations": { - parameters: Endpoints["GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations"]["parameters"]; - response: Endpoints["GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations"]["response"] & { - data: Endpoints["GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations"]["response"]["data"]["organizations"]; + "GET /enterprises/{enterprise}/actions/runner-groups": { + parameters: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups"]["parameters"]; + response: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups"]["response"] & { + data: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups"]["response"]["data"]["runner_groups"]; }; }; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-self-hosted-runners-in-a-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise */ - "GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners": { - parameters: Endpoints["GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners"]["parameters"]; - response: Endpoints["GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners"]["response"] & { - data: Endpoints["GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners"]["response"]["data"]["runners"]; + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations": { + parameters: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations"]["parameters"]; + response: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations"]["response"] & { + data: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations"]["response"]["data"]["organizations"]; }; }; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-self-hosted-runners-for-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#list-self-hosted-runners-in-a-group-for-an-enterprise */ - "GET /enterprises/:enterprise/actions/runners": { - parameters: Endpoints["GET /enterprises/:enterprise/actions/runners"]["parameters"]; - response: Endpoints["GET /enterprises/:enterprise/actions/runners"]["response"] & { - data: Endpoints["GET /enterprises/:enterprise/actions/runners"]["response"]["data"]["runners"]; + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners": { + parameters: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners"]["parameters"]; + response: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners"]["response"] & { + data: Endpoints["GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners"]["response"]["data"]["runners"]; }; }; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-runner-applications-for-an-enterprise - */ - "GET /enterprises/:enterprise/actions/runners/downloads": { - parameters: Endpoints["GET /enterprises/:enterprise/actions/runners/downloads"]["parameters"]; - response: Endpoints["GET /enterprises/:enterprise/actions/runners/downloads"]["response"]; - }; - /** - * @see https://developer.github.com/v3/gists/#list-gists-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/enterprise-admin#list-self-hosted-runners-for-an-enterprise */ - "GET /gists": { - parameters: Endpoints["GET /gists"]["parameters"]; - response: Endpoints["GET /gists"]["response"]; + "GET /enterprises/{enterprise}/actions/runners": { + parameters: Endpoints["GET /enterprises/{enterprise}/actions/runners"]["parameters"]; + response: Endpoints["GET /enterprises/{enterprise}/actions/runners"]["response"] & { + data: Endpoints["GET /enterprises/{enterprise}/actions/runners"]["response"]["data"]["runners"]; + }; }; /** - * @see https://developer.github.com/v3/gists/comments/#list-gist-comments + * @see https://docs.github.com/rest/reference/enterprise-admin#list-runner-applications-for-an-enterprise */ - "GET /gists/:gist_id/comments": { - parameters: Endpoints["GET /gists/:gist_id/comments"]["parameters"]; - response: Endpoints["GET /gists/:gist_id/comments"]["response"]; + "GET /enterprises/{enterprise}/actions/runners/downloads": { + parameters: Endpoints["GET /enterprises/{enterprise}/actions/runners/downloads"]["parameters"]; + response: Endpoints["GET /enterprises/{enterprise}/actions/runners/downloads"]["response"]; }; /** - * @see https://developer.github.com/v3/gists/#list-gist-commits + * @see https://docs.github.com/rest/reference/activity#list-public-events */ - "GET /gists/:gist_id/commits": { - parameters: Endpoints["GET /gists/:gist_id/commits"]["parameters"]; - response: Endpoints["GET /gists/:gist_id/commits"]["response"]; + "GET /events": { + parameters: Endpoints["GET /events"]["parameters"]; + response: Endpoints["GET /events"]["response"]; }; /** - * @see https://developer.github.com/v3/gists/#list-gist-forks + * @see https://docs.github.com/rest/reference/gists#list-gists-for-the-authenticated-user */ - "GET /gists/:gist_id/forks": { - parameters: Endpoints["GET /gists/:gist_id/forks"]["parameters"]; - response: Endpoints["GET /gists/:gist_id/forks"]["response"]; + "GET /gists": { + parameters: Endpoints["GET /gists"]["parameters"]; + response: Endpoints["GET /gists"]["response"]; }; /** - * @see https://developer.github.com/v3/gists/#list-public-gists + * @see https://docs.github.com/rest/reference/gists#list-public-gists */ "GET /gists/public": { parameters: Endpoints["GET /gists/public"]["parameters"]; response: Endpoints["GET /gists/public"]["response"]; }; /** - * @see https://developer.github.com/v3/gists/#list-starred-gists + * @see https://docs.github.com/rest/reference/gists#list-starred-gists */ "GET /gists/starred": { parameters: Endpoints["GET /gists/starred"]["parameters"]; response: Endpoints["GET /gists/starred"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-app-installation + * @see https://docs.github.com/rest/reference/gists#list-gist-comments + */ + "GET /gists/{gist_id}/comments": { + parameters: Endpoints["GET /gists/{gist_id}/comments"]["parameters"]; + response: Endpoints["GET /gists/{gist_id}/comments"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/gists#list-gist-commits + */ + "GET /gists/{gist_id}/commits": { + parameters: Endpoints["GET /gists/{gist_id}/commits"]["parameters"]; + response: Endpoints["GET /gists/{gist_id}/commits"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/gists#list-gist-forks + */ + "GET /gists/{gist_id}/forks": { + parameters: Endpoints["GET /gists/{gist_id}/forks"]["parameters"]; + response: Endpoints["GET /gists/{gist_id}/forks"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-app-installation */ "GET /installation/repositories": { parameters: Endpoints["GET /installation/repositories"]["parameters"]; @@ -116,832 +139,906 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/issues/#list-issues-assigned-to-the-authenticated-user + * @see https://docs.github.com/rest/reference/issues#list-issues-assigned-to-the-authenticated-user */ "GET /issues": { parameters: Endpoints["GET /issues"]["parameters"]; response: Endpoints["GET /issues"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-plans + * @see https://docs.github.com/rest/reference/apps#list-plans */ "GET /marketplace_listing/plans": { parameters: Endpoints["GET /marketplace_listing/plans"]["parameters"]; response: Endpoints["GET /marketplace_listing/plans"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-accounts-for-a-plan + * @see https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan */ - "GET /marketplace_listing/plans/:plan_id/accounts": { - parameters: Endpoints["GET /marketplace_listing/plans/:plan_id/accounts"]["parameters"]; - response: Endpoints["GET /marketplace_listing/plans/:plan_id/accounts"]["response"]; + "GET /marketplace_listing/plans/{plan_id}/accounts": { + parameters: Endpoints["GET /marketplace_listing/plans/{plan_id}/accounts"]["parameters"]; + response: Endpoints["GET /marketplace_listing/plans/{plan_id}/accounts"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-plans-stubbed + * @see https://docs.github.com/rest/reference/apps#list-plans-stubbed */ "GET /marketplace_listing/stubbed/plans": { parameters: Endpoints["GET /marketplace_listing/stubbed/plans"]["parameters"]; response: Endpoints["GET /marketplace_listing/stubbed/plans"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-accounts-for-a-plan-stubbed + * @see https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan-stubbed + */ + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts": { + parameters: Endpoints["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"]["parameters"]; + response: Endpoints["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/activity#list-public-events-for-a-network-of-repositories */ - "GET /marketplace_listing/stubbed/plans/:plan_id/accounts": { - parameters: Endpoints["GET /marketplace_listing/stubbed/plans/:plan_id/accounts"]["parameters"]; - response: Endpoints["GET /marketplace_listing/stubbed/plans/:plan_id/accounts"]["response"]; + "GET /networks/{owner}/{repo}/events": { + parameters: Endpoints["GET /networks/{owner}/{repo}/events"]["parameters"]; + response: Endpoints["GET /networks/{owner}/{repo}/events"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/notifications/#list-notifications-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user */ "GET /notifications": { parameters: Endpoints["GET /notifications"]["parameters"]; response: Endpoints["GET /notifications"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/#list-organizations + * @see https://docs.github.com/rest/reference/orgs#list-organizations */ "GET /organizations": { parameters: Endpoints["GET /organizations"]["parameters"]; response: Endpoints["GET /organizations"]["response"]; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#list-self-hosted-runner-groups-for-an-organization + * @see https://docs.github.com/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization */ - "GET /orgs/:org/actions/runner-groups": { - parameters: Endpoints["GET /orgs/:org/actions/runner-groups"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/runner-groups"]["response"] & { - data: Endpoints["GET /orgs/:org/actions/runner-groups"]["response"]["data"]["runner_groups"]; + "GET /orgs/{org}/actions/permissions/repositories": { + parameters: Endpoints["GET /orgs/{org}/actions/permissions/repositories"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/permissions/repositories"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/permissions/repositories"]["response"]["data"]["repositories"]; }; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#list-repository-access-to-a-self-hosted-runner-group-in-an-organization + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization */ - "GET /orgs/:org/actions/runner-groups/:runner_group_id/repositories": { - parameters: Endpoints["GET /orgs/:org/actions/runner-groups/:runner_group_id/repositories"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/runner-groups/:runner_group_id/repositories"]["response"] & { - data: Endpoints["GET /orgs/:org/actions/runner-groups/:runner_group_id/repositories"]["response"]["data"]["repositories"]; + "GET /orgs/{org}/actions/runner-groups": { + parameters: Endpoints["GET /orgs/{org}/actions/runner-groups"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/runner-groups"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/runner-groups"]["response"]["data"]["runner_groups"]; }; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#list-self-hosted-runners-in-a-group-for-an-organization + * @see https://docs.github.com/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization */ - "GET /orgs/:org/actions/runner-groups/:runner_group_id/runners": { - parameters: Endpoints["GET /orgs/:org/actions/runner-groups/:runner_group_id/runners"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/runner-groups/:runner_group_id/runners"]["response"] & { - data: Endpoints["GET /orgs/:org/actions/runner-groups/:runner_group_id/runners"]["response"]["data"]["runners"]; + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": { + parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories"]["response"]["data"]["repositories"]; }; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization */ - "GET /orgs/:org/actions/runners": { - parameters: Endpoints["GET /orgs/:org/actions/runners"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/runners"]["response"] & { - data: Endpoints["GET /orgs/:org/actions/runners"]["response"]["data"]["runners"]; + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners": { + parameters: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners"]["response"]["data"]["runners"]; }; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-runner-applications-for-an-organization + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-an-organization */ - "GET /orgs/:org/actions/runners/downloads": { - parameters: Endpoints["GET /orgs/:org/actions/runners/downloads"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/runners/downloads"]["response"]; + "GET /orgs/{org}/actions/runners": { + parameters: Endpoints["GET /orgs/{org}/actions/runners"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/runners"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/runners"]["response"]["data"]["runners"]; + }; }; /** - * @see https://developer.github.com/v3/actions/secrets/#list-organization-secrets + * @see https://docs.github.com/rest/reference/actions#list-runner-applications-for-an-organization */ - "GET /orgs/:org/actions/secrets": { - parameters: Endpoints["GET /orgs/:org/actions/secrets"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/secrets"]["response"] & { - data: Endpoints["GET /orgs/:org/actions/secrets"]["response"]["data"]["secrets"]; + "GET /orgs/{org}/actions/runners/downloads": { + parameters: Endpoints["GET /orgs/{org}/actions/runners/downloads"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/runners/downloads"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/actions#list-organization-secrets + */ + "GET /orgs/{org}/actions/secrets": { + parameters: Endpoints["GET /orgs/{org}/actions/secrets"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/secrets"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/secrets"]["response"]["data"]["secrets"]; }; }; /** - * @see https://developer.github.com/v3/actions/secrets/#list-selected-repositories-for-an-organization-secret + * @see https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret */ - "GET /orgs/:org/actions/secrets/:secret_name/repositories": { - parameters: Endpoints["GET /orgs/:org/actions/secrets/:secret_name/repositories"]["parameters"]; - response: Endpoints["GET /orgs/:org/actions/secrets/:secret_name/repositories"]["response"] & { - data: Endpoints["GET /orgs/:org/actions/secrets/:secret_name/repositories"]["response"]["data"]["repositories"]; + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories": { + parameters: Endpoints["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"]["parameters"]; + response: Endpoints["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"]["response"] & { + data: Endpoints["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"]["response"]["data"]["repositories"]; }; }; /** - * @see https://developer.github.com/v3/orgs/blocking/#list-users-blocked-by-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-users-blocked-by-an-organization */ - "GET /orgs/:org/blocks": { - parameters: Endpoints["GET /orgs/:org/blocks"]["parameters"]; - response: Endpoints["GET /orgs/:org/blocks"]["response"]; + "GET /orgs/{org}/blocks": { + parameters: Endpoints["GET /orgs/{org}/blocks"]["parameters"]; + response: Endpoints["GET /orgs/{org}/blocks"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/#list-saml-sso-authorizations-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-saml-sso-authorizations-for-an-organization */ - "GET /orgs/:org/credential-authorizations": { - parameters: Endpoints["GET /orgs/:org/credential-authorizations"]["parameters"]; - response: Endpoints["GET /orgs/:org/credential-authorizations"]["response"]; + "GET /orgs/{org}/credential-authorizations": { + parameters: Endpoints["GET /orgs/{org}/credential-authorizations"]["parameters"]; + response: Endpoints["GET /orgs/{org}/credential-authorizations"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/hooks/#list-organization-webhooks + * @see https://docs.github.com/rest/reference/activity#list-public-organization-events */ - "GET /orgs/:org/hooks": { - parameters: Endpoints["GET /orgs/:org/hooks"]["parameters"]; - response: Endpoints["GET /orgs/:org/hooks"]["response"]; + "GET /orgs/{org}/events": { + parameters: Endpoints["GET /orgs/{org}/events"]["parameters"]; + response: Endpoints["GET /orgs/{org}/events"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/#list-app-installations-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-failed-organization-invitations */ - "GET /orgs/:org/installations": { - parameters: Endpoints["GET /orgs/:org/installations"]["parameters"]; - response: Endpoints["GET /orgs/:org/installations"]["response"] & { - data: Endpoints["GET /orgs/:org/installations"]["response"]["data"]["installations"]; + "GET /orgs/{org}/failed_invitations": { + parameters: Endpoints["GET /orgs/{org}/failed_invitations"]["parameters"]; + response: Endpoints["GET /orgs/{org}/failed_invitations"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/orgs#list-organization-webhooks + */ + "GET /orgs/{org}/hooks": { + parameters: Endpoints["GET /orgs/{org}/hooks"]["parameters"]; + response: Endpoints["GET /orgs/{org}/hooks"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/orgs#list-deliveries-for-an-organization-webhook + */ + "GET /orgs/{org}/hooks/{hook_id}/deliveries": { + parameters: Endpoints["GET /orgs/{org}/hooks/{hook_id}/deliveries"]["parameters"]; + response: Endpoints["GET /orgs/{org}/hooks/{hook_id}/deliveries"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/orgs#list-app-installations-for-an-organization + */ + "GET /orgs/{org}/installations": { + parameters: Endpoints["GET /orgs/{org}/installations"]["parameters"]; + response: Endpoints["GET /orgs/{org}/installations"]["response"] & { + data: Endpoints["GET /orgs/{org}/installations"]["response"]["data"]["installations"]; }; }; /** - * @see https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations + * @see https://docs.github.com/rest/reference/orgs#list-pending-organization-invitations */ - "GET /orgs/:org/invitations": { - parameters: Endpoints["GET /orgs/:org/invitations"]["parameters"]; - response: Endpoints["GET /orgs/:org/invitations"]["response"]; + "GET /orgs/{org}/invitations": { + parameters: Endpoints["GET /orgs/{org}/invitations"]["parameters"]; + response: Endpoints["GET /orgs/{org}/invitations"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/members/#list-organization-invitation-teams + * @see https://docs.github.com/rest/reference/orgs#list-organization-invitation-teams */ - "GET /orgs/:org/invitations/:invitation_id/teams": { - parameters: Endpoints["GET /orgs/:org/invitations/:invitation_id/teams"]["parameters"]; - response: Endpoints["GET /orgs/:org/invitations/:invitation_id/teams"]["response"]; + "GET /orgs/{org}/invitations/{invitation_id}/teams": { + parameters: Endpoints["GET /orgs/{org}/invitations/{invitation_id}/teams"]["parameters"]; + response: Endpoints["GET /orgs/{org}/invitations/{invitation_id}/teams"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/#list-organization-issues-assigned-to-the-authenticated-user + * @see https://docs.github.com/rest/reference/issues#list-organization-issues-assigned-to-the-authenticated-user */ - "GET /orgs/:org/issues": { - parameters: Endpoints["GET /orgs/:org/issues"]["parameters"]; - response: Endpoints["GET /orgs/:org/issues"]["response"]; + "GET /orgs/{org}/issues": { + parameters: Endpoints["GET /orgs/{org}/issues"]["parameters"]; + response: Endpoints["GET /orgs/{org}/issues"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/members/#list-organization-members + * @see https://docs.github.com/rest/reference/orgs#list-organization-members */ - "GET /orgs/:org/members": { - parameters: Endpoints["GET /orgs/:org/members"]["parameters"]; - response: Endpoints["GET /orgs/:org/members"]["response"]; + "GET /orgs/{org}/members": { + parameters: Endpoints["GET /orgs/{org}/members"]["parameters"]; + response: Endpoints["GET /orgs/{org}/members"]["response"]; }; /** - * @see https://developer.github.com/v3/migrations/orgs/#list-organization-migrations + * @see https://docs.github.com/rest/reference/migrations#list-organization-migrations */ - "GET /orgs/:org/migrations": { - parameters: Endpoints["GET /orgs/:org/migrations"]["parameters"]; - response: Endpoints["GET /orgs/:org/migrations"]["response"]; + "GET /orgs/{org}/migrations": { + parameters: Endpoints["GET /orgs/{org}/migrations"]["parameters"]; + response: Endpoints["GET /orgs/{org}/migrations"]["response"]; }; /** - * @see https://developer.github.com/v3/migrations/orgs/#list-repositories-in-an-organization-migration + * @see https://docs.github.com/rest/reference/migrations#list-repositories-in-an-organization-migration */ - "GET /orgs/:org/migrations/:migration_id/repositories": { - parameters: Endpoints["GET /orgs/:org/migrations/:migration_id/repositories"]["parameters"]; - response: Endpoints["GET /orgs/:org/migrations/:migration_id/repositories"]["response"]; + "GET /orgs/{org}/migrations/{migration_id}/repositories": { + parameters: Endpoints["GET /orgs/{org}/migrations/{migration_id}/repositories"]["parameters"]; + response: Endpoints["GET /orgs/{org}/migrations/{migration_id}/repositories"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-outside-collaborators-for-an-organization */ - "GET /orgs/:org/outside_collaborators": { - parameters: Endpoints["GET /orgs/:org/outside_collaborators"]["parameters"]; - response: Endpoints["GET /orgs/:org/outside_collaborators"]["response"]; + "GET /orgs/{org}/outside_collaborators": { + parameters: Endpoints["GET /orgs/{org}/outside_collaborators"]["parameters"]; + response: Endpoints["GET /orgs/{org}/outside_collaborators"]["response"]; }; /** - * @see https://developer.github.com/v3/projects/#list-organization-projects + * @see https://docs.github.com/rest/reference/projects#list-organization-projects */ - "GET /orgs/:org/projects": { - parameters: Endpoints["GET /orgs/:org/projects"]["parameters"]; - response: Endpoints["GET /orgs/:org/projects"]["response"]; + "GET /orgs/{org}/projects": { + parameters: Endpoints["GET /orgs/{org}/projects"]["parameters"]; + response: Endpoints["GET /orgs/{org}/projects"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/members/#list-public-organization-members + * @see https://docs.github.com/rest/reference/orgs#list-public-organization-members */ - "GET /orgs/:org/public_members": { - parameters: Endpoints["GET /orgs/:org/public_members"]["parameters"]; - response: Endpoints["GET /orgs/:org/public_members"]["response"]; + "GET /orgs/{org}/public_members": { + parameters: Endpoints["GET /orgs/{org}/public_members"]["parameters"]; + response: Endpoints["GET /orgs/{org}/public_members"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/#list-organization-repositories + * @see https://docs.github.com/rest/reference/repos#list-organization-repositories */ - "GET /orgs/:org/repos": { - parameters: Endpoints["GET /orgs/:org/repos"]["parameters"]; - response: Endpoints["GET /orgs/:org/repos"]["response"]; + "GET /orgs/{org}/repos": { + parameters: Endpoints["GET /orgs/{org}/repos"]["parameters"]; + response: Endpoints["GET /orgs/{org}/repos"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-an-organization + * @see https://docs.github.com/rest/reference/teams#list-idp-groups-for-an-organization */ - "GET /orgs/:org/team-sync/groups": { - parameters: Endpoints["GET /orgs/:org/team-sync/groups"]["parameters"]; - response: Endpoints["GET /orgs/:org/team-sync/groups"]["response"] & { - data: Endpoints["GET /orgs/:org/team-sync/groups"]["response"]["data"]["groups"]; + "GET /orgs/{org}/team-sync/groups": { + parameters: Endpoints["GET /orgs/{org}/team-sync/groups"]["parameters"]; + response: Endpoints["GET /orgs/{org}/team-sync/groups"]["response"] & { + data: Endpoints["GET /orgs/{org}/team-sync/groups"]["response"]["data"]["groups"]; }; }; /** - * @see https://developer.github.com/v3/teams/#list-teams + * @see https://docs.github.com/rest/reference/teams#list-teams */ - "GET /orgs/:org/teams": { - parameters: Endpoints["GET /orgs/:org/teams"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams"]["response"]; + "GET /orgs/{org}/teams": { + parameters: Endpoints["GET /orgs/{org}/teams"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/discussions/#list-discussions + * @see https://docs.github.com/rest/reference/teams#list-discussions */ - "GET /orgs/:org/teams/:team_slug/discussions": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/discussions"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/discussions": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#list-discussion-comments + * @see https://docs.github.com/rest/reference/teams#list-discussion-comments */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/members/#list-pending-team-invitations + * @see https://docs.github.com/rest/reference/teams#list-pending-team-invitations */ - "GET /orgs/:org/teams/:team_slug/invitations": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/invitations"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/invitations"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/invitations": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/invitations"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/invitations"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/members/#list-team-members + * @see https://docs.github.com/rest/reference/teams#list-team-members */ - "GET /orgs/:org/teams/:team_slug/members": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/members"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/members"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/members": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/members"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/members"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/#list-team-projects + * @see https://docs.github.com/rest/reference/teams#list-team-projects */ - "GET /orgs/:org/teams/:team_slug/projects": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/projects"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/projects"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/projects": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/projects"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/projects"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/#list-team-repositories + * @see https://docs.github.com/rest/reference/teams#list-team-repositories */ - "GET /orgs/:org/teams/:team_slug/repos": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/repos"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/repos"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/repos": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/repos"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/repos"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-a-team + * @see https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team */ - "GET /orgs/:org/teams/:team_slug/team-sync/group-mappings": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/team-sync/group-mappings"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/team-sync/group-mappings"]["response"] & { - data: Endpoints["GET /orgs/:org/teams/:team_slug/team-sync/group-mappings"]["response"]["data"]["groups"]; + "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings"]["response"] & { + data: Endpoints["GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings"]["response"]["data"]["groups"]; }; }; /** - * @see https://developer.github.com/v3/teams/#list-child-teams + * @see https://docs.github.com/rest/reference/teams#list-child-teams */ - "GET /orgs/:org/teams/:team_slug/teams": { - parameters: Endpoints["GET /orgs/:org/teams/:team_slug/teams"]["parameters"]; - response: Endpoints["GET /orgs/:org/teams/:team_slug/teams"]["response"]; + "GET /orgs/{org}/teams/{team_slug}/teams": { + parameters: Endpoints["GET /orgs/{org}/teams/{team_slug}/teams"]["parameters"]; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/teams"]["response"]; }; /** - * @see https://developer.github.com/v3/projects/collaborators/#list-project-collaborators + * @see https://docs.github.com/rest/reference/projects#list-project-cards */ - "GET /projects/:project_id/collaborators": { - parameters: Endpoints["GET /projects/:project_id/collaborators"]["parameters"]; - response: Endpoints["GET /projects/:project_id/collaborators"]["response"]; + "GET /projects/columns/{column_id}/cards": { + parameters: Endpoints["GET /projects/columns/{column_id}/cards"]["parameters"]; + response: Endpoints["GET /projects/columns/{column_id}/cards"]["response"]; }; /** - * @see https://developer.github.com/v3/projects/columns/#list-project-columns + * @see https://docs.github.com/rest/reference/projects#list-project-collaborators */ - "GET /projects/:project_id/columns": { - parameters: Endpoints["GET /projects/:project_id/columns"]["parameters"]; - response: Endpoints["GET /projects/:project_id/columns"]["response"]; + "GET /projects/{project_id}/collaborators": { + parameters: Endpoints["GET /projects/{project_id}/collaborators"]["parameters"]; + response: Endpoints["GET /projects/{project_id}/collaborators"]["response"]; }; /** - * @see https://developer.github.com/v3/projects/cards/#list-project-cards + * @see https://docs.github.com/rest/reference/projects#list-project-columns */ - "GET /projects/columns/:column_id/cards": { - parameters: Endpoints["GET /projects/columns/:column_id/cards"]["parameters"]; - response: Endpoints["GET /projects/columns/:column_id/cards"]["response"]; + "GET /projects/{project_id}/columns": { + parameters: Endpoints["GET /projects/{project_id}/columns"]["parameters"]; + response: Endpoints["GET /projects/{project_id}/columns"]["response"]; }; /** - * @see https://developer.github.com/v3/actions/artifacts/#list-artifacts-for-a-repository + * @see https://docs.github.com/rest/reference/actions#list-artifacts-for-a-repository */ - "GET /repos/:owner/:repo/actions/artifacts": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/artifacts"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/artifacts"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/artifacts"]["response"]["data"]["artifacts"]; + "GET /repos/{owner}/{repo}/actions/artifacts": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/artifacts"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/artifacts"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/artifacts"]["response"]["data"]["artifacts"]; }; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-a-repository */ - "GET /repos/:owner/:repo/actions/runners": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/runners"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/runners"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/runners"]["response"]["data"]["runners"]; + "GET /repos/{owner}/{repo}/actions/runners": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/runners"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runners"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/runners"]["response"]["data"]["runners"]; }; }; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-runner-applications-for-a-repository + * @see https://docs.github.com/rest/reference/actions#list-runner-applications-for-a-repository */ - "GET /repos/:owner/:repo/actions/runners/downloads": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/runners/downloads"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/runners/downloads"]["response"]; + "GET /repos/{owner}/{repo}/actions/runners/downloads": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/runners/downloads"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runners/downloads"]["response"]; }; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs-for-a-repository + * @see https://docs.github.com/rest/reference/actions#list-workflow-runs-for-a-repository */ - "GET /repos/:owner/:repo/actions/runs": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/runs"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/runs"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/runs"]["response"]["data"]["workflow_runs"]; + "GET /repos/{owner}/{repo}/actions/runs": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/runs"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/runs"]["response"]["data"]["workflow_runs"]; }; }; /** - * @see https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts + * @see https://docs.github.com/rest/reference/actions#list-workflow-run-artifacts */ - "GET /repos/:owner/:repo/actions/runs/:run_id/artifacts": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/artifacts"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/artifacts"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/artifacts"]["response"]["data"]["artifacts"]; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"]["response"]["data"]["artifacts"]; }; }; /** - * @see https://developer.github.com/v3/actions/workflow-jobs/#list-jobs-for-a-workflow-run + * @see https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run */ - "GET /repos/:owner/:repo/actions/runs/:run_id/jobs": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/jobs"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/jobs"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/jobs"]["response"]["data"]["jobs"]; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"]["response"]["data"]["jobs"]; }; }; /** - * @see https://developer.github.com/v3/actions/secrets/#list-repository-secrets + * @see https://docs.github.com/rest/reference/actions#list-repository-secrets */ - "GET /repos/:owner/:repo/actions/secrets": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/secrets"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/secrets"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/secrets"]["response"]["data"]["secrets"]; + "GET /repos/{owner}/{repo}/actions/secrets": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/secrets"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/secrets"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/secrets"]["response"]["data"]["secrets"]; }; }; /** - * @see https://developer.github.com/v3/actions/workflows/#list-repository-workflows + * @see https://docs.github.com/rest/reference/actions#list-repository-workflows */ - "GET /repos/:owner/:repo/actions/workflows": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/workflows"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/workflows"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/workflows"]["response"]["data"]["workflows"]; + "GET /repos/{owner}/{repo}/actions/workflows": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/workflows"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/workflows"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/workflows"]["response"]["data"]["workflows"]; }; }; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs + * @see https://docs.github.com/rest/reference/actions#list-workflow-runs */ - "GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs": { - parameters: Endpoints["GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs"]["response"]["data"]["workflow_runs"]; + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs": { + parameters: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"]["response"]["data"]["workflow_runs"]; }; }; /** - * @see https://developer.github.com/v3/issues/assignees/#list-assignees + * @see https://docs.github.com/rest/reference/issues#list-assignees */ - "GET /repos/:owner/:repo/assignees": { - parameters: Endpoints["GET /repos/:owner/:repo/assignees"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/assignees"]["response"]; + "GET /repos/{owner}/{repo}/assignees": { + parameters: Endpoints["GET /repos/{owner}/{repo}/assignees"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/assignees"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/branches/#list-branches + * @see https://docs.github.com/v3/repos#list-autolinks */ - "GET /repos/:owner/:repo/branches": { - parameters: Endpoints["GET /repos/:owner/:repo/branches"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/branches"]["response"]; + "GET /repos/{owner}/{repo}/autolinks": { + parameters: Endpoints["GET /repos/{owner}/{repo}/autolinks"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/autolinks"]["response"]; }; /** - * @see https://developer.github.com/v3/checks/runs/#list-check-run-annotations + * @see https://docs.github.com/rest/reference/repos#list-branches */ - "GET /repos/:owner/:repo/check-runs/:check_run_id/annotations": { - parameters: Endpoints["GET /repos/:owner/:repo/check-runs/:check_run_id/annotations"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/check-runs/:check_run_id/annotations"]["response"]; + "GET /repos/{owner}/{repo}/branches": { + parameters: Endpoints["GET /repos/{owner}/{repo}/branches"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/branches"]["response"]; }; /** - * @see https://developer.github.com/v3/checks/runs/#list-check-runs-in-a-check-suite + * @see https://docs.github.com/rest/reference/checks#list-check-run-annotations */ - "GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs": { - parameters: Endpoints["GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs"]["response"]["data"]["check_runs"]; + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations": { + parameters: Endpoints["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite + */ + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs": { + parameters: Endpoints["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"]["response"]["data"]["check_runs"]; }; }; /** - * @see https://developer.github.com/v3/code-scanning/#list-code-scanning-alerts-for-a-repository + * @see https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository + */ + "GET /repos/{owner}/{repo}/code-scanning/alerts": { + parameters: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/code-scanning#list-instances-of-a-code-scanning-alert */ - "GET /repos/:owner/:repo/code-scanning/alerts": { - parameters: Endpoints["GET /repos/:owner/:repo/code-scanning/alerts"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/code-scanning/alerts"]["response"]; + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances": { + parameters: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"]["response"]; }; /** - * @see https://developer.github.com/v3/code-scanning/#list-recent-analyses + * @see https://docs.github.com/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository */ - "GET /repos/:owner/:repo/code-scanning/analyses": { - parameters: Endpoints["GET /repos/:owner/:repo/code-scanning/analyses"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/code-scanning/analyses"]["response"]; + "GET /repos/{owner}/{repo}/code-scanning/analyses": { + parameters: Endpoints["GET /repos/{owner}/{repo}/code-scanning/analyses"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/analyses"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/collaborators/#list-repository-collaborators + * @see https://docs.github.com/rest/reference/repos#list-repository-collaborators */ - "GET /repos/:owner/:repo/collaborators": { - parameters: Endpoints["GET /repos/:owner/:repo/collaborators"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/collaborators"]["response"]; + "GET /repos/{owner}/{repo}/collaborators": { + parameters: Endpoints["GET /repos/{owner}/{repo}/collaborators"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/collaborators"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository + * @see https://docs.github.com/rest/reference/repos#list-commit-comments-for-a-repository */ - "GET /repos/:owner/:repo/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/comments"]["response"]; + "GET /repos/{owner}/{repo}/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-commit-comment */ - "GET /repos/:owner/:repo/comments/:comment_id/reactions": { - parameters: Endpoints["GET /repos/:owner/:repo/comments/:comment_id/reactions"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/comments/:comment_id/reactions"]["response"]; + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions": { + parameters: Endpoints["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/commits/#list-commits + * @see https://docs.github.com/rest/reference/repos#list-commits */ - "GET /repos/:owner/:repo/commits": { - parameters: Endpoints["GET /repos/:owner/:repo/commits"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits"]["response"]; + "GET /repos/{owner}/{repo}/commits": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/commits/#list-branches-for-head-commit + * @see https://docs.github.com/rest/reference/repos#list-branches-for-head-commit */ - "GET /repos/:owner/:repo/commits/:commit_sha/branches-where-head": { - parameters: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/branches-where-head"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/branches-where-head"]["response"]; + "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/comments/#list-commit-comments + * @see https://docs.github.com/rest/reference/repos#list-commit-comments */ - "GET /repos/:owner/:repo/commits/:commit_sha/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/comments"]["response"]; + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-a-commit + * @see https://docs.github.com/rest/reference/repos#list-pull-requests-associated-with-a-commit */ - "GET /repos/:owner/:repo/commits/:commit_sha/pulls": { - parameters: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/pulls"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/pulls"]["response"]; + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"]["response"]; }; /** - * @see https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-git-reference + * @see https://docs.github.com/rest/reference/checks#list-check-runs-for-a-git-reference */ - "GET /repos/:owner/:repo/commits/:ref/check-runs": { - parameters: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-runs"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-runs"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-runs"]["response"]["data"]["check_runs"]; + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"]["response"]["data"]["check_runs"]; }; }; /** - * @see https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-git-reference + * @see https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference */ - "GET /repos/:owner/:repo/commits/:ref/check-suites": { - parameters: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-suites"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-suites"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-suites"]["response"]["data"]["check_suites"]; + "GET /repos/{owner}/{repo}/commits/{ref}/check-suites": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"]["response"]["data"]["check_suites"]; }; }; /** - * @see https://developer.github.com/v3/repos/statuses/#list-commit-statuses-for-a-reference + * @see https://docs.github.com/rest/reference/repos#list-commit-statuses-for-a-reference */ - "GET /repos/:owner/:repo/commits/:ref/statuses": { - parameters: Endpoints["GET /repos/:owner/:repo/commits/:ref/statuses"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/statuses"]["response"]; + "GET /repos/{owner}/{repo}/commits/{ref}/statuses": { + parameters: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/statuses"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/statuses"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/#list-repository-contributors + * @see https://docs.github.com/rest/reference/repos#list-repository-contributors */ - "GET /repos/:owner/:repo/contributors": { - parameters: Endpoints["GET /repos/:owner/:repo/contributors"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/contributors"]["response"]; + "GET /repos/{owner}/{repo}/contributors": { + parameters: Endpoints["GET /repos/{owner}/{repo}/contributors"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/contributors"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/deployments/#list-deployments + * @see https://docs.github.com/rest/reference/repos#list-deployments */ - "GET /repos/:owner/:repo/deployments": { - parameters: Endpoints["GET /repos/:owner/:repo/deployments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/deployments"]["response"]; + "GET /repos/{owner}/{repo}/deployments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/deployments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/deployments"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/deployments/#list-deployment-statuses + * @see https://docs.github.com/rest/reference/repos#list-deployment-statuses */ - "GET /repos/:owner/:repo/deployments/:deployment_id/statuses": { - parameters: Endpoints["GET /repos/:owner/:repo/deployments/:deployment_id/statuses"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/deployments/:deployment_id/statuses"]["response"]; + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses": { + parameters: Endpoints["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/forks/#list-forks + * @see https://docs.github.com/rest/reference/activity#list-repository-events */ - "GET /repos/:owner/:repo/forks": { - parameters: Endpoints["GET /repos/:owner/:repo/forks"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/forks"]["response"]; + "GET /repos/{owner}/{repo}/events": { + parameters: Endpoints["GET /repos/{owner}/{repo}/events"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/events"]["response"]; }; /** - * @see https://developer.github.com/v3/git/refs/#list-matching-references + * @see https://docs.github.com/rest/reference/repos#list-forks */ - "GET /repos/:owner/:repo/git/matching-refs/:ref": { - parameters: Endpoints["GET /repos/:owner/:repo/git/matching-refs/:ref"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/git/matching-refs/:ref"]["response"]; + "GET /repos/{owner}/{repo}/forks": { + parameters: Endpoints["GET /repos/{owner}/{repo}/forks"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/forks"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/hooks/#list-repository-webhooks + * @see https://docs.github.com/rest/reference/git#list-matching-references */ - "GET /repos/:owner/:repo/hooks": { - parameters: Endpoints["GET /repos/:owner/:repo/hooks"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/hooks"]["response"]; + "GET /repos/{owner}/{repo}/git/matching-refs/{ref}": { + parameters: Endpoints["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/invitations/#list-repository-invitations + * @see https://docs.github.com/rest/reference/repos#list-repository-webhooks */ - "GET /repos/:owner/:repo/invitations": { - parameters: Endpoints["GET /repos/:owner/:repo/invitations"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/invitations"]["response"]; + "GET /repos/{owner}/{repo}/hooks": { + parameters: Endpoints["GET /repos/{owner}/{repo}/hooks"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/hooks"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/#list-repository-issues + * @see https://docs.github.com/rest/reference/repos#list-deliveries-for-a-repository-webhook */ - "GET /repos/:owner/:repo/issues": { - parameters: Endpoints["GET /repos/:owner/:repo/issues"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues"]["response"]; + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries": { + parameters: Endpoints["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/comments/#list-issue-comments + * @see https://docs.github.com/rest/reference/repos#list-repository-invitations */ - "GET /repos/:owner/:repo/issues/:issue_number/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/comments"]["response"]; + "GET /repos/{owner}/{repo}/invitations": { + parameters: Endpoints["GET /repos/{owner}/{repo}/invitations"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/invitations"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/events/#list-issue-events + * @see https://docs.github.com/rest/reference/issues#list-repository-issues */ - "GET /repos/:owner/:repo/issues/:issue_number/events": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/events"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/events"]["response"]; + "GET /repos/{owner}/{repo}/issues": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/labels/#list-labels-for-an-issue + * @see https://docs.github.com/rest/reference/issues#list-issue-comments-for-a-repository */ - "GET /repos/:owner/:repo/issues/:issue_number/labels": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/labels"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/labels"]["response"]; + "GET /repos/{owner}/{repo}/issues/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-an-issue + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-an-issue-comment */ - "GET /repos/:owner/:repo/issues/:issue_number/reactions": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/reactions"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/reactions"]["response"]; + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/timeline/#list-timeline-events-for-an-issue + * @see https://docs.github.com/rest/reference/issues#list-issue-events-for-a-repository */ - "GET /repos/:owner/:repo/issues/:issue_number/timeline": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/timeline"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/timeline"]["response"]; + "GET /repos/{owner}/{repo}/issues/events": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/events"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/events"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/comments/#list-issue-comments-for-a-repository + * @see https://docs.github.com/rest/reference/issues#list-issue-comments */ - "GET /repos/:owner/:repo/issues/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/comments"]["response"]; + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment + * @see https://docs.github.com/rest/reference/issues#list-issue-events */ - "GET /repos/:owner/:repo/issues/comments/:comment_id/reactions": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/comments/:comment_id/reactions"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/comments/:comment_id/reactions"]["response"]; + "GET /repos/{owner}/{repo}/issues/{issue_number}/events": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/events"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/events"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/events/#list-issue-events-for-a-repository + * @see https://docs.github.com/rest/reference/issues#list-labels-for-an-issue */ - "GET /repos/:owner/:repo/issues/events": { - parameters: Endpoints["GET /repos/:owner/:repo/issues/events"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/issues/events"]["response"]; + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/keys/#list-deploy-keys + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-an-issue */ - "GET /repos/:owner/:repo/keys": { - parameters: Endpoints["GET /repos/:owner/:repo/keys"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/keys"]["response"]; + "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/labels/#list-labels-for-a-repository + * @see https://docs.github.com/rest/reference/issues#list-timeline-events-for-an-issue */ - "GET /repos/:owner/:repo/labels": { - parameters: Endpoints["GET /repos/:owner/:repo/labels"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/labels"]["response"]; + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline": { + parameters: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/#list-repository-languages + * @see https://docs.github.com/rest/reference/repos#list-deploy-keys */ - "GET /repos/:owner/:repo/languages": { - parameters: Endpoints["GET /repos/:owner/:repo/languages"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/languages"]["response"]; + "GET /repos/{owner}/{repo}/keys": { + parameters: Endpoints["GET /repos/{owner}/{repo}/keys"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/keys"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/milestones/#list-milestones + * @see https://docs.github.com/rest/reference/issues#list-labels-for-a-repository */ - "GET /repos/:owner/:repo/milestones": { - parameters: Endpoints["GET /repos/:owner/:repo/milestones"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/milestones"]["response"]; + "GET /repos/{owner}/{repo}/labels": { + parameters: Endpoints["GET /repos/{owner}/{repo}/labels"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/labels"]["response"]; }; /** - * @see https://developer.github.com/v3/issues/labels/#list-labels-for-issues-in-a-milestone + * @see https://docs.github.com/rest/reference/issues#list-milestones */ - "GET /repos/:owner/:repo/milestones/:milestone_number/labels": { - parameters: Endpoints["GET /repos/:owner/:repo/milestones/:milestone_number/labels"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/milestones/:milestone_number/labels"]["response"]; + "GET /repos/{owner}/{repo}/milestones": { + parameters: Endpoints["GET /repos/{owner}/{repo}/milestones"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/milestones"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/notifications/#list-repository-notifications-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/issues#list-labels-for-issues-in-a-milestone */ - "GET /repos/:owner/:repo/notifications": { - parameters: Endpoints["GET /repos/:owner/:repo/notifications"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/notifications"]["response"]; + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels": { + parameters: Endpoints["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/pages/#list-github-pages-builds + * @see https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user */ - "GET /repos/:owner/:repo/pages/builds": { - parameters: Endpoints["GET /repos/:owner/:repo/pages/builds"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pages/builds"]["response"]; + "GET /repos/{owner}/{repo}/notifications": { + parameters: Endpoints["GET /repos/{owner}/{repo}/notifications"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/notifications"]["response"]; }; /** - * @see https://developer.github.com/v3/projects/#list-repository-projects + * @see https://docs.github.com/rest/reference/repos#list-github-pages-builds */ - "GET /repos/:owner/:repo/projects": { - parameters: Endpoints["GET /repos/:owner/:repo/projects"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/projects"]["response"]; + "GET /repos/{owner}/{repo}/pages/builds": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pages/builds"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pages/builds"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/#list-pull-requests + * @see https://docs.github.com/rest/reference/projects#list-repository-projects */ - "GET /repos/:owner/:repo/pulls": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls"]["response"]; + "GET /repos/{owner}/{repo}/projects": { + parameters: Endpoints["GET /repos/{owner}/{repo}/projects"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/projects"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/comments/#list-review-comments-on-a-pull-request + * @see https://docs.github.com/rest/reference/pulls#list-pull-requests */ - "GET /repos/:owner/:repo/pulls/:pull_number/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/comments"]["response"]; + "GET /repos/{owner}/{repo}/pulls": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request + * @see https://docs.github.com/rest/reference/pulls#list-review-comments-in-a-repository */ - "GET /repos/:owner/:repo/pulls/:pull_number/commits": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/commits"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/commits"]["response"]; + "GET /repos/{owner}/{repo}/pulls/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/#list-pull-requests-files + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment */ - "GET /repos/:owner/:repo/pulls/:pull_number/files": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/files"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/files"]["response"]; + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/review_requests/#list-requested-reviewers-for-a-pull-request + * @see https://docs.github.com/rest/reference/pulls#list-review-comments-on-a-pull-request */ - "GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers"]["response"] & { - data: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers"]["response"]["data"]["users"]; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/reviews/#list-reviews-for-a-pull-request + * @see https://docs.github.com/rest/reference/pulls#list-commits-on-a-pull-request */ - "GET /repos/:owner/:repo/pulls/:pull_number/reviews": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews"]["response"]; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"]["response"]; }; /** - * @see https://developer.github.com/v3/pulls/reviews/#list-comments-for-a-pull-request-review + * @see https://docs.github.com/rest/reference/pulls#list-pull-requests-files */ - "GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"]["response"]; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/files": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/pulls#list-requested-reviewers-for-a-pull-request + */ + "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"]["response"] & { + data: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"]["response"]["data"]["users"]; + }; }; /** - * @see https://developer.github.com/v3/pulls/comments/#list-review-comments-in-a-repository + * @see https://docs.github.com/rest/reference/pulls#list-reviews-for-a-pull-request */ - "GET /repos/:owner/:repo/pulls/comments": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/comments"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/comments"]["response"]; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment + * @see https://docs.github.com/rest/reference/pulls#list-comments-for-a-pull-request-review */ - "GET /repos/:owner/:repo/pulls/comments/:comment_id/reactions": { - parameters: Endpoints["GET /repos/:owner/:repo/pulls/comments/:comment_id/reactions"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/pulls/comments/:comment_id/reactions"]["response"]; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments": { + parameters: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/releases/#list-releases + * @see https://docs.github.com/rest/reference/repos#list-releases */ - "GET /repos/:owner/:repo/releases": { - parameters: Endpoints["GET /repos/:owner/:repo/releases"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/releases"]["response"]; + "GET /repos/{owner}/{repo}/releases": { + parameters: Endpoints["GET /repos/{owner}/{repo}/releases"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/releases"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/releases/#list-release-assets + * @see https://docs.github.com/rest/reference/repos#list-release-assets */ - "GET /repos/:owner/:repo/releases/:release_id/assets": { - parameters: Endpoints["GET /repos/:owner/:repo/releases/:release_id/assets"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/releases/:release_id/assets"]["response"]; + "GET /repos/{owner}/{repo}/releases/{release_id}/assets": { + parameters: Endpoints["GET /repos/{owner}/{repo}/releases/{release_id}/assets"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/releases/{release_id}/assets"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/starring/#list-stargazers + * @see https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-a-repository */ - "GET /repos/:owner/:repo/stargazers": { - parameters: Endpoints["GET /repos/:owner/:repo/stargazers"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/stargazers"]["response"]; + "GET /repos/{owner}/{repo}/secret-scanning/alerts": { + parameters: Endpoints["GET /repos/{owner}/{repo}/secret-scanning/alerts"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/secret-scanning/alerts"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/watching/#list-watchers + * @see https://docs.github.com/rest/reference/activity#list-stargazers */ - "GET /repos/:owner/:repo/subscribers": { - parameters: Endpoints["GET /repos/:owner/:repo/subscribers"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/subscribers"]["response"]; + "GET /repos/{owner}/{repo}/stargazers": { + parameters: Endpoints["GET /repos/{owner}/{repo}/stargazers"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/stargazers"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/#list-repository-tags + * @see https://docs.github.com/rest/reference/activity#list-watchers */ - "GET /repos/:owner/:repo/tags": { - parameters: Endpoints["GET /repos/:owner/:repo/tags"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/tags"]["response"]; + "GET /repos/{owner}/{repo}/subscribers": { + parameters: Endpoints["GET /repos/{owner}/{repo}/subscribers"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/subscribers"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/#list-repository-teams + * @see https://docs.github.com/rest/reference/repos#list-repository-tags */ - "GET /repos/:owner/:repo/teams": { - parameters: Endpoints["GET /repos/:owner/:repo/teams"]["parameters"]; - response: Endpoints["GET /repos/:owner/:repo/teams"]["response"]; + "GET /repos/{owner}/{repo}/tags": { + parameters: Endpoints["GET /repos/{owner}/{repo}/tags"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/tags"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/#list-public-repositories + * @see https://docs.github.com/rest/reference/repos#list-repository-teams + */ + "GET /repos/{owner}/{repo}/teams": { + parameters: Endpoints["GET /repos/{owner}/{repo}/teams"]["parameters"]; + response: Endpoints["GET /repos/{owner}/{repo}/teams"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/repos#list-public-repositories */ "GET /repositories": { parameters: Endpoints["GET /repositories"]["parameters"]; response: Endpoints["GET /repositories"]["response"]; }; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#list-provisioned-scim groups-for-an-enterprise + * @see https://docs.github.com/rest/reference/actions#list-environment-secrets */ - "GET /scim/v2/enterprises/:enterprise/Groups": { - parameters: Endpoints["GET /scim/v2/enterprises/:enterprise/Groups"]["parameters"]; - response: Endpoints["GET /scim/v2/enterprises/:enterprise/Groups"]["response"] & { - data: Endpoints["GET /scim/v2/enterprises/:enterprise/Groups"]["response"]["data"]["schemas"]; + "GET /repositories/{repository_id}/environments/{environment_name}/secrets": { + parameters: Endpoints["GET /repositories/{repository_id}/environments/{environment_name}/secrets"]["parameters"]; + response: Endpoints["GET /repositories/{repository_id}/environments/{environment_name}/secrets"]["response"] & { + data: Endpoints["GET /repositories/{repository_id}/environments/{environment_name}/secrets"]["response"]["data"]["secrets"]; }; }; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#list-scim-provisioned-identities-for-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#list-provisioned-scim-groups-for-an-enterprise */ - "GET /scim/v2/enterprises/:enterprise/Users": { - parameters: Endpoints["GET /scim/v2/enterprises/:enterprise/Users"]["parameters"]; - response: Endpoints["GET /scim/v2/enterprises/:enterprise/Users"]["response"] & { - data: Endpoints["GET /scim/v2/enterprises/:enterprise/Users"]["response"]["data"]["schemas"]; + "GET /scim/v2/enterprises/{enterprise}/Groups": { + parameters: Endpoints["GET /scim/v2/enterprises/{enterprise}/Groups"]["parameters"]; + response: Endpoints["GET /scim/v2/enterprises/{enterprise}/Groups"]["response"] & { + data: Endpoints["GET /scim/v2/enterprises/{enterprise}/Groups"]["response"]["data"]["Resources"]; }; }; /** - * @see https://developer.github.com/v3/scim/#list-scim-provisioned-identities + * @see https://docs.github.com/rest/reference/enterprise-admin#list-scim-provisioned-identities-for-an-enterprise */ - "GET /scim/v2/organizations/:org/Users": { - parameters: Endpoints["GET /scim/v2/organizations/:org/Users"]["parameters"]; - response: Endpoints["GET /scim/v2/organizations/:org/Users"]["response"] & { - data: Endpoints["GET /scim/v2/organizations/:org/Users"]["response"]["data"]["schemas"]; + "GET /scim/v2/enterprises/{enterprise}/Users": { + parameters: Endpoints["GET /scim/v2/enterprises/{enterprise}/Users"]["parameters"]; + response: Endpoints["GET /scim/v2/enterprises/{enterprise}/Users"]["response"] & { + data: Endpoints["GET /scim/v2/enterprises/{enterprise}/Users"]["response"]["data"]["Resources"]; }; }; /** - * @see https://developer.github.com/v3/search/#search-code + * @see https://docs.github.com/rest/reference/scim#list-scim-provisioned-identities + */ + "GET /scim/v2/organizations/{org}/Users": { + parameters: Endpoints["GET /scim/v2/organizations/{org}/Users"]["parameters"]; + response: Endpoints["GET /scim/v2/organizations/{org}/Users"]["response"] & { + data: Endpoints["GET /scim/v2/organizations/{org}/Users"]["response"]["data"]["Resources"]; + }; + }; + /** + * @see https://docs.github.com/rest/reference/search#search-code */ "GET /search/code": { parameters: Endpoints["GET /search/code"]["parameters"]; @@ -950,7 +1047,7 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/search/#search-commits + * @see https://docs.github.com/rest/reference/search#search-commits */ "GET /search/commits": { parameters: Endpoints["GET /search/commits"]["parameters"]; @@ -959,7 +1056,7 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/search/#search-issues-and-pull-requests + * @see https://docs.github.com/rest/reference/search#search-issues-and-pull-requests */ "GET /search/issues": { parameters: Endpoints["GET /search/issues"]["parameters"]; @@ -968,7 +1065,7 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/search/#search-labels + * @see https://docs.github.com/rest/reference/search#search-labels */ "GET /search/labels": { parameters: Endpoints["GET /search/labels"]["parameters"]; @@ -977,7 +1074,7 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/search/#search-repositories + * @see https://docs.github.com/rest/reference/search#search-repositories */ "GET /search/repositories": { parameters: Endpoints["GET /search/repositories"]["parameters"]; @@ -986,7 +1083,7 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/search/#search-topics + * @see https://docs.github.com/rest/reference/search#search-topics */ "GET /search/topics": { parameters: Endpoints["GET /search/topics"]["parameters"]; @@ -995,7 +1092,7 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/search/#search-users + * @see https://docs.github.com/rest/reference/search#search-users */ "GET /search/users": { parameters: Endpoints["GET /search/users"]["parameters"]; @@ -1004,114 +1101,114 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy + * @see https://docs.github.com/rest/reference/teams#list-discussions-legacy */ - "GET /teams/:team_id/discussions": { - parameters: Endpoints["GET /teams/:team_id/discussions"]["parameters"]; - response: Endpoints["GET /teams/:team_id/discussions"]["response"]; + "GET /teams/{team_id}/discussions": { + parameters: Endpoints["GET /teams/{team_id}/discussions"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/discussions"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#list-discussion-comments-legacy + * @see https://docs.github.com/rest/reference/teams#list-discussion-comments-legacy */ - "GET /teams/:team_id/discussions/:discussion_number/comments": { - parameters: Endpoints["GET /teams/:team_id/discussions/:discussion_number/comments"]["parameters"]; - response: Endpoints["GET /teams/:team_id/discussions/:discussion_number/comments"]["response"]; + "GET /teams/{team_id}/discussions/{discussion_number}/comments": { + parameters: Endpoints["GET /teams/{team_id}/discussions/{discussion_number}/comments"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/discussions/{discussion_number}/comments"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment-legacy */ - "GET /teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions": { - parameters: Endpoints["GET /teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"]["parameters"]; - response: Endpoints["GET /teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"]["response"]; + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions": { + parameters: Endpoints["GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy + * @see https://docs.github.com/rest/reference/reactions/#list-reactions-for-a-team-discussion-legacy */ - "GET /teams/:team_id/discussions/:discussion_number/reactions": { - parameters: Endpoints["GET /teams/:team_id/discussions/:discussion_number/reactions"]["parameters"]; - response: Endpoints["GET /teams/:team_id/discussions/:discussion_number/reactions"]["response"]; + "GET /teams/{team_id}/discussions/{discussion_number}/reactions": { + parameters: Endpoints["GET /teams/{team_id}/discussions/{discussion_number}/reactions"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/discussions/{discussion_number}/reactions"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy + * @see https://docs.github.com/rest/reference/teams#list-pending-team-invitations-legacy */ - "GET /teams/:team_id/invitations": { - parameters: Endpoints["GET /teams/:team_id/invitations"]["parameters"]; - response: Endpoints["GET /teams/:team_id/invitations"]["response"]; + "GET /teams/{team_id}/invitations": { + parameters: Endpoints["GET /teams/{team_id}/invitations"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/invitations"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/members/#list-team-members-legacy + * @see https://docs.github.com/rest/reference/teams#list-team-members-legacy */ - "GET /teams/:team_id/members": { - parameters: Endpoints["GET /teams/:team_id/members"]["parameters"]; - response: Endpoints["GET /teams/:team_id/members"]["response"]; + "GET /teams/{team_id}/members": { + parameters: Endpoints["GET /teams/{team_id}/members"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/members"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/#list-team-projects-legacy + * @see https://docs.github.com/rest/reference/teams/#list-team-projects-legacy */ - "GET /teams/:team_id/projects": { - parameters: Endpoints["GET /teams/:team_id/projects"]["parameters"]; - response: Endpoints["GET /teams/:team_id/projects"]["response"]; + "GET /teams/{team_id}/projects": { + parameters: Endpoints["GET /teams/{team_id}/projects"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/projects"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/#list-team-repositories-legacy + * @see https://docs.github.com/rest/reference/teams/#list-team-repositories-legacy */ - "GET /teams/:team_id/repos": { - parameters: Endpoints["GET /teams/:team_id/repos"]["parameters"]; - response: Endpoints["GET /teams/:team_id/repos"]["response"]; + "GET /teams/{team_id}/repos": { + parameters: Endpoints["GET /teams/{team_id}/repos"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/repos"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-a-team-legacy + * @see https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team-legacy */ - "GET /teams/:team_id/team-sync/group-mappings": { - parameters: Endpoints["GET /teams/:team_id/team-sync/group-mappings"]["parameters"]; - response: Endpoints["GET /teams/:team_id/team-sync/group-mappings"]["response"] & { - data: Endpoints["GET /teams/:team_id/team-sync/group-mappings"]["response"]["data"]["groups"]; + "GET /teams/{team_id}/team-sync/group-mappings": { + parameters: Endpoints["GET /teams/{team_id}/team-sync/group-mappings"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/team-sync/group-mappings"]["response"] & { + data: Endpoints["GET /teams/{team_id}/team-sync/group-mappings"]["response"]["data"]["groups"]; }; }; /** - * @see https://developer.github.com/v3/teams/#list-child-teams-legacy + * @see https://docs.github.com/rest/reference/teams/#list-child-teams-legacy */ - "GET /teams/:team_id/teams": { - parameters: Endpoints["GET /teams/:team_id/teams"]["parameters"]; - response: Endpoints["GET /teams/:team_id/teams"]["response"]; + "GET /teams/{team_id}/teams": { + parameters: Endpoints["GET /teams/{team_id}/teams"]["parameters"]; + response: Endpoints["GET /teams/{team_id}/teams"]["response"]; }; /** - * @see https://developer.github.com/v3/users/blocking/#list-users-blocked-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-users-blocked-by-the-authenticated-user */ "GET /user/blocks": { parameters: Endpoints["GET /user/blocks"]["parameters"]; response: Endpoints["GET /user/blocks"]["response"]; }; /** - * @see https://developer.github.com/v3/users/emails/#list-email-addresses-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-email-addresses-for-the-authenticated-user */ "GET /user/emails": { parameters: Endpoints["GET /user/emails"]["parameters"]; response: Endpoints["GET /user/emails"]["response"]; }; /** - * @see https://developer.github.com/v3/users/followers/#list-followers-of-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-followers-of-the-authenticated-user */ "GET /user/followers": { parameters: Endpoints["GET /user/followers"]["parameters"]; response: Endpoints["GET /user/followers"]["response"]; }; /** - * @see https://developer.github.com/v3/users/followers/#list-the-people-the-authenticated-user-follows + * @see https://docs.github.com/rest/reference/users#list-the-people-the-authenticated-user-follows */ "GET /user/following": { parameters: Endpoints["GET /user/following"]["parameters"]; response: Endpoints["GET /user/following"]["response"]; }; /** - * @see https://developer.github.com/v3/users/gpg_keys/#list-gpg-keys-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-gpg-keys-for-the-authenticated-user */ "GET /user/gpg_keys": { parameters: Endpoints["GET /user/gpg_keys"]["parameters"]; response: Endpoints["GET /user/gpg_keys"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/installations/#list-app-installations-accessible-to-the-user-access-token + * @see https://docs.github.com/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token */ "GET /user/installations": { parameters: Endpoints["GET /user/installations"]["parameters"]; @@ -1120,173 +1217,223 @@ export interface PaginatingEndpoints { }; }; /** - * @see https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-access-token + * @see https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-user-access-token */ - "GET /user/installations/:installation_id/repositories": { - parameters: Endpoints["GET /user/installations/:installation_id/repositories"]["parameters"]; - response: Endpoints["GET /user/installations/:installation_id/repositories"]["response"] & { - data: Endpoints["GET /user/installations/:installation_id/repositories"]["response"]["data"]["repositories"]; + "GET /user/installations/{installation_id}/repositories": { + parameters: Endpoints["GET /user/installations/{installation_id}/repositories"]["parameters"]; + response: Endpoints["GET /user/installations/{installation_id}/repositories"]["response"] & { + data: Endpoints["GET /user/installations/{installation_id}/repositories"]["response"]["data"]["repositories"]; }; }; /** - * @see https://developer.github.com/v3/issues/#list-user-account-issues-assigned-to-the-authenticated-user + * @see https://docs.github.com/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user */ "GET /user/issues": { parameters: Endpoints["GET /user/issues"]["parameters"]; response: Endpoints["GET /user/issues"]["response"]; }; /** - * @see https://developer.github.com/v3/users/keys/#list-public-ssh-keys-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-public-ssh-keys-for-the-authenticated-user */ "GET /user/keys": { parameters: Endpoints["GET /user/keys"]["parameters"]; response: Endpoints["GET /user/keys"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-subscriptions-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user */ "GET /user/marketplace_purchases": { parameters: Endpoints["GET /user/marketplace_purchases"]["parameters"]; response: Endpoints["GET /user/marketplace_purchases"]["response"]; }; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-subscriptions-for-the-authenticated-user-stubbed + * @see https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user-stubbed */ "GET /user/marketplace_purchases/stubbed": { parameters: Endpoints["GET /user/marketplace_purchases/stubbed"]["parameters"]; response: Endpoints["GET /user/marketplace_purchases/stubbed"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/members/#list-organization-memberships-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/orgs#list-organization-memberships-for-the-authenticated-user */ "GET /user/memberships/orgs": { parameters: Endpoints["GET /user/memberships/orgs"]["parameters"]; response: Endpoints["GET /user/memberships/orgs"]["response"]; }; /** - * @see https://developer.github.com/v3/migrations/users/#list-user-migrations + * @see https://docs.github.com/rest/reference/migrations#list-user-migrations */ "GET /user/migrations": { parameters: Endpoints["GET /user/migrations"]["parameters"]; response: Endpoints["GET /user/migrations"]["response"]; }; /** - * @see https://developer.github.com/v3/migrations/users/#list-repositories-for-a-user-migration + * @see https://docs.github.com/rest/reference/migrations#list-repositories-for-a-user-migration */ - "GET /user/migrations/:migration_id/repositories": { - parameters: Endpoints["GET /user/migrations/:migration_id/repositories"]["parameters"]; - response: Endpoints["GET /user/migrations/:migration_id/repositories"]["response"]; + "GET /user/migrations/{migration_id}/repositories": { + parameters: Endpoints["GET /user/migrations/{migration_id}/repositories"]["parameters"]; + response: Endpoints["GET /user/migrations/{migration_id}/repositories"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/#list-organizations-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user */ "GET /user/orgs": { parameters: Endpoints["GET /user/orgs"]["parameters"]; response: Endpoints["GET /user/orgs"]["response"]; }; /** - * @see https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-public-email-addresses-for-the-authenticated-user */ "GET /user/public_emails": { parameters: Endpoints["GET /user/public_emails"]["parameters"]; response: Endpoints["GET /user/public_emails"]["response"]; }; /** - * @see https://developer.github.com/v3/repos/invitations/#list-repository-invitations-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#list-repositories-for-the-authenticated-user + */ + "GET /user/repos": { + parameters: Endpoints["GET /user/repos"]["parameters"]; + response: Endpoints["GET /user/repos"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/repos#list-repository-invitations-for-the-authenticated-user */ "GET /user/repository_invitations": { parameters: Endpoints["GET /user/repository_invitations"]["parameters"]; response: Endpoints["GET /user/repository_invitations"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/starring/#list-repositories-starred-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/activity#list-repositories-starred-by-the-authenticated-user */ "GET /user/starred": { parameters: Endpoints["GET /user/starred"]["parameters"]; response: Endpoints["GET /user/starred"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/watching/#list-repositories-watched-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/activity#list-repositories-watched-by-the-authenticated-user */ "GET /user/subscriptions": { parameters: Endpoints["GET /user/subscriptions"]["parameters"]; response: Endpoints["GET /user/subscriptions"]["response"]; }; /** - * @see https://developer.github.com/v3/teams/#list-teams-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/teams#list-teams-for-the-authenticated-user */ "GET /user/teams": { parameters: Endpoints["GET /user/teams"]["parameters"]; response: Endpoints["GET /user/teams"]["response"]; }; /** - * @see https://developer.github.com/v3/users/#list-users + * @see https://docs.github.com/rest/reference/users#list-users */ "GET /users": { parameters: Endpoints["GET /users"]["parameters"]; response: Endpoints["GET /users"]["response"]; }; /** - * @see https://developer.github.com/v3/users/followers/#list-followers-of-a-user + * @see https://docs.github.com/rest/reference/activity#list-events-for-the-authenticated-user + */ + "GET /users/{username}/events": { + parameters: Endpoints["GET /users/{username}/events"]["parameters"]; + response: Endpoints["GET /users/{username}/events"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/activity#list-organization-events-for-the-authenticated-user + */ + "GET /users/{username}/events/orgs/{org}": { + parameters: Endpoints["GET /users/{username}/events/orgs/{org}"]["parameters"]; + response: Endpoints["GET /users/{username}/events/orgs/{org}"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/activity#list-public-events-for-a-user + */ + "GET /users/{username}/events/public": { + parameters: Endpoints["GET /users/{username}/events/public"]["parameters"]; + response: Endpoints["GET /users/{username}/events/public"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/users#list-followers-of-a-user + */ + "GET /users/{username}/followers": { + parameters: Endpoints["GET /users/{username}/followers"]["parameters"]; + response: Endpoints["GET /users/{username}/followers"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/users#list-the-people-a-user-follows + */ + "GET /users/{username}/following": { + parameters: Endpoints["GET /users/{username}/following"]["parameters"]; + response: Endpoints["GET /users/{username}/following"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/gists#list-gists-for-a-user + */ + "GET /users/{username}/gists": { + parameters: Endpoints["GET /users/{username}/gists"]["parameters"]; + response: Endpoints["GET /users/{username}/gists"]["response"]; + }; + /** + * @see https://docs.github.com/rest/reference/users#list-gpg-keys-for-a-user */ - "GET /users/:username/followers": { - parameters: Endpoints["GET /users/:username/followers"]["parameters"]; - response: Endpoints["GET /users/:username/followers"]["response"]; + "GET /users/{username}/gpg_keys": { + parameters: Endpoints["GET /users/{username}/gpg_keys"]["parameters"]; + response: Endpoints["GET /users/{username}/gpg_keys"]["response"]; }; /** - * @see https://developer.github.com/v3/users/followers/#list-the-people-a-user-follows + * @see https://docs.github.com/rest/reference/users#list-public-keys-for-a-user */ - "GET /users/:username/following": { - parameters: Endpoints["GET /users/:username/following"]["parameters"]; - response: Endpoints["GET /users/:username/following"]["response"]; + "GET /users/{username}/keys": { + parameters: Endpoints["GET /users/{username}/keys"]["parameters"]; + response: Endpoints["GET /users/{username}/keys"]["response"]; }; /** - * @see https://developer.github.com/v3/gists/#list-gists-for-a-user + * @see https://docs.github.com/rest/reference/orgs#list-organizations-for-a-user */ - "GET /users/:username/gists": { - parameters: Endpoints["GET /users/:username/gists"]["parameters"]; - response: Endpoints["GET /users/:username/gists"]["response"]; + "GET /users/{username}/orgs": { + parameters: Endpoints["GET /users/{username}/orgs"]["parameters"]; + response: Endpoints["GET /users/{username}/orgs"]["response"]; }; /** - * @see https://developer.github.com/v3/users/gpg_keys/#list-gpg-keys-for-a-user + * @see https://docs.github.com/rest/reference/projects#list-user-projects */ - "GET /users/:username/gpg_keys": { - parameters: Endpoints["GET /users/:username/gpg_keys"]["parameters"]; - response: Endpoints["GET /users/:username/gpg_keys"]["response"]; + "GET /users/{username}/projects": { + parameters: Endpoints["GET /users/{username}/projects"]["parameters"]; + response: Endpoints["GET /users/{username}/projects"]["response"]; }; /** - * @see https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user + * @see https://docs.github.com/rest/reference/activity#list-events-received-by-the-authenticated-user */ - "GET /users/:username/keys": { - parameters: Endpoints["GET /users/:username/keys"]["parameters"]; - response: Endpoints["GET /users/:username/keys"]["response"]; + "GET /users/{username}/received_events": { + parameters: Endpoints["GET /users/{username}/received_events"]["parameters"]; + response: Endpoints["GET /users/{username}/received_events"]["response"]; }; /** - * @see https://developer.github.com/v3/orgs/#list-organizations-for-a-user + * @see https://docs.github.com/rest/reference/activity#list-public-events-received-by-a-user */ - "GET /users/:username/orgs": { - parameters: Endpoints["GET /users/:username/orgs"]["parameters"]; - response: Endpoints["GET /users/:username/orgs"]["response"]; + "GET /users/{username}/received_events/public": { + parameters: Endpoints["GET /users/{username}/received_events/public"]["parameters"]; + response: Endpoints["GET /users/{username}/received_events/public"]["response"]; }; /** - * @see https://developer.github.com/v3/projects/#list-user-projects + * @see https://docs.github.com/rest/reference/repos#list-repositories-for-a-user */ - "GET /users/:username/projects": { - parameters: Endpoints["GET /users/:username/projects"]["parameters"]; - response: Endpoints["GET /users/:username/projects"]["response"]; + "GET /users/{username}/repos": { + parameters: Endpoints["GET /users/{username}/repos"]["parameters"]; + response: Endpoints["GET /users/{username}/repos"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/starring/#list-repositories-starred-by-a-user + * @see https://docs.github.com/rest/reference/activity#list-repositories-starred-by-a-user */ - "GET /users/:username/starred": { - parameters: Endpoints["GET /users/:username/starred"]["parameters"]; - response: Endpoints["GET /users/:username/starred"]["response"]; + "GET /users/{username}/starred": { + parameters: Endpoints["GET /users/{username}/starred"]["parameters"]; + response: Endpoints["GET /users/{username}/starred"]["response"]; }; /** - * @see https://developer.github.com/v3/activity/watching/#list-repositories-watched-by-a-user + * @see https://docs.github.com/rest/reference/activity#list-repositories-watched-by-a-user */ - "GET /users/:username/subscriptions": { - parameters: Endpoints["GET /users/:username/subscriptions"]["parameters"]; - response: Endpoints["GET /users/:username/subscriptions"]["response"]; + "GET /users/{username}/subscriptions": { + parameters: Endpoints["GET /users/{username}/subscriptions"]["parameters"]; + response: Endpoints["GET /users/{username}/subscriptions"]["response"]; }; } +export declare const paginatingEndpoints: (keyof PaginatingEndpoints)[]; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts index 64f9c46..4d84aae 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts @@ -1,6 +1,9 @@ +import { Octokit } from "@octokit/core"; import { PaginateInterface } from "./types"; export { PaginateInterface } from "./types"; -import { Octokit } from "@octokit/core"; +export { PaginatingEndpoints } from "./types"; +export { composePaginateRest } from "./compose-paginate"; +export { isPaginatingEndpoint, paginatingEndpoints, } from "./paginating-endpoints"; /** * @param octokit Octokit instance * @param options Options passed to Octokit constructor diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts index 4df3cce..931d530 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts @@ -1,11 +1,20 @@ import { Octokit } from "@octokit/core"; -import { RequestInterface, OctokitResponse, RequestParameters, Route } from "./types"; +import { RequestInterface, RequestParameters, Route } from "./types"; export declare function iterator(octokit: Octokit, route: Route | RequestInterface, parameters?: RequestParameters): { [Symbol.asyncIterator]: () => { next(): Promise<{ done: boolean; - }> | Promise<{ - value: OctokitResponse; + value?: undefined; + } | { + value: import("@octokit/types/dist-types/OctokitResponse").OctokitResponse; + done?: undefined; + } | { + value: { + status: number; + headers: {}; + data: never[]; + }; + done?: undefined; }>; }; }; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/paginating-endpoints.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/paginating-endpoints.d.ts new file mode 100644 index 0000000..f6a4d7b --- /dev/null +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/paginating-endpoints.d.ts @@ -0,0 +1,3 @@ +import { PaginatingEndpoints } from "./generated/paginating-endpoints"; +export { paginatingEndpoints } from "./generated/paginating-endpoints"; +export declare function isPaginatingEndpoint(arg: unknown): arg is keyof PaginatingEndpoints; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts index d4a239e..0634907 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts @@ -1,5 +1,7 @@ +import { Octokit } from "@octokit/core"; import * as OctokitTypes from "@octokit/types"; export { EndpointOptions, RequestInterface, OctokitResponse, RequestParameters, Route, } from "@octokit/types"; +export { PaginatingEndpoints } from "./generated/paginating-endpoints"; import { PaginatingEndpoints } from "./generated/paginating-endpoints"; declare type KnownKeys = Extract<{ [K in keyof T]: string extends K ? never : number extends K ? never : K; @@ -18,50 +20,51 @@ declare type GetResultsType = T extends { declare type NormalizeResponse = T & { data: GetResultsType; }; -export interface MapFunction { - (response: OctokitTypes.OctokitResponse>, done: () => void): R[]; +declare type DataType = "data" extends keyof T ? T["data"] : unknown; +export interface MapFunction>, M = unknown[]> { + (response: T, done: () => void): M; } export declare type PaginationResults = T[]; export interface PaginateInterface { /** * Paginate a request using endpoint options and map each response to a custom array * - * @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + * @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. * @param {function} mapFn Optional method to map each response to a custom array */ - (options: OctokitTypes.EndpointOptions, mapFn: MapFunction): Promise>; + (options: OctokitTypes.EndpointOptions, mapFn: MapFunction>, M[]>): Promise>; /** * Paginate a request using endpoint options * - * @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + * @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (options: OctokitTypes.EndpointOptions): Promise>; /** * Paginate a request using a known endpoint route string and map each response to a custom array * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {function} mapFn Optional method to map each response to a custom array */ - (route: R, mapFn: (response: PaginatingEndpoints[R]["response"], done: () => void) => MR): Promise; + (route: R, mapFn: MapFunction): Promise; /** * Paginate a request using a known endpoint route string and parameters, and map each response to a custom array * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. * @param {function} mapFn Optional method to map each response to a custom array */ - (route: R, parameters: PaginatingEndpoints[R]["parameters"], mapFn: (response: PaginatingEndpoints[R]["response"], done: () => void) => MR): Promise; + (route: R, parameters: PaginatingEndpoints[R]["parameters"], mapFn: MapFunction): Promise; /** * Paginate a request using an known endpoint route string * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ - (route: R, parameters?: PaginatingEndpoints[R]["parameters"]): Promise; + (route: R, parameters?: PaginatingEndpoints[R]["parameters"]): Promise>; /** * Paginate a request using an unknown endpoint route string * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): Promise; @@ -71,7 +74,7 @@ export interface PaginateInterface { * @param {string} request Request method (`octokit.request` or `@octokit/request`) * @param {function} mapFn? Optional method to map each response to a custom array */ - (request: R, mapFn: (response: NormalizeResponse>, done: () => void) => MR): Promise; + (request: R, mapFn: MapFunction>, M>): Promise; /** * Paginate a request using an endpoint method, parameters, and a map function * @@ -79,7 +82,7 @@ export interface PaginateInterface { * @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. * @param {function} mapFn? Optional method to map each response to a custom array */ - (request: R, parameters: Parameters[0], mapFn: (response: NormalizeResponse>, done?: () => void) => MR): Promise; + (request: R, parameters: Parameters[0], mapFn: MapFunction>, M>): Promise; /** * Paginate a request using an endpoint method and parameters * @@ -92,22 +95,22 @@ export interface PaginateInterface { * Get an async iterator to paginate a request using endpoint options * * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of - * @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + * @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ - (EndpointOptions: OctokitTypes.EndpointOptions): AsyncIterableIterator>>; + (options: OctokitTypes.EndpointOptions): AsyncIterableIterator>>; /** * Get an async iterator to paginate a request using a known endpoint route string and optional parameters * * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ - (route: R, parameters?: PaginatingEndpoints[R]["parameters"]): AsyncIterableIterator>; + (route: R, parameters?: PaginatingEndpoints[R]["parameters"]): AsyncIterableIterator>>; /** * Get an async iterator to paginate a request using an unknown endpoint route string and optional parameters * * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): AsyncIterableIterator>>; @@ -121,3 +124,119 @@ export interface PaginateInterface { (request: R, parameters?: Parameters[0]): AsyncIterableIterator>>; }; } +export interface ComposePaginateInterface { + /** + * Paginate a request using endpoint options and map each response to a custom array + * + * @param {object} octokit Octokit instance + * @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + * @param {function} mapFn Optional method to map each response to a custom array + */ + (octokit: Octokit, options: OctokitTypes.EndpointOptions, mapFn: MapFunction>, M[]>): Promise>; + /** + * Paginate a request using endpoint options + * + * @param {object} octokit Octokit instance + * @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, options: OctokitTypes.EndpointOptions): Promise>; + /** + * Paginate a request using a known endpoint route string and map each response to a custom array + * + * @param {object} octokit Octokit instance + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` + * @param {function} mapFn Optional method to map each response to a custom array + */ + (octokit: Octokit, route: R, mapFn: MapFunction): Promise; + /** + * Paginate a request using a known endpoint route string and parameters, and map each response to a custom array + * + * @param {object} octokit Octokit instance + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` + * @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + * @param {function} mapFn Optional method to map each response to a custom array + */ + (octokit: Octokit, route: R, parameters: PaginatingEndpoints[R]["parameters"], mapFn: MapFunction): Promise; + /** + * Paginate a request using an known endpoint route string + * + * @param {object} octokit Octokit instance + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` + * @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, route: R, parameters?: PaginatingEndpoints[R]["parameters"]): Promise>; + /** + * Paginate a request using an unknown endpoint route string + * + * @param {object} octokit Octokit instance + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` + * @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): Promise; + /** + * Paginate a request using an endpoint method and a map function + * + * @param {object} octokit Octokit instance + * @param {string} request Request method (`octokit.request` or `@octokit/request`) + * @param {function} mapFn? Optional method to map each response to a custom array + */ + (octokit: Octokit, request: R, mapFn: MapFunction>, M>): Promise; + /** + * Paginate a request using an endpoint method, parameters, and a map function + * + * @param {object} octokit Octokit instance + * @param {string} request Request method (`octokit.request` or `@octokit/request`) + * @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + * @param {function} mapFn? Optional method to map each response to a custom array + */ + (octokit: Octokit, request: R, parameters: Parameters[0], mapFn: MapFunction>, M>): Promise; + /** + * Paginate a request using an endpoint method and parameters + * + * @param {object} octokit Octokit instance + * @param {string} request Request method (`octokit.request` or `@octokit/request`) + * @param {object} parameters? URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, request: R, parameters?: Parameters[0]): Promise>["data"]>; + iterator: { + /** + * Get an async iterator to paginate a request using endpoint options + * + * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of + * + * @param {object} octokit Octokit instance + * @param {object} options Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, options: OctokitTypes.EndpointOptions): AsyncIterableIterator>>; + /** + * Get an async iterator to paginate a request using a known endpoint route string and optional parameters + * + * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of + * + * @param {object} octokit Octokit instance + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` + * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, route: R, parameters?: PaginatingEndpoints[R]["parameters"]): AsyncIterableIterator>>; + /** + * Get an async iterator to paginate a request using an unknown endpoint route string and optional parameters + * + * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of + * + * @param {object} octokit Octokit instance + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` + * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, route: R, parameters?: R extends keyof PaginatingEndpoints ? PaginatingEndpoints[R]["parameters"] : OctokitTypes.RequestParameters): AsyncIterableIterator>>; + /** + * Get an async iterator to paginate a request using a request method and optional parameters + * + * @see {link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} for await...of + * + * @param {object} octokit Octokit instance + * @param {string} request `@octokit/request` or `octokit.request` method + * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. + */ + (octokit: Octokit, request: R, parameters?: Parameters[0]): AsyncIterableIterator>>; + }; +} diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts b/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts index d1c6894..9fa1bdc 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts +++ b/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "2.4.0"; +export declare const VERSION = "2.15.1"; diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js b/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js index 9fb8322..47868fb 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js +++ b/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js @@ -1,4 +1,4 @@ -const VERSION = "2.4.0"; +const VERSION = "2.15.1"; /** * Some “list” response that can be paginated have a different response structure @@ -17,6 +17,13 @@ const VERSION = "2.4.0"; * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref */ function normalizePaginatedListResponse(response) { + // endpoints can respond with 204 if repository is empty + if (!response.data) { + return { + ...response, + data: [], + }; + } const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); if (!responseNeedsNormalization) return response; @@ -51,19 +58,30 @@ function iterator(octokit, route, parameters) { let url = options.url; return { [Symbol.asyncIterator]: () => ({ - next() { - if (!url) { - return Promise.resolve({ done: true }); - } - return requestMethod({ method, url, headers }) - .then(normalizePaginatedListResponse) - .then((response) => { + async next() { + if (!url) + return { done: true }; + try { + const response = await requestMethod({ method, url, headers }); + const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: // '; rel="next", ; rel="last"' // sets `url` to undefined if "next" URL is not present or `link` header is not set - url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { value: response }; - }); + url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { value: normalizedResponse }; + } + catch (error) { + if (error.status !== 409) + throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [], + }, + }; + } }, }), }; @@ -93,6 +111,215 @@ function gather(octokit, results, iterator, mapFn) { }); } +const composePaginateRest = Object.assign(paginate, { + iterator, +}); + +const paginatingEndpoints = [ + "GET /app/hook/deliveries", + "GET /app/installations", + "GET /applications/grants", + "GET /authorizations", + "GET /enterprises/{enterprise}/actions/permissions/organizations", + "GET /enterprises/{enterprise}/actions/runner-groups", + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", + "GET /enterprises/{enterprise}/actions/runners", + "GET /enterprises/{enterprise}/actions/runners/downloads", + "GET /events", + "GET /gists", + "GET /gists/public", + "GET /gists/starred", + "GET /gists/{gist_id}/comments", + "GET /gists/{gist_id}/commits", + "GET /gists/{gist_id}/forks", + "GET /installation/repositories", + "GET /issues", + "GET /marketplace_listing/plans", + "GET /marketplace_listing/plans/{plan_id}/accounts", + "GET /marketplace_listing/stubbed/plans", + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", + "GET /networks/{owner}/{repo}/events", + "GET /notifications", + "GET /organizations", + "GET /orgs/{org}/actions/permissions/repositories", + "GET /orgs/{org}/actions/runner-groups", + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", + "GET /orgs/{org}/actions/runners", + "GET /orgs/{org}/actions/runners/downloads", + "GET /orgs/{org}/actions/secrets", + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", + "GET /orgs/{org}/blocks", + "GET /orgs/{org}/credential-authorizations", + "GET /orgs/{org}/events", + "GET /orgs/{org}/failed_invitations", + "GET /orgs/{org}/hooks", + "GET /orgs/{org}/hooks/{hook_id}/deliveries", + "GET /orgs/{org}/installations", + "GET /orgs/{org}/invitations", + "GET /orgs/{org}/invitations/{invitation_id}/teams", + "GET /orgs/{org}/issues", + "GET /orgs/{org}/members", + "GET /orgs/{org}/migrations", + "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/outside_collaborators", + "GET /orgs/{org}/projects", + "GET /orgs/{org}/public_members", + "GET /orgs/{org}/repos", + "GET /orgs/{org}/team-sync/groups", + "GET /orgs/{org}/teams", + "GET /orgs/{org}/teams/{team_slug}/discussions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", + "GET /orgs/{org}/teams/{team_slug}/invitations", + "GET /orgs/{org}/teams/{team_slug}/members", + "GET /orgs/{org}/teams/{team_slug}/projects", + "GET /orgs/{org}/teams/{team_slug}/repos", + "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings", + "GET /orgs/{org}/teams/{team_slug}/teams", + "GET /projects/columns/{column_id}/cards", + "GET /projects/{project_id}/collaborators", + "GET /projects/{project_id}/columns", + "GET /repos/{owner}/{repo}/actions/artifacts", + "GET /repos/{owner}/{repo}/actions/runners", + "GET /repos/{owner}/{repo}/actions/runners/downloads", + "GET /repos/{owner}/{repo}/actions/runs", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", + "GET /repos/{owner}/{repo}/actions/secrets", + "GET /repos/{owner}/{repo}/actions/workflows", + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", + "GET /repos/{owner}/{repo}/assignees", + "GET /repos/{owner}/{repo}/autolinks", + "GET /repos/{owner}/{repo}/branches", + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", + "GET /repos/{owner}/{repo}/code-scanning/alerts", + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + "GET /repos/{owner}/{repo}/code-scanning/analyses", + "GET /repos/{owner}/{repo}/collaborators", + "GET /repos/{owner}/{repo}/comments", + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/commits", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", + "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", + "GET /repos/{owner}/{repo}/commits/{ref}/statuses", + "GET /repos/{owner}/{repo}/contributors", + "GET /repos/{owner}/{repo}/deployments", + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", + "GET /repos/{owner}/{repo}/events", + "GET /repos/{owner}/{repo}/forks", + "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", + "GET /repos/{owner}/{repo}/hooks", + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", + "GET /repos/{owner}/{repo}/invitations", + "GET /repos/{owner}/{repo}/issues", + "GET /repos/{owner}/{repo}/issues/comments", + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/issues/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", + "GET /repos/{owner}/{repo}/issues/{issue_number}/events", + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", + "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", + "GET /repos/{owner}/{repo}/keys", + "GET /repos/{owner}/{repo}/labels", + "GET /repos/{owner}/{repo}/milestones", + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", + "GET /repos/{owner}/{repo}/notifications", + "GET /repos/{owner}/{repo}/pages/builds", + "GET /repos/{owner}/{repo}/projects", + "GET /repos/{owner}/{repo}/pulls", + "GET /repos/{owner}/{repo}/pulls/comments", + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", + "GET /repos/{owner}/{repo}/releases", + "GET /repos/{owner}/{repo}/releases/{release_id}/assets", + "GET /repos/{owner}/{repo}/secret-scanning/alerts", + "GET /repos/{owner}/{repo}/stargazers", + "GET /repos/{owner}/{repo}/subscribers", + "GET /repos/{owner}/{repo}/tags", + "GET /repos/{owner}/{repo}/teams", + "GET /repositories", + "GET /repositories/{repository_id}/environments/{environment_name}/secrets", + "GET /scim/v2/enterprises/{enterprise}/Groups", + "GET /scim/v2/enterprises/{enterprise}/Users", + "GET /scim/v2/organizations/{org}/Users", + "GET /search/code", + "GET /search/commits", + "GET /search/issues", + "GET /search/labels", + "GET /search/repositories", + "GET /search/topics", + "GET /search/users", + "GET /teams/{team_id}/discussions", + "GET /teams/{team_id}/discussions/{discussion_number}/comments", + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", + "GET /teams/{team_id}/discussions/{discussion_number}/reactions", + "GET /teams/{team_id}/invitations", + "GET /teams/{team_id}/members", + "GET /teams/{team_id}/projects", + "GET /teams/{team_id}/repos", + "GET /teams/{team_id}/team-sync/group-mappings", + "GET /teams/{team_id}/teams", + "GET /user/blocks", + "GET /user/emails", + "GET /user/followers", + "GET /user/following", + "GET /user/gpg_keys", + "GET /user/installations", + "GET /user/installations/{installation_id}/repositories", + "GET /user/issues", + "GET /user/keys", + "GET /user/marketplace_purchases", + "GET /user/marketplace_purchases/stubbed", + "GET /user/memberships/orgs", + "GET /user/migrations", + "GET /user/migrations/{migration_id}/repositories", + "GET /user/orgs", + "GET /user/public_emails", + "GET /user/repos", + "GET /user/repository_invitations", + "GET /user/starred", + "GET /user/subscriptions", + "GET /user/teams", + "GET /users", + "GET /users/{username}/events", + "GET /users/{username}/events/orgs/{org}", + "GET /users/{username}/events/public", + "GET /users/{username}/followers", + "GET /users/{username}/following", + "GET /users/{username}/gists", + "GET /users/{username}/gpg_keys", + "GET /users/{username}/keys", + "GET /users/{username}/orgs", + "GET /users/{username}/projects", + "GET /users/{username}/received_events", + "GET /users/{username}/received_events/public", + "GET /users/{username}/repos", + "GET /users/{username}/starred", + "GET /users/{username}/subscriptions", +]; + +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } + else { + return false; + } +} + /** * @param octokit Octokit instance * @param options Options passed to Octokit constructor @@ -106,5 +333,5 @@ function paginateRest(octokit) { } paginateRest.VERSION = VERSION; -export { paginateRest }; +export { composePaginateRest, isPaginatingEndpoint, paginateRest, paginatingEndpoints }; //# sourceMappingURL=index.js.map diff --git a/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map b/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map index 790f068..d94a91a 100644 --- a/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map +++ b/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/normalize-paginated-list-response.js","../dist-src/iterator.js","../dist-src/paginate.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"2.4.0\";\n","/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nexport function normalizePaginatedListResponse(response) {\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization)\n return response;\n // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n","import { normalizePaginatedListResponse } from \"./normalize-paginated-list-response\";\nexport function iterator(octokit, route, parameters) {\n const options = typeof route === \"function\"\n ? route.endpoint(parameters)\n : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n next() {\n if (!url) {\n return Promise.resolve({ done: true });\n }\n return requestMethod({ method, url, headers })\n .then(normalizePaginatedListResponse)\n .then((response) => {\n // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n url = ((response.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return { value: response };\n });\n },\n }),\n };\n}\n","import { iterator } from \"./iterator\";\nexport function paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then((result) => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator, mapFn);\n });\n}\n","import { VERSION } from \"./version\";\nimport { paginate } from \"./paginate\";\nimport { iterator } from \"./iterator\";\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nexport function paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit),\n }),\n };\n}\npaginateRest.VERSION = VERSION;\n"],"names":[],"mappings":"AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACA1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AAAO,SAAS,8BAA8B,CAAC,QAAQ,EAAE;AACzD,IAAI,MAAM,0BAA0B,GAAG,aAAa,IAAI,QAAQ,CAAC,IAAI,IAAI,EAAE,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnG,IAAI,IAAI,CAAC,0BAA0B;AACnC,QAAQ,OAAO,QAAQ,CAAC;AACxB;AACA;AACA,IAAI,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;AAC/D,IAAI,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;AACnE,IAAI,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;AACjD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;AAC5C,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;AAC9C,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;AACrC,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,IAAI,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC7C,IAAI,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB,IAAI,IAAI,OAAO,iBAAiB,KAAK,WAAW,EAAE;AAClD,QAAQ,QAAQ,CAAC,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;AAC7D,KAAK;AACL,IAAI,IAAI,OAAO,mBAAmB,KAAK,WAAW,EAAE;AACpD,QAAQ,QAAQ,CAAC,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;AACjE,KAAK;AACL,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;AAC3C,IAAI,OAAO,QAAQ,CAAC;AACpB,CAAC;;ACtCM,SAAS,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE;AACrD,IAAI,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,UAAU;AAC/C,UAAU,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;AACpC,UAAU,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AACtD,IAAI,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;AAChF,IAAI,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAClC,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACpC,IAAI,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AAC1B,IAAI,OAAO;AACX,QAAQ,CAAC,MAAM,CAAC,aAAa,GAAG,OAAO;AACvC,YAAY,IAAI,GAAG;AACnB,gBAAgB,IAAI,CAAC,GAAG,EAAE;AAC1B,oBAAoB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,iBAAiB;AACjB,gBAAgB,OAAO,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC9D,qBAAqB,IAAI,CAAC,8BAA8B,CAAC;AACzD,qBAAqB,IAAI,CAAC,CAAC,QAAQ,KAAK;AACxC;AACA;AACA;AACA,oBAAoB,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,yBAAyB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AACpG,oBAAoB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC/C,iBAAiB,CAAC,CAAC;AACnB,aAAa;AACb,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC;;AC1BM,SAAS,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;AAC5D,IAAI,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;AAC1C,QAAQ,KAAK,GAAG,UAAU,CAAC;AAC3B,QAAQ,UAAU,GAAG,SAAS,CAAC;AAC/B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACpG,CAAC;AACD,SAAS,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE;AACnD,IAAI,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK;AAC5C,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE;AACzB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,IAAI,SAAS,GAAG,KAAK,CAAC;AAC9B,QAAQ,SAAS,IAAI,GAAG;AACxB,YAAY,SAAS,GAAG,IAAI,CAAC;AAC7B,SAAS;AACT,QAAQ,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACxF,QAAQ,IAAI,SAAS,EAAE;AACvB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,OAAO,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACzD,KAAK,CAAC,CAAC;AACP,CAAC;;ACpBD;AACA;AACA;AACA;AACA,AAAO,SAAS,YAAY,CAAC,OAAO,EAAE;AACtC,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;AAC9D,YAAY,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;AAClD,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC;AACD,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/normalize-paginated-list-response.js","../dist-src/iterator.js","../dist-src/paginate.js","../dist-src/compose-paginate.js","../dist-src/generated/paginating-endpoints.js","../dist-src/paginating-endpoints.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"2.15.1\";\n","/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nexport function normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return {\n ...response,\n data: [],\n };\n }\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization)\n return response;\n // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n response.data.total_count = totalCount;\n return response;\n}\n","import { normalizePaginatedListResponse } from \"./normalize-paginated-list-response\";\nexport function iterator(octokit, route, parameters) {\n const options = typeof route === \"function\"\n ? route.endpoint(parameters)\n : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url)\n return { done: true };\n try {\n const response = await requestMethod({ method, url, headers });\n const normalizedResponse = normalizePaginatedListResponse(response);\n // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return { value: normalizedResponse };\n }\n catch (error) {\n if (error.status !== 409)\n throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: [],\n },\n };\n }\n },\n }),\n };\n}\n","import { iterator } from \"./iterator\";\nexport function paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then((result) => {\n if (result.done) {\n return results;\n }\n let earlyExit = false;\n function done() {\n earlyExit = true;\n }\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n if (earlyExit) {\n return results;\n }\n return gather(octokit, results, iterator, mapFn);\n });\n}\n","import { paginate } from \"./paginate\";\nimport { iterator } from \"./iterator\";\nexport const composePaginateRest = Object.assign(paginate, {\n iterator,\n});\n","export const paginatingEndpoints = [\n \"GET /app/hook/deliveries\",\n \"GET /app/installations\",\n \"GET /applications/grants\",\n \"GET /authorizations\",\n \"GET /enterprises/{enterprise}/actions/permissions/organizations\",\n \"GET /enterprises/{enterprise}/actions/runner-groups\",\n \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\",\n \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\",\n \"GET /enterprises/{enterprise}/actions/runners\",\n \"GET /enterprises/{enterprise}/actions/runners/downloads\",\n \"GET /events\",\n \"GET /gists\",\n \"GET /gists/public\",\n \"GET /gists/starred\",\n \"GET /gists/{gist_id}/comments\",\n \"GET /gists/{gist_id}/commits\",\n \"GET /gists/{gist_id}/forks\",\n \"GET /installation/repositories\",\n \"GET /issues\",\n \"GET /marketplace_listing/plans\",\n \"GET /marketplace_listing/plans/{plan_id}/accounts\",\n \"GET /marketplace_listing/stubbed/plans\",\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"GET /networks/{owner}/{repo}/events\",\n \"GET /notifications\",\n \"GET /organizations\",\n \"GET /orgs/{org}/actions/permissions/repositories\",\n \"GET /orgs/{org}/actions/runner-groups\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\",\n \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\",\n \"GET /orgs/{org}/actions/runners\",\n \"GET /orgs/{org}/actions/runners/downloads\",\n \"GET /orgs/{org}/actions/secrets\",\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n \"GET /orgs/{org}/blocks\",\n \"GET /orgs/{org}/credential-authorizations\",\n \"GET /orgs/{org}/events\",\n \"GET /orgs/{org}/failed_invitations\",\n \"GET /orgs/{org}/hooks\",\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries\",\n \"GET /orgs/{org}/installations\",\n \"GET /orgs/{org}/invitations\",\n \"GET /orgs/{org}/invitations/{invitation_id}/teams\",\n \"GET /orgs/{org}/issues\",\n \"GET /orgs/{org}/members\",\n \"GET /orgs/{org}/migrations\",\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n \"GET /orgs/{org}/outside_collaborators\",\n \"GET /orgs/{org}/projects\",\n \"GET /orgs/{org}/public_members\",\n \"GET /orgs/{org}/repos\",\n \"GET /orgs/{org}/team-sync/groups\",\n \"GET /orgs/{org}/teams\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n \"GET /orgs/{org}/teams/{team_slug}/members\",\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n \"GET /orgs/{org}/teams/{team_slug}/repos\",\n \"GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\",\n \"GET /orgs/{org}/teams/{team_slug}/teams\",\n \"GET /projects/columns/{column_id}/cards\",\n \"GET /projects/{project_id}/collaborators\",\n \"GET /projects/{project_id}/columns\",\n \"GET /repos/{owner}/{repo}/actions/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/runners\",\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n \"GET /repos/{owner}/{repo}/actions/runs\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n \"GET /repos/{owner}/{repo}/actions/secrets\",\n \"GET /repos/{owner}/{repo}/actions/workflows\",\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n \"GET /repos/{owner}/{repo}/assignees\",\n \"GET /repos/{owner}/{repo}/autolinks\",\n \"GET /repos/{owner}/{repo}/branches\",\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n \"GET /repos/{owner}/{repo}/code-scanning/analyses\",\n \"GET /repos/{owner}/{repo}/collaborators\",\n \"GET /repos/{owner}/{repo}/comments\",\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/commits\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\",\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n \"GET /repos/{owner}/{repo}/contributors\",\n \"GET /repos/{owner}/{repo}/deployments\",\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n \"GET /repos/{owner}/{repo}/events\",\n \"GET /repos/{owner}/{repo}/forks\",\n \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\",\n \"GET /repos/{owner}/{repo}/hooks\",\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n \"GET /repos/{owner}/{repo}/invitations\",\n \"GET /repos/{owner}/{repo}/issues\",\n \"GET /repos/{owner}/{repo}/issues/comments\",\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n \"GET /repos/{owner}/{repo}/keys\",\n \"GET /repos/{owner}/{repo}/labels\",\n \"GET /repos/{owner}/{repo}/milestones\",\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n \"GET /repos/{owner}/{repo}/notifications\",\n \"GET /repos/{owner}/{repo}/pages/builds\",\n \"GET /repos/{owner}/{repo}/projects\",\n \"GET /repos/{owner}/{repo}/pulls\",\n \"GET /repos/{owner}/{repo}/pulls/comments\",\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\",\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n \"GET /repos/{owner}/{repo}/releases\",\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts\",\n \"GET /repos/{owner}/{repo}/stargazers\",\n \"GET /repos/{owner}/{repo}/subscribers\",\n \"GET /repos/{owner}/{repo}/tags\",\n \"GET /repos/{owner}/{repo}/teams\",\n \"GET /repositories\",\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\",\n \"GET /scim/v2/enterprises/{enterprise}/Groups\",\n \"GET /scim/v2/enterprises/{enterprise}/Users\",\n \"GET /scim/v2/organizations/{org}/Users\",\n \"GET /search/code\",\n \"GET /search/commits\",\n \"GET /search/issues\",\n \"GET /search/labels\",\n \"GET /search/repositories\",\n \"GET /search/topics\",\n \"GET /search/users\",\n \"GET /teams/{team_id}/discussions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\",\n \"GET /teams/{team_id}/invitations\",\n \"GET /teams/{team_id}/members\",\n \"GET /teams/{team_id}/projects\",\n \"GET /teams/{team_id}/repos\",\n \"GET /teams/{team_id}/team-sync/group-mappings\",\n \"GET /teams/{team_id}/teams\",\n \"GET /user/blocks\",\n \"GET /user/emails\",\n \"GET /user/followers\",\n \"GET /user/following\",\n \"GET /user/gpg_keys\",\n \"GET /user/installations\",\n \"GET /user/installations/{installation_id}/repositories\",\n \"GET /user/issues\",\n \"GET /user/keys\",\n \"GET /user/marketplace_purchases\",\n \"GET /user/marketplace_purchases/stubbed\",\n \"GET /user/memberships/orgs\",\n \"GET /user/migrations\",\n \"GET /user/migrations/{migration_id}/repositories\",\n \"GET /user/orgs\",\n \"GET /user/public_emails\",\n \"GET /user/repos\",\n \"GET /user/repository_invitations\",\n \"GET /user/starred\",\n \"GET /user/subscriptions\",\n \"GET /user/teams\",\n \"GET /users\",\n \"GET /users/{username}/events\",\n \"GET /users/{username}/events/orgs/{org}\",\n \"GET /users/{username}/events/public\",\n \"GET /users/{username}/followers\",\n \"GET /users/{username}/following\",\n \"GET /users/{username}/gists\",\n \"GET /users/{username}/gpg_keys\",\n \"GET /users/{username}/keys\",\n \"GET /users/{username}/orgs\",\n \"GET /users/{username}/projects\",\n \"GET /users/{username}/received_events\",\n \"GET /users/{username}/received_events/public\",\n \"GET /users/{username}/repos\",\n \"GET /users/{username}/starred\",\n \"GET /users/{username}/subscriptions\",\n];\n","import { paginatingEndpoints, } from \"./generated/paginating-endpoints\";\nexport { paginatingEndpoints } from \"./generated/paginating-endpoints\";\nexport function isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n }\n else {\n return false;\n }\n}\n","import { VERSION } from \"./version\";\nimport { paginate } from \"./paginate\";\nimport { iterator } from \"./iterator\";\nexport { composePaginateRest } from \"./compose-paginate\";\nexport { isPaginatingEndpoint, paginatingEndpoints, } from \"./paginating-endpoints\";\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\nexport function paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit),\n }),\n };\n}\npaginateRest.VERSION = VERSION;\n"],"names":[],"mappings":"AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACA1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AAAO,SAAS,8BAA8B,CAAC,QAAQ,EAAE;AACzD;AACA,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AACxB,QAAQ,OAAO;AACf,YAAY,GAAG,QAAQ;AACvB,YAAY,IAAI,EAAE,EAAE;AACpB,SAAS,CAAC;AACV,KAAK;AACL,IAAI,MAAM,0BAA0B,GAAG,aAAa,IAAI,QAAQ,CAAC,IAAI,IAAI,EAAE,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnG,IAAI,IAAI,CAAC,0BAA0B;AACnC,QAAQ,OAAO,QAAQ,CAAC;AACxB;AACA;AACA,IAAI,MAAM,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;AAC/D,IAAI,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;AACnE,IAAI,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;AACjD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC;AAC5C,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC;AAC9C,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;AACrC,IAAI,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,IAAI,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC7C,IAAI,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;AACzB,IAAI,IAAI,OAAO,iBAAiB,KAAK,WAAW,EAAE;AAClD,QAAQ,QAAQ,CAAC,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;AAC7D,KAAK;AACL,IAAI,IAAI,OAAO,mBAAmB,KAAK,WAAW,EAAE;AACpD,QAAQ,QAAQ,CAAC,IAAI,CAAC,oBAAoB,GAAG,mBAAmB,CAAC;AACjE,KAAK;AACL,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;AAC3C,IAAI,OAAO,QAAQ,CAAC;AACpB,CAAC;;AC7CM,SAAS,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE;AACrD,IAAI,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,UAAU;AAC/C,UAAU,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;AACpC,UAAU,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AACtD,IAAI,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;AAChF,IAAI,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAClC,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACpC,IAAI,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AAC1B,IAAI,OAAO;AACX,QAAQ,CAAC,MAAM,CAAC,aAAa,GAAG,OAAO;AACvC,YAAY,MAAM,IAAI,GAAG;AACzB,gBAAgB,IAAI,CAAC,GAAG;AACxB,oBAAoB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1C,gBAAgB,IAAI;AACpB,oBAAoB,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AACnF,oBAAoB,MAAM,kBAAkB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;AACxF;AACA;AACA;AACA,oBAAoB,GAAG,GAAG,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,yBAAyB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAC9G,oBAAoB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;AACzD,iBAAiB;AACjB,gBAAgB,OAAO,KAAK,EAAE;AAC9B,oBAAoB,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG;AAC5C,wBAAwB,MAAM,KAAK,CAAC;AACpC,oBAAoB,GAAG,GAAG,EAAE,CAAC;AAC7B,oBAAoB,OAAO;AAC3B,wBAAwB,KAAK,EAAE;AAC/B,4BAA4B,MAAM,EAAE,GAAG;AACvC,4BAA4B,OAAO,EAAE,EAAE;AACvC,4BAA4B,IAAI,EAAE,EAAE;AACpC,yBAAyB;AACzB,qBAAqB,CAAC;AACtB,iBAAiB;AACjB,aAAa;AACb,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC;;ACrCM,SAAS,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;AAC5D,IAAI,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;AAC1C,QAAQ,KAAK,GAAG,UAAU,CAAC;AAC3B,QAAQ,UAAU,GAAG,SAAS,CAAC;AAC/B,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACpG,CAAC;AACD,SAAS,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE;AACnD,IAAI,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK;AAC5C,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE;AACzB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,IAAI,SAAS,GAAG,KAAK,CAAC;AAC9B,QAAQ,SAAS,IAAI,GAAG;AACxB,YAAY,SAAS,GAAG,IAAI,CAAC;AAC7B,SAAS;AACT,QAAQ,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACxF,QAAQ,IAAI,SAAS,EAAE;AACvB,YAAY,OAAO,OAAO,CAAC;AAC3B,SAAS;AACT,QAAQ,OAAO,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACzD,KAAK,CAAC,CAAC;AACP,CAAC;;ACrBW,MAAC,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;AAC3D,IAAI,QAAQ;AACZ,CAAC,CAAC;;ACJU,MAAC,mBAAmB,GAAG;AACnC,IAAI,0BAA0B;AAC9B,IAAI,wBAAwB;AAC5B,IAAI,0BAA0B;AAC9B,IAAI,qBAAqB;AACzB,IAAI,iEAAiE;AACrE,IAAI,qDAAqD;AACzD,IAAI,qFAAqF;AACzF,IAAI,+EAA+E;AACnF,IAAI,+CAA+C;AACnD,IAAI,yDAAyD;AAC7D,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,oBAAoB;AACxB,IAAI,+BAA+B;AACnC,IAAI,8BAA8B;AAClC,IAAI,4BAA4B;AAChC,IAAI,gCAAgC;AACpC,IAAI,aAAa;AACjB,IAAI,gCAAgC;AACpC,IAAI,mDAAmD;AACvD,IAAI,wCAAwC;AAC5C,IAAI,2DAA2D;AAC/D,IAAI,qCAAqC;AACzC,IAAI,oBAAoB;AACxB,IAAI,oBAAoB;AACxB,IAAI,kDAAkD;AACtD,IAAI,uCAAuC;AAC3C,IAAI,sEAAsE;AAC1E,IAAI,iEAAiE;AACrE,IAAI,iCAAiC;AACrC,IAAI,2CAA2C;AAC/C,IAAI,iCAAiC;AACrC,IAAI,4DAA4D;AAChE,IAAI,wBAAwB;AAC5B,IAAI,2CAA2C;AAC/C,IAAI,wBAAwB;AAC5B,IAAI,oCAAoC;AACxC,IAAI,uBAAuB;AAC3B,IAAI,4CAA4C;AAChD,IAAI,+BAA+B;AACnC,IAAI,6BAA6B;AACjC,IAAI,mDAAmD;AACvD,IAAI,wBAAwB;AAC5B,IAAI,yBAAyB;AAC7B,IAAI,4BAA4B;AAChC,IAAI,wDAAwD;AAC5D,IAAI,uCAAuC;AAC3C,IAAI,0BAA0B;AAC9B,IAAI,gCAAgC;AACpC,IAAI,uBAAuB;AAC3B,IAAI,kCAAkC;AACtC,IAAI,uBAAuB;AAC3B,IAAI,+CAA+C;AACnD,IAAI,4EAA4E;AAChF,IAAI,uGAAuG;AAC3G,IAAI,6EAA6E;AACjF,IAAI,+CAA+C;AACnD,IAAI,2CAA2C;AAC/C,IAAI,4CAA4C;AAChD,IAAI,yCAAyC;AAC7C,IAAI,4DAA4D;AAChE,IAAI,yCAAyC;AAC7C,IAAI,yCAAyC;AAC7C,IAAI,0CAA0C;AAC9C,IAAI,oCAAoC;AACxC,IAAI,6CAA6C;AACjD,IAAI,2CAA2C;AAC/C,IAAI,qDAAqD;AACzD,IAAI,wCAAwC;AAC5C,IAAI,2DAA2D;AAC/D,IAAI,sDAAsD;AAC1D,IAAI,2CAA2C;AAC/C,IAAI,6CAA6C;AACjD,IAAI,gEAAgE;AACpE,IAAI,qCAAqC;AACzC,IAAI,qCAAqC;AACzC,IAAI,oCAAoC;AACxC,IAAI,iEAAiE;AACrE,IAAI,oEAAoE;AACxE,IAAI,gDAAgD;AACpD,IAAI,yEAAyE;AAC7E,IAAI,kDAAkD;AACtD,IAAI,yCAAyC;AAC7C,IAAI,oCAAoC;AACxC,IAAI,2DAA2D;AAC/D,IAAI,mCAAmC;AACvC,IAAI,oEAAoE;AACxE,IAAI,yDAAyD;AAC7D,IAAI,sDAAsD;AAC1D,IAAI,oDAAoD;AACxD,IAAI,sDAAsD;AAC1D,IAAI,kDAAkD;AACtD,IAAI,wCAAwC;AAC5C,IAAI,uCAAuC;AAC3C,IAAI,gEAAgE;AACpE,IAAI,kCAAkC;AACtC,IAAI,iCAAiC;AACrC,IAAI,mDAAmD;AACvD,IAAI,iCAAiC;AACrC,IAAI,sDAAsD;AAC1D,IAAI,uCAAuC;AAC3C,IAAI,kCAAkC;AACtC,IAAI,2CAA2C;AAC/C,IAAI,kEAAkE;AACtE,IAAI,yCAAyC;AAC7C,IAAI,0DAA0D;AAC9D,IAAI,wDAAwD;AAC5D,IAAI,wDAAwD;AAC5D,IAAI,2DAA2D;AAC/D,IAAI,0DAA0D;AAC9D,IAAI,gCAAgC;AACpC,IAAI,kCAAkC;AACtC,IAAI,sCAAsC;AAC1C,IAAI,gEAAgE;AACpE,IAAI,yCAAyC;AAC7C,IAAI,wCAAwC;AAC5C,IAAI,oCAAoC;AACxC,IAAI,iCAAiC;AACrC,IAAI,0CAA0C;AAC9C,IAAI,iEAAiE;AACrE,IAAI,wDAAwD;AAC5D,IAAI,uDAAuD;AAC3D,IAAI,qDAAqD;AACzD,IAAI,mEAAmE;AACvE,IAAI,uDAAuD;AAC3D,IAAI,4EAA4E;AAChF,IAAI,oCAAoC;AACxC,IAAI,wDAAwD;AAC5D,IAAI,kDAAkD;AACtD,IAAI,sCAAsC;AAC1C,IAAI,uCAAuC;AAC3C,IAAI,gCAAgC;AACpC,IAAI,iCAAiC;AACrC,IAAI,mBAAmB;AACvB,IAAI,2EAA2E;AAC/E,IAAI,8CAA8C;AAClD,IAAI,6CAA6C;AACjD,IAAI,wCAAwC;AAC5C,IAAI,kBAAkB;AACtB,IAAI,qBAAqB;AACzB,IAAI,oBAAoB;AACxB,IAAI,oBAAoB;AACxB,IAAI,0BAA0B;AAC9B,IAAI,oBAAoB;AACxB,IAAI,mBAAmB;AACvB,IAAI,kCAAkC;AACtC,IAAI,+DAA+D;AACnE,IAAI,0FAA0F;AAC9F,IAAI,gEAAgE;AACpE,IAAI,kCAAkC;AACtC,IAAI,8BAA8B;AAClC,IAAI,+BAA+B;AACnC,IAAI,4BAA4B;AAChC,IAAI,+CAA+C;AACnD,IAAI,4BAA4B;AAChC,IAAI,kBAAkB;AACtB,IAAI,kBAAkB;AACtB,IAAI,qBAAqB;AACzB,IAAI,qBAAqB;AACzB,IAAI,oBAAoB;AACxB,IAAI,yBAAyB;AAC7B,IAAI,wDAAwD;AAC5D,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,iCAAiC;AACrC,IAAI,yCAAyC;AAC7C,IAAI,4BAA4B;AAChC,IAAI,sBAAsB;AAC1B,IAAI,kDAAkD;AACtD,IAAI,gBAAgB;AACpB,IAAI,yBAAyB;AAC7B,IAAI,iBAAiB;AACrB,IAAI,kCAAkC;AACtC,IAAI,mBAAmB;AACvB,IAAI,yBAAyB;AAC7B,IAAI,iBAAiB;AACrB,IAAI,YAAY;AAChB,IAAI,8BAA8B;AAClC,IAAI,yCAAyC;AAC7C,IAAI,qCAAqC;AACzC,IAAI,iCAAiC;AACrC,IAAI,iCAAiC;AACrC,IAAI,6BAA6B;AACjC,IAAI,gCAAgC;AACpC,IAAI,4BAA4B;AAChC,IAAI,4BAA4B;AAChC,IAAI,gCAAgC;AACpC,IAAI,uCAAuC;AAC3C,IAAI,8CAA8C;AAClD,IAAI,6BAA6B;AACjC,IAAI,+BAA+B;AACnC,IAAI,qCAAqC;AACzC,CAAC;;AChMM,SAAS,oBAAoB,CAAC,GAAG,EAAE;AAC1C,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACjC,QAAQ,OAAO,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACjD,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,CAAC;;ACJD;AACA;AACA;AACA;AACA,AAAO,SAAS,YAAY,CAAC,OAAO,EAAE;AACtC,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;AAC9D,YAAY,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;AAClD,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC;AACD,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/plugin-paginate-rest/package.json b/node_modules/@octokit/plugin-paginate-rest/package.json index f63a723..899dac2 100644 --- a/node_modules/@octokit/plugin-paginate-rest/package.json +++ b/node_modules/@octokit/plugin-paginate-rest/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/plugin-paginate-rest", "description": "Octokit plugin to paginate REST API endpoint responses", - "version": "2.4.0", + "version": "2.15.1", "license": "MIT", "files": [ "dist-*/", @@ -15,16 +15,16 @@ "sdk", "toolkit" ], - "repository": "https://github.com/octokit/plugin-paginate-rest.js", + "repository": "github:octokit/plugin-paginate-rest.js", "dependencies": { - "@octokit/types": "^5.5.0" + "@octokit/types": "^6.24.0" }, "peerDependencies": { "@octokit/core": ">=2" }, "devDependencies": { "@octokit/core": "^3.0.0", - "@octokit/plugin-rest-endpoint-methods": "^4.0.0", + "@octokit/plugin-rest-endpoint-methods": "^5.0.0", "@pika/pack": "^0.5.0", "@pika/plugin-build-node": "^0.9.0", "@pika/plugin-build-web": "^0.9.0", @@ -33,12 +33,13 @@ "@types/jest": "^26.0.0", "@types/node": "^14.0.4", "fetch-mock": "^9.0.0", - "jest": "^26.0.1", + "github-openapi-graphql-query": "^1.0.4", + "jest": "^27.0.0", "npm-run-all": "^4.1.5", - "prettier": "^2.0.4", + "prettier": "2.3.2", "semantic-release": "^17.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", - "ts-jest": "^26.0.0", + "ts-jest": "^27.0.0-next.12", "typescript": "^4.0.2" }, "publishConfig": { diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/README.md b/node_modules/@octokit/plugin-rest-endpoint-methods/README.md index ab4b6cb..8a17a79 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/README.md +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/README.md @@ -13,12 +13,12 @@ Browsers -Load `@octokit/plugin-rest-endpoint-methods` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.pika.dev](https://cdn.pika.dev) +Load `@octokit/plugin-rest-endpoint-methods` and [`@octokit/core`](https://github.com/octokit/core.js) (or core-compatible module) directly from [cdn.skypack.dev](https://cdn.skypack.dev) ```html ``` @@ -45,7 +45,7 @@ const MyOctokit = Octokit.plugin(restEndpointMethods); const octokit = new MyOctokit({ auth: "secret123" }); // https://developer.github.com/v3/users/#get-the-authenticated-user -octokit.users.getAuthenticated(); +octokit.rest.users.getAuthenticated(); ``` There is one method for each REST API endpoint documented at [https://developer.github.com/v3](https://developer.github.com/v3). All endpoint methods are documented in the [docs/](docs/) folder, e.g. [docs/users/getAuthenticated.md](docs/users/getAuthenticated.md) @@ -59,10 +59,14 @@ Example ```ts import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods"; -type UpdateLabelParameters = RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"]; -type UpdateLabelResponse = RestEndpointMethodTypes["issues"]["updateLabel"]["response"]; +type UpdateLabelParameters = + RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"]; +type UpdateLabelResponse = + RestEndpointMethodTypes["issues"]["updateLabel"]["response"]; ``` +In order to get types beyond parameters and responses, check out [`@octokit/openapi-types`](https://github.com/octokit/openapi-types.ts/#readme), which is a direct transpliation from GitHub's official OpenAPI specification. + ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js index 75420e4..7ad5b15 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js @@ -2,10 +2,65 @@ Object.defineProperty(exports, '__esModule', { value: true }); +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; +} + const Endpoints = { actions: { addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], + createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], @@ -14,21 +69,37 @@ const Endpoints = { createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], + disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], + enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], + getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], + getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], + getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], + getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getPendingDeploymentsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + getRepoPermissions: ["GET /repos/{owner}/{repo}/actions/permissions", {}, { + renamed: ["actions", "getGithubActionsPermissionsRepository"] + }], getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getReviewsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"], getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], @@ -36,6 +107,7 @@ const Endpoints = { getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], @@ -43,6 +115,7 @@ const Endpoints = { listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], + listSelectedRepositoriesEnabledGithubActionsOrganization: ["GET /orgs/{org}/actions/permissions/repositories"], listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], @@ -50,7 +123,13 @@ const Endpoints = { listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"] + reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], + setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], + setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], + setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], + setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"] }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], @@ -93,6 +172,11 @@ const Endpoints = { previews: ["corsair"] } }], + createContentAttachmentForRepo: ["POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", { + mediaType: { + previews: ["corsair"] + } + }], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], deleteAuthorization: ["DELETE /applications/{client_id}/grant"], @@ -106,6 +190,8 @@ const Endpoints = { getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], @@ -116,11 +202,15 @@ const Endpoints = { listReposAccessibleToInstallation: ["GET /installation/repositories"], listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"] + unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"], + updateWebhookConfigForApp: ["PATCH /app/hook/config"] }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], @@ -131,84 +221,39 @@ const Endpoints = { getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] }, checks: { - create: ["POST /repos/{owner}/{repo}/check-runs", { - mediaType: { - previews: ["antiope"] - } - }], - createSuite: ["POST /repos/{owner}/{repo}/check-suites", { - mediaType: { - previews: ["antiope"] - } - }], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}", { - mediaType: { - previews: ["antiope"] - } - }], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}", { - mediaType: { - previews: ["antiope"] - } - }], - listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", { - mediaType: { - previews: ["antiope"] - } - }], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs", { - mediaType: { - previews: ["antiope"] - } - }], - listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", { - mediaType: { - previews: ["antiope"] - } - }], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites", { - mediaType: { - previews: ["antiope"] - } - }], - rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", { - mediaType: { - previews: ["antiope"] - } - }], - setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences", { - mediaType: { - previews: ["antiope"] - } - }], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}", { - mediaType: { - previews: ["antiope"] - } - }] + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], + listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], + listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], + rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], + setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] }, codeScanning: { + deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { renamedParameters: { alert_id: "alert_number" } }], + getAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { + renamed: ["codeScanning", "listAlertInstances"] + }], listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] }, codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct", { - mediaType: { - previews: ["scarlet-witch"] - } - }], - getConductCode: ["GET /codes_of_conduct/{key}", { - mediaType: { - previews: ["scarlet-witch"] - } - }], + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"], getForRepo: ["GET /repos/{owner}/{repo}/community/code_of_conduct", { mediaType: { previews: ["scarlet-witch"] @@ -218,6 +263,16 @@ const Endpoints = { emojis: { get: ["GET /emojis"] }, + enterpriseAdmin: { + disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], + getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], + listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], + setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], + setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], + setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] + }, gists: { checkIsStarred: ["GET /gists/{gist_id}/star"], create: ["POST /gists"], @@ -260,35 +315,23 @@ const Endpoints = { getTemplate: ["GET /gitignore/templates/{name}"] }, interactions: { - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } - }], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits", { - mediaType: { - previews: ["sombra"] - } + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits", {}, { + renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] + }], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], + removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits"], + removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits", {}, { + renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] + }], + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits", {}, { + renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }] }, issues: { @@ -350,7 +393,10 @@ const Endpoints = { }] }, meta: { - get: ["GET /meta"] + get: ["GET /meta"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"] }, migrations: { cancelImport: ["DELETE /repos/{owner}/{repo}/import"], @@ -426,6 +472,7 @@ const Endpoints = { }, orgs: { blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], @@ -437,9 +484,12 @@ const Endpoints = { getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listBlockedUsers: ["GET /orgs/{org}/blocks"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], @@ -448,8 +498,10 @@ const Endpoints = { listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], @@ -459,7 +511,33 @@ const Endpoints = { unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], update: ["PATCH /orgs/{org}"], updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"] + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] + }, + packages: { + deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], + deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], + deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] + }], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] + }], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], + getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], + getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], + getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], + getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] }, projects: { addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}", { @@ -645,6 +723,11 @@ const Endpoints = { previews: ["squirrel-girl"] } }], + createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions", { + mediaType: { + previews: ["squirrel-girl"] + } + }], createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { mediaType: { previews: ["squirrel-girl"] @@ -690,7 +773,7 @@ const Endpoints = { previews: ["squirrel-girl"] } }, { - deprecated: "octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy" + deprecated: "octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy" }], listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", { mediaType: { @@ -745,6 +828,8 @@ const Endpoints = { } }], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { mediaType: { @@ -759,6 +844,7 @@ const Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateEnvironment: ["PUT /repos/{owner}/{repo}/environments/{environment_name}"], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createPagesSite: ["POST /repos/{owner}/{repo}/pages", { mediaType: { @@ -776,6 +862,8 @@ const Endpoints = { delete: ["DELETE /repos/{owner}/{repo}"], deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { @@ -806,7 +894,11 @@ const Endpoints = { previews: ["dorian"] } }], - downloadArchive: ["GET /repos/{owner}/{repo}/{archive_format}/{ref}"], + downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { + renamed: ["repos", "downloadZipballArchive"] + }], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes", { mediaType: { previews: ["london"] @@ -820,6 +912,7 @@ const Endpoints = { get: ["GET /repos/{owner}/{repo}"], getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], getAllTopics: ["GET /repos/{owner}/{repo}/topics", { mediaType: { @@ -827,6 +920,7 @@ const Endpoints = { } }], getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], @@ -841,24 +935,23 @@ const Endpoints = { previews: ["zzzax"] } }], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile", { - mediaType: { - previews: ["black-panther"] - } - }], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], + getEnvironment: ["GET /repos/{owner}/{repo}/environments/{environment_name}"], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], @@ -869,6 +962,9 @@ const Endpoints = { getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], listBranches: ["GET /repos/{owner}/{repo}/branches"], listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", { mediaType: { @@ -902,9 +998,11 @@ const Endpoints = { listReleases: ["GET /repos/{owner}/{repo}/releases"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { mapToData: "apps" }], @@ -919,6 +1017,7 @@ const Endpoints = { removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { mapToData: "users" }], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { mediaType: { previews: ["mercy"] @@ -948,8 +1047,12 @@ const Endpoints = { updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], - updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { + renamed: ["repos", "updateStatusCheckProtection"] + }], + updateStatusCheckProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"], uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" }] @@ -971,6 +1074,11 @@ const Endpoints = { }], users: ["GET /search/users"] }, + secretScanning: { + getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] + }, teams: { addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}", { @@ -1051,7 +1159,7 @@ const Endpoints = { } }; -const VERSION = "4.2.0"; +const VERSION = "5.8.0"; function endpointsToMethods(octokit, endpointsMap) { const newMethods = {}; @@ -1134,21 +1242,21 @@ function decorate(octokit, scope, methodName, defaults, decorations) { return Object.assign(withDecorations, requestWithDefaults); } -/** - * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary - * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is - * done, we will remove the registerEndpoints methods and return the methods - * directly as with the other plugins. At that point we will also remove the - * legacy workarounds and deprecations. - * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 - */ - function restEndpointMethods(octokit) { - return endpointsToMethods(octokit, Endpoints); + const api = endpointsToMethods(octokit, Endpoints); + return { + rest: api + }; } restEndpointMethods.VERSION = VERSION; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return _objectSpread2(_objectSpread2({}, api), {}, { + rest: api + }); +} +legacyRestEndpointMethods.VERSION = VERSION; +exports.legacyRestEndpointMethods = legacyRestEndpointMethods; exports.restEndpointMethods = restEndpointMethods; //# sourceMappingURL=index.js.map diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map index da4294e..03b5a35 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/generated/endpoints.js","../dist-src/version.js","../dist-src/endpoints-to-methods.js","../dist-src/index.js"],"sourcesContent":["const Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n cancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\",\n ],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n createRegistrationTokenForOrg: [\n \"POST /orgs/{org}/actions/runners/registration-token\",\n ],\n createRegistrationTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/registration-token\",\n ],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/remove-token\",\n ],\n createWorkflowDispatch: [\n \"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\",\n ],\n deleteArtifact: [\n \"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n deleteSelfHostedRunnerFromOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}\",\n ],\n deleteSelfHostedRunnerFromRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\n \"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n downloadArtifact: [\n \"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\",\n ],\n downloadJobLogsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\",\n ],\n downloadWorkflowRunLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunUsage: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\",\n ],\n getWorkflowUsage: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\",\n ],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listJobsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n ],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n ],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n ],\n listWorkflowRuns: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n ],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\n \"DELETE /notifications/threads/{thread_id}/subscription\",\n ],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\n \"GET /notifications/threads/{thread_id}/subscription\",\n ],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\n \"GET /users/{username}/events/orgs/{org}\",\n ],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\n \"GET /users/{username}/received_events/public\",\n ],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/notifications\",\n ],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\n \"PUT /notifications/threads/{thread_id}/subscription\",\n ],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"],\n },\n apps: {\n addRepoToInstallation: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\n \"POST /content_references/{content_reference_id}/attachments\",\n { mediaType: { previews: [\"corsair\"] } },\n ],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\n \"POST /app/installations/{installation_id}/access_tokens\",\n ],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\n \"GET /marketplace_listing/accounts/{account_id}\",\n ],\n getSubscriptionPlanForAccountStubbed: [\n \"GET /marketplace_listing/stubbed/accounts/{account_id}\",\n ],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n ],\n listInstallationReposForAuthenticatedUser: [\n \"GET /user/installations/{installation_id}/repositories\",\n ],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\n \"GET /user/marketplace_purchases/stubbed\",\n ],\n removeRepoFromInstallation: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\n \"DELETE /app/installations/{installation_id}/suspended\",\n ],\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\n \"GET /users/{username}/settings/billing/actions\",\n ],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\n \"GET /users/{username}/settings/billing/packages\",\n ],\n getSharedStorageBillingOrg: [\n \"GET /orgs/{org}/settings/billing/shared-storage\",\n ],\n getSharedStorageBillingUser: [\n \"GET /users/{username}/settings/billing/shared-storage\",\n ],\n },\n checks: {\n create: [\n \"POST /repos/{owner}/{repo}/check-runs\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n createSuite: [\n \"POST /repos/{owner}/{repo}/check-suites\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n get: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n getSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listAnnotations: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listForSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listSuitesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n rerequestSuite: [\n \"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n setSuitesPreferences: [\n \"PATCH /repos/{owner}/{repo}/check-suites/preferences\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n update: [\n \"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n },\n codeScanning: {\n getAlert: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n {},\n { renamedParameters: { alert_id: \"alert_number\" } },\n ],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n ],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"],\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\n \"GET /codes_of_conduct\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n getConductCode: [\n \"GET /codes_of_conduct/{key}\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n getForRepo: [\n \"GET /repos/{owner}/{repo}/community/code_of_conduct\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n },\n emojis: { get: [\"GET /emojis\"] },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"],\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"],\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"],\n },\n interactions: {\n getRestrictionsForOrg: [\n \"GET /orgs/{org}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n getRestrictionsForRepo: [\n \"GET /repos/{owner}/{repo}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n removeRestrictionsForOrg: [\n \"DELETE /orgs/{org}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n removeRestrictionsForRepo: [\n \"DELETE /repos/{owner}/{repo}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n setRestrictionsForOrg: [\n \"PUT /orgs/{org}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n setRestrictionsForRepo: [\n \"PUT /repos/{owner}/{repo}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n },\n issues: {\n addAssignees: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n ],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\",\n ],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\n \"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n { mediaType: { previews: [\"mockingbird\"] } },\n ],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n ],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n removeAssignees: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n removeLabel: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\",\n ],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\n \"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"],\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\n \"POST /markdown/raw\",\n { headers: { \"content-type\": \"text/plain; charset=utf-8\" } },\n ],\n },\n meta: { get: [\"GET /meta\"] },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n deleteArchiveForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n downloadArchiveForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getArchiveForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getStatusForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForAuthenticatedUser: [\n \"GET /user/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n unlockRepoForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"],\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\n \"PUT /orgs/{org}/outside_collaborators/{username}\",\n ],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\n \"DELETE /orgs/{org}/outside_collaborators/{username}\",\n ],\n removePublicMembershipForAuthenticatedUser: [\n \"DELETE /orgs/{org}/public_members/{username}\",\n ],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\n \"PUT /orgs/{org}/public_members/{username}\",\n ],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\n \"PATCH /user/memberships/orgs/{org}\",\n ],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n },\n projects: {\n addCollaborator: [\n \"PUT /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createCard: [\n \"POST /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createColumn: [\n \"POST /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForAuthenticatedUser: [\n \"POST /user/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForOrg: [\n \"POST /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForRepo: [\n \"POST /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n delete: [\n \"DELETE /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteCard: [\n \"DELETE /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteColumn: [\n \"DELETE /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n get: [\n \"GET /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getCard: [\n \"GET /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getColumn: [\n \"GET /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getPermissionForUser: [\n \"GET /projects/{project_id}/collaborators/{username}/permission\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCards: [\n \"GET /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCollaborators: [\n \"GET /projects/{project_id}/collaborators\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listColumns: [\n \"GET /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForRepo: [\n \"GET /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForUser: [\n \"GET /users/{username}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveCard: [\n \"POST /projects/columns/cards/{card_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveColumn: [\n \"POST /projects/columns/{column_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n removeCollaborator: [\n \"DELETE /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n update: [\n \"PATCH /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateCard: [\n \"PATCH /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateColumn: [\n \"PATCH /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\",\n ],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n deletePendingReview: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n deleteReviewComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n dismissReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\",\n ],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n listReviewComments: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n requestReviewers: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n submitReview: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\",\n { mediaType: { previews: [\"lydian\"] } },\n ],\n updateReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n updateReviewComment: [\n \"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n },\n rateLimit: { get: [\"GET /rate_limit\"] },\n reactions: {\n createForCommitComment: [\n \"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssueComment: [\n \"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForPullRequestReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForCommitComment: [\n \"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssueComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForPullRequestComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussion: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussionComment: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteLegacy: [\n \"DELETE /reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n {\n deprecated: \"octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy\",\n },\n ],\n listForCommitComment: [\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssueComment: [\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForPullRequestReviewComment: [\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n addTeamAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n addUserAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\n \"GET /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n createCommitComment: [\n \"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n createCommitSignatureProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\n \"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\n \"POST /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\n \"POST /repos/{template_owner}/{template_repo}/generate\",\n { mediaType: { previews: [\"baptiste\"] } },\n ],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n deleteAdminBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n deleteBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\n \"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\",\n ],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\n \"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n deletePagesSite: [\n \"DELETE /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n deletePullRequestReviewProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\n \"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\n \"DELETE /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n disableVulnerabilityAlerts: [\n \"DELETE /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n downloadArchive: [\"GET /repos/{owner}/{repo}/{archive_format}/{ref}\"],\n enableAutomatedSecurityFixes: [\n \"PUT /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n enableVulnerabilityAlerts: [\n \"PUT /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n getAdminBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n getAllStatusCheckContexts: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n ],\n getAllTopics: [\n \"GET /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n getAppsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n ],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\n \"GET /repos/{owner}/{repo}/collaborators/{username}/permission\",\n ],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n getCommunityProfileMetrics: [\n \"GET /repos/{owner}/{repo}/community/profile\",\n { mediaType: { previews: [\"black-panther\"] } },\n ],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\",\n ],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n getTeamsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n ],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n ],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listReleaseAssets: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n ],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n removeAppAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n removeCollaborator: [\n \"DELETE /repos/{owner}/{repo}/collaborators/{username}\",\n ],\n removeStatusCheckContexts: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n removeStatusCheckProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n removeTeamAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n removeUserAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n replaceAllTopics: [\n \"PUT /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n setAppAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n setStatusCheckContexts: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n setTeamAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n setUserAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\n \"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n updatePullRequestReviewProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\n \"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n updateStatusCheckPotection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n uploadReleaseAsset: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\",\n { baseUrl: \"https://uploads.github.com\" },\n ],\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\", { mediaType: { previews: [\"cloak\"] } }],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", { mediaType: { previews: [\"mercy\"] } }],\n users: [\"GET /search/users\"],\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n addOrUpdateProjectPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n addOrUpdateRepoPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n checkPermissionsForProjectInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n checkPermissionsForRepoInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n deleteDiscussionInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n getDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n getMembershipForUserInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n ],\n listProjectsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n removeProjectInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n ],\n removeRepoInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n updateDiscussionCommentInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n updateDiscussionInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"],\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"],\n },\n};\nexport default Endpoints;\n","export const VERSION = \"4.2.0\";\n","export function endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({ method, url }, defaults);\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n const scopeMethods = newMethods[scope];\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined,\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n","import ENDPOINTS from \"./generated/endpoints\";\nimport { VERSION } from \"./version\";\nimport { endpointsToMethods } from \"./endpoints-to-methods\";\n/**\n * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary\n * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is\n * done, we will remove the registerEndpoints methods and return the methods\n * directly as with the other plugins. At that point we will also remove the\n * legacy workarounds and deprecations.\n *\n * See the plan at\n * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1\n */\nexport function restEndpointMethods(octokit) {\n return endpointsToMethods(octokit, ENDPOINTS);\n}\nrestEndpointMethods.VERSION = VERSION;\n"],"names":["Endpoints","actions","addSelectedRepoToOrgSecret","cancelWorkflowRun","createOrUpdateOrgSecret","createOrUpdateRepoSecret","createRegistrationTokenForOrg","createRegistrationTokenForRepo","createRemoveTokenForOrg","createRemoveTokenForRepo","createWorkflowDispatch","deleteArtifact","deleteOrgSecret","deleteRepoSecret","deleteSelfHostedRunnerFromOrg","deleteSelfHostedRunnerFromRepo","deleteWorkflowRun","deleteWorkflowRunLogs","downloadArtifact","downloadJobLogsForWorkflowRun","downloadWorkflowRunLogs","getArtifact","getJobForWorkflowRun","getOrgPublicKey","getOrgSecret","getRepoPublicKey","getRepoSecret","getSelfHostedRunnerForOrg","getSelfHostedRunnerForRepo","getWorkflow","getWorkflowRun","getWorkflowRunUsage","getWorkflowUsage","listArtifactsForRepo","listJobsForWorkflowRun","listOrgSecrets","listRepoSecrets","listRepoWorkflows","listRunnerApplicationsForOrg","listRunnerApplicationsForRepo","listSelectedReposForOrgSecret","listSelfHostedRunnersForOrg","listSelfHostedRunnersForRepo","listWorkflowRunArtifacts","listWorkflowRuns","listWorkflowRunsForRepo","reRunWorkflow","removeSelectedRepoFromOrgSecret","setSelectedReposForOrgSecret","activity","checkRepoIsStarredByAuthenticatedUser","deleteRepoSubscription","deleteThreadSubscription","getFeeds","getRepoSubscription","getThread","getThreadSubscriptionForAuthenticatedUser","listEventsForAuthenticatedUser","listNotificationsForAuthenticatedUser","listOrgEventsForAuthenticatedUser","listPublicEvents","listPublicEventsForRepoNetwork","listPublicEventsForUser","listPublicOrgEvents","listReceivedEventsForUser","listReceivedPublicEventsForUser","listRepoEvents","listRepoNotificationsForAuthenticatedUser","listReposStarredByAuthenticatedUser","listReposStarredByUser","listReposWatchedByUser","listStargazersForRepo","listWatchedReposForAuthenticatedUser","listWatchersForRepo","markNotificationsAsRead","markRepoNotificationsAsRead","markThreadAsRead","setRepoSubscription","setThreadSubscription","starRepoForAuthenticatedUser","unstarRepoForAuthenticatedUser","apps","addRepoToInstallation","checkToken","createContentAttachment","mediaType","previews","createFromManifest","createInstallationAccessToken","deleteAuthorization","deleteInstallation","deleteToken","getAuthenticated","getBySlug","getInstallation","getOrgInstallation","getRepoInstallation","getSubscriptionPlanForAccount","getSubscriptionPlanForAccountStubbed","getUserInstallation","listAccountsForPlan","listAccountsForPlanStubbed","listInstallationReposForAuthenticatedUser","listInstallations","listInstallationsForAuthenticatedUser","listPlans","listPlansStubbed","listReposAccessibleToInstallation","listSubscriptionsForAuthenticatedUser","listSubscriptionsForAuthenticatedUserStubbed","removeRepoFromInstallation","resetToken","revokeInstallationAccessToken","suspendInstallation","unsuspendInstallation","billing","getGithubActionsBillingOrg","getGithubActionsBillingUser","getGithubPackagesBillingOrg","getGithubPackagesBillingUser","getSharedStorageBillingOrg","getSharedStorageBillingUser","checks","create","createSuite","get","getSuite","listAnnotations","listForRef","listForSuite","listSuitesForRef","rerequestSuite","setSuitesPreferences","update","codeScanning","getAlert","renamedParameters","alert_id","listAlertsForRepo","listRecentAnalyses","updateAlert","uploadSarif","codesOfConduct","getAllCodesOfConduct","getConductCode","getForRepo","emojis","gists","checkIsStarred","createComment","delete","deleteComment","fork","getComment","getRevision","list","listComments","listCommits","listForUser","listForks","listPublic","listStarred","star","unstar","updateComment","git","createBlob","createCommit","createRef","createTag","createTree","deleteRef","getBlob","getCommit","getRef","getTag","getTree","listMatchingRefs","updateRef","gitignore","getAllTemplates","getTemplate","interactions","getRestrictionsForOrg","getRestrictionsForRepo","removeRestrictionsForOrg","removeRestrictionsForRepo","setRestrictionsForOrg","setRestrictionsForRepo","issues","addAssignees","addLabels","checkUserCanBeAssigned","createLabel","createMilestone","deleteLabel","deleteMilestone","getEvent","getLabel","getMilestone","listAssignees","listCommentsForRepo","listEvents","listEventsForRepo","listEventsForTimeline","listForAuthenticatedUser","listForOrg","listForRepo","listLabelsForMilestone","listLabelsForRepo","listLabelsOnIssue","listMilestones","lock","removeAllLabels","removeAssignees","removeLabel","setLabels","unlock","updateLabel","updateMilestone","licenses","getAllCommonlyUsed","markdown","render","renderRaw","headers","meta","migrations","cancelImport","deleteArchiveForAuthenticatedUser","deleteArchiveForOrg","downloadArchiveForOrg","getArchiveForAuthenticatedUser","getCommitAuthors","getImportStatus","getLargeFiles","getStatusForAuthenticatedUser","getStatusForOrg","listReposForOrg","listReposForUser","mapCommitAuthor","setLfsPreference","startForAuthenticatedUser","startForOrg","startImport","unlockRepoForAuthenticatedUser","unlockRepoForOrg","updateImport","orgs","blockUser","checkBlockedUser","checkMembershipForUser","checkPublicMembershipForUser","convertMemberToOutsideCollaborator","createInvitation","createWebhook","deleteWebhook","getMembershipForAuthenticatedUser","getMembershipForUser","getWebhook","listAppInstallations","listBlockedUsers","listInvitationTeams","listMembers","listMembershipsForAuthenticatedUser","listOutsideCollaborators","listPendingInvitations","listPublicMembers","listWebhooks","pingWebhook","removeMember","removeMembershipForUser","removeOutsideCollaborator","removePublicMembershipForAuthenticatedUser","setMembershipForUser","setPublicMembershipForAuthenticatedUser","unblockUser","updateMembershipForAuthenticatedUser","updateWebhook","projects","addCollaborator","createCard","createColumn","createForAuthenticatedUser","createForOrg","createForRepo","deleteCard","deleteColumn","getCard","getColumn","getPermissionForUser","listCards","listCollaborators","listColumns","moveCard","moveColumn","removeCollaborator","updateCard","updateColumn","pulls","checkIfMerged","createReplyForReviewComment","createReview","createReviewComment","deletePendingReview","deleteReviewComment","dismissReview","getReview","getReviewComment","listCommentsForReview","listFiles","listRequestedReviewers","listReviewComments","listReviewCommentsForRepo","listReviews","merge","removeRequestedReviewers","requestReviewers","submitReview","updateBranch","updateReview","updateReviewComment","rateLimit","reactions","createForCommitComment","createForIssue","createForIssueComment","createForPullRequestReviewComment","createForTeamDiscussionCommentInOrg","createForTeamDiscussionInOrg","deleteForCommitComment","deleteForIssue","deleteForIssueComment","deleteForPullRequestComment","deleteForTeamDiscussion","deleteForTeamDiscussionComment","deleteLegacy","deprecated","listForCommitComment","listForIssue","listForIssueComment","listForPullRequestReviewComment","listForTeamDiscussionCommentInOrg","listForTeamDiscussionInOrg","repos","acceptInvitation","addAppAccessRestrictions","mapToData","addStatusCheckContexts","addTeamAccessRestrictions","addUserAccessRestrictions","checkCollaborator","checkVulnerabilityAlerts","compareCommits","createCommitComment","createCommitSignatureProtection","createCommitStatus","createDeployKey","createDeployment","createDeploymentStatus","createDispatchEvent","createFork","createInOrg","createOrUpdateFileContents","createPagesSite","createRelease","createUsingTemplate","declineInvitation","deleteAccessRestrictions","deleteAdminBranchProtection","deleteBranchProtection","deleteCommitComment","deleteCommitSignatureProtection","deleteDeployKey","deleteDeployment","deleteFile","deleteInvitation","deletePagesSite","deletePullRequestReviewProtection","deleteRelease","deleteReleaseAsset","disableAutomatedSecurityFixes","disableVulnerabilityAlerts","downloadArchive","enableAutomatedSecurityFixes","enableVulnerabilityAlerts","getAccessRestrictions","getAdminBranchProtection","getAllStatusCheckContexts","getAllTopics","getAppsWithAccessToProtectedBranch","getBranch","getBranchProtection","getClones","getCodeFrequencyStats","getCollaboratorPermissionLevel","getCombinedStatusForRef","getCommitActivityStats","getCommitComment","getCommitSignatureProtection","getCommunityProfileMetrics","getContent","getContributorsStats","getDeployKey","getDeployment","getDeploymentStatus","getLatestPagesBuild","getLatestRelease","getPages","getPagesBuild","getParticipationStats","getPullRequestReviewProtection","getPunchCardStats","getReadme","getRelease","getReleaseAsset","getReleaseByTag","getStatusChecksProtection","getTeamsWithAccessToProtectedBranch","getTopPaths","getTopReferrers","getUsersWithAccessToProtectedBranch","getViews","listBranches","listBranchesForHeadCommit","listCommentsForCommit","listCommitCommentsForRepo","listCommitStatusesForRef","listContributors","listDeployKeys","listDeploymentStatuses","listDeployments","listInvitations","listInvitationsForAuthenticatedUser","listLanguages","listPagesBuilds","listPullRequestsAssociatedWithCommit","listReleaseAssets","listReleases","listTags","listTeams","removeAppAccessRestrictions","removeStatusCheckContexts","removeStatusCheckProtection","removeTeamAccessRestrictions","removeUserAccessRestrictions","replaceAllTopics","requestPagesBuild","setAdminBranchProtection","setAppAccessRestrictions","setStatusCheckContexts","setTeamAccessRestrictions","setUserAccessRestrictions","testPushWebhook","transfer","updateBranchProtection","updateCommitComment","updateInformationAboutPagesSite","updateInvitation","updatePullRequestReviewProtection","updateRelease","updateReleaseAsset","updateStatusCheckPotection","uploadReleaseAsset","baseUrl","search","code","commits","issuesAndPullRequests","labels","topics","users","teams","addOrUpdateMembershipForUserInOrg","addOrUpdateProjectPermissionsInOrg","addOrUpdateRepoPermissionsInOrg","checkPermissionsForProjectInOrg","checkPermissionsForRepoInOrg","createDiscussionCommentInOrg","createDiscussionInOrg","deleteDiscussionCommentInOrg","deleteDiscussionInOrg","deleteInOrg","getByName","getDiscussionCommentInOrg","getDiscussionInOrg","getMembershipForUserInOrg","listChildInOrg","listDiscussionCommentsInOrg","listDiscussionsInOrg","listMembersInOrg","listPendingInvitationsInOrg","listProjectsInOrg","listReposInOrg","removeMembershipForUserInOrg","removeProjectInOrg","removeRepoInOrg","updateDiscussionCommentInOrg","updateDiscussionInOrg","updateInOrg","addEmailForAuthenticated","block","checkBlocked","checkFollowingForUser","checkPersonIsFollowedByAuthenticated","createGpgKeyForAuthenticated","createPublicSshKeyForAuthenticated","deleteEmailForAuthenticated","deleteGpgKeyForAuthenticated","deletePublicSshKeyForAuthenticated","follow","getByUsername","getContextForUser","getGpgKeyForAuthenticated","getPublicSshKeyForAuthenticated","listBlockedByAuthenticated","listEmailsForAuthenticated","listFollowedByAuthenticated","listFollowersForAuthenticatedUser","listFollowersForUser","listFollowingForUser","listGpgKeysForAuthenticated","listGpgKeysForUser","listPublicEmailsForAuthenticated","listPublicKeysForUser","listPublicSshKeysForAuthenticated","setPrimaryEmailVisibilityForAuthenticated","unblock","unfollow","updateAuthenticated","VERSION","endpointsToMethods","octokit","endpointsMap","newMethods","scope","endpoints","Object","entries","methodName","endpoint","route","defaults","decorations","method","url","split","endpointDefaults","assign","scopeMethods","decorate","request","requestWithDefaults","withDecorations","args","options","data","undefined","renamed","newScope","newMethodName","log","warn","name","alias","restEndpointMethods","ENDPOINTS"],"mappings":";;;;AAAA,MAAMA,SAAS,GAAG;AACdC,EAAAA,OAAO,EAAE;AACLC,IAAAA,0BAA0B,EAAE,CACxB,4EADwB,CADvB;AAILC,IAAAA,iBAAiB,EAAE,CACf,yDADe,CAJd;AAOLC,IAAAA,uBAAuB,EAAE,CAAC,+CAAD,CAPpB;AAQLC,IAAAA,wBAAwB,EAAE,CACtB,yDADsB,CARrB;AAWLC,IAAAA,6BAA6B,EAAE,CAC3B,qDAD2B,CAX1B;AAcLC,IAAAA,8BAA8B,EAAE,CAC5B,+DAD4B,CAd3B;AAiBLC,IAAAA,uBAAuB,EAAE,CAAC,+CAAD,CAjBpB;AAkBLC,IAAAA,wBAAwB,EAAE,CACtB,yDADsB,CAlBrB;AAqBLC,IAAAA,sBAAsB,EAAE,CACpB,uEADoB,CArBnB;AAwBLC,IAAAA,cAAc,EAAE,CACZ,8DADY,CAxBX;AA2BLC,IAAAA,eAAe,EAAE,CAAC,kDAAD,CA3BZ;AA4BLC,IAAAA,gBAAgB,EAAE,CACd,4DADc,CA5Bb;AA+BLC,IAAAA,6BAA6B,EAAE,CAC3B,gDAD2B,CA/B1B;AAkCLC,IAAAA,8BAA8B,EAAE,CAC5B,0DAD4B,CAlC3B;AAqCLC,IAAAA,iBAAiB,EAAE,CAAC,oDAAD,CArCd;AAsCLC,IAAAA,qBAAqB,EAAE,CACnB,yDADmB,CAtClB;AAyCLC,IAAAA,gBAAgB,EAAE,CACd,4EADc,CAzCb;AA4CLC,IAAAA,6BAA6B,EAAE,CAC3B,sDAD2B,CA5C1B;AA+CLC,IAAAA,uBAAuB,EAAE,CACrB,sDADqB,CA/CpB;AAkDLC,IAAAA,WAAW,EAAE,CAAC,2DAAD,CAlDR;AAmDLC,IAAAA,oBAAoB,EAAE,CAAC,iDAAD,CAnDjB;AAoDLC,IAAAA,eAAe,EAAE,CAAC,4CAAD,CApDZ;AAqDLC,IAAAA,YAAY,EAAE,CAAC,+CAAD,CArDT;AAsDLC,IAAAA,gBAAgB,EAAE,CAAC,sDAAD,CAtDb;AAuDLC,IAAAA,aAAa,EAAE,CAAC,yDAAD,CAvDV;AAwDLC,IAAAA,yBAAyB,EAAE,CAAC,6CAAD,CAxDtB;AAyDLC,IAAAA,0BAA0B,EAAE,CACxB,uDADwB,CAzDvB;AA4DLC,IAAAA,WAAW,EAAE,CAAC,2DAAD,CA5DR;AA6DLC,IAAAA,cAAc,EAAE,CAAC,iDAAD,CA7DX;AA8DLC,IAAAA,mBAAmB,EAAE,CACjB,wDADiB,CA9DhB;AAiELC,IAAAA,gBAAgB,EAAE,CACd,kEADc,CAjEb;AAoELC,IAAAA,oBAAoB,EAAE,CAAC,6CAAD,CApEjB;AAqELC,IAAAA,sBAAsB,EAAE,CACpB,sDADoB,CArEnB;AAwELC,IAAAA,cAAc,EAAE,CAAC,iCAAD,CAxEX;AAyELC,IAAAA,eAAe,EAAE,CAAC,2CAAD,CAzEZ;AA0ELC,IAAAA,iBAAiB,EAAE,CAAC,6CAAD,CA1Ed;AA2ELC,IAAAA,4BAA4B,EAAE,CAAC,2CAAD,CA3EzB;AA4ELC,IAAAA,6BAA6B,EAAE,CAC3B,qDAD2B,CA5E1B;AA+ELC,IAAAA,6BAA6B,EAAE,CAC3B,4DAD2B,CA/E1B;AAkFLC,IAAAA,2BAA2B,EAAE,CAAC,iCAAD,CAlFxB;AAmFLC,IAAAA,4BAA4B,EAAE,CAAC,2CAAD,CAnFzB;AAoFLC,IAAAA,wBAAwB,EAAE,CACtB,2DADsB,CApFrB;AAuFLC,IAAAA,gBAAgB,EAAE,CACd,gEADc,CAvFb;AA0FLC,IAAAA,uBAAuB,EAAE,CAAC,wCAAD,CA1FpB;AA2FLC,IAAAA,aAAa,EAAE,CAAC,wDAAD,CA3FV;AA4FLC,IAAAA,+BAA+B,EAAE,CAC7B,+EAD6B,CA5F5B;AA+FLC,IAAAA,4BAA4B,EAAE,CAC1B,4DAD0B;AA/FzB,GADK;AAoGdC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,qCAAqC,EAAE,CAAC,kCAAD,CADjC;AAENC,IAAAA,sBAAsB,EAAE,CAAC,2CAAD,CAFlB;AAGNC,IAAAA,wBAAwB,EAAE,CACtB,wDADsB,CAHpB;AAMNC,IAAAA,QAAQ,EAAE,CAAC,YAAD,CANJ;AAONC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAPf;AAQNC,IAAAA,SAAS,EAAE,CAAC,wCAAD,CARL;AASNC,IAAAA,yCAAyC,EAAE,CACvC,qDADuC,CATrC;AAYNC,IAAAA,8BAA8B,EAAE,CAAC,8BAAD,CAZ1B;AAaNC,IAAAA,qCAAqC,EAAE,CAAC,oBAAD,CAbjC;AAcNC,IAAAA,iCAAiC,EAAE,CAC/B,yCAD+B,CAd7B;AAiBNC,IAAAA,gBAAgB,EAAE,CAAC,aAAD,CAjBZ;AAkBNC,IAAAA,8BAA8B,EAAE,CAAC,qCAAD,CAlB1B;AAmBNC,IAAAA,uBAAuB,EAAE,CAAC,qCAAD,CAnBnB;AAoBNC,IAAAA,mBAAmB,EAAE,CAAC,wBAAD,CApBf;AAqBNC,IAAAA,yBAAyB,EAAE,CAAC,uCAAD,CArBrB;AAsBNC,IAAAA,+BAA+B,EAAE,CAC7B,8CAD6B,CAtB3B;AAyBNC,IAAAA,cAAc,EAAE,CAAC,kCAAD,CAzBV;AA0BNC,IAAAA,yCAAyC,EAAE,CACvC,yCADuC,CA1BrC;AA6BNC,IAAAA,mCAAmC,EAAE,CAAC,mBAAD,CA7B/B;AA8BNC,IAAAA,sBAAsB,EAAE,CAAC,+BAAD,CA9BlB;AA+BNC,IAAAA,sBAAsB,EAAE,CAAC,qCAAD,CA/BlB;AAgCNC,IAAAA,qBAAqB,EAAE,CAAC,sCAAD,CAhCjB;AAiCNC,IAAAA,oCAAoC,EAAE,CAAC,yBAAD,CAjChC;AAkCNC,IAAAA,mBAAmB,EAAE,CAAC,uCAAD,CAlCf;AAmCNC,IAAAA,uBAAuB,EAAE,CAAC,oBAAD,CAnCnB;AAoCNC,IAAAA,2BAA2B,EAAE,CAAC,yCAAD,CApCvB;AAqCNC,IAAAA,gBAAgB,EAAE,CAAC,0CAAD,CArCZ;AAsCNC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAtCf;AAuCNC,IAAAA,qBAAqB,EAAE,CACnB,qDADmB,CAvCjB;AA0CNC,IAAAA,4BAA4B,EAAE,CAAC,kCAAD,CA1CxB;AA2CNC,IAAAA,8BAA8B,EAAE,CAAC,qCAAD;AA3C1B,GApGI;AAiJdC,EAAAA,IAAI,EAAE;AACFC,IAAAA,qBAAqB,EAAE,CACnB,wEADmB,CADrB;AAIFC,IAAAA,UAAU,EAAE,CAAC,sCAAD,CAJV;AAKFC,IAAAA,uBAAuB,EAAE,CACrB,6DADqB,EAErB;AAAEC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFqB,CALvB;AASFC,IAAAA,kBAAkB,EAAE,CAAC,wCAAD,CATlB;AAUFC,IAAAA,6BAA6B,EAAE,CAC3B,yDAD2B,CAV7B;AAaFC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAbnB;AAcFC,IAAAA,kBAAkB,EAAE,CAAC,6CAAD,CAdlB;AAeFC,IAAAA,WAAW,EAAE,CAAC,wCAAD,CAfX;AAgBFC,IAAAA,gBAAgB,EAAE,CAAC,UAAD,CAhBhB;AAiBFC,IAAAA,SAAS,EAAE,CAAC,sBAAD,CAjBT;AAkBFC,IAAAA,eAAe,EAAE,CAAC,0CAAD,CAlBf;AAmBFC,IAAAA,kBAAkB,EAAE,CAAC,8BAAD,CAnBlB;AAoBFC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CApBnB;AAqBFC,IAAAA,6BAA6B,EAAE,CAC3B,gDAD2B,CArB7B;AAwBFC,IAAAA,oCAAoC,EAAE,CAClC,wDADkC,CAxBpC;AA2BFC,IAAAA,mBAAmB,EAAE,CAAC,oCAAD,CA3BnB;AA4BFC,IAAAA,mBAAmB,EAAE,CAAC,mDAAD,CA5BnB;AA6BFC,IAAAA,0BAA0B,EAAE,CACxB,2DADwB,CA7B1B;AAgCFC,IAAAA,yCAAyC,EAAE,CACvC,wDADuC,CAhCzC;AAmCFC,IAAAA,iBAAiB,EAAE,CAAC,wBAAD,CAnCjB;AAoCFC,IAAAA,qCAAqC,EAAE,CAAC,yBAAD,CApCrC;AAqCFC,IAAAA,SAAS,EAAE,CAAC,gCAAD,CArCT;AAsCFC,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CAtChB;AAuCFC,IAAAA,iCAAiC,EAAE,CAAC,gCAAD,CAvCjC;AAwCFC,IAAAA,qCAAqC,EAAE,CAAC,iCAAD,CAxCrC;AAyCFC,IAAAA,4CAA4C,EAAE,CAC1C,yCAD0C,CAzC5C;AA4CFC,IAAAA,0BAA0B,EAAE,CACxB,2EADwB,CA5C1B;AA+CFC,IAAAA,UAAU,EAAE,CAAC,uCAAD,CA/CV;AAgDFC,IAAAA,6BAA6B,EAAE,CAAC,4BAAD,CAhD7B;AAiDFC,IAAAA,mBAAmB,EAAE,CAAC,oDAAD,CAjDnB;AAkDFC,IAAAA,qBAAqB,EAAE,CACnB,uDADmB;AAlDrB,GAjJQ;AAuMdC,EAAAA,OAAO,EAAE;AACLC,IAAAA,0BAA0B,EAAE,CAAC,0CAAD,CADvB;AAELC,IAAAA,2BAA2B,EAAE,CACzB,gDADyB,CAFxB;AAKLC,IAAAA,2BAA2B,EAAE,CAAC,2CAAD,CALxB;AAMLC,IAAAA,4BAA4B,EAAE,CAC1B,iDAD0B,CANzB;AASLC,IAAAA,0BAA0B,EAAE,CACxB,iDADwB,CATvB;AAYLC,IAAAA,2BAA2B,EAAE,CACzB,uDADyB;AAZxB,GAvMK;AAuNdC,EAAAA,MAAM,EAAE;AACJC,IAAAA,MAAM,EAAE,CACJ,uCADI,EAEJ;AAAEtC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFI,CADJ;AAKJsC,IAAAA,WAAW,EAAE,CACT,yCADS,EAET;AAAEvC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CALT;AASJuC,IAAAA,GAAG,EAAE,CACD,qDADC,EAED;AAAExC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFC,CATD;AAaJwC,IAAAA,QAAQ,EAAE,CACN,yDADM,EAEN;AAAEzC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFM,CAbN;AAiBJyC,IAAAA,eAAe,EAAE,CACb,iEADa,EAEb;AAAE1C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFa,CAjBb;AAqBJ0C,IAAAA,UAAU,EAAE,CACR,oDADQ,EAER;AAAE3C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CArBR;AAyBJ2C,IAAAA,YAAY,EAAE,CACV,oEADU,EAEV;AAAE5C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CAzBV;AA6BJ4C,IAAAA,gBAAgB,EAAE,CACd,sDADc,EAEd;AAAE7C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFc,CA7Bd;AAiCJ6C,IAAAA,cAAc,EAAE,CACZ,oEADY,EAEZ;AAAE9C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFY,CAjCZ;AAqCJ8C,IAAAA,oBAAoB,EAAE,CAClB,sDADkB,EAElB;AAAE/C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFkB,CArClB;AAyCJ+C,IAAAA,MAAM,EAAE,CACJ,uDADI,EAEJ;AAAEhD,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFI;AAzCJ,GAvNM;AAqQdgD,EAAAA,YAAY,EAAE;AACVC,IAAAA,QAAQ,EAAE,CACN,+DADM,EAEN,EAFM,EAGN;AAAEC,MAAAA,iBAAiB,EAAE;AAAEC,QAAAA,QAAQ,EAAE;AAAZ;AAArB,KAHM,CADA;AAMVC,IAAAA,iBAAiB,EAAE,CAAC,gDAAD,CANT;AAOVC,IAAAA,kBAAkB,EAAE,CAAC,kDAAD,CAPV;AAQVC,IAAAA,WAAW,EAAE,CACT,iEADS,CARH;AAWVC,IAAAA,WAAW,EAAE,CAAC,iDAAD;AAXH,GArQA;AAkRdC,EAAAA,cAAc,EAAE;AACZC,IAAAA,oBAAoB,EAAE,CAClB,uBADkB,EAElB;AAAE1D,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFkB,CADV;AAKZ0D,IAAAA,cAAc,EAAE,CACZ,6BADY,EAEZ;AAAE3D,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFY,CALJ;AASZ2D,IAAAA,UAAU,EAAE,CACR,qDADQ,EAER;AAAE5D,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFQ;AATA,GAlRF;AAgSd4D,EAAAA,MAAM,EAAE;AAAErB,IAAAA,GAAG,EAAE,CAAC,aAAD;AAAP,GAhSM;AAiSdsB,EAAAA,KAAK,EAAE;AACHC,IAAAA,cAAc,EAAE,CAAC,2BAAD,CADb;AAEHzB,IAAAA,MAAM,EAAE,CAAC,aAAD,CAFL;AAGH0B,IAAAA,aAAa,EAAE,CAAC,gCAAD,CAHZ;AAIHC,IAAAA,MAAM,EAAE,CAAC,yBAAD,CAJL;AAKHC,IAAAA,aAAa,EAAE,CAAC,+CAAD,CALZ;AAMHC,IAAAA,IAAI,EAAE,CAAC,6BAAD,CANH;AAOH3B,IAAAA,GAAG,EAAE,CAAC,sBAAD,CAPF;AAQH4B,IAAAA,UAAU,EAAE,CAAC,4CAAD,CART;AASHC,IAAAA,WAAW,EAAE,CAAC,4BAAD,CATV;AAUHC,IAAAA,IAAI,EAAE,CAAC,YAAD,CAVH;AAWHC,IAAAA,YAAY,EAAE,CAAC,+BAAD,CAXX;AAYHC,IAAAA,WAAW,EAAE,CAAC,8BAAD,CAZV;AAaHC,IAAAA,WAAW,EAAE,CAAC,6BAAD,CAbV;AAcHC,IAAAA,SAAS,EAAE,CAAC,4BAAD,CAdR;AAeHC,IAAAA,UAAU,EAAE,CAAC,mBAAD,CAfT;AAgBHC,IAAAA,WAAW,EAAE,CAAC,oBAAD,CAhBV;AAiBHC,IAAAA,IAAI,EAAE,CAAC,2BAAD,CAjBH;AAkBHC,IAAAA,MAAM,EAAE,CAAC,8BAAD,CAlBL;AAmBH9B,IAAAA,MAAM,EAAE,CAAC,wBAAD,CAnBL;AAoBH+B,IAAAA,aAAa,EAAE,CAAC,8CAAD;AApBZ,GAjSO;AAuTdC,EAAAA,GAAG,EAAE;AACDC,IAAAA,UAAU,EAAE,CAAC,sCAAD,CADX;AAEDC,IAAAA,YAAY,EAAE,CAAC,wCAAD,CAFb;AAGDC,IAAAA,SAAS,EAAE,CAAC,qCAAD,CAHV;AAIDC,IAAAA,SAAS,EAAE,CAAC,qCAAD,CAJV;AAKDC,IAAAA,UAAU,EAAE,CAAC,sCAAD,CALX;AAMDC,IAAAA,SAAS,EAAE,CAAC,6CAAD,CANV;AAODC,IAAAA,OAAO,EAAE,CAAC,gDAAD,CAPR;AAQDC,IAAAA,SAAS,EAAE,CAAC,oDAAD,CARV;AASDC,IAAAA,MAAM,EAAE,CAAC,yCAAD,CATP;AAUDC,IAAAA,MAAM,EAAE,CAAC,8CAAD,CAVP;AAWDC,IAAAA,OAAO,EAAE,CAAC,gDAAD,CAXR;AAYDC,IAAAA,gBAAgB,EAAE,CAAC,mDAAD,CAZjB;AAaDC,IAAAA,SAAS,EAAE,CAAC,4CAAD;AAbV,GAvTS;AAsUdC,EAAAA,SAAS,EAAE;AACPC,IAAAA,eAAe,EAAE,CAAC,0BAAD,CADV;AAEPC,IAAAA,WAAW,EAAE,CAAC,iCAAD;AAFN,GAtUG;AA0UdC,EAAAA,YAAY,EAAE;AACVC,IAAAA,qBAAqB,EAAE,CACnB,oCADmB,EAEnB;AAAElG,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFmB,CADb;AAKVkG,IAAAA,sBAAsB,EAAE,CACpB,8CADoB,EAEpB;AAAEnG,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFoB,CALd;AASVmG,IAAAA,wBAAwB,EAAE,CACtB,uCADsB,EAEtB;AAAEpG,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFsB,CAThB;AAaVoG,IAAAA,yBAAyB,EAAE,CACvB,iDADuB,EAEvB;AAAErG,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFuB,CAbjB;AAiBVqG,IAAAA,qBAAqB,EAAE,CACnB,oCADmB,EAEnB;AAAEtG,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFmB,CAjBb;AAqBVsG,IAAAA,sBAAsB,EAAE,CACpB,8CADoB,EAEpB;AAAEvG,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFoB;AArBd,GA1UA;AAoWduG,EAAAA,MAAM,EAAE;AACJC,IAAAA,YAAY,EAAE,CACV,4DADU,CADV;AAIJC,IAAAA,SAAS,EAAE,CAAC,yDAAD,CAJP;AAKJC,IAAAA,sBAAsB,EAAE,CAAC,gDAAD,CALpB;AAMJrE,IAAAA,MAAM,EAAE,CAAC,mCAAD,CANJ;AAOJ0B,IAAAA,aAAa,EAAE,CACX,2DADW,CAPX;AAUJ4C,IAAAA,WAAW,EAAE,CAAC,mCAAD,CAVT;AAWJC,IAAAA,eAAe,EAAE,CAAC,uCAAD,CAXb;AAYJ3C,IAAAA,aAAa,EAAE,CACX,2DADW,CAZX;AAeJ4C,IAAAA,WAAW,EAAE,CAAC,4CAAD,CAfT;AAgBJC,IAAAA,eAAe,EAAE,CACb,4DADa,CAhBb;AAmBJvE,IAAAA,GAAG,EAAE,CAAC,iDAAD,CAnBD;AAoBJ4B,IAAAA,UAAU,EAAE,CAAC,wDAAD,CApBR;AAqBJ4C,IAAAA,QAAQ,EAAE,CAAC,oDAAD,CArBN;AAsBJC,IAAAA,QAAQ,EAAE,CAAC,yCAAD,CAtBN;AAuBJC,IAAAA,YAAY,EAAE,CAAC,yDAAD,CAvBV;AAwBJ5C,IAAAA,IAAI,EAAE,CAAC,aAAD,CAxBF;AAyBJ6C,IAAAA,aAAa,EAAE,CAAC,qCAAD,CAzBX;AA0BJ5C,IAAAA,YAAY,EAAE,CAAC,0DAAD,CA1BV;AA2BJ6C,IAAAA,mBAAmB,EAAE,CAAC,2CAAD,CA3BjB;AA4BJC,IAAAA,UAAU,EAAE,CAAC,wDAAD,CA5BR;AA6BJC,IAAAA,iBAAiB,EAAE,CAAC,yCAAD,CA7Bf;AA8BJC,IAAAA,qBAAqB,EAAE,CACnB,0DADmB,EAEnB;AAAEvH,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,aAAD;AAAZ;AAAb,KAFmB,CA9BnB;AAkCJuH,IAAAA,wBAAwB,EAAE,CAAC,kBAAD,CAlCtB;AAmCJC,IAAAA,UAAU,EAAE,CAAC,wBAAD,CAnCR;AAoCJC,IAAAA,WAAW,EAAE,CAAC,kCAAD,CApCT;AAqCJC,IAAAA,sBAAsB,EAAE,CACpB,gEADoB,CArCpB;AAwCJC,IAAAA,iBAAiB,EAAE,CAAC,kCAAD,CAxCf;AAyCJC,IAAAA,iBAAiB,EAAE,CACf,wDADe,CAzCf;AA4CJC,IAAAA,cAAc,EAAE,CAAC,sCAAD,CA5CZ;AA6CJC,IAAAA,IAAI,EAAE,CAAC,sDAAD,CA7CF;AA8CJC,IAAAA,eAAe,EAAE,CACb,2DADa,CA9Cb;AAiDJC,IAAAA,eAAe,EAAE,CACb,8DADa,CAjDb;AAoDJC,IAAAA,WAAW,EAAE,CACT,kEADS,CApDT;AAuDJC,IAAAA,SAAS,EAAE,CAAC,wDAAD,CAvDP;AAwDJC,IAAAA,MAAM,EAAE,CAAC,yDAAD,CAxDJ;AAyDJpF,IAAAA,MAAM,EAAE,CAAC,mDAAD,CAzDJ;AA0DJ+B,IAAAA,aAAa,EAAE,CAAC,0DAAD,CA1DX;AA2DJsD,IAAAA,WAAW,EAAE,CAAC,2CAAD,CA3DT;AA4DJC,IAAAA,eAAe,EAAE,CACb,2DADa;AA5Db,GApWM;AAoadC,EAAAA,QAAQ,EAAE;AACN/F,IAAAA,GAAG,EAAE,CAAC,yBAAD,CADC;AAENgG,IAAAA,kBAAkB,EAAE,CAAC,eAAD,CAFd;AAGN5E,IAAAA,UAAU,EAAE,CAAC,mCAAD;AAHN,GApaI;AAyad6E,EAAAA,QAAQ,EAAE;AACNC,IAAAA,MAAM,EAAE,CAAC,gBAAD,CADF;AAENC,IAAAA,SAAS,EAAE,CACP,oBADO,EAEP;AAAEC,MAAAA,OAAO,EAAE;AAAE,wBAAgB;AAAlB;AAAX,KAFO;AAFL,GAzaI;AAgbdC,EAAAA,IAAI,EAAE;AAAErG,IAAAA,GAAG,EAAE,CAAC,WAAD;AAAP,GAhbQ;AAibdsG,EAAAA,UAAU,EAAE;AACRC,IAAAA,YAAY,EAAE,CAAC,qCAAD,CADN;AAERC,IAAAA,iCAAiC,EAAE,CAC/B,gDAD+B,EAE/B;AAAEhJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF+B,CAF3B;AAMRgJ,IAAAA,mBAAmB,EAAE,CACjB,sDADiB,EAEjB;AAAEjJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFiB,CANb;AAURiJ,IAAAA,qBAAqB,EAAE,CACnB,mDADmB,EAEnB;AAAElJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFmB,CAVf;AAcRkJ,IAAAA,8BAA8B,EAAE,CAC5B,6CAD4B,EAE5B;AAAEnJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF4B,CAdxB;AAkBRmJ,IAAAA,gBAAgB,EAAE,CAAC,0CAAD,CAlBV;AAmBRC,IAAAA,eAAe,EAAE,CAAC,kCAAD,CAnBT;AAoBRC,IAAAA,aAAa,EAAE,CAAC,8CAAD,CApBP;AAqBRC,IAAAA,6BAA6B,EAAE,CAC3B,qCAD2B,EAE3B;AAAEvJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF2B,CArBvB;AAyBRuJ,IAAAA,eAAe,EAAE,CACb,2CADa,EAEb;AAAExJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFa,CAzBT;AA6BRuH,IAAAA,wBAAwB,EAAE,CACtB,sBADsB,EAEtB;AAAExH,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFsB,CA7BlB;AAiCRwH,IAAAA,UAAU,EAAE,CACR,4BADQ,EAER;AAAEzH,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFQ,CAjCJ;AAqCRwJ,IAAAA,eAAe,EAAE,CACb,wDADa,EAEb;AAAEzJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFa,CArCT;AAyCRyJ,IAAAA,gBAAgB,EAAE,CACd,kDADc,EAEd;AAAE1J,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFc,CAzCV;AA6CR0J,IAAAA,eAAe,EAAE,CAAC,wDAAD,CA7CT;AA8CRC,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CA9CV;AA+CRC,IAAAA,yBAAyB,EAAE,CAAC,uBAAD,CA/CnB;AAgDRC,IAAAA,WAAW,EAAE,CAAC,6BAAD,CAhDL;AAiDRC,IAAAA,WAAW,EAAE,CAAC,kCAAD,CAjDL;AAkDRC,IAAAA,8BAA8B,EAAE,CAC5B,+DAD4B,EAE5B;AAAEhK,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF4B,CAlDxB;AAsDRgK,IAAAA,gBAAgB,EAAE,CACd,qEADc,EAEd;AAAEjK,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFc,CAtDV;AA0DRiK,IAAAA,YAAY,EAAE,CAAC,oCAAD;AA1DN,GAjbE;AA6edC,EAAAA,IAAI,EAAE;AACFC,IAAAA,SAAS,EAAE,CAAC,mCAAD,CADT;AAEFC,IAAAA,gBAAgB,EAAE,CAAC,mCAAD,CAFhB;AAGFC,IAAAA,sBAAsB,EAAE,CAAC,oCAAD,CAHtB;AAIFC,IAAAA,4BAA4B,EAAE,CAAC,2CAAD,CAJ5B;AAKFC,IAAAA,kCAAkC,EAAE,CAChC,kDADgC,CALlC;AAQFC,IAAAA,gBAAgB,EAAE,CAAC,8BAAD,CARhB;AASFC,IAAAA,aAAa,EAAE,CAAC,wBAAD,CATb;AAUFC,IAAAA,aAAa,EAAE,CAAC,oCAAD,CAVb;AAWFnI,IAAAA,GAAG,EAAE,CAAC,iBAAD,CAXH;AAYFoI,IAAAA,iCAAiC,EAAE,CAAC,kCAAD,CAZjC;AAaFC,IAAAA,oBAAoB,EAAE,CAAC,wCAAD,CAbpB;AAcFC,IAAAA,UAAU,EAAE,CAAC,iCAAD,CAdV;AAeFxG,IAAAA,IAAI,EAAE,CAAC,oBAAD,CAfJ;AAgBFyG,IAAAA,oBAAoB,EAAE,CAAC,+BAAD,CAhBpB;AAiBFC,IAAAA,gBAAgB,EAAE,CAAC,wBAAD,CAjBhB;AAkBFxD,IAAAA,wBAAwB,EAAE,CAAC,gBAAD,CAlBxB;AAmBF/C,IAAAA,WAAW,EAAE,CAAC,4BAAD,CAnBX;AAoBFwG,IAAAA,mBAAmB,EAAE,CAAC,mDAAD,CApBnB;AAqBFC,IAAAA,WAAW,EAAE,CAAC,yBAAD,CArBX;AAsBFC,IAAAA,mCAAmC,EAAE,CAAC,4BAAD,CAtBnC;AAuBFC,IAAAA,wBAAwB,EAAE,CAAC,uCAAD,CAvBxB;AAwBFC,IAAAA,sBAAsB,EAAE,CAAC,6BAAD,CAxBtB;AAyBFC,IAAAA,iBAAiB,EAAE,CAAC,gCAAD,CAzBjB;AA0BFC,IAAAA,YAAY,EAAE,CAAC,uBAAD,CA1BZ;AA2BFC,IAAAA,WAAW,EAAE,CAAC,wCAAD,CA3BX;AA4BFC,IAAAA,YAAY,EAAE,CAAC,uCAAD,CA5BZ;AA6BFC,IAAAA,uBAAuB,EAAE,CAAC,2CAAD,CA7BvB;AA8BFC,IAAAA,yBAAyB,EAAE,CACvB,qDADuB,CA9BzB;AAiCFC,IAAAA,0CAA0C,EAAE,CACxC,8CADwC,CAjC1C;AAoCFC,IAAAA,oBAAoB,EAAE,CAAC,wCAAD,CApCpB;AAqCFC,IAAAA,uCAAuC,EAAE,CACrC,2CADqC,CArCvC;AAwCFC,IAAAA,WAAW,EAAE,CAAC,sCAAD,CAxCX;AAyCF/I,IAAAA,MAAM,EAAE,CAAC,mBAAD,CAzCN;AA0CFgJ,IAAAA,oCAAoC,EAAE,CAClC,oCADkC,CA1CpC;AA6CFC,IAAAA,aAAa,EAAE,CAAC,mCAAD;AA7Cb,GA7eQ;AA4hBdC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,eAAe,EAAE,CACb,qDADa,EAEb;AAAEnM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFa,CADX;AAKNmM,IAAAA,UAAU,EAAE,CACR,0CADQ,EAER;AAAEpM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CALN;AASNoM,IAAAA,YAAY,EAAE,CACV,qCADU,EAEV;AAAErM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CATR;AAaNqM,IAAAA,0BAA0B,EAAE,CACxB,qBADwB,EAExB;AAAEtM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFwB,CAbtB;AAiBNsM,IAAAA,YAAY,EAAE,CACV,2BADU,EAEV;AAAEvM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CAjBR;AAqBNuM,IAAAA,aAAa,EAAE,CACX,qCADW,EAEX;AAAExM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFW,CArBT;AAyBNgE,IAAAA,MAAM,EAAE,CACJ,+BADI,EAEJ;AAAEjE,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFI,CAzBF;AA6BNwM,IAAAA,UAAU,EAAE,CACR,0CADQ,EAER;AAAEzM,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CA7BN;AAiCNyM,IAAAA,YAAY,EAAE,CACV,sCADU,EAEV;AAAE1M,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CAjCR;AAqCNuC,IAAAA,GAAG,EAAE,CACD,4BADC,EAED;AAAExC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFC,CArCC;AAyCN0M,IAAAA,OAAO,EAAE,CACL,uCADK,EAEL;AAAE3M,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFK,CAzCH;AA6CN2M,IAAAA,SAAS,EAAE,CACP,mCADO,EAEP;AAAE5M,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFO,CA7CL;AAiDN4M,IAAAA,oBAAoB,EAAE,CAClB,gEADkB,EAElB;AAAE7M,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFkB,CAjDhB;AAqDN6M,IAAAA,SAAS,EAAE,CACP,yCADO,EAEP;AAAE9M,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFO,CArDL;AAyDN8M,IAAAA,iBAAiB,EAAE,CACf,0CADe,EAEf;AAAE/M,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFe,CAzDb;AA6DN+M,IAAAA,WAAW,EAAE,CACT,oCADS,EAET;AAAEhN,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CA7DP;AAiENwH,IAAAA,UAAU,EAAE,CACR,0BADQ,EAER;AAAEzH,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CAjEN;AAqENyH,IAAAA,WAAW,EAAE,CACT,oCADS,EAET;AAAE1H,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CArEP;AAyENwE,IAAAA,WAAW,EAAE,CACT,gCADS,EAET;AAAEzE,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CAzEP;AA6ENgN,IAAAA,QAAQ,EAAE,CACN,8CADM,EAEN;AAAEjN,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFM,CA7EJ;AAiFNiN,IAAAA,UAAU,EAAE,CACR,0CADQ,EAER;AAAElN,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CAjFN;AAqFNkN,IAAAA,kBAAkB,EAAE,CAChB,wDADgB,EAEhB;AAAEnN,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFgB,CArFd;AAyFN+C,IAAAA,MAAM,EAAE,CACJ,8BADI,EAEJ;AAAEhD,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFI,CAzFF;AA6FNmN,IAAAA,UAAU,EAAE,CACR,yCADQ,EAER;AAAEpN,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CA7FN;AAiGNoN,IAAAA,YAAY,EAAE,CACV,qCADU,EAEV;AAAErN,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU;AAjGR,GA5hBI;AAkoBdqN,EAAAA,KAAK,EAAE;AACHC,IAAAA,aAAa,EAAE,CAAC,qDAAD,CADZ;AAEHjL,IAAAA,MAAM,EAAE,CAAC,kCAAD,CAFL;AAGHkL,IAAAA,2BAA2B,EAAE,CACzB,8EADyB,CAH1B;AAMHC,IAAAA,YAAY,EAAE,CAAC,wDAAD,CANX;AAOHC,IAAAA,mBAAmB,EAAE,CACjB,yDADiB,CAPlB;AAUHC,IAAAA,mBAAmB,EAAE,CACjB,sEADiB,CAVlB;AAaHC,IAAAA,mBAAmB,EAAE,CACjB,0DADiB,CAblB;AAgBHC,IAAAA,aAAa,EAAE,CACX,8EADW,CAhBZ;AAmBHrL,IAAAA,GAAG,EAAE,CAAC,+CAAD,CAnBF;AAoBHsL,IAAAA,SAAS,EAAE,CACP,mEADO,CApBR;AAuBHC,IAAAA,gBAAgB,EAAE,CAAC,uDAAD,CAvBf;AAwBHzJ,IAAAA,IAAI,EAAE,CAAC,iCAAD,CAxBH;AAyBH0J,IAAAA,qBAAqB,EAAE,CACnB,4EADmB,CAzBpB;AA4BHxJ,IAAAA,WAAW,EAAE,CAAC,uDAAD,CA5BV;AA6BHyJ,IAAAA,SAAS,EAAE,CAAC,qDAAD,CA7BR;AA8BHC,IAAAA,sBAAsB,EAAE,CACpB,mEADoB,CA9BrB;AAiCHC,IAAAA,kBAAkB,EAAE,CAChB,wDADgB,CAjCjB;AAoCHC,IAAAA,yBAAyB,EAAE,CAAC,0CAAD,CApCxB;AAqCHC,IAAAA,WAAW,EAAE,CAAC,uDAAD,CArCV;AAsCHC,IAAAA,KAAK,EAAE,CAAC,qDAAD,CAtCJ;AAuCHC,IAAAA,wBAAwB,EAAE,CACtB,sEADsB,CAvCvB;AA0CHC,IAAAA,gBAAgB,EAAE,CACd,oEADc,CA1Cf;AA6CHC,IAAAA,YAAY,EAAE,CACV,2EADU,CA7CX;AAgDHzL,IAAAA,MAAM,EAAE,CAAC,iDAAD,CAhDL;AAiDH0L,IAAAA,YAAY,EAAE,CACV,6DADU,EAEV;AAAE1O,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFU,CAjDX;AAqDH0O,IAAAA,YAAY,EAAE,CACV,mEADU,CArDX;AAwDHC,IAAAA,mBAAmB,EAAE,CACjB,yDADiB;AAxDlB,GAloBO;AA8rBdC,EAAAA,SAAS,EAAE;AAAErM,IAAAA,GAAG,EAAE,CAAC,iBAAD;AAAP,GA9rBG;AA+rBdsM,EAAAA,SAAS,EAAE;AACPC,IAAAA,sBAAsB,EAAE,CACpB,4DADoB,EAEpB;AAAE/O,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFoB,CADjB;AAKP+O,IAAAA,cAAc,EAAE,CACZ,4DADY,EAEZ;AAAEhP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFY,CALT;AASPgP,IAAAA,qBAAqB,EAAE,CACnB,mEADmB,EAEnB;AAAEjP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFmB,CAThB;AAaPiP,IAAAA,iCAAiC,EAAE,CAC/B,kEAD+B,EAE/B;AAAElP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF+B,CAb5B;AAiBPkP,IAAAA,mCAAmC,EAAE,CACjC,wGADiC,EAEjC;AAAEnP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFiC,CAjB9B;AAqBPmP,IAAAA,4BAA4B,EAAE,CAC1B,8EAD0B,EAE1B;AAAEpP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF0B,CArBvB;AAyBPoP,IAAAA,sBAAsB,EAAE,CACpB,4EADoB,EAEpB;AAAErP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFoB,CAzBjB;AA6BPqP,IAAAA,cAAc,EAAE,CACZ,4EADY,EAEZ;AAAEtP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFY,CA7BT;AAiCPsP,IAAAA,qBAAqB,EAAE,CACnB,mFADmB,EAEnB;AAAEvP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFmB,CAjChB;AAqCPuP,IAAAA,2BAA2B,EAAE,CACzB,kFADyB,EAEzB;AAAExP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFyB,CArCtB;AAyCPwP,IAAAA,uBAAuB,EAAE,CACrB,8FADqB,EAErB;AAAEzP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFqB,CAzClB;AA6CPyP,IAAAA,8BAA8B,EAAE,CAC5B,wHAD4B,EAE5B;AAAE1P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF4B,CA7CzB;AAiDP0P,IAAAA,YAAY,EAAE,CACV,iCADU,EAEV;AAAE3P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFU,EAGV;AACI2P,MAAAA,UAAU,EAAE;AADhB,KAHU,CAjDP;AAwDPC,IAAAA,oBAAoB,EAAE,CAClB,2DADkB,EAElB;AAAE7P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFkB,CAxDf;AA4DP6P,IAAAA,YAAY,EAAE,CACV,2DADU,EAEV;AAAE9P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFU,CA5DP;AAgEP8P,IAAAA,mBAAmB,EAAE,CACjB,kEADiB,EAEjB;AAAE/P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFiB,CAhEd;AAoEP+P,IAAAA,+BAA+B,EAAE,CAC7B,iEAD6B,EAE7B;AAAEhQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF6B,CApE1B;AAwEPgQ,IAAAA,iCAAiC,EAAE,CAC/B,uGAD+B,EAE/B;AAAEjQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF+B,CAxE5B;AA4EPiQ,IAAAA,0BAA0B,EAAE,CACxB,6EADwB,EAExB;AAAElQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFwB;AA5ErB,GA/rBG;AAgxBdkQ,EAAAA,KAAK,EAAE;AACHC,IAAAA,gBAAgB,EAAE,CAAC,oDAAD,CADf;AAEHC,IAAAA,wBAAwB,EAAE,CACtB,2EADsB,EAEtB,EAFsB,EAGtB;AAAEC,MAAAA,SAAS,EAAE;AAAb,KAHsB,CAFvB;AAOHnE,IAAAA,eAAe,EAAE,CAAC,oDAAD,CAPd;AAQHoE,IAAAA,sBAAsB,EAAE,CACpB,yFADoB,EAEpB,EAFoB,EAGpB;AAAED,MAAAA,SAAS,EAAE;AAAb,KAHoB,CARrB;AAaHE,IAAAA,yBAAyB,EAAE,CACvB,4EADuB,EAEvB,EAFuB,EAGvB;AAAEF,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAbxB;AAkBHG,IAAAA,yBAAyB,EAAE,CACvB,4EADuB,EAEvB,EAFuB,EAGvB;AAAEH,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAlBxB;AAuBHI,IAAAA,iBAAiB,EAAE,CAAC,oDAAD,CAvBhB;AAwBHC,IAAAA,wBAAwB,EAAE,CACtB,gDADsB,EAEtB;AAAE3Q,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFsB,CAxBvB;AA4BH2Q,IAAAA,cAAc,EAAE,CAAC,mDAAD,CA5Bb;AA6BHC,IAAAA,mBAAmB,EAAE,CACjB,0DADiB,CA7BlB;AAgCHC,IAAAA,+BAA+B,EAAE,CAC7B,6EAD6B,EAE7B;AAAE9Q,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAF6B,CAhC9B;AAoCH8Q,IAAAA,kBAAkB,EAAE,CAAC,2CAAD,CApCjB;AAqCHC,IAAAA,eAAe,EAAE,CAAC,iCAAD,CArCd;AAsCHC,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CAtCf;AAuCHC,IAAAA,sBAAsB,EAAE,CACpB,iEADoB,CAvCrB;AA0CHC,IAAAA,mBAAmB,EAAE,CAAC,uCAAD,CA1ClB;AA2CH7E,IAAAA,0BAA0B,EAAE,CAAC,kBAAD,CA3CzB;AA4CH8E,IAAAA,UAAU,EAAE,CAAC,kCAAD,CA5CT;AA6CHC,IAAAA,WAAW,EAAE,CAAC,wBAAD,CA7CV;AA8CHC,IAAAA,0BAA0B,EAAE,CAAC,2CAAD,CA9CzB;AA+CHC,IAAAA,eAAe,EAAE,CACb,kCADa,EAEb;AAAEvR,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,YAAD;AAAZ;AAAb,KAFa,CA/Cd;AAmDHuR,IAAAA,aAAa,EAAE,CAAC,qCAAD,CAnDZ;AAoDHC,IAAAA,mBAAmB,EAAE,CACjB,uDADiB,EAEjB;AAAEzR,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,UAAD;AAAZ;AAAb,KAFiB,CApDlB;AAwDHyK,IAAAA,aAAa,EAAE,CAAC,kCAAD,CAxDZ;AAyDHgH,IAAAA,iBAAiB,EAAE,CAAC,qDAAD,CAzDhB;AA0DHzN,IAAAA,MAAM,EAAE,CAAC,8BAAD,CA1DL;AA2DH0N,IAAAA,wBAAwB,EAAE,CACtB,wEADsB,CA3DvB;AA8DHC,IAAAA,2BAA2B,EAAE,CACzB,0EADyB,CA9D1B;AAiEHC,IAAAA,sBAAsB,EAAE,CACpB,2DADoB,CAjErB;AAoEHC,IAAAA,mBAAmB,EAAE,CAAC,oDAAD,CApElB;AAqEHC,IAAAA,+BAA+B,EAAE,CAC7B,+EAD6B,EAE7B;AAAE/R,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAF6B,CArE9B;AAyEH+R,IAAAA,eAAe,EAAE,CAAC,4CAAD,CAzEd;AA0EHC,IAAAA,gBAAgB,EAAE,CACd,0DADc,CA1Ef;AA6EHC,IAAAA,UAAU,EAAE,CAAC,8CAAD,CA7ET;AA8EHC,IAAAA,gBAAgB,EAAE,CACd,0DADc,CA9Ef;AAiFHC,IAAAA,eAAe,EAAE,CACb,oCADa,EAEb;AAAEpS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,YAAD;AAAZ;AAAb,KAFa,CAjFd;AAqFHoS,IAAAA,iCAAiC,EAAE,CAC/B,yFAD+B,CArFhC;AAwFHC,IAAAA,aAAa,EAAE,CAAC,oDAAD,CAxFZ;AAyFHC,IAAAA,kBAAkB,EAAE,CAChB,yDADgB,CAzFjB;AA4FH5H,IAAAA,aAAa,EAAE,CAAC,8CAAD,CA5FZ;AA6FH6H,IAAAA,6BAA6B,EAAE,CAC3B,uDAD2B,EAE3B;AAAExS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAF2B,CA7F5B;AAiGHwS,IAAAA,0BAA0B,EAAE,CACxB,mDADwB,EAExB;AAAEzS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFwB,CAjGzB;AAqGHyS,IAAAA,eAAe,EAAE,CAAC,kDAAD,CArGd;AAsGHC,IAAAA,4BAA4B,EAAE,CAC1B,oDAD0B,EAE1B;AAAE3S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAF0B,CAtG3B;AA0GH2S,IAAAA,yBAAyB,EAAE,CACvB,gDADuB,EAEvB;AAAE5S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFuB,CA1GxB;AA8GHuC,IAAAA,GAAG,EAAE,CAAC,2BAAD,CA9GF;AA+GHqQ,IAAAA,qBAAqB,EAAE,CACnB,qEADmB,CA/GpB;AAkHHC,IAAAA,wBAAwB,EAAE,CACtB,uEADsB,CAlHvB;AAqHHC,IAAAA,yBAAyB,EAAE,CACvB,wFADuB,CArHxB;AAwHHC,IAAAA,YAAY,EAAE,CACV,kCADU,EAEV;AAAEhT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFU,CAxHX;AA4HHgT,IAAAA,kCAAkC,EAAE,CAChC,0EADgC,CA5HjC;AA+HHC,IAAAA,SAAS,EAAE,CAAC,6CAAD,CA/HR;AAgIHC,IAAAA,mBAAmB,EAAE,CACjB,wDADiB,CAhIlB;AAmIHC,IAAAA,SAAS,EAAE,CAAC,0CAAD,CAnIR;AAoIHC,IAAAA,qBAAqB,EAAE,CAAC,gDAAD,CApIpB;AAqIHC,IAAAA,8BAA8B,EAAE,CAC5B,+DAD4B,CArI7B;AAwIHC,IAAAA,uBAAuB,EAAE,CAAC,gDAAD,CAxItB;AAyIH/N,IAAAA,SAAS,EAAE,CAAC,yCAAD,CAzIR;AA0IHgO,IAAAA,sBAAsB,EAAE,CAAC,iDAAD,CA1IrB;AA2IHC,IAAAA,gBAAgB,EAAE,CAAC,iDAAD,CA3If;AA4IHC,IAAAA,4BAA4B,EAAE,CAC1B,4EAD0B,EAE1B;AAAE1T,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAF0B,CA5I3B;AAgJH0T,IAAAA,0BAA0B,EAAE,CACxB,6CADwB,EAExB;AAAE3T,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFwB,CAhJzB;AAoJH2T,IAAAA,UAAU,EAAE,CAAC,2CAAD,CApJT;AAqJHC,IAAAA,oBAAoB,EAAE,CAAC,8CAAD,CArJnB;AAsJHC,IAAAA,YAAY,EAAE,CAAC,yCAAD,CAtJX;AAuJHC,IAAAA,aAAa,EAAE,CAAC,uDAAD,CAvJZ;AAwJHC,IAAAA,mBAAmB,EAAE,CACjB,4EADiB,CAxJlB;AA2JHC,IAAAA,mBAAmB,EAAE,CAAC,+CAAD,CA3JlB;AA4JHC,IAAAA,gBAAgB,EAAE,CAAC,2CAAD,CA5Jf;AA6JHC,IAAAA,QAAQ,EAAE,CAAC,iCAAD,CA7JP;AA8JHC,IAAAA,aAAa,EAAE,CAAC,mDAAD,CA9JZ;AA+JHC,IAAAA,qBAAqB,EAAE,CAAC,+CAAD,CA/JpB;AAgKHC,IAAAA,8BAA8B,EAAE,CAC5B,sFAD4B,CAhK7B;AAmKHC,IAAAA,iBAAiB,EAAE,CAAC,4CAAD,CAnKhB;AAoKHC,IAAAA,SAAS,EAAE,CAAC,kCAAD,CApKR;AAqKHC,IAAAA,UAAU,EAAE,CAAC,iDAAD,CArKT;AAsKHC,IAAAA,eAAe,EAAE,CAAC,sDAAD,CAtKd;AAuKHC,IAAAA,eAAe,EAAE,CAAC,+CAAD,CAvKd;AAwKHC,IAAAA,yBAAyB,EAAE,CACvB,+EADuB,CAxKxB;AA2KHC,IAAAA,mCAAmC,EAAE,CACjC,2EADiC,CA3KlC;AA8KHC,IAAAA,WAAW,EAAE,CAAC,iDAAD,CA9KV;AA+KHC,IAAAA,eAAe,EAAE,CAAC,qDAAD,CA/Kd;AAgLHC,IAAAA,mCAAmC,EAAE,CACjC,2EADiC,CAhLlC;AAmLHC,IAAAA,QAAQ,EAAE,CAAC,yCAAD,CAnLP;AAoLHnK,IAAAA,UAAU,EAAE,CAAC,2CAAD,CApLT;AAqLHoK,IAAAA,YAAY,EAAE,CAAC,oCAAD,CArLX;AAsLHC,IAAAA,yBAAyB,EAAE,CACvB,oEADuB,EAEvB;AAAEnV,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFuB,CAtLxB;AA0LH8M,IAAAA,iBAAiB,EAAE,CAAC,yCAAD,CA1LhB;AA2LHqI,IAAAA,qBAAqB,EAAE,CACnB,yDADmB,CA3LpB;AA8LHC,IAAAA,yBAAyB,EAAE,CAAC,oCAAD,CA9LxB;AA+LHC,IAAAA,wBAAwB,EAAE,CACtB,kDADsB,CA/LvB;AAkMH9Q,IAAAA,WAAW,EAAE,CAAC,mCAAD,CAlMV;AAmMH+Q,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CAnMf;AAoMHC,IAAAA,cAAc,EAAE,CAAC,gCAAD,CApMb;AAqMHC,IAAAA,sBAAsB,EAAE,CACpB,gEADoB,CArMrB;AAwMHC,IAAAA,eAAe,EAAE,CAAC,uCAAD,CAxMd;AAyMHlO,IAAAA,wBAAwB,EAAE,CAAC,iBAAD,CAzMvB;AA0MHC,IAAAA,UAAU,EAAE,CAAC,uBAAD,CA1MT;AA2MHhD,IAAAA,WAAW,EAAE,CAAC,6BAAD,CA3MV;AA4MHC,IAAAA,SAAS,EAAE,CAAC,iCAAD,CA5MR;AA6MHiR,IAAAA,eAAe,EAAE,CAAC,uCAAD,CA7Md;AA8MHC,IAAAA,mCAAmC,EAAE,CAAC,kCAAD,CA9MlC;AA+MHC,IAAAA,aAAa,EAAE,CAAC,qCAAD,CA/MZ;AAgNHC,IAAAA,eAAe,EAAE,CAAC,wCAAD,CAhNd;AAiNHnR,IAAAA,UAAU,EAAE,CAAC,mBAAD,CAjNT;AAkNHoR,IAAAA,oCAAoC,EAAE,CAClC,sDADkC,EAElC;AAAE/V,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFkC,CAlNnC;AAsNH+V,IAAAA,iBAAiB,EAAE,CACf,wDADe,CAtNhB;AAyNHC,IAAAA,YAAY,EAAE,CAAC,oCAAD,CAzNX;AA0NHC,IAAAA,QAAQ,EAAE,CAAC,gCAAD,CA1NP;AA2NHC,IAAAA,SAAS,EAAE,CAAC,iCAAD,CA3NR;AA4NH5K,IAAAA,YAAY,EAAE,CAAC,iCAAD,CA5NX;AA6NH+C,IAAAA,KAAK,EAAE,CAAC,mCAAD,CA7NJ;AA8NH9C,IAAAA,WAAW,EAAE,CAAC,kDAAD,CA9NV;AA+NH4K,IAAAA,2BAA2B,EAAE,CACzB,6EADyB,EAEzB,EAFyB,EAGzB;AAAE9F,MAAAA,SAAS,EAAE;AAAb,KAHyB,CA/N1B;AAoOHnD,IAAAA,kBAAkB,EAAE,CAChB,uDADgB,CApOjB;AAuOHkJ,IAAAA,yBAAyB,EAAE,CACvB,2FADuB,EAEvB,EAFuB,EAGvB;AAAE/F,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAvOxB;AA4OHgG,IAAAA,2BAA2B,EAAE,CACzB,kFADyB,CA5O1B;AA+OHC,IAAAA,4BAA4B,EAAE,CAC1B,8EAD0B,EAE1B,EAF0B,EAG1B;AAAEjG,MAAAA,SAAS,EAAE;AAAb,KAH0B,CA/O3B;AAoPHkG,IAAAA,4BAA4B,EAAE,CAC1B,8EAD0B,EAE1B,EAF0B,EAG1B;AAAElG,MAAAA,SAAS,EAAE;AAAb,KAH0B,CApP3B;AAyPHmG,IAAAA,gBAAgB,EAAE,CACd,kCADc,EAEd;AAAEzW,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFc,CAzPf;AA6PHyW,IAAAA,iBAAiB,EAAE,CAAC,yCAAD,CA7PhB;AA8PHC,IAAAA,wBAAwB,EAAE,CACtB,wEADsB,CA9PvB;AAiQHC,IAAAA,wBAAwB,EAAE,CACtB,0EADsB,EAEtB,EAFsB,EAGtB;AAAEtG,MAAAA,SAAS,EAAE;AAAb,KAHsB,CAjQvB;AAsQHuG,IAAAA,sBAAsB,EAAE,CACpB,wFADoB,EAEpB,EAFoB,EAGpB;AAAEvG,MAAAA,SAAS,EAAE;AAAb,KAHoB,CAtQrB;AA2QHwG,IAAAA,yBAAyB,EAAE,CACvB,2EADuB,EAEvB,EAFuB,EAGvB;AAAExG,MAAAA,SAAS,EAAE;AAAb,KAHuB,CA3QxB;AAgRHyG,IAAAA,yBAAyB,EAAE,CACvB,2EADuB,EAEvB,EAFuB,EAGvB;AAAEzG,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAhRxB;AAqRH0G,IAAAA,eAAe,EAAE,CAAC,kDAAD,CArRd;AAsRHC,IAAAA,QAAQ,EAAE,CAAC,qCAAD,CAtRP;AAuRHjU,IAAAA,MAAM,EAAE,CAAC,6BAAD,CAvRL;AAwRHkU,IAAAA,sBAAsB,EAAE,CACpB,wDADoB,CAxRrB;AA2RHC,IAAAA,mBAAmB,EAAE,CAAC,mDAAD,CA3RlB;AA4RHC,IAAAA,+BAA+B,EAAE,CAAC,iCAAD,CA5R9B;AA6RHC,IAAAA,gBAAgB,EAAE,CACd,yDADc,CA7Rf;AAgSHC,IAAAA,iCAAiC,EAAE,CAC/B,wFAD+B,CAhShC;AAmSHC,IAAAA,aAAa,EAAE,CAAC,mDAAD,CAnSZ;AAoSHC,IAAAA,kBAAkB,EAAE,CAChB,wDADgB,CApSjB;AAuSHC,IAAAA,0BAA0B,EAAE,CACxB,iFADwB,CAvSzB;AA0SHxL,IAAAA,aAAa,EAAE,CAAC,6CAAD,CA1SZ;AA2SHyL,IAAAA,kBAAkB,EAAE,CAChB,sEADgB,EAEhB;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAFgB;AA3SjB,GAhxBO;AAgkCdC,EAAAA,MAAM,EAAE;AACJC,IAAAA,IAAI,EAAE,CAAC,kBAAD,CADF;AAEJC,IAAAA,OAAO,EAAE,CAAC,qBAAD,EAAwB;AAAE9X,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAAxB,CAFL;AAGJ8X,IAAAA,qBAAqB,EAAE,CAAC,oBAAD,CAHnB;AAIJC,IAAAA,MAAM,EAAE,CAAC,oBAAD,CAJJ;AAKJ7H,IAAAA,KAAK,EAAE,CAAC,0BAAD,CALH;AAMJ8H,IAAAA,MAAM,EAAE,CAAC,oBAAD,EAAuB;AAAEjY,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAAvB,CANJ;AAOJiY,IAAAA,KAAK,EAAE,CAAC,mBAAD;AAPH,GAhkCM;AAykCdC,EAAAA,KAAK,EAAE;AACHC,IAAAA,iCAAiC,EAAE,CAC/B,0DAD+B,CADhC;AAIHC,IAAAA,kCAAkC,EAAE,CAChC,yDADgC,EAEhC;AAAErY,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFgC,CAJjC;AAQHqY,IAAAA,+BAA+B,EAAE,CAC7B,wDAD6B,CAR9B;AAWHC,IAAAA,+BAA+B,EAAE,CAC7B,yDAD6B,EAE7B;AAAEvY,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAF6B,CAX9B;AAeHuY,IAAAA,4BAA4B,EAAE,CAC1B,wDAD0B,CAf3B;AAkBHlW,IAAAA,MAAM,EAAE,CAAC,wBAAD,CAlBL;AAmBHmW,IAAAA,4BAA4B,EAAE,CAC1B,6EAD0B,CAnB3B;AAsBHC,IAAAA,qBAAqB,EAAE,CAAC,gDAAD,CAtBpB;AAuBHC,IAAAA,4BAA4B,EAAE,CAC1B,gGAD0B,CAvB3B;AA0BHC,IAAAA,qBAAqB,EAAE,CACnB,sEADmB,CA1BpB;AA6BHC,IAAAA,WAAW,EAAE,CAAC,sCAAD,CA7BV;AA8BHC,IAAAA,SAAS,EAAE,CAAC,mCAAD,CA9BR;AA+BHC,IAAAA,yBAAyB,EAAE,CACvB,6FADuB,CA/BxB;AAkCHC,IAAAA,kBAAkB,EAAE,CAChB,mEADgB,CAlCjB;AAqCHC,IAAAA,yBAAyB,EAAE,CACvB,0DADuB,CArCxB;AAwCH3U,IAAAA,IAAI,EAAE,CAAC,uBAAD,CAxCH;AAyCH4U,IAAAA,cAAc,EAAE,CAAC,yCAAD,CAzCb;AA0CHC,IAAAA,2BAA2B,EAAE,CACzB,4EADyB,CA1C1B;AA6CHC,IAAAA,oBAAoB,EAAE,CAAC,+CAAD,CA7CnB;AA8CH5R,IAAAA,wBAAwB,EAAE,CAAC,iBAAD,CA9CvB;AA+CH6R,IAAAA,gBAAgB,EAAE,CAAC,2CAAD,CA/Cf;AAgDHC,IAAAA,2BAA2B,EAAE,CACzB,+CADyB,CAhD1B;AAmDHC,IAAAA,iBAAiB,EAAE,CACf,4CADe,EAEf;AAAEvZ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFe,CAnDhB;AAuDHuZ,IAAAA,cAAc,EAAE,CAAC,yCAAD,CAvDb;AAwDHC,IAAAA,4BAA4B,EAAE,CAC1B,6DAD0B,CAxD3B;AA2DHC,IAAAA,kBAAkB,EAAE,CAChB,4DADgB,CA3DjB;AA8DHC,IAAAA,eAAe,EAAE,CACb,2DADa,CA9Dd;AAiEHC,IAAAA,4BAA4B,EAAE,CAC1B,+FAD0B,CAjE3B;AAoEHC,IAAAA,qBAAqB,EAAE,CACnB,qEADmB,CApEpB;AAuEHC,IAAAA,WAAW,EAAE,CAAC,qCAAD;AAvEV,GAzkCO;AAkpCd5B,EAAAA,KAAK,EAAE;AACH6B,IAAAA,wBAAwB,EAAE,CAAC,mBAAD,CADvB;AAEHC,IAAAA,KAAK,EAAE,CAAC,6BAAD,CAFJ;AAGHC,IAAAA,YAAY,EAAE,CAAC,6BAAD,CAHX;AAIHC,IAAAA,qBAAqB,EAAE,CAAC,+CAAD,CAJpB;AAKHC,IAAAA,oCAAoC,EAAE,CAAC,gCAAD,CALnC;AAMHC,IAAAA,4BAA4B,EAAE,CAAC,qBAAD,CAN3B;AAOHC,IAAAA,kCAAkC,EAAE,CAAC,iBAAD,CAPjC;AAQHC,IAAAA,2BAA2B,EAAE,CAAC,qBAAD,CAR1B;AASHC,IAAAA,4BAA4B,EAAE,CAAC,oCAAD,CAT3B;AAUHC,IAAAA,kCAAkC,EAAE,CAAC,4BAAD,CAVjC;AAWHC,IAAAA,MAAM,EAAE,CAAC,gCAAD,CAXL;AAYHla,IAAAA,gBAAgB,EAAE,CAAC,WAAD,CAZf;AAaHma,IAAAA,aAAa,EAAE,CAAC,uBAAD,CAbZ;AAcHC,IAAAA,iBAAiB,EAAE,CAAC,iCAAD,CAdhB;AAeHC,IAAAA,yBAAyB,EAAE,CAAC,iCAAD,CAfxB;AAgBHC,IAAAA,+BAA+B,EAAE,CAAC,yBAAD,CAhB9B;AAiBHvW,IAAAA,IAAI,EAAE,CAAC,YAAD,CAjBH;AAkBHwW,IAAAA,0BAA0B,EAAE,CAAC,kBAAD,CAlBzB;AAmBHC,IAAAA,0BAA0B,EAAE,CAAC,kBAAD,CAnBzB;AAoBHC,IAAAA,2BAA2B,EAAE,CAAC,qBAAD,CApB1B;AAqBHC,IAAAA,iCAAiC,EAAE,CAAC,qBAAD,CArBhC;AAsBHC,IAAAA,oBAAoB,EAAE,CAAC,iCAAD,CAtBnB;AAuBHC,IAAAA,oBAAoB,EAAE,CAAC,iCAAD,CAvBnB;AAwBHC,IAAAA,2BAA2B,EAAE,CAAC,oBAAD,CAxB1B;AAyBHC,IAAAA,kBAAkB,EAAE,CAAC,gCAAD,CAzBjB;AA0BHC,IAAAA,gCAAgC,EAAE,CAAC,yBAAD,CA1B/B;AA2BHC,IAAAA,qBAAqB,EAAE,CAAC,4BAAD,CA3BpB;AA4BHC,IAAAA,iCAAiC,EAAE,CAAC,gBAAD,CA5BhC;AA6BHC,IAAAA,yCAAyC,EAAE,CAAC,8BAAD,CA7BxC;AA8BHC,IAAAA,OAAO,EAAE,CAAC,gCAAD,CA9BN;AA+BHC,IAAAA,QAAQ,EAAE,CAAC,mCAAD,CA/BP;AAgCHC,IAAAA,mBAAmB,EAAE,CAAC,aAAD;AAhClB;AAlpCO,CAAlB;;ACAO,MAAMC,OAAO,GAAG,mBAAhB;;ACAA,SAASC,kBAAT,CAA4BC,OAA5B,EAAqCC,YAArC,EAAmD;AACtD,QAAMC,UAAU,GAAG,EAAnB;;AACA,OAAK,MAAM,CAACC,KAAD,EAAQC,SAAR,CAAX,IAAiCC,MAAM,CAACC,OAAP,CAAeL,YAAf,CAAjC,EAA+D;AAC3D,SAAK,MAAM,CAACM,UAAD,EAAaC,QAAb,CAAX,IAAqCH,MAAM,CAACC,OAAP,CAAeF,SAAf,CAArC,EAAgE;AAC5D,YAAM,CAACK,KAAD,EAAQC,QAAR,EAAkBC,WAAlB,IAAiCH,QAAvC;AACA,YAAM,CAACI,MAAD,EAASC,GAAT,IAAgBJ,KAAK,CAACK,KAAN,CAAY,GAAZ,CAAtB;AACA,YAAMC,gBAAgB,GAAGV,MAAM,CAACW,MAAP,CAAc;AAAEJ,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAd,EAA+BH,QAA/B,CAAzB;;AACA,UAAI,CAACR,UAAU,CAACC,KAAD,CAAf,EAAwB;AACpBD,QAAAA,UAAU,CAACC,KAAD,CAAV,GAAoB,EAApB;AACH;;AACD,YAAMc,YAAY,GAAGf,UAAU,CAACC,KAAD,CAA/B;;AACA,UAAIQ,WAAJ,EAAiB;AACbM,QAAAA,YAAY,CAACV,UAAD,CAAZ,GAA2BW,QAAQ,CAAClB,OAAD,EAAUG,KAAV,EAAiBI,UAAjB,EAA6BQ,gBAA7B,EAA+CJ,WAA/C,CAAnC;AACA;AACH;;AACDM,MAAAA,YAAY,CAACV,UAAD,CAAZ,GAA2BP,OAAO,CAACmB,OAAR,CAAgBT,QAAhB,CAAyBK,gBAAzB,CAA3B;AACH;AACJ;;AACD,SAAOb,UAAP;AACH;;AACD,SAASgB,QAAT,CAAkBlB,OAAlB,EAA2BG,KAA3B,EAAkCI,UAAlC,EAA8CG,QAA9C,EAAwDC,WAAxD,EAAqE;AACjE,QAAMS,mBAAmB,GAAGpB,OAAO,CAACmB,OAAR,CAAgBT,QAAhB,CAAyBA,QAAzB,CAA5B;AACA;;AACA,WAASW,eAAT,CAAyB,GAAGC,IAA5B,EAAkC;AAC9B;AACA,QAAIC,OAAO,GAAGH,mBAAmB,CAACZ,QAApB,CAA6BjO,KAA7B,CAAmC,GAAG+O,IAAtC,CAAd,CAF8B;;AAI9B,QAAIX,WAAW,CAACpM,SAAhB,EAA2B;AACvBgN,MAAAA,OAAO,GAAGlB,MAAM,CAACW,MAAP,CAAc,EAAd,EAAkBO,OAAlB,EAA2B;AACjCC,QAAAA,IAAI,EAAED,OAAO,CAACZ,WAAW,CAACpM,SAAb,CADoB;AAEjC,SAACoM,WAAW,CAACpM,SAAb,GAAyBkN;AAFQ,OAA3B,CAAV;AAIA,aAAOL,mBAAmB,CAACG,OAAD,CAA1B;AACH;;AACD,QAAIZ,WAAW,CAACe,OAAhB,EAAyB;AACrB,YAAM,CAACC,QAAD,EAAWC,aAAX,IAA4BjB,WAAW,CAACe,OAA9C;AACA1B,MAAAA,OAAO,CAAC6B,GAAR,CAAYC,IAAZ,CAAkB,WAAU3B,KAAM,IAAGI,UAAW,kCAAiCoB,QAAS,IAAGC,aAAc,IAA3G;AACH;;AACD,QAAIjB,WAAW,CAAC9M,UAAhB,EAA4B;AACxBmM,MAAAA,OAAO,CAAC6B,GAAR,CAAYC,IAAZ,CAAiBnB,WAAW,CAAC9M,UAA7B;AACH;;AACD,QAAI8M,WAAW,CAACvZ,iBAAhB,EAAmC;AAC/B;AACA,YAAMma,OAAO,GAAGH,mBAAmB,CAACZ,QAApB,CAA6BjO,KAA7B,CAAmC,GAAG+O,IAAtC,CAAhB;;AACA,WAAK,MAAM,CAACS,IAAD,EAAOC,KAAP,CAAX,IAA4B3B,MAAM,CAACC,OAAP,CAAeK,WAAW,CAACvZ,iBAA3B,CAA5B,EAA2E;AACvE,YAAI2a,IAAI,IAAIR,OAAZ,EAAqB;AACjBvB,UAAAA,OAAO,CAAC6B,GAAR,CAAYC,IAAZ,CAAkB,IAAGC,IAAK,0CAAyC5B,KAAM,IAAGI,UAAW,aAAYyB,KAAM,WAAzG;;AACA,cAAI,EAAEA,KAAK,IAAIT,OAAX,CAAJ,EAAyB;AACrBA,YAAAA,OAAO,CAACS,KAAD,CAAP,GAAiBT,OAAO,CAACQ,IAAD,CAAxB;AACH;;AACD,iBAAOR,OAAO,CAACQ,IAAD,CAAd;AACH;AACJ;;AACD,aAAOX,mBAAmB,CAACG,OAAD,CAA1B;AACH,KA/B6B;;;AAiC9B,WAAOH,mBAAmB,CAAC,GAAGE,IAAJ,CAA1B;AACH;;AACD,SAAOjB,MAAM,CAACW,MAAP,CAAcK,eAAd,EAA+BD,mBAA/B,CAAP;AACH;;ACxDD;;;;;;;;;;;AAUA,AAAO,SAASa,mBAAT,CAA6BjC,OAA7B,EAAsC;AACzC,SAAOD,kBAAkB,CAACC,OAAD,EAAUkC,SAAV,CAAzB;AACH;AACDD,mBAAmB,CAACnC,OAApB,GAA8BA,OAA9B;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/generated/endpoints.js","../dist-src/version.js","../dist-src/endpoints-to-methods.js","../dist-src/index.js"],"sourcesContent":["const Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n approveWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\",\n ],\n cancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\",\n ],\n createOrUpdateEnvironmentSecret: [\n \"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n createRegistrationTokenForOrg: [\n \"POST /orgs/{org}/actions/runners/registration-token\",\n ],\n createRegistrationTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/registration-token\",\n ],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/remove-token\",\n ],\n createWorkflowDispatch: [\n \"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\",\n ],\n deleteArtifact: [\n \"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\",\n ],\n deleteEnvironmentSecret: [\n \"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n deleteSelfHostedRunnerFromOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}\",\n ],\n deleteSelfHostedRunnerFromRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\n \"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n disableSelectedRepositoryGithubActionsOrganization: [\n \"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\",\n ],\n disableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\",\n ],\n downloadArtifact: [\n \"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\",\n ],\n downloadJobLogsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\",\n ],\n downloadWorkflowRunLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n enableSelectedRepositoryGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\",\n ],\n enableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\",\n ],\n getAllowedActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/selected-actions\",\n ],\n getAllowedActionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\",\n ],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\",\n ],\n getEnvironmentSecret: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n getGithubActionsPermissionsOrganization: [\n \"GET /orgs/{org}/actions/permissions\",\n ],\n getGithubActionsPermissionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n ],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\",\n ],\n getRepoPermissions: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n {},\n { renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"] },\n ],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\",\n ],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunUsage: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\",\n ],\n getWorkflowUsage: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\",\n ],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\",\n ],\n listJobsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n ],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n ],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/repositories\",\n ],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n ],\n listWorkflowRuns: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n ],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n reviewPendingDeploymentsForRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\",\n ],\n setAllowedActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/selected-actions\",\n ],\n setAllowedActionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\",\n ],\n setGithubActionsPermissionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions\",\n ],\n setGithubActionsPermissionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories\",\n ],\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\n \"DELETE /notifications/threads/{thread_id}/subscription\",\n ],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\n \"GET /notifications/threads/{thread_id}/subscription\",\n ],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\n \"GET /users/{username}/events/orgs/{org}\",\n ],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\n \"GET /users/{username}/received_events/public\",\n ],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/notifications\",\n ],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\n \"PUT /notifications/threads/{thread_id}/subscription\",\n ],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"],\n },\n apps: {\n addRepoToInstallation: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\n \"POST /content_references/{content_reference_id}/attachments\",\n { mediaType: { previews: [\"corsair\"] } },\n ],\n createContentAttachmentForRepo: [\n \"POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\",\n { mediaType: { previews: [\"corsair\"] } },\n ],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\n \"POST /app/installations/{installation_id}/access_tokens\",\n ],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\n \"GET /marketplace_listing/accounts/{account_id}\",\n ],\n getSubscriptionPlanForAccountStubbed: [\n \"GET /marketplace_listing/stubbed/accounts/{account_id}\",\n ],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n ],\n listInstallationReposForAuthenticatedUser: [\n \"GET /user/installations/{installation_id}/repositories\",\n ],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\n \"GET /user/marketplace_purchases/stubbed\",\n ],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\n \"POST /app/hook/deliveries/{delivery_id}/attempts\",\n ],\n removeRepoFromInstallation: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\n \"DELETE /app/installations/{installation_id}/suspended\",\n ],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"],\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\n \"GET /users/{username}/settings/billing/actions\",\n ],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\n \"GET /users/{username}/settings/billing/packages\",\n ],\n getSharedStorageBillingOrg: [\n \"GET /orgs/{org}/settings/billing/shared-storage\",\n ],\n getSharedStorageBillingUser: [\n \"GET /users/{username}/settings/billing/shared-storage\",\n ],\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n ],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n ],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestSuite: [\n \"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\",\n ],\n setSuitesPreferences: [\n \"PATCH /repos/{owner}/{repo}/check-suites/preferences\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n },\n codeScanning: {\n deleteAnalysis: [\n \"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\",\n ],\n getAlert: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n {},\n { renamedParameters: { alert_id: \"alert_number\" } },\n ],\n getAnalysis: [\n \"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\",\n ],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n ],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n {},\n { renamed: [\"codeScanning\", \"listAlertInstances\"] },\n ],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n ],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"],\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"],\n getForRepo: [\n \"GET /repos/{owner}/{repo}/community/code_of_conduct\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n },\n emojis: { get: [\"GET /emojis\"] },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\n \"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\",\n ],\n enableSelectedOrganizationGithubActionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\",\n ],\n getAllowedActionsEnterprise: [\n \"GET /enterprises/{enterprise}/actions/permissions/selected-actions\",\n ],\n getGithubActionsPermissionsEnterprise: [\n \"GET /enterprises/{enterprise}/actions/permissions\",\n ],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\n \"GET /enterprises/{enterprise}/actions/permissions/organizations\",\n ],\n setAllowedActionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\",\n ],\n setGithubActionsPermissionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions\",\n ],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions/organizations\",\n ],\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"],\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"],\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"],\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\n \"GET /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"] },\n ],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\n \"DELETE /repos/{owner}/{repo}/interaction-limits\",\n ],\n removeRestrictionsForYourPublicRepos: [\n \"DELETE /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"] },\n ],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\n \"PUT /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"] },\n ],\n },\n issues: {\n addAssignees: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n ],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\",\n ],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\n \"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n { mediaType: { previews: [\"mockingbird\"] } },\n ],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n ],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n removeAssignees: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n removeLabel: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\",\n ],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\n \"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"],\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\n \"POST /markdown/raw\",\n { headers: { \"content-type\": \"text/plain; charset=utf-8\" } },\n ],\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"],\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n deleteArchiveForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n downloadArchiveForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getArchiveForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getStatusForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForAuthenticatedUser: [\n \"GET /user/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n unlockRepoForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"],\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\n \"PUT /orgs/{org}/outside_collaborators/{username}\",\n ],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\",\n ],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\",\n ],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\n \"DELETE /orgs/{org}/outside_collaborators/{username}\",\n ],\n removePublicMembershipForAuthenticatedUser: [\n \"DELETE /orgs/{org}/public_members/{username}\",\n ],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\n \"PUT /orgs/{org}/public_members/{username}\",\n ],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\n \"PATCH /user/memberships/orgs/{org}\",\n ],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"],\n },\n packages: {\n deletePackageForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}\",\n ],\n deletePackageForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}\",\n ],\n deletePackageVersionForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n deletePackageVersionForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n {},\n { renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"] },\n ],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n {},\n {\n renamed: [\n \"packages\",\n \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\",\n ],\n },\n ],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n ],\n getAllPackageVersionsForPackageOwnedByOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n ],\n getAllPackageVersionsForPackageOwnedByUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions\",\n ],\n getPackageForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}\",\n ],\n getPackageForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}\",\n ],\n getPackageForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}\",\n ],\n getPackageVersionForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getPackageVersionForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getPackageVersionForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n restorePackageForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageVersionForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n restorePackageVersionForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n },\n projects: {\n addCollaborator: [\n \"PUT /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createCard: [\n \"POST /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createColumn: [\n \"POST /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForAuthenticatedUser: [\n \"POST /user/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForOrg: [\n \"POST /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForRepo: [\n \"POST /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n delete: [\n \"DELETE /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteCard: [\n \"DELETE /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteColumn: [\n \"DELETE /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n get: [\n \"GET /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getCard: [\n \"GET /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getColumn: [\n \"GET /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getPermissionForUser: [\n \"GET /projects/{project_id}/collaborators/{username}/permission\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCards: [\n \"GET /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCollaborators: [\n \"GET /projects/{project_id}/collaborators\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listColumns: [\n \"GET /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForRepo: [\n \"GET /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForUser: [\n \"GET /users/{username}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveCard: [\n \"POST /projects/columns/cards/{card_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveColumn: [\n \"POST /projects/columns/{column_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n removeCollaborator: [\n \"DELETE /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n update: [\n \"PATCH /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateCard: [\n \"PATCH /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateColumn: [\n \"PATCH /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\",\n ],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n deletePendingReview: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n deleteReviewComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n dismissReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\",\n ],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n listReviewComments: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n requestReviewers: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n submitReview: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\",\n { mediaType: { previews: [\"lydian\"] } },\n ],\n updateReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n updateReviewComment: [\n \"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n },\n rateLimit: { get: [\"GET /rate_limit\"] },\n reactions: {\n createForCommitComment: [\n \"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssueComment: [\n \"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForPullRequestReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForRelease: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForCommitComment: [\n \"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssueComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForPullRequestComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussion: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussionComment: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteLegacy: [\n \"DELETE /reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n {\n deprecated: \"octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy\",\n },\n ],\n listForCommitComment: [\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssueComment: [\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForPullRequestReviewComment: [\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n addTeamAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n addUserAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\n \"GET /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\n \"GET /repos/{owner}/{repo}/compare/{basehead}\",\n ],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\n \"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n createCommitSignatureProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\n \"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\n \"POST /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\n \"POST /repos/{template_owner}/{template_repo}/generate\",\n { mediaType: { previews: [\"baptiste\"] } },\n ],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n deleteAdminBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n deleteAnEnvironment: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\n \"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\",\n ],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\n \"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n deletePagesSite: [\n \"DELETE /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n deletePullRequestReviewProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\n \"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\n \"DELETE /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n disableVulnerabilityAlerts: [\n \"DELETE /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n downloadArchive: [\n \"GET /repos/{owner}/{repo}/zipball/{ref}\",\n {},\n { renamed: [\"repos\", \"downloadZipballArchive\"] },\n ],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\n \"PUT /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n enableVulnerabilityAlerts: [\n \"PUT /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n getAdminBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n ],\n getAllTopics: [\n \"GET /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n getAppsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n ],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\n \"GET /repos/{owner}/{repo}/collaborators/{username}/permission\",\n ],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\",\n ],\n getEnvironment: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n getTeamsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n ],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n ],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\",\n ],\n getWebhookDelivery: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\",\n ],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listReleaseAssets: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n ],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n ],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\",\n ],\n removeAppAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n removeCollaborator: [\n \"DELETE /repos/{owner}/{repo}/collaborators/{username}\",\n ],\n removeStatusCheckContexts: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n removeStatusCheckProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n removeTeamAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n removeUserAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\n \"PUT /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n setAppAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n setStatusCheckContexts: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n setTeamAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n setUserAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\n \"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n updatePullRequestReviewProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\n \"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n updateStatusCheckPotection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n {},\n { renamed: [\"repos\", \"updateStatusCheckProtection\"] },\n ],\n updateStatusCheckProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\n \"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\",\n ],\n uploadReleaseAsset: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\",\n { baseUrl: \"https://uploads.github.com\" },\n ],\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\", { mediaType: { previews: [\"cloak\"] } }],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", { mediaType: { previews: [\"mercy\"] } }],\n users: [\"GET /search/users\"],\n },\n secretScanning: {\n getAlert: [\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\",\n ],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\",\n ],\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n addOrUpdateProjectPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n addOrUpdateRepoPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n checkPermissionsForProjectInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n checkPermissionsForRepoInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n deleteDiscussionInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n getDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n getMembershipForUserInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n ],\n listProjectsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n removeProjectInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n ],\n removeRepoInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n updateDiscussionCommentInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n updateDiscussionInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"],\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"],\n },\n};\nexport default Endpoints;\n","export const VERSION = \"5.8.0\";\n","export function endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({ method, url }, defaults);\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n const scopeMethods = newMethods[scope];\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined,\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n","import ENDPOINTS from \"./generated/endpoints\";\nimport { VERSION } from \"./version\";\nimport { endpointsToMethods } from \"./endpoints-to-methods\";\nexport function restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, ENDPOINTS);\n return {\n rest: api,\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nexport function legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, ENDPOINTS);\n return {\n ...api,\n rest: api,\n };\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n"],"names":["Endpoints","actions","addSelectedRepoToOrgSecret","approveWorkflowRun","cancelWorkflowRun","createOrUpdateEnvironmentSecret","createOrUpdateOrgSecret","createOrUpdateRepoSecret","createRegistrationTokenForOrg","createRegistrationTokenForRepo","createRemoveTokenForOrg","createRemoveTokenForRepo","createWorkflowDispatch","deleteArtifact","deleteEnvironmentSecret","deleteOrgSecret","deleteRepoSecret","deleteSelfHostedRunnerFromOrg","deleteSelfHostedRunnerFromRepo","deleteWorkflowRun","deleteWorkflowRunLogs","disableSelectedRepositoryGithubActionsOrganization","disableWorkflow","downloadArtifact","downloadJobLogsForWorkflowRun","downloadWorkflowRunLogs","enableSelectedRepositoryGithubActionsOrganization","enableWorkflow","getAllowedActionsOrganization","getAllowedActionsRepository","getArtifact","getEnvironmentPublicKey","getEnvironmentSecret","getGithubActionsPermissionsOrganization","getGithubActionsPermissionsRepository","getJobForWorkflowRun","getOrgPublicKey","getOrgSecret","getPendingDeploymentsForRun","getRepoPermissions","renamed","getRepoPublicKey","getRepoSecret","getReviewsForRun","getSelfHostedRunnerForOrg","getSelfHostedRunnerForRepo","getWorkflow","getWorkflowRun","getWorkflowRunUsage","getWorkflowUsage","listArtifactsForRepo","listEnvironmentSecrets","listJobsForWorkflowRun","listOrgSecrets","listRepoSecrets","listRepoWorkflows","listRunnerApplicationsForOrg","listRunnerApplicationsForRepo","listSelectedReposForOrgSecret","listSelectedRepositoriesEnabledGithubActionsOrganization","listSelfHostedRunnersForOrg","listSelfHostedRunnersForRepo","listWorkflowRunArtifacts","listWorkflowRuns","listWorkflowRunsForRepo","reRunWorkflow","removeSelectedRepoFromOrgSecret","reviewPendingDeploymentsForRun","setAllowedActionsOrganization","setAllowedActionsRepository","setGithubActionsPermissionsOrganization","setGithubActionsPermissionsRepository","setSelectedReposForOrgSecret","setSelectedRepositoriesEnabledGithubActionsOrganization","activity","checkRepoIsStarredByAuthenticatedUser","deleteRepoSubscription","deleteThreadSubscription","getFeeds","getRepoSubscription","getThread","getThreadSubscriptionForAuthenticatedUser","listEventsForAuthenticatedUser","listNotificationsForAuthenticatedUser","listOrgEventsForAuthenticatedUser","listPublicEvents","listPublicEventsForRepoNetwork","listPublicEventsForUser","listPublicOrgEvents","listReceivedEventsForUser","listReceivedPublicEventsForUser","listRepoEvents","listRepoNotificationsForAuthenticatedUser","listReposStarredByAuthenticatedUser","listReposStarredByUser","listReposWatchedByUser","listStargazersForRepo","listWatchedReposForAuthenticatedUser","listWatchersForRepo","markNotificationsAsRead","markRepoNotificationsAsRead","markThreadAsRead","setRepoSubscription","setThreadSubscription","starRepoForAuthenticatedUser","unstarRepoForAuthenticatedUser","apps","addRepoToInstallation","checkToken","createContentAttachment","mediaType","previews","createContentAttachmentForRepo","createFromManifest","createInstallationAccessToken","deleteAuthorization","deleteInstallation","deleteToken","getAuthenticated","getBySlug","getInstallation","getOrgInstallation","getRepoInstallation","getSubscriptionPlanForAccount","getSubscriptionPlanForAccountStubbed","getUserInstallation","getWebhookConfigForApp","getWebhookDelivery","listAccountsForPlan","listAccountsForPlanStubbed","listInstallationReposForAuthenticatedUser","listInstallations","listInstallationsForAuthenticatedUser","listPlans","listPlansStubbed","listReposAccessibleToInstallation","listSubscriptionsForAuthenticatedUser","listSubscriptionsForAuthenticatedUserStubbed","listWebhookDeliveries","redeliverWebhookDelivery","removeRepoFromInstallation","resetToken","revokeInstallationAccessToken","scopeToken","suspendInstallation","unsuspendInstallation","updateWebhookConfigForApp","billing","getGithubActionsBillingOrg","getGithubActionsBillingUser","getGithubPackagesBillingOrg","getGithubPackagesBillingUser","getSharedStorageBillingOrg","getSharedStorageBillingUser","checks","create","createSuite","get","getSuite","listAnnotations","listForRef","listForSuite","listSuitesForRef","rerequestSuite","setSuitesPreferences","update","codeScanning","deleteAnalysis","getAlert","renamedParameters","alert_id","getAnalysis","getSarif","listAlertInstances","listAlertsForRepo","listAlertsInstances","listRecentAnalyses","updateAlert","uploadSarif","codesOfConduct","getAllCodesOfConduct","getConductCode","getForRepo","emojis","enterpriseAdmin","disableSelectedOrganizationGithubActionsEnterprise","enableSelectedOrganizationGithubActionsEnterprise","getAllowedActionsEnterprise","getGithubActionsPermissionsEnterprise","listSelectedOrganizationsEnabledGithubActionsEnterprise","setAllowedActionsEnterprise","setGithubActionsPermissionsEnterprise","setSelectedOrganizationsEnabledGithubActionsEnterprise","gists","checkIsStarred","createComment","delete","deleteComment","fork","getComment","getRevision","list","listComments","listCommits","listForUser","listForks","listPublic","listStarred","star","unstar","updateComment","git","createBlob","createCommit","createRef","createTag","createTree","deleteRef","getBlob","getCommit","getRef","getTag","getTree","listMatchingRefs","updateRef","gitignore","getAllTemplates","getTemplate","interactions","getRestrictionsForAuthenticatedUser","getRestrictionsForOrg","getRestrictionsForRepo","getRestrictionsForYourPublicRepos","removeRestrictionsForAuthenticatedUser","removeRestrictionsForOrg","removeRestrictionsForRepo","removeRestrictionsForYourPublicRepos","setRestrictionsForAuthenticatedUser","setRestrictionsForOrg","setRestrictionsForRepo","setRestrictionsForYourPublicRepos","issues","addAssignees","addLabels","checkUserCanBeAssigned","createLabel","createMilestone","deleteLabel","deleteMilestone","getEvent","getLabel","getMilestone","listAssignees","listCommentsForRepo","listEvents","listEventsForRepo","listEventsForTimeline","listForAuthenticatedUser","listForOrg","listForRepo","listLabelsForMilestone","listLabelsForRepo","listLabelsOnIssue","listMilestones","lock","removeAllLabels","removeAssignees","removeLabel","setLabels","unlock","updateLabel","updateMilestone","licenses","getAllCommonlyUsed","markdown","render","renderRaw","headers","meta","getOctocat","getZen","root","migrations","cancelImport","deleteArchiveForAuthenticatedUser","deleteArchiveForOrg","downloadArchiveForOrg","getArchiveForAuthenticatedUser","getCommitAuthors","getImportStatus","getLargeFiles","getStatusForAuthenticatedUser","getStatusForOrg","listReposForOrg","listReposForUser","mapCommitAuthor","setLfsPreference","startForAuthenticatedUser","startForOrg","startImport","unlockRepoForAuthenticatedUser","unlockRepoForOrg","updateImport","orgs","blockUser","cancelInvitation","checkBlockedUser","checkMembershipForUser","checkPublicMembershipForUser","convertMemberToOutsideCollaborator","createInvitation","createWebhook","deleteWebhook","getMembershipForAuthenticatedUser","getMembershipForUser","getWebhook","getWebhookConfigForOrg","listAppInstallations","listBlockedUsers","listFailedInvitations","listInvitationTeams","listMembers","listMembershipsForAuthenticatedUser","listOutsideCollaborators","listPendingInvitations","listPublicMembers","listWebhooks","pingWebhook","removeMember","removeMembershipForUser","removeOutsideCollaborator","removePublicMembershipForAuthenticatedUser","setMembershipForUser","setPublicMembershipForAuthenticatedUser","unblockUser","updateMembershipForAuthenticatedUser","updateWebhook","updateWebhookConfigForOrg","packages","deletePackageForAuthenticatedUser","deletePackageForOrg","deletePackageVersionForAuthenticatedUser","deletePackageVersionForOrg","getAllPackageVersionsForAPackageOwnedByAnOrg","getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser","getAllPackageVersionsForPackageOwnedByAuthenticatedUser","getAllPackageVersionsForPackageOwnedByOrg","getAllPackageVersionsForPackageOwnedByUser","getPackageForAuthenticatedUser","getPackageForOrganization","getPackageForUser","getPackageVersionForAuthenticatedUser","getPackageVersionForOrganization","getPackageVersionForUser","restorePackageForAuthenticatedUser","restorePackageForOrg","restorePackageVersionForAuthenticatedUser","restorePackageVersionForOrg","projects","addCollaborator","createCard","createColumn","createForAuthenticatedUser","createForOrg","createForRepo","deleteCard","deleteColumn","getCard","getColumn","getPermissionForUser","listCards","listCollaborators","listColumns","moveCard","moveColumn","removeCollaborator","updateCard","updateColumn","pulls","checkIfMerged","createReplyForReviewComment","createReview","createReviewComment","deletePendingReview","deleteReviewComment","dismissReview","getReview","getReviewComment","listCommentsForReview","listFiles","listRequestedReviewers","listReviewComments","listReviewCommentsForRepo","listReviews","merge","removeRequestedReviewers","requestReviewers","submitReview","updateBranch","updateReview","updateReviewComment","rateLimit","reactions","createForCommitComment","createForIssue","createForIssueComment","createForPullRequestReviewComment","createForRelease","createForTeamDiscussionCommentInOrg","createForTeamDiscussionInOrg","deleteForCommitComment","deleteForIssue","deleteForIssueComment","deleteForPullRequestComment","deleteForTeamDiscussion","deleteForTeamDiscussionComment","deleteLegacy","deprecated","listForCommitComment","listForIssue","listForIssueComment","listForPullRequestReviewComment","listForTeamDiscussionCommentInOrg","listForTeamDiscussionInOrg","repos","acceptInvitation","addAppAccessRestrictions","mapToData","addStatusCheckContexts","addTeamAccessRestrictions","addUserAccessRestrictions","checkCollaborator","checkVulnerabilityAlerts","compareCommits","compareCommitsWithBasehead","createAutolink","createCommitComment","createCommitSignatureProtection","createCommitStatus","createDeployKey","createDeployment","createDeploymentStatus","createDispatchEvent","createFork","createInOrg","createOrUpdateEnvironment","createOrUpdateFileContents","createPagesSite","createRelease","createUsingTemplate","declineInvitation","deleteAccessRestrictions","deleteAdminBranchProtection","deleteAnEnvironment","deleteAutolink","deleteBranchProtection","deleteCommitComment","deleteCommitSignatureProtection","deleteDeployKey","deleteDeployment","deleteFile","deleteInvitation","deletePagesSite","deletePullRequestReviewProtection","deleteRelease","deleteReleaseAsset","disableAutomatedSecurityFixes","disableVulnerabilityAlerts","downloadArchive","downloadTarballArchive","downloadZipballArchive","enableAutomatedSecurityFixes","enableVulnerabilityAlerts","getAccessRestrictions","getAdminBranchProtection","getAllEnvironments","getAllStatusCheckContexts","getAllTopics","getAppsWithAccessToProtectedBranch","getAutolink","getBranch","getBranchProtection","getClones","getCodeFrequencyStats","getCollaboratorPermissionLevel","getCombinedStatusForRef","getCommitActivityStats","getCommitComment","getCommitSignatureProtection","getCommunityProfileMetrics","getContent","getContributorsStats","getDeployKey","getDeployment","getDeploymentStatus","getEnvironment","getLatestPagesBuild","getLatestRelease","getPages","getPagesBuild","getPagesHealthCheck","getParticipationStats","getPullRequestReviewProtection","getPunchCardStats","getReadme","getReadmeInDirectory","getRelease","getReleaseAsset","getReleaseByTag","getStatusChecksProtection","getTeamsWithAccessToProtectedBranch","getTopPaths","getTopReferrers","getUsersWithAccessToProtectedBranch","getViews","getWebhookConfigForRepo","listAutolinks","listBranches","listBranchesForHeadCommit","listCommentsForCommit","listCommitCommentsForRepo","listCommitStatusesForRef","listContributors","listDeployKeys","listDeploymentStatuses","listDeployments","listInvitations","listInvitationsForAuthenticatedUser","listLanguages","listPagesBuilds","listPullRequestsAssociatedWithCommit","listReleaseAssets","listReleases","listTags","listTeams","removeAppAccessRestrictions","removeStatusCheckContexts","removeStatusCheckProtection","removeTeamAccessRestrictions","removeUserAccessRestrictions","renameBranch","replaceAllTopics","requestPagesBuild","setAdminBranchProtection","setAppAccessRestrictions","setStatusCheckContexts","setTeamAccessRestrictions","setUserAccessRestrictions","testPushWebhook","transfer","updateBranchProtection","updateCommitComment","updateInformationAboutPagesSite","updateInvitation","updatePullRequestReviewProtection","updateRelease","updateReleaseAsset","updateStatusCheckPotection","updateStatusCheckProtection","updateWebhookConfigForRepo","uploadReleaseAsset","baseUrl","search","code","commits","issuesAndPullRequests","labels","topics","users","secretScanning","teams","addOrUpdateMembershipForUserInOrg","addOrUpdateProjectPermissionsInOrg","addOrUpdateRepoPermissionsInOrg","checkPermissionsForProjectInOrg","checkPermissionsForRepoInOrg","createDiscussionCommentInOrg","createDiscussionInOrg","deleteDiscussionCommentInOrg","deleteDiscussionInOrg","deleteInOrg","getByName","getDiscussionCommentInOrg","getDiscussionInOrg","getMembershipForUserInOrg","listChildInOrg","listDiscussionCommentsInOrg","listDiscussionsInOrg","listMembersInOrg","listPendingInvitationsInOrg","listProjectsInOrg","listReposInOrg","removeMembershipForUserInOrg","removeProjectInOrg","removeRepoInOrg","updateDiscussionCommentInOrg","updateDiscussionInOrg","updateInOrg","addEmailForAuthenticated","block","checkBlocked","checkFollowingForUser","checkPersonIsFollowedByAuthenticated","createGpgKeyForAuthenticated","createPublicSshKeyForAuthenticated","deleteEmailForAuthenticated","deleteGpgKeyForAuthenticated","deletePublicSshKeyForAuthenticated","follow","getByUsername","getContextForUser","getGpgKeyForAuthenticated","getPublicSshKeyForAuthenticated","listBlockedByAuthenticated","listEmailsForAuthenticated","listFollowedByAuthenticated","listFollowersForAuthenticatedUser","listFollowersForUser","listFollowingForUser","listGpgKeysForAuthenticated","listGpgKeysForUser","listPublicEmailsForAuthenticated","listPublicKeysForUser","listPublicSshKeysForAuthenticated","setPrimaryEmailVisibilityForAuthenticated","unblock","unfollow","updateAuthenticated","VERSION","endpointsToMethods","octokit","endpointsMap","newMethods","scope","endpoints","Object","entries","methodName","endpoint","route","defaults","decorations","method","url","split","endpointDefaults","assign","scopeMethods","decorate","request","requestWithDefaults","withDecorations","args","options","data","undefined","newScope","newMethodName","log","warn","name","alias","restEndpointMethods","api","ENDPOINTS","rest","legacyRestEndpointMethods"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAMA,SAAS,GAAG;AACdC,EAAAA,OAAO,EAAE;AACLC,IAAAA,0BAA0B,EAAE,CACxB,4EADwB,CADvB;AAILC,IAAAA,kBAAkB,EAAE,CAChB,0DADgB,CAJf;AAOLC,IAAAA,iBAAiB,EAAE,CACf,yDADe,CAPd;AAULC,IAAAA,+BAA+B,EAAE,CAC7B,yFAD6B,CAV5B;AAaLC,IAAAA,uBAAuB,EAAE,CAAC,+CAAD,CAbpB;AAcLC,IAAAA,wBAAwB,EAAE,CACtB,yDADsB,CAdrB;AAiBLC,IAAAA,6BAA6B,EAAE,CAC3B,qDAD2B,CAjB1B;AAoBLC,IAAAA,8BAA8B,EAAE,CAC5B,+DAD4B,CApB3B;AAuBLC,IAAAA,uBAAuB,EAAE,CAAC,+CAAD,CAvBpB;AAwBLC,IAAAA,wBAAwB,EAAE,CACtB,yDADsB,CAxBrB;AA2BLC,IAAAA,sBAAsB,EAAE,CACpB,uEADoB,CA3BnB;AA8BLC,IAAAA,cAAc,EAAE,CACZ,8DADY,CA9BX;AAiCLC,IAAAA,uBAAuB,EAAE,CACrB,4FADqB,CAjCpB;AAoCLC,IAAAA,eAAe,EAAE,CAAC,kDAAD,CApCZ;AAqCLC,IAAAA,gBAAgB,EAAE,CACd,4DADc,CArCb;AAwCLC,IAAAA,6BAA6B,EAAE,CAC3B,gDAD2B,CAxC1B;AA2CLC,IAAAA,8BAA8B,EAAE,CAC5B,0DAD4B,CA3C3B;AA8CLC,IAAAA,iBAAiB,EAAE,CAAC,oDAAD,CA9Cd;AA+CLC,IAAAA,qBAAqB,EAAE,CACnB,yDADmB,CA/ClB;AAkDLC,IAAAA,kDAAkD,EAAE,CAChD,qEADgD,CAlD/C;AAqDLC,IAAAA,eAAe,EAAE,CACb,mEADa,CArDZ;AAwDLC,IAAAA,gBAAgB,EAAE,CACd,4EADc,CAxDb;AA2DLC,IAAAA,6BAA6B,EAAE,CAC3B,sDAD2B,CA3D1B;AA8DLC,IAAAA,uBAAuB,EAAE,CACrB,sDADqB,CA9DpB;AAiELC,IAAAA,iDAAiD,EAAE,CAC/C,kEAD+C,CAjE9C;AAoELC,IAAAA,cAAc,EAAE,CACZ,kEADY,CApEX;AAuELC,IAAAA,6BAA6B,EAAE,CAC3B,sDAD2B,CAvE1B;AA0ELC,IAAAA,2BAA2B,EAAE,CACzB,gEADyB,CA1ExB;AA6ELC,IAAAA,WAAW,EAAE,CAAC,2DAAD,CA7ER;AA8ELC,IAAAA,uBAAuB,EAAE,CACrB,sFADqB,CA9EpB;AAiFLC,IAAAA,oBAAoB,EAAE,CAClB,yFADkB,CAjFjB;AAoFLC,IAAAA,uCAAuC,EAAE,CACrC,qCADqC,CApFpC;AAuFLC,IAAAA,qCAAqC,EAAE,CACnC,+CADmC,CAvFlC;AA0FLC,IAAAA,oBAAoB,EAAE,CAAC,iDAAD,CA1FjB;AA2FLC,IAAAA,eAAe,EAAE,CAAC,4CAAD,CA3FZ;AA4FLC,IAAAA,YAAY,EAAE,CAAC,+CAAD,CA5FT;AA6FLC,IAAAA,2BAA2B,EAAE,CACzB,qEADyB,CA7FxB;AAgGLC,IAAAA,kBAAkB,EAAE,CAChB,+CADgB,EAEhB,EAFgB,EAGhB;AAAEC,MAAAA,OAAO,EAAE,CAAC,SAAD,EAAY,uCAAZ;AAAX,KAHgB,CAhGf;AAqGLC,IAAAA,gBAAgB,EAAE,CAAC,sDAAD,CArGb;AAsGLC,IAAAA,aAAa,EAAE,CAAC,yDAAD,CAtGV;AAuGLC,IAAAA,gBAAgB,EAAE,CACd,2DADc,CAvGb;AA0GLC,IAAAA,yBAAyB,EAAE,CAAC,6CAAD,CA1GtB;AA2GLC,IAAAA,0BAA0B,EAAE,CACxB,uDADwB,CA3GvB;AA8GLC,IAAAA,WAAW,EAAE,CAAC,2DAAD,CA9GR;AA+GLC,IAAAA,cAAc,EAAE,CAAC,iDAAD,CA/GX;AAgHLC,IAAAA,mBAAmB,EAAE,CACjB,wDADiB,CAhHhB;AAmHLC,IAAAA,gBAAgB,EAAE,CACd,kEADc,CAnHb;AAsHLC,IAAAA,oBAAoB,EAAE,CAAC,6CAAD,CAtHjB;AAuHLC,IAAAA,sBAAsB,EAAE,CACpB,2EADoB,CAvHnB;AA0HLC,IAAAA,sBAAsB,EAAE,CACpB,sDADoB,CA1HnB;AA6HLC,IAAAA,cAAc,EAAE,CAAC,iCAAD,CA7HX;AA8HLC,IAAAA,eAAe,EAAE,CAAC,2CAAD,CA9HZ;AA+HLC,IAAAA,iBAAiB,EAAE,CAAC,6CAAD,CA/Hd;AAgILC,IAAAA,4BAA4B,EAAE,CAAC,2CAAD,CAhIzB;AAiILC,IAAAA,6BAA6B,EAAE,CAC3B,qDAD2B,CAjI1B;AAoILC,IAAAA,6BAA6B,EAAE,CAC3B,4DAD2B,CApI1B;AAuILC,IAAAA,wDAAwD,EAAE,CACtD,kDADsD,CAvIrD;AA0ILC,IAAAA,2BAA2B,EAAE,CAAC,iCAAD,CA1IxB;AA2ILC,IAAAA,4BAA4B,EAAE,CAAC,2CAAD,CA3IzB;AA4ILC,IAAAA,wBAAwB,EAAE,CACtB,2DADsB,CA5IrB;AA+ILC,IAAAA,gBAAgB,EAAE,CACd,gEADc,CA/Ib;AAkJLC,IAAAA,uBAAuB,EAAE,CAAC,wCAAD,CAlJpB;AAmJLC,IAAAA,aAAa,EAAE,CAAC,wDAAD,CAnJV;AAoJLC,IAAAA,+BAA+B,EAAE,CAC7B,+EAD6B,CApJ5B;AAuJLC,IAAAA,8BAA8B,EAAE,CAC5B,sEAD4B,CAvJ3B;AA0JLC,IAAAA,6BAA6B,EAAE,CAC3B,sDAD2B,CA1J1B;AA6JLC,IAAAA,2BAA2B,EAAE,CACzB,gEADyB,CA7JxB;AAgKLC,IAAAA,uCAAuC,EAAE,CACrC,qCADqC,CAhKpC;AAmKLC,IAAAA,qCAAqC,EAAE,CACnC,+CADmC,CAnKlC;AAsKLC,IAAAA,4BAA4B,EAAE,CAC1B,4DAD0B,CAtKzB;AAyKLC,IAAAA,uDAAuD,EAAE,CACrD,kDADqD;AAzKpD,GADK;AA8KdC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,qCAAqC,EAAE,CAAC,kCAAD,CADjC;AAENC,IAAAA,sBAAsB,EAAE,CAAC,2CAAD,CAFlB;AAGNC,IAAAA,wBAAwB,EAAE,CACtB,wDADsB,CAHpB;AAMNC,IAAAA,QAAQ,EAAE,CAAC,YAAD,CANJ;AAONC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAPf;AAQNC,IAAAA,SAAS,EAAE,CAAC,wCAAD,CARL;AASNC,IAAAA,yCAAyC,EAAE,CACvC,qDADuC,CATrC;AAYNC,IAAAA,8BAA8B,EAAE,CAAC,8BAAD,CAZ1B;AAaNC,IAAAA,qCAAqC,EAAE,CAAC,oBAAD,CAbjC;AAcNC,IAAAA,iCAAiC,EAAE,CAC/B,yCAD+B,CAd7B;AAiBNC,IAAAA,gBAAgB,EAAE,CAAC,aAAD,CAjBZ;AAkBNC,IAAAA,8BAA8B,EAAE,CAAC,qCAAD,CAlB1B;AAmBNC,IAAAA,uBAAuB,EAAE,CAAC,qCAAD,CAnBnB;AAoBNC,IAAAA,mBAAmB,EAAE,CAAC,wBAAD,CApBf;AAqBNC,IAAAA,yBAAyB,EAAE,CAAC,uCAAD,CArBrB;AAsBNC,IAAAA,+BAA+B,EAAE,CAC7B,8CAD6B,CAtB3B;AAyBNC,IAAAA,cAAc,EAAE,CAAC,kCAAD,CAzBV;AA0BNC,IAAAA,yCAAyC,EAAE,CACvC,yCADuC,CA1BrC;AA6BNC,IAAAA,mCAAmC,EAAE,CAAC,mBAAD,CA7B/B;AA8BNC,IAAAA,sBAAsB,EAAE,CAAC,+BAAD,CA9BlB;AA+BNC,IAAAA,sBAAsB,EAAE,CAAC,qCAAD,CA/BlB;AAgCNC,IAAAA,qBAAqB,EAAE,CAAC,sCAAD,CAhCjB;AAiCNC,IAAAA,oCAAoC,EAAE,CAAC,yBAAD,CAjChC;AAkCNC,IAAAA,mBAAmB,EAAE,CAAC,uCAAD,CAlCf;AAmCNC,IAAAA,uBAAuB,EAAE,CAAC,oBAAD,CAnCnB;AAoCNC,IAAAA,2BAA2B,EAAE,CAAC,yCAAD,CApCvB;AAqCNC,IAAAA,gBAAgB,EAAE,CAAC,0CAAD,CArCZ;AAsCNC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAtCf;AAuCNC,IAAAA,qBAAqB,EAAE,CACnB,qDADmB,CAvCjB;AA0CNC,IAAAA,4BAA4B,EAAE,CAAC,kCAAD,CA1CxB;AA2CNC,IAAAA,8BAA8B,EAAE,CAAC,qCAAD;AA3C1B,GA9KI;AA2NdC,EAAAA,IAAI,EAAE;AACFC,IAAAA,qBAAqB,EAAE,CACnB,wEADmB,CADrB;AAIFC,IAAAA,UAAU,EAAE,CAAC,sCAAD,CAJV;AAKFC,IAAAA,uBAAuB,EAAE,CACrB,6DADqB,EAErB;AAAEC,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFqB,CALvB;AASFC,IAAAA,8BAA8B,EAAE,CAC5B,kFAD4B,EAE5B;AAAEF,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAF4B,CAT9B;AAaFE,IAAAA,kBAAkB,EAAE,CAAC,wCAAD,CAblB;AAcFC,IAAAA,6BAA6B,EAAE,CAC3B,yDAD2B,CAd7B;AAiBFC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAjBnB;AAkBFC,IAAAA,kBAAkB,EAAE,CAAC,6CAAD,CAlBlB;AAmBFC,IAAAA,WAAW,EAAE,CAAC,wCAAD,CAnBX;AAoBFC,IAAAA,gBAAgB,EAAE,CAAC,UAAD,CApBhB;AAqBFC,IAAAA,SAAS,EAAE,CAAC,sBAAD,CArBT;AAsBFC,IAAAA,eAAe,EAAE,CAAC,0CAAD,CAtBf;AAuBFC,IAAAA,kBAAkB,EAAE,CAAC,8BAAD,CAvBlB;AAwBFC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAxBnB;AAyBFC,IAAAA,6BAA6B,EAAE,CAC3B,gDAD2B,CAzB7B;AA4BFC,IAAAA,oCAAoC,EAAE,CAClC,wDADkC,CA5BpC;AA+BFC,IAAAA,mBAAmB,EAAE,CAAC,oCAAD,CA/BnB;AAgCFC,IAAAA,sBAAsB,EAAE,CAAC,sBAAD,CAhCtB;AAiCFC,IAAAA,kBAAkB,EAAE,CAAC,wCAAD,CAjClB;AAkCFC,IAAAA,mBAAmB,EAAE,CAAC,mDAAD,CAlCnB;AAmCFC,IAAAA,0BAA0B,EAAE,CACxB,2DADwB,CAnC1B;AAsCFC,IAAAA,yCAAyC,EAAE,CACvC,wDADuC,CAtCzC;AAyCFC,IAAAA,iBAAiB,EAAE,CAAC,wBAAD,CAzCjB;AA0CFC,IAAAA,qCAAqC,EAAE,CAAC,yBAAD,CA1CrC;AA2CFC,IAAAA,SAAS,EAAE,CAAC,gCAAD,CA3CT;AA4CFC,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CA5ChB;AA6CFC,IAAAA,iCAAiC,EAAE,CAAC,gCAAD,CA7CjC;AA8CFC,IAAAA,qCAAqC,EAAE,CAAC,iCAAD,CA9CrC;AA+CFC,IAAAA,4CAA4C,EAAE,CAC1C,yCAD0C,CA/C5C;AAkDFC,IAAAA,qBAAqB,EAAE,CAAC,0BAAD,CAlDrB;AAmDFC,IAAAA,wBAAwB,EAAE,CACtB,kDADsB,CAnDxB;AAsDFC,IAAAA,0BAA0B,EAAE,CACxB,2EADwB,CAtD1B;AAyDFC,IAAAA,UAAU,EAAE,CAAC,uCAAD,CAzDV;AA0DFC,IAAAA,6BAA6B,EAAE,CAAC,4BAAD,CA1D7B;AA2DFC,IAAAA,UAAU,EAAE,CAAC,6CAAD,CA3DV;AA4DFC,IAAAA,mBAAmB,EAAE,CAAC,oDAAD,CA5DnB;AA6DFC,IAAAA,qBAAqB,EAAE,CACnB,uDADmB,CA7DrB;AAgEFC,IAAAA,yBAAyB,EAAE,CAAC,wBAAD;AAhEzB,GA3NQ;AA6RdC,EAAAA,OAAO,EAAE;AACLC,IAAAA,0BAA0B,EAAE,CAAC,0CAAD,CADvB;AAELC,IAAAA,2BAA2B,EAAE,CACzB,gDADyB,CAFxB;AAKLC,IAAAA,2BAA2B,EAAE,CAAC,2CAAD,CALxB;AAMLC,IAAAA,4BAA4B,EAAE,CAC1B,iDAD0B,CANzB;AASLC,IAAAA,0BAA0B,EAAE,CACxB,iDADwB,CATvB;AAYLC,IAAAA,2BAA2B,EAAE,CACzB,uDADyB;AAZxB,GA7RK;AA6SdC,EAAAA,MAAM,EAAE;AACJC,IAAAA,MAAM,EAAE,CAAC,uCAAD,CADJ;AAEJC,IAAAA,WAAW,EAAE,CAAC,yCAAD,CAFT;AAGJC,IAAAA,GAAG,EAAE,CAAC,qDAAD,CAHD;AAIJC,IAAAA,QAAQ,EAAE,CAAC,yDAAD,CAJN;AAKJC,IAAAA,eAAe,EAAE,CACb,iEADa,CALb;AAQJC,IAAAA,UAAU,EAAE,CAAC,oDAAD,CARR;AASJC,IAAAA,YAAY,EAAE,CACV,oEADU,CATV;AAYJC,IAAAA,gBAAgB,EAAE,CAAC,sDAAD,CAZd;AAaJC,IAAAA,cAAc,EAAE,CACZ,oEADY,CAbZ;AAgBJC,IAAAA,oBAAoB,EAAE,CAClB,sDADkB,CAhBlB;AAmBJC,IAAAA,MAAM,EAAE,CAAC,uDAAD;AAnBJ,GA7SM;AAkUdC,EAAAA,YAAY,EAAE;AACVC,IAAAA,cAAc,EAAE,CACZ,oFADY,CADN;AAIVC,IAAAA,QAAQ,EAAE,CACN,+DADM,EAEN,EAFM,EAGN;AAAEC,MAAAA,iBAAiB,EAAE;AAAEC,QAAAA,QAAQ,EAAE;AAAZ;AAArB,KAHM,CAJA;AASVC,IAAAA,WAAW,EAAE,CACT,gEADS,CATH;AAYVC,IAAAA,QAAQ,EAAE,CAAC,2DAAD,CAZA;AAaVC,IAAAA,kBAAkB,EAAE,CAChB,yEADgB,CAbV;AAgBVC,IAAAA,iBAAiB,EAAE,CAAC,gDAAD,CAhBT;AAiBVC,IAAAA,mBAAmB,EAAE,CACjB,yEADiB,EAEjB,EAFiB,EAGjB;AAAEvI,MAAAA,OAAO,EAAE,CAAC,cAAD,EAAiB,oBAAjB;AAAX,KAHiB,CAjBX;AAsBVwI,IAAAA,kBAAkB,EAAE,CAAC,kDAAD,CAtBV;AAuBVC,IAAAA,WAAW,EAAE,CACT,iEADS,CAvBH;AA0BVC,IAAAA,WAAW,EAAE,CAAC,iDAAD;AA1BH,GAlUA;AA8VdC,EAAAA,cAAc,EAAE;AACZC,IAAAA,oBAAoB,EAAE,CAAC,uBAAD,CADV;AAEZC,IAAAA,cAAc,EAAE,CAAC,6BAAD,CAFJ;AAGZC,IAAAA,UAAU,EAAE,CACR,qDADQ,EAER;AAAExE,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFQ;AAHA,GA9VF;AAsWdwE,EAAAA,MAAM,EAAE;AAAE1B,IAAAA,GAAG,EAAE,CAAC,aAAD;AAAP,GAtWM;AAuWd2B,EAAAA,eAAe,EAAE;AACbC,IAAAA,kDAAkD,EAAE,CAChD,6EADgD,CADvC;AAIbC,IAAAA,iDAAiD,EAAE,CAC/C,0EAD+C,CAJtC;AAObC,IAAAA,2BAA2B,EAAE,CACzB,oEADyB,CAPhB;AAUbC,IAAAA,qCAAqC,EAAE,CACnC,mDADmC,CAV1B;AAabC,IAAAA,uDAAuD,EAAE,CACrD,iEADqD,CAb5C;AAgBbC,IAAAA,2BAA2B,EAAE,CACzB,oEADyB,CAhBhB;AAmBbC,IAAAA,qCAAqC,EAAE,CACnC,mDADmC,CAnB1B;AAsBbC,IAAAA,sDAAsD,EAAE,CACpD,iEADoD;AAtB3C,GAvWH;AAiYdC,EAAAA,KAAK,EAAE;AACHC,IAAAA,cAAc,EAAE,CAAC,2BAAD,CADb;AAEHvC,IAAAA,MAAM,EAAE,CAAC,aAAD,CAFL;AAGHwC,IAAAA,aAAa,EAAE,CAAC,gCAAD,CAHZ;AAIHC,IAAAA,MAAM,EAAE,CAAC,yBAAD,CAJL;AAKHC,IAAAA,aAAa,EAAE,CAAC,+CAAD,CALZ;AAMHC,IAAAA,IAAI,EAAE,CAAC,6BAAD,CANH;AAOHzC,IAAAA,GAAG,EAAE,CAAC,sBAAD,CAPF;AAQH0C,IAAAA,UAAU,EAAE,CAAC,4CAAD,CART;AASHC,IAAAA,WAAW,EAAE,CAAC,4BAAD,CATV;AAUHC,IAAAA,IAAI,EAAE,CAAC,YAAD,CAVH;AAWHC,IAAAA,YAAY,EAAE,CAAC,+BAAD,CAXX;AAYHC,IAAAA,WAAW,EAAE,CAAC,8BAAD,CAZV;AAaHC,IAAAA,WAAW,EAAE,CAAC,6BAAD,CAbV;AAcHC,IAAAA,SAAS,EAAE,CAAC,4BAAD,CAdR;AAeHC,IAAAA,UAAU,EAAE,CAAC,mBAAD,CAfT;AAgBHC,IAAAA,WAAW,EAAE,CAAC,oBAAD,CAhBV;AAiBHC,IAAAA,IAAI,EAAE,CAAC,2BAAD,CAjBH;AAkBHC,IAAAA,MAAM,EAAE,CAAC,8BAAD,CAlBL;AAmBH5C,IAAAA,MAAM,EAAE,CAAC,wBAAD,CAnBL;AAoBH6C,IAAAA,aAAa,EAAE,CAAC,8CAAD;AApBZ,GAjYO;AAuZdC,EAAAA,GAAG,EAAE;AACDC,IAAAA,UAAU,EAAE,CAAC,sCAAD,CADX;AAEDC,IAAAA,YAAY,EAAE,CAAC,wCAAD,CAFb;AAGDC,IAAAA,SAAS,EAAE,CAAC,qCAAD,CAHV;AAIDC,IAAAA,SAAS,EAAE,CAAC,qCAAD,CAJV;AAKDC,IAAAA,UAAU,EAAE,CAAC,sCAAD,CALX;AAMDC,IAAAA,SAAS,EAAE,CAAC,6CAAD,CANV;AAODC,IAAAA,OAAO,EAAE,CAAC,gDAAD,CAPR;AAQDC,IAAAA,SAAS,EAAE,CAAC,oDAAD,CARV;AASDC,IAAAA,MAAM,EAAE,CAAC,yCAAD,CATP;AAUDC,IAAAA,MAAM,EAAE,CAAC,8CAAD,CAVP;AAWDC,IAAAA,OAAO,EAAE,CAAC,gDAAD,CAXR;AAYDC,IAAAA,gBAAgB,EAAE,CAAC,mDAAD,CAZjB;AAaDC,IAAAA,SAAS,EAAE,CAAC,4CAAD;AAbV,GAvZS;AAsadC,EAAAA,SAAS,EAAE;AACPC,IAAAA,eAAe,EAAE,CAAC,0BAAD,CADV;AAEPC,IAAAA,WAAW,EAAE,CAAC,iCAAD;AAFN,GAtaG;AA0adC,EAAAA,YAAY,EAAE;AACVC,IAAAA,mCAAmC,EAAE,CAAC,8BAAD,CAD3B;AAEVC,IAAAA,qBAAqB,EAAE,CAAC,oCAAD,CAFb;AAGVC,IAAAA,sBAAsB,EAAE,CAAC,8CAAD,CAHd;AAIVC,IAAAA,iCAAiC,EAAE,CAC/B,8BAD+B,EAE/B,EAF+B,EAG/B;AAAEhM,MAAAA,OAAO,EAAE,CAAC,cAAD,EAAiB,qCAAjB;AAAX,KAH+B,CAJzB;AASViM,IAAAA,sCAAsC,EAAE,CAAC,iCAAD,CAT9B;AAUVC,IAAAA,wBAAwB,EAAE,CAAC,uCAAD,CAVhB;AAWVC,IAAAA,yBAAyB,EAAE,CACvB,iDADuB,CAXjB;AAcVC,IAAAA,oCAAoC,EAAE,CAClC,iCADkC,EAElC,EAFkC,EAGlC;AAAEpM,MAAAA,OAAO,EAAE,CAAC,cAAD,EAAiB,wCAAjB;AAAX,KAHkC,CAd5B;AAmBVqM,IAAAA,mCAAmC,EAAE,CAAC,8BAAD,CAnB3B;AAoBVC,IAAAA,qBAAqB,EAAE,CAAC,oCAAD,CApBb;AAqBVC,IAAAA,sBAAsB,EAAE,CAAC,8CAAD,CArBd;AAsBVC,IAAAA,iCAAiC,EAAE,CAC/B,8BAD+B,EAE/B,EAF+B,EAG/B;AAAExM,MAAAA,OAAO,EAAE,CAAC,cAAD,EAAiB,qCAAjB;AAAX,KAH+B;AAtBzB,GA1aA;AAscdyM,EAAAA,MAAM,EAAE;AACJC,IAAAA,YAAY,EAAE,CACV,4DADU,CADV;AAIJC,IAAAA,SAAS,EAAE,CAAC,yDAAD,CAJP;AAKJC,IAAAA,sBAAsB,EAAE,CAAC,gDAAD,CALpB;AAMJzF,IAAAA,MAAM,EAAE,CAAC,mCAAD,CANJ;AAOJwC,IAAAA,aAAa,EAAE,CACX,2DADW,CAPX;AAUJkD,IAAAA,WAAW,EAAE,CAAC,mCAAD,CAVT;AAWJC,IAAAA,eAAe,EAAE,CAAC,uCAAD,CAXb;AAYJjD,IAAAA,aAAa,EAAE,CACX,2DADW,CAZX;AAeJkD,IAAAA,WAAW,EAAE,CAAC,4CAAD,CAfT;AAgBJC,IAAAA,eAAe,EAAE,CACb,4DADa,CAhBb;AAmBJ3F,IAAAA,GAAG,EAAE,CAAC,iDAAD,CAnBD;AAoBJ0C,IAAAA,UAAU,EAAE,CAAC,wDAAD,CApBR;AAqBJkD,IAAAA,QAAQ,EAAE,CAAC,oDAAD,CArBN;AAsBJC,IAAAA,QAAQ,EAAE,CAAC,yCAAD,CAtBN;AAuBJC,IAAAA,YAAY,EAAE,CAAC,yDAAD,CAvBV;AAwBJlD,IAAAA,IAAI,EAAE,CAAC,aAAD,CAxBF;AAyBJmD,IAAAA,aAAa,EAAE,CAAC,qCAAD,CAzBX;AA0BJlD,IAAAA,YAAY,EAAE,CAAC,0DAAD,CA1BV;AA2BJmD,IAAAA,mBAAmB,EAAE,CAAC,2CAAD,CA3BjB;AA4BJC,IAAAA,UAAU,EAAE,CAAC,wDAAD,CA5BR;AA6BJC,IAAAA,iBAAiB,EAAE,CAAC,yCAAD,CA7Bf;AA8BJC,IAAAA,qBAAqB,EAAE,CACnB,0DADmB,EAEnB;AAAElJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,aAAD;AAAZ;AAAb,KAFmB,CA9BnB;AAkCJkJ,IAAAA,wBAAwB,EAAE,CAAC,kBAAD,CAlCtB;AAmCJC,IAAAA,UAAU,EAAE,CAAC,wBAAD,CAnCR;AAoCJC,IAAAA,WAAW,EAAE,CAAC,kCAAD,CApCT;AAqCJC,IAAAA,sBAAsB,EAAE,CACpB,gEADoB,CArCpB;AAwCJC,IAAAA,iBAAiB,EAAE,CAAC,kCAAD,CAxCf;AAyCJC,IAAAA,iBAAiB,EAAE,CACf,wDADe,CAzCf;AA4CJC,IAAAA,cAAc,EAAE,CAAC,sCAAD,CA5CZ;AA6CJC,IAAAA,IAAI,EAAE,CAAC,sDAAD,CA7CF;AA8CJC,IAAAA,eAAe,EAAE,CACb,2DADa,CA9Cb;AAiDJC,IAAAA,eAAe,EAAE,CACb,8DADa,CAjDb;AAoDJC,IAAAA,WAAW,EAAE,CACT,kEADS,CApDT;AAuDJC,IAAAA,SAAS,EAAE,CAAC,wDAAD,CAvDP;AAwDJC,IAAAA,MAAM,EAAE,CAAC,yDAAD,CAxDJ;AAyDJxG,IAAAA,MAAM,EAAE,CAAC,mDAAD,CAzDJ;AA0DJ6C,IAAAA,aAAa,EAAE,CAAC,0DAAD,CA1DX;AA2DJ4D,IAAAA,WAAW,EAAE,CAAC,2CAAD,CA3DT;AA4DJC,IAAAA,eAAe,EAAE,CACb,2DADa;AA5Db,GAtcM;AAsgBdC,EAAAA,QAAQ,EAAE;AACNnH,IAAAA,GAAG,EAAE,CAAC,yBAAD,CADC;AAENoH,IAAAA,kBAAkB,EAAE,CAAC,eAAD,CAFd;AAGN3F,IAAAA,UAAU,EAAE,CAAC,mCAAD;AAHN,GAtgBI;AA2gBd4F,EAAAA,QAAQ,EAAE;AACNC,IAAAA,MAAM,EAAE,CAAC,gBAAD,CADF;AAENC,IAAAA,SAAS,EAAE,CACP,oBADO,EAEP;AAAEC,MAAAA,OAAO,EAAE;AAAE,wBAAgB;AAAlB;AAAX,KAFO;AAFL,GA3gBI;AAkhBdC,EAAAA,IAAI,EAAE;AACFzH,IAAAA,GAAG,EAAE,CAAC,WAAD,CADH;AAEF0H,IAAAA,UAAU,EAAE,CAAC,cAAD,CAFV;AAGFC,IAAAA,MAAM,EAAE,CAAC,UAAD,CAHN;AAIFC,IAAAA,IAAI,EAAE,CAAC,OAAD;AAJJ,GAlhBQ;AAwhBdC,EAAAA,UAAU,EAAE;AACRC,IAAAA,YAAY,EAAE,CAAC,qCAAD,CADN;AAERC,IAAAA,iCAAiC,EAAE,CAC/B,gDAD+B,EAE/B;AAAE9K,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF+B,CAF3B;AAMR8K,IAAAA,mBAAmB,EAAE,CACjB,sDADiB,EAEjB;AAAE/K,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFiB,CANb;AAUR+K,IAAAA,qBAAqB,EAAE,CACnB,mDADmB,EAEnB;AAAEhL,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFmB,CAVf;AAcRgL,IAAAA,8BAA8B,EAAE,CAC5B,6CAD4B,EAE5B;AAAEjL,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF4B,CAdxB;AAkBRiL,IAAAA,gBAAgB,EAAE,CAAC,0CAAD,CAlBV;AAmBRC,IAAAA,eAAe,EAAE,CAAC,kCAAD,CAnBT;AAoBRC,IAAAA,aAAa,EAAE,CAAC,8CAAD,CApBP;AAqBRC,IAAAA,6BAA6B,EAAE,CAC3B,qCAD2B,EAE3B;AAAErL,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF2B,CArBvB;AAyBRqL,IAAAA,eAAe,EAAE,CACb,2CADa,EAEb;AAAEtL,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFa,CAzBT;AA6BRkJ,IAAAA,wBAAwB,EAAE,CACtB,sBADsB,EAEtB;AAAEnJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFsB,CA7BlB;AAiCRmJ,IAAAA,UAAU,EAAE,CACR,4BADQ,EAER;AAAEpJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFQ,CAjCJ;AAqCRsL,IAAAA,eAAe,EAAE,CACb,wDADa,EAEb;AAAEvL,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFa,CArCT;AAyCRuL,IAAAA,gBAAgB,EAAE,CACd,kDADc,EAEd;AAAExL,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFc,CAzCV;AA6CRwL,IAAAA,eAAe,EAAE,CAAC,wDAAD,CA7CT;AA8CRC,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CA9CV;AA+CRC,IAAAA,yBAAyB,EAAE,CAAC,uBAAD,CA/CnB;AAgDRC,IAAAA,WAAW,EAAE,CAAC,6BAAD,CAhDL;AAiDRC,IAAAA,WAAW,EAAE,CAAC,kCAAD,CAjDL;AAkDRC,IAAAA,8BAA8B,EAAE,CAC5B,+DAD4B,EAE5B;AAAE9L,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAF4B,CAlDxB;AAsDR8L,IAAAA,gBAAgB,EAAE,CACd,qEADc,EAEd;AAAE/L,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,WAAD;AAAZ;AAAb,KAFc,CAtDV;AA0DR+L,IAAAA,YAAY,EAAE,CAAC,oCAAD;AA1DN,GAxhBE;AAolBdC,EAAAA,IAAI,EAAE;AACFC,IAAAA,SAAS,EAAE,CAAC,mCAAD,CADT;AAEFC,IAAAA,gBAAgB,EAAE,CAAC,gDAAD,CAFhB;AAGFC,IAAAA,gBAAgB,EAAE,CAAC,mCAAD,CAHhB;AAIFC,IAAAA,sBAAsB,EAAE,CAAC,oCAAD,CAJtB;AAKFC,IAAAA,4BAA4B,EAAE,CAAC,2CAAD,CAL5B;AAMFC,IAAAA,kCAAkC,EAAE,CAChC,kDADgC,CANlC;AASFC,IAAAA,gBAAgB,EAAE,CAAC,8BAAD,CAThB;AAUFC,IAAAA,aAAa,EAAE,CAAC,wBAAD,CAVb;AAWFC,IAAAA,aAAa,EAAE,CAAC,oCAAD,CAXb;AAYF3J,IAAAA,GAAG,EAAE,CAAC,iBAAD,CAZH;AAaF4J,IAAAA,iCAAiC,EAAE,CAAC,kCAAD,CAbjC;AAcFC,IAAAA,oBAAoB,EAAE,CAAC,wCAAD,CAdpB;AAeFC,IAAAA,UAAU,EAAE,CAAC,iCAAD,CAfV;AAgBFC,IAAAA,sBAAsB,EAAE,CAAC,wCAAD,CAhBtB;AAiBF7L,IAAAA,kBAAkB,EAAE,CAChB,0DADgB,CAjBlB;AAoBF0E,IAAAA,IAAI,EAAE,CAAC,oBAAD,CApBJ;AAqBFoH,IAAAA,oBAAoB,EAAE,CAAC,+BAAD,CArBpB;AAsBFC,IAAAA,gBAAgB,EAAE,CAAC,wBAAD,CAtBhB;AAuBFC,IAAAA,qBAAqB,EAAE,CAAC,oCAAD,CAvBrB;AAwBF9D,IAAAA,wBAAwB,EAAE,CAAC,gBAAD,CAxBxB;AAyBFrD,IAAAA,WAAW,EAAE,CAAC,4BAAD,CAzBX;AA0BFoH,IAAAA,mBAAmB,EAAE,CAAC,mDAAD,CA1BnB;AA2BFC,IAAAA,WAAW,EAAE,CAAC,yBAAD,CA3BX;AA4BFC,IAAAA,mCAAmC,EAAE,CAAC,4BAAD,CA5BnC;AA6BFC,IAAAA,wBAAwB,EAAE,CAAC,uCAAD,CA7BxB;AA8BFC,IAAAA,sBAAsB,EAAE,CAAC,6BAAD,CA9BtB;AA+BFC,IAAAA,iBAAiB,EAAE,CAAC,gCAAD,CA/BjB;AAgCF3L,IAAAA,qBAAqB,EAAE,CAAC,4CAAD,CAhCrB;AAiCF4L,IAAAA,YAAY,EAAE,CAAC,uBAAD,CAjCZ;AAkCFC,IAAAA,WAAW,EAAE,CAAC,wCAAD,CAlCX;AAmCF5L,IAAAA,wBAAwB,EAAE,CACtB,oEADsB,CAnCxB;AAsCF6L,IAAAA,YAAY,EAAE,CAAC,uCAAD,CAtCZ;AAuCFC,IAAAA,uBAAuB,EAAE,CAAC,2CAAD,CAvCvB;AAwCFC,IAAAA,yBAAyB,EAAE,CACvB,qDADuB,CAxCzB;AA2CFC,IAAAA,0CAA0C,EAAE,CACxC,8CADwC,CA3C1C;AA8CFC,IAAAA,oBAAoB,EAAE,CAAC,wCAAD,CA9CpB;AA+CFC,IAAAA,uCAAuC,EAAE,CACrC,2CADqC,CA/CvC;AAkDFC,IAAAA,WAAW,EAAE,CAAC,sCAAD,CAlDX;AAmDFzK,IAAAA,MAAM,EAAE,CAAC,mBAAD,CAnDN;AAoDF0K,IAAAA,oCAAoC,EAAE,CAClC,oCADkC,CApDpC;AAuDFC,IAAAA,aAAa,EAAE,CAAC,mCAAD,CAvDb;AAwDFC,IAAAA,yBAAyB,EAAE,CAAC,0CAAD;AAxDzB,GAplBQ;AA8oBdC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,iCAAiC,EAAE,CAC/B,qDAD+B,CAD7B;AAINC,IAAAA,mBAAmB,EAAE,CACjB,2DADiB,CAJf;AAONC,IAAAA,wCAAwC,EAAE,CACtC,mFADsC,CAPpC;AAUNC,IAAAA,0BAA0B,EAAE,CACxB,yFADwB,CAVtB;AAaNC,IAAAA,4CAA4C,EAAE,CAC1C,iEAD0C,EAE1C,EAF0C,EAG1C;AAAE/S,MAAAA,OAAO,EAAE,CAAC,UAAD,EAAa,2CAAb;AAAX,KAH0C,CAbxC;AAkBNgT,IAAAA,2DAA2D,EAAE,CACzD,2DADyD,EAEzD,EAFyD,EAGzD;AACIhT,MAAAA,OAAO,EAAE,CACL,UADK,EAEL,yDAFK;AADb,KAHyD,CAlBvD;AA4BNiT,IAAAA,uDAAuD,EAAE,CACrD,2DADqD,CA5BnD;AA+BNC,IAAAA,yCAAyC,EAAE,CACvC,iEADuC,CA/BrC;AAkCNC,IAAAA,0CAA0C,EAAE,CACxC,uEADwC,CAlCtC;AAqCNC,IAAAA,8BAA8B,EAAE,CAC5B,kDAD4B,CArC1B;AAwCNC,IAAAA,yBAAyB,EAAE,CACvB,wDADuB,CAxCrB;AA2CNC,IAAAA,iBAAiB,EAAE,CACf,8DADe,CA3Cb;AA8CNC,IAAAA,qCAAqC,EAAE,CACnC,gFADmC,CA9CjC;AAiDNC,IAAAA,gCAAgC,EAAE,CAC9B,sFAD8B,CAjD5B;AAoDNC,IAAAA,wBAAwB,EAAE,CACtB,4FADsB,CApDpB;AAuDNC,IAAAA,kCAAkC,EAAE,CAChC,mEADgC,CAvD9B;AA0DNC,IAAAA,oBAAoB,EAAE,CAClB,yEADkB,CA1DhB;AA6DNC,IAAAA,yCAAyC,EAAE,CACvC,yFADuC,CA7DrC;AAgENC,IAAAA,2BAA2B,EAAE,CACzB,+FADyB;AAhEvB,GA9oBI;AAktBdC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,eAAe,EAAE,CACb,qDADa,EAEb;AAAEzP,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFa,CADX;AAKNyP,IAAAA,UAAU,EAAE,CACR,0CADQ,EAER;AAAE1P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CALN;AASN0P,IAAAA,YAAY,EAAE,CACV,qCADU,EAEV;AAAE3P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CATR;AAaN2P,IAAAA,0BAA0B,EAAE,CACxB,qBADwB,EAExB;AAAE5P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFwB,CAbtB;AAiBN4P,IAAAA,YAAY,EAAE,CACV,2BADU,EAEV;AAAE7P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CAjBR;AAqBN6P,IAAAA,aAAa,EAAE,CACX,qCADW,EAEX;AAAE9P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFW,CArBT;AAyBNqF,IAAAA,MAAM,EAAE,CACJ,+BADI,EAEJ;AAAEtF,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFI,CAzBF;AA6BN8P,IAAAA,UAAU,EAAE,CACR,0CADQ,EAER;AAAE/P,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CA7BN;AAiCN+P,IAAAA,YAAY,EAAE,CACV,sCADU,EAEV;AAAEhQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU,CAjCR;AAqCN8C,IAAAA,GAAG,EAAE,CACD,4BADC,EAED;AAAE/C,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFC,CArCC;AAyCNgQ,IAAAA,OAAO,EAAE,CACL,uCADK,EAEL;AAAEjQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFK,CAzCH;AA6CNiQ,IAAAA,SAAS,EAAE,CACP,mCADO,EAEP;AAAElQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFO,CA7CL;AAiDNkQ,IAAAA,oBAAoB,EAAE,CAClB,gEADkB,EAElB;AAAEnQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFkB,CAjDhB;AAqDNmQ,IAAAA,SAAS,EAAE,CACP,yCADO,EAEP;AAAEpQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFO,CArDL;AAyDNoQ,IAAAA,iBAAiB,EAAE,CACf,0CADe,EAEf;AAAErQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFe,CAzDb;AA6DNqQ,IAAAA,WAAW,EAAE,CACT,oCADS,EAET;AAAEtQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CA7DP;AAiENmJ,IAAAA,UAAU,EAAE,CACR,0BADQ,EAER;AAAEpJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CAjEN;AAqENoJ,IAAAA,WAAW,EAAE,CACT,oCADS,EAET;AAAErJ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CArEP;AAyEN6F,IAAAA,WAAW,EAAE,CACT,gCADS,EAET;AAAE9F,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFS,CAzEP;AA6ENsQ,IAAAA,QAAQ,EAAE,CACN,8CADM,EAEN;AAAEvQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFM,CA7EJ;AAiFNuQ,IAAAA,UAAU,EAAE,CACR,0CADQ,EAER;AAAExQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CAjFN;AAqFNwQ,IAAAA,kBAAkB,EAAE,CAChB,wDADgB,EAEhB;AAAEzQ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFgB,CArFd;AAyFNsD,IAAAA,MAAM,EAAE,CACJ,8BADI,EAEJ;AAAEvD,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFI,CAzFF;AA6FNyQ,IAAAA,UAAU,EAAE,CACR,yCADQ,EAER;AAAE1Q,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFQ,CA7FN;AAiGN0Q,IAAAA,YAAY,EAAE,CACV,qCADU,EAEV;AAAE3Q,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFU;AAjGR,GAltBI;AAwzBd2Q,EAAAA,KAAK,EAAE;AACHC,IAAAA,aAAa,EAAE,CAAC,qDAAD,CADZ;AAEHhO,IAAAA,MAAM,EAAE,CAAC,kCAAD,CAFL;AAGHiO,IAAAA,2BAA2B,EAAE,CACzB,8EADyB,CAH1B;AAMHC,IAAAA,YAAY,EAAE,CAAC,wDAAD,CANX;AAOHC,IAAAA,mBAAmB,EAAE,CACjB,yDADiB,CAPlB;AAUHC,IAAAA,mBAAmB,EAAE,CACjB,sEADiB,CAVlB;AAaHC,IAAAA,mBAAmB,EAAE,CACjB,0DADiB,CAblB;AAgBHC,IAAAA,aAAa,EAAE,CACX,8EADW,CAhBZ;AAmBHpO,IAAAA,GAAG,EAAE,CAAC,+CAAD,CAnBF;AAoBHqO,IAAAA,SAAS,EAAE,CACP,mEADO,CApBR;AAuBHC,IAAAA,gBAAgB,EAAE,CAAC,uDAAD,CAvBf;AAwBH1L,IAAAA,IAAI,EAAE,CAAC,iCAAD,CAxBH;AAyBH2L,IAAAA,qBAAqB,EAAE,CACnB,4EADmB,CAzBpB;AA4BHzL,IAAAA,WAAW,EAAE,CAAC,uDAAD,CA5BV;AA6BH0L,IAAAA,SAAS,EAAE,CAAC,qDAAD,CA7BR;AA8BHC,IAAAA,sBAAsB,EAAE,CACpB,mEADoB,CA9BrB;AAiCHC,IAAAA,kBAAkB,EAAE,CAChB,wDADgB,CAjCjB;AAoCHC,IAAAA,yBAAyB,EAAE,CAAC,0CAAD,CApCxB;AAqCHC,IAAAA,WAAW,EAAE,CAAC,uDAAD,CArCV;AAsCHC,IAAAA,KAAK,EAAE,CAAC,qDAAD,CAtCJ;AAuCHC,IAAAA,wBAAwB,EAAE,CACtB,sEADsB,CAvCvB;AA0CHC,IAAAA,gBAAgB,EAAE,CACd,oEADc,CA1Cf;AA6CHC,IAAAA,YAAY,EAAE,CACV,2EADU,CA7CX;AAgDHxO,IAAAA,MAAM,EAAE,CAAC,iDAAD,CAhDL;AAiDHyO,IAAAA,YAAY,EAAE,CACV,6DADU,EAEV;AAAEhS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFU,CAjDX;AAqDHgS,IAAAA,YAAY,EAAE,CACV,mEADU,CArDX;AAwDHC,IAAAA,mBAAmB,EAAE,CACjB,yDADiB;AAxDlB,GAxzBO;AAo3BdC,EAAAA,SAAS,EAAE;AAAEpP,IAAAA,GAAG,EAAE,CAAC,iBAAD;AAAP,GAp3BG;AAq3BdqP,EAAAA,SAAS,EAAE;AACPC,IAAAA,sBAAsB,EAAE,CACpB,4DADoB,EAEpB;AAAErS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFoB,CADjB;AAKPqS,IAAAA,cAAc,EAAE,CACZ,4DADY,EAEZ;AAAEtS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFY,CALT;AASPsS,IAAAA,qBAAqB,EAAE,CACnB,mEADmB,EAEnB;AAAEvS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFmB,CAThB;AAaPuS,IAAAA,iCAAiC,EAAE,CAC/B,kEAD+B,EAE/B;AAAExS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF+B,CAb5B;AAiBPwS,IAAAA,gBAAgB,EAAE,CACd,4DADc,EAEd;AAAEzS,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFc,CAjBX;AAqBPyS,IAAAA,mCAAmC,EAAE,CACjC,wGADiC,EAEjC;AAAE1S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFiC,CArB9B;AAyBP0S,IAAAA,4BAA4B,EAAE,CAC1B,8EAD0B,EAE1B;AAAE3S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF0B,CAzBvB;AA6BP2S,IAAAA,sBAAsB,EAAE,CACpB,4EADoB,EAEpB;AAAE5S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFoB,CA7BjB;AAiCP4S,IAAAA,cAAc,EAAE,CACZ,4EADY,EAEZ;AAAE7S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFY,CAjCT;AAqCP6S,IAAAA,qBAAqB,EAAE,CACnB,mFADmB,EAEnB;AAAE9S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFmB,CArChB;AAyCP8S,IAAAA,2BAA2B,EAAE,CACzB,kFADyB,EAEzB;AAAE/S,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFyB,CAzCtB;AA6CP+S,IAAAA,uBAAuB,EAAE,CACrB,8FADqB,EAErB;AAAEhT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFqB,CA7ClB;AAiDPgT,IAAAA,8BAA8B,EAAE,CAC5B,wHAD4B,EAE5B;AAAEjT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF4B,CAjDzB;AAqDPiT,IAAAA,YAAY,EAAE,CACV,iCADU,EAEV;AAAElT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFU,EAGV;AACIkT,MAAAA,UAAU,EAAE;AADhB,KAHU,CArDP;AA4DPC,IAAAA,oBAAoB,EAAE,CAClB,2DADkB,EAElB;AAAEpT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFkB,CA5Df;AAgEPoT,IAAAA,YAAY,EAAE,CACV,2DADU,EAEV;AAAErT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFU,CAhEP;AAoEPqT,IAAAA,mBAAmB,EAAE,CACjB,kEADiB,EAEjB;AAAEtT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFiB,CApEd;AAwEPsT,IAAAA,+BAA+B,EAAE,CAC7B,iEAD6B,EAE7B;AAAEvT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF6B,CAxE1B;AA4EPuT,IAAAA,iCAAiC,EAAE,CAC/B,uGAD+B,EAE/B;AAAExT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAF+B,CA5E5B;AAgFPwT,IAAAA,0BAA0B,EAAE,CACxB,6EADwB,EAExB;AAAEzT,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,eAAD;AAAZ;AAAb,KAFwB;AAhFrB,GAr3BG;AA08BdyT,EAAAA,KAAK,EAAE;AACHC,IAAAA,gBAAgB,EAAE,CAAC,oDAAD,CADf;AAEHC,IAAAA,wBAAwB,EAAE,CACtB,2EADsB,EAEtB,EAFsB,EAGtB;AAAEC,MAAAA,SAAS,EAAE;AAAb,KAHsB,CAFvB;AAOHpE,IAAAA,eAAe,EAAE,CAAC,oDAAD,CAPd;AAQHqE,IAAAA,sBAAsB,EAAE,CACpB,yFADoB,EAEpB,EAFoB,EAGpB;AAAED,MAAAA,SAAS,EAAE;AAAb,KAHoB,CARrB;AAaHE,IAAAA,yBAAyB,EAAE,CACvB,4EADuB,EAEvB,EAFuB,EAGvB;AAAEF,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAbxB;AAkBHG,IAAAA,yBAAyB,EAAE,CACvB,4EADuB,EAEvB,EAFuB,EAGvB;AAAEH,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAlBxB;AAuBHI,IAAAA,iBAAiB,EAAE,CAAC,oDAAD,CAvBhB;AAwBHC,IAAAA,wBAAwB,EAAE,CACtB,gDADsB,EAEtB;AAAElU,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFsB,CAxBvB;AA4BHkU,IAAAA,cAAc,EAAE,CAAC,mDAAD,CA5Bb;AA6BHC,IAAAA,0BAA0B,EAAE,CACxB,8CADwB,CA7BzB;AAgCHC,IAAAA,cAAc,EAAE,CAAC,sCAAD,CAhCb;AAiCHC,IAAAA,mBAAmB,EAAE,CACjB,0DADiB,CAjClB;AAoCHC,IAAAA,+BAA+B,EAAE,CAC7B,6EAD6B,EAE7B;AAAEvU,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAF6B,CApC9B;AAwCHuU,IAAAA,kBAAkB,EAAE,CAAC,2CAAD,CAxCjB;AAyCHC,IAAAA,eAAe,EAAE,CAAC,iCAAD,CAzCd;AA0CHC,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CA1Cf;AA2CHC,IAAAA,sBAAsB,EAAE,CACpB,iEADoB,CA3CrB;AA8CHC,IAAAA,mBAAmB,EAAE,CAAC,uCAAD,CA9ClB;AA+CHhF,IAAAA,0BAA0B,EAAE,CAAC,kBAAD,CA/CzB;AAgDHiF,IAAAA,UAAU,EAAE,CAAC,kCAAD,CAhDT;AAiDHC,IAAAA,WAAW,EAAE,CAAC,wBAAD,CAjDV;AAkDHC,IAAAA,yBAAyB,EAAE,CACvB,2DADuB,CAlDxB;AAqDHC,IAAAA,0BAA0B,EAAE,CAAC,2CAAD,CArDzB;AAsDHC,IAAAA,eAAe,EAAE,CACb,kCADa,EAEb;AAAEjV,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,YAAD;AAAZ;AAAb,KAFa,CAtDd;AA0DHiV,IAAAA,aAAa,EAAE,CAAC,qCAAD,CA1DZ;AA2DHC,IAAAA,mBAAmB,EAAE,CACjB,uDADiB,EAEjB;AAAEnV,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,UAAD;AAAZ;AAAb,KAFiB,CA3DlB;AA+DHwM,IAAAA,aAAa,EAAE,CAAC,kCAAD,CA/DZ;AAgEH2I,IAAAA,iBAAiB,EAAE,CAAC,qDAAD,CAhEhB;AAiEH9P,IAAAA,MAAM,EAAE,CAAC,8BAAD,CAjEL;AAkEH+P,IAAAA,wBAAwB,EAAE,CACtB,wEADsB,CAlEvB;AAqEHC,IAAAA,2BAA2B,EAAE,CACzB,0EADyB,CArE1B;AAwEHC,IAAAA,mBAAmB,EAAE,CACjB,8DADiB,CAxElB;AA2EHC,IAAAA,cAAc,EAAE,CAAC,sDAAD,CA3Eb;AA4EHC,IAAAA,sBAAsB,EAAE,CACpB,2DADoB,CA5ErB;AA+EHC,IAAAA,mBAAmB,EAAE,CAAC,oDAAD,CA/ElB;AAgFHC,IAAAA,+BAA+B,EAAE,CAC7B,+EAD6B,EAE7B;AAAE3V,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAF6B,CAhF9B;AAoFH2V,IAAAA,eAAe,EAAE,CAAC,4CAAD,CApFd;AAqFHC,IAAAA,gBAAgB,EAAE,CACd,0DADc,CArFf;AAwFHC,IAAAA,UAAU,EAAE,CAAC,8CAAD,CAxFT;AAyFHC,IAAAA,gBAAgB,EAAE,CACd,0DADc,CAzFf;AA4FHC,IAAAA,eAAe,EAAE,CACb,oCADa,EAEb;AAAEhW,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,YAAD;AAAZ;AAAb,KAFa,CA5Fd;AAgGHgW,IAAAA,iCAAiC,EAAE,CAC/B,yFAD+B,CAhGhC;AAmGHC,IAAAA,aAAa,EAAE,CAAC,oDAAD,CAnGZ;AAoGHC,IAAAA,kBAAkB,EAAE,CAChB,yDADgB,CApGjB;AAuGHzJ,IAAAA,aAAa,EAAE,CAAC,8CAAD,CAvGZ;AAwGH0J,IAAAA,6BAA6B,EAAE,CAC3B,uDAD2B,EAE3B;AAAEpW,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAF2B,CAxG5B;AA4GHoW,IAAAA,0BAA0B,EAAE,CACxB,mDADwB,EAExB;AAAErW,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFwB,CA5GzB;AAgHHqW,IAAAA,eAAe,EAAE,CACb,yCADa,EAEb,EAFa,EAGb;AAAE5a,MAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,wBAAV;AAAX,KAHa,CAhHd;AAqHH6a,IAAAA,sBAAsB,EAAE,CAAC,yCAAD,CArHrB;AAsHHC,IAAAA,sBAAsB,EAAE,CAAC,yCAAD,CAtHrB;AAuHHC,IAAAA,4BAA4B,EAAE,CAC1B,oDAD0B,EAE1B;AAAEzW,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAF0B,CAvH3B;AA2HHyW,IAAAA,yBAAyB,EAAE,CACvB,gDADuB,EAEvB;AAAE1W,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,QAAD;AAAZ;AAAb,KAFuB,CA3HxB;AA+HH8C,IAAAA,GAAG,EAAE,CAAC,2BAAD,CA/HF;AAgIH4T,IAAAA,qBAAqB,EAAE,CACnB,qEADmB,CAhIpB;AAmIHC,IAAAA,wBAAwB,EAAE,CACtB,uEADsB,CAnIvB;AAsIHC,IAAAA,kBAAkB,EAAE,CAAC,wCAAD,CAtIjB;AAuIHC,IAAAA,yBAAyB,EAAE,CACvB,wFADuB,CAvIxB;AA0IHC,IAAAA,YAAY,EAAE,CACV,kCADU,EAEV;AAAE/W,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFU,CA1IX;AA8IH+W,IAAAA,kCAAkC,EAAE,CAChC,0EADgC,CA9IjC;AAiJHC,IAAAA,WAAW,EAAE,CAAC,mDAAD,CAjJV;AAkJHC,IAAAA,SAAS,EAAE,CAAC,6CAAD,CAlJR;AAmJHC,IAAAA,mBAAmB,EAAE,CACjB,wDADiB,CAnJlB;AAsJHC,IAAAA,SAAS,EAAE,CAAC,0CAAD,CAtJR;AAuJHC,IAAAA,qBAAqB,EAAE,CAAC,gDAAD,CAvJpB;AAwJHC,IAAAA,8BAA8B,EAAE,CAC5B,+DAD4B,CAxJ7B;AA2JHC,IAAAA,uBAAuB,EAAE,CAAC,gDAAD,CA3JtB;AA4JH1Q,IAAAA,SAAS,EAAE,CAAC,yCAAD,CA5JR;AA6JH2Q,IAAAA,sBAAsB,EAAE,CAAC,iDAAD,CA7JrB;AA8JHC,IAAAA,gBAAgB,EAAE,CAAC,iDAAD,CA9Jf;AA+JHC,IAAAA,4BAA4B,EAAE,CAC1B,4EAD0B,EAE1B;AAAE1X,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAF0B,CA/J3B;AAmKH0X,IAAAA,0BAA0B,EAAE,CAAC,6CAAD,CAnKzB;AAoKHC,IAAAA,UAAU,EAAE,CAAC,2CAAD,CApKT;AAqKHC,IAAAA,oBAAoB,EAAE,CAAC,8CAAD,CArKnB;AAsKHC,IAAAA,YAAY,EAAE,CAAC,yCAAD,CAtKX;AAuKHC,IAAAA,aAAa,EAAE,CAAC,uDAAD,CAvKZ;AAwKHC,IAAAA,mBAAmB,EAAE,CACjB,4EADiB,CAxKlB;AA2KHC,IAAAA,cAAc,EAAE,CACZ,2DADY,CA3Kb;AA8KHC,IAAAA,mBAAmB,EAAE,CAAC,+CAAD,CA9KlB;AA+KHC,IAAAA,gBAAgB,EAAE,CAAC,2CAAD,CA/Kf;AAgLHC,IAAAA,QAAQ,EAAE,CAAC,iCAAD,CAhLP;AAiLHC,IAAAA,aAAa,EAAE,CAAC,mDAAD,CAjLZ;AAkLHC,IAAAA,mBAAmB,EAAE,CAAC,wCAAD,CAlLlB;AAmLHC,IAAAA,qBAAqB,EAAE,CAAC,+CAAD,CAnLpB;AAoLHC,IAAAA,8BAA8B,EAAE,CAC5B,sFAD4B,CApL7B;AAuLHC,IAAAA,iBAAiB,EAAE,CAAC,4CAAD,CAvLhB;AAwLHC,IAAAA,SAAS,EAAE,CAAC,kCAAD,CAxLR;AAyLHC,IAAAA,oBAAoB,EAAE,CAAC,wCAAD,CAzLnB;AA0LHC,IAAAA,UAAU,EAAE,CAAC,iDAAD,CA1LT;AA2LHC,IAAAA,eAAe,EAAE,CAAC,sDAAD,CA3Ld;AA4LHC,IAAAA,eAAe,EAAE,CAAC,+CAAD,CA5Ld;AA6LHC,IAAAA,yBAAyB,EAAE,CACvB,+EADuB,CA7LxB;AAgMHC,IAAAA,mCAAmC,EAAE,CACjC,2EADiC,CAhMlC;AAmMHC,IAAAA,WAAW,EAAE,CAAC,iDAAD,CAnMV;AAoMHC,IAAAA,eAAe,EAAE,CAAC,qDAAD,CApMd;AAqMHC,IAAAA,mCAAmC,EAAE,CACjC,2EADiC,CArMlC;AAwMHC,IAAAA,QAAQ,EAAE,CAAC,yCAAD,CAxMP;AAyMHvM,IAAAA,UAAU,EAAE,CAAC,2CAAD,CAzMT;AA0MHwM,IAAAA,uBAAuB,EAAE,CACrB,kDADqB,CA1MtB;AA6MHpY,IAAAA,kBAAkB,EAAE,CAChB,oEADgB,CA7MjB;AAgNHqY,IAAAA,aAAa,EAAE,CAAC,qCAAD,CAhNZ;AAiNHC,IAAAA,YAAY,EAAE,CAAC,oCAAD,CAjNX;AAkNHC,IAAAA,yBAAyB,EAAE,CACvB,oEADuB,EAEvB;AAAExZ,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFuB,CAlNxB;AAsNHoQ,IAAAA,iBAAiB,EAAE,CAAC,yCAAD,CAtNhB;AAuNHoJ,IAAAA,qBAAqB,EAAE,CACnB,yDADmB,CAvNpB;AA0NHC,IAAAA,yBAAyB,EAAE,CAAC,oCAAD,CA1NxB;AA2NHC,IAAAA,wBAAwB,EAAE,CACtB,kDADsB,CA3NvB;AA8NH9T,IAAAA,WAAW,EAAE,CAAC,mCAAD,CA9NV;AA+NH+T,IAAAA,gBAAgB,EAAE,CAAC,wCAAD,CA/Nf;AAgOHC,IAAAA,cAAc,EAAE,CAAC,gCAAD,CAhOb;AAiOHC,IAAAA,sBAAsB,EAAE,CACpB,gEADoB,CAjOrB;AAoOHC,IAAAA,eAAe,EAAE,CAAC,uCAAD,CApOd;AAqOH5Q,IAAAA,wBAAwB,EAAE,CAAC,iBAAD,CArOvB;AAsOHC,IAAAA,UAAU,EAAE,CAAC,uBAAD,CAtOT;AAuOHtD,IAAAA,WAAW,EAAE,CAAC,6BAAD,CAvOV;AAwOHC,IAAAA,SAAS,EAAE,CAAC,iCAAD,CAxOR;AAyOHiU,IAAAA,eAAe,EAAE,CAAC,uCAAD,CAzOd;AA0OHC,IAAAA,mCAAmC,EAAE,CAAC,kCAAD,CA1OlC;AA2OHC,IAAAA,aAAa,EAAE,CAAC,qCAAD,CA3OZ;AA4OHC,IAAAA,eAAe,EAAE,CAAC,wCAAD,CA5Od;AA6OHnU,IAAAA,UAAU,EAAE,CAAC,mBAAD,CA7OT;AA8OHoU,IAAAA,oCAAoC,EAAE,CAClC,sDADkC,EAElC;AAAEpa,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFkC,CA9OnC;AAkPHoa,IAAAA,iBAAiB,EAAE,CACf,wDADe,CAlPhB;AAqPHC,IAAAA,YAAY,EAAE,CAAC,oCAAD,CArPX;AAsPHC,IAAAA,QAAQ,EAAE,CAAC,gCAAD,CAtPP;AAuPHC,IAAAA,SAAS,EAAE,CAAC,iCAAD,CAvPR;AAwPH5Y,IAAAA,qBAAqB,EAAE,CACnB,sDADmB,CAxPpB;AA2PH4L,IAAAA,YAAY,EAAE,CAAC,iCAAD,CA3PX;AA4PHoE,IAAAA,KAAK,EAAE,CAAC,mCAAD,CA5PJ;AA6PHnE,IAAAA,WAAW,EAAE,CAAC,kDAAD,CA7PV;AA8PH5L,IAAAA,wBAAwB,EAAE,CACtB,8EADsB,CA9PvB;AAiQH4Y,IAAAA,2BAA2B,EAAE,CACzB,6EADyB,EAEzB,EAFyB,EAGzB;AAAE5G,MAAAA,SAAS,EAAE;AAAb,KAHyB,CAjQ1B;AAsQHpD,IAAAA,kBAAkB,EAAE,CAChB,uDADgB,CAtQjB;AAyQHiK,IAAAA,yBAAyB,EAAE,CACvB,2FADuB,EAEvB,EAFuB,EAGvB;AAAE7G,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAzQxB;AA8QH8G,IAAAA,2BAA2B,EAAE,CACzB,kFADyB,CA9Q1B;AAiRHC,IAAAA,4BAA4B,EAAE,CAC1B,8EAD0B,EAE1B,EAF0B,EAG1B;AAAE/G,MAAAA,SAAS,EAAE;AAAb,KAH0B,CAjR3B;AAsRHgH,IAAAA,4BAA4B,EAAE,CAC1B,8EAD0B,EAE1B,EAF0B,EAG1B;AAAEhH,MAAAA,SAAS,EAAE;AAAb,KAH0B,CAtR3B;AA2RHiH,IAAAA,YAAY,EAAE,CAAC,qDAAD,CA3RX;AA4RHC,IAAAA,gBAAgB,EAAE,CACd,kCADc,EAEd;AAAE/a,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAFc,CA5Rf;AAgSH+a,IAAAA,iBAAiB,EAAE,CAAC,yCAAD,CAhShB;AAiSHC,IAAAA,wBAAwB,EAAE,CACtB,wEADsB,CAjSvB;AAoSHC,IAAAA,wBAAwB,EAAE,CACtB,0EADsB,EAEtB,EAFsB,EAGtB;AAAErH,MAAAA,SAAS,EAAE;AAAb,KAHsB,CApSvB;AAySHsH,IAAAA,sBAAsB,EAAE,CACpB,wFADoB,EAEpB,EAFoB,EAGpB;AAAEtH,MAAAA,SAAS,EAAE;AAAb,KAHoB,CAzSrB;AA8SHuH,IAAAA,yBAAyB,EAAE,CACvB,2EADuB,EAEvB,EAFuB,EAGvB;AAAEvH,MAAAA,SAAS,EAAE;AAAb,KAHuB,CA9SxB;AAmTHwH,IAAAA,yBAAyB,EAAE,CACvB,2EADuB,EAEvB,EAFuB,EAGvB;AAAExH,MAAAA,SAAS,EAAE;AAAb,KAHuB,CAnTxB;AAwTHyH,IAAAA,eAAe,EAAE,CAAC,kDAAD,CAxTd;AAyTHC,IAAAA,QAAQ,EAAE,CAAC,qCAAD,CAzTP;AA0THhY,IAAAA,MAAM,EAAE,CAAC,6BAAD,CA1TL;AA2THiY,IAAAA,sBAAsB,EAAE,CACpB,wDADoB,CA3TrB;AA8THC,IAAAA,mBAAmB,EAAE,CAAC,mDAAD,CA9TlB;AA+THC,IAAAA,+BAA+B,EAAE,CAAC,iCAAD,CA/T9B;AAgUHC,IAAAA,gBAAgB,EAAE,CACd,yDADc,CAhUf;AAmUHC,IAAAA,iCAAiC,EAAE,CAC/B,wFAD+B,CAnUhC;AAsUHC,IAAAA,aAAa,EAAE,CAAC,mDAAD,CAtUZ;AAuUHC,IAAAA,kBAAkB,EAAE,CAChB,wDADgB,CAvUjB;AA0UHC,IAAAA,0BAA0B,EAAE,CACxB,iFADwB,EAExB,EAFwB,EAGxB;AAAErgB,MAAAA,OAAO,EAAE,CAAC,OAAD,EAAU,6BAAV;AAAX,KAHwB,CA1UzB;AA+UHsgB,IAAAA,2BAA2B,EAAE,CACzB,iFADyB,CA/U1B;AAkVH9N,IAAAA,aAAa,EAAE,CAAC,6CAAD,CAlVZ;AAmVH+N,IAAAA,0BAA0B,EAAE,CACxB,oDADwB,CAnVzB;AAsVHC,IAAAA,kBAAkB,EAAE,CAChB,sEADgB,EAEhB;AAAEC,MAAAA,OAAO,EAAE;AAAX,KAFgB;AAtVjB,GA18BO;AAqyCdC,EAAAA,MAAM,EAAE;AACJC,IAAAA,IAAI,EAAE,CAAC,kBAAD,CADF;AAEJC,IAAAA,OAAO,EAAE,CAAC,qBAAD,EAAwB;AAAEtc,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAAxB,CAFL;AAGJsc,IAAAA,qBAAqB,EAAE,CAAC,oBAAD,CAHnB;AAIJC,IAAAA,MAAM,EAAE,CAAC,oBAAD,CAJJ;AAKJ9I,IAAAA,KAAK,EAAE,CAAC,0BAAD,CALH;AAMJ+I,IAAAA,MAAM,EAAE,CAAC,oBAAD,EAAuB;AAAEzc,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,OAAD;AAAZ;AAAb,KAAvB,CANJ;AAOJyc,IAAAA,KAAK,EAAE,CAAC,mBAAD;AAPH,GAryCM;AA8yCdC,EAAAA,cAAc,EAAE;AACZjZ,IAAAA,QAAQ,EAAE,CACN,iEADM,CADE;AAIZM,IAAAA,iBAAiB,EAAE,CAAC,kDAAD,CAJP;AAKZG,IAAAA,WAAW,EAAE,CACT,mEADS;AALD,GA9yCF;AAuzCdyY,EAAAA,KAAK,EAAE;AACHC,IAAAA,iCAAiC,EAAE,CAC/B,0DAD+B,CADhC;AAIHC,IAAAA,kCAAkC,EAAE,CAChC,yDADgC,EAEhC;AAAE9c,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFgC,CAJjC;AAQH8c,IAAAA,+BAA+B,EAAE,CAC7B,wDAD6B,CAR9B;AAWHC,IAAAA,+BAA+B,EAAE,CAC7B,yDAD6B,EAE7B;AAAEhd,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAF6B,CAX9B;AAeHgd,IAAAA,4BAA4B,EAAE,CAC1B,wDAD0B,CAf3B;AAkBHpa,IAAAA,MAAM,EAAE,CAAC,wBAAD,CAlBL;AAmBHqa,IAAAA,4BAA4B,EAAE,CAC1B,6EAD0B,CAnB3B;AAsBHC,IAAAA,qBAAqB,EAAE,CAAC,gDAAD,CAtBpB;AAuBHC,IAAAA,4BAA4B,EAAE,CAC1B,gGAD0B,CAvB3B;AA0BHC,IAAAA,qBAAqB,EAAE,CACnB,sEADmB,CA1BpB;AA6BHC,IAAAA,WAAW,EAAE,CAAC,sCAAD,CA7BV;AA8BHC,IAAAA,SAAS,EAAE,CAAC,mCAAD,CA9BR;AA+BHC,IAAAA,yBAAyB,EAAE,CACvB,6FADuB,CA/BxB;AAkCHC,IAAAA,kBAAkB,EAAE,CAChB,mEADgB,CAlCjB;AAqCHC,IAAAA,yBAAyB,EAAE,CACvB,0DADuB,CArCxB;AAwCH/X,IAAAA,IAAI,EAAE,CAAC,uBAAD,CAxCH;AAyCHgY,IAAAA,cAAc,EAAE,CAAC,yCAAD,CAzCb;AA0CHC,IAAAA,2BAA2B,EAAE,CACzB,4EADyB,CA1C1B;AA6CHC,IAAAA,oBAAoB,EAAE,CAAC,+CAAD,CA7CnB;AA8CH1U,IAAAA,wBAAwB,EAAE,CAAC,iBAAD,CA9CvB;AA+CH2U,IAAAA,gBAAgB,EAAE,CAAC,2CAAD,CA/Cf;AAgDHC,IAAAA,2BAA2B,EAAE,CACzB,+CADyB,CAhD1B;AAmDHC,IAAAA,iBAAiB,EAAE,CACf,4CADe,EAEf;AAAEhe,MAAAA,SAAS,EAAE;AAAEC,QAAAA,QAAQ,EAAE,CAAC,SAAD;AAAZ;AAAb,KAFe,CAnDhB;AAuDHge,IAAAA,cAAc,EAAE,CAAC,yCAAD,CAvDb;AAwDHC,IAAAA,4BAA4B,EAAE,CAC1B,6DAD0B,CAxD3B;AA2DHC,IAAAA,kBAAkB,EAAE,CAChB,4DADgB,CA3DjB;AA8DHC,IAAAA,eAAe,EAAE,CACb,2DADa,CA9Dd;AAiEHC,IAAAA,4BAA4B,EAAE,CAC1B,+FAD0B,CAjE3B;AAoEHC,IAAAA,qBAAqB,EAAE,CACnB,qEADmB,CApEpB;AAuEHC,IAAAA,WAAW,EAAE,CAAC,qCAAD;AAvEV,GAvzCO;AAg4Cd7B,EAAAA,KAAK,EAAE;AACH8B,IAAAA,wBAAwB,EAAE,CAAC,mBAAD,CADvB;AAEHC,IAAAA,KAAK,EAAE,CAAC,6BAAD,CAFJ;AAGHC,IAAAA,YAAY,EAAE,CAAC,6BAAD,CAHX;AAIHC,IAAAA,qBAAqB,EAAE,CAAC,+CAAD,CAJpB;AAKHC,IAAAA,oCAAoC,EAAE,CAAC,gCAAD,CALnC;AAMHC,IAAAA,4BAA4B,EAAE,CAAC,qBAAD,CAN3B;AAOHC,IAAAA,kCAAkC,EAAE,CAAC,iBAAD,CAPjC;AAQHC,IAAAA,2BAA2B,EAAE,CAAC,qBAAD,CAR1B;AASHC,IAAAA,4BAA4B,EAAE,CAAC,oCAAD,CAT3B;AAUHC,IAAAA,kCAAkC,EAAE,CAAC,4BAAD,CAVjC;AAWHC,IAAAA,MAAM,EAAE,CAAC,gCAAD,CAXL;AAYH1e,IAAAA,gBAAgB,EAAE,CAAC,WAAD,CAZf;AAaH2e,IAAAA,aAAa,EAAE,CAAC,uBAAD,CAbZ;AAcHC,IAAAA,iBAAiB,EAAE,CAAC,iCAAD,CAdhB;AAeHC,IAAAA,yBAAyB,EAAE,CAAC,iCAAD,CAfxB;AAgBHC,IAAAA,+BAA+B,EAAE,CAAC,yBAAD,CAhB9B;AAiBH3Z,IAAAA,IAAI,EAAE,CAAC,YAAD,CAjBH;AAkBH4Z,IAAAA,0BAA0B,EAAE,CAAC,kBAAD,CAlBzB;AAmBHC,IAAAA,0BAA0B,EAAE,CAAC,kBAAD,CAnBzB;AAoBHC,IAAAA,2BAA2B,EAAE,CAAC,qBAAD,CApB1B;AAqBHC,IAAAA,iCAAiC,EAAE,CAAC,qBAAD,CArBhC;AAsBHC,IAAAA,oBAAoB,EAAE,CAAC,iCAAD,CAtBnB;AAuBHC,IAAAA,oBAAoB,EAAE,CAAC,iCAAD,CAvBnB;AAwBHC,IAAAA,2BAA2B,EAAE,CAAC,oBAAD,CAxB1B;AAyBHC,IAAAA,kBAAkB,EAAE,CAAC,gCAAD,CAzBjB;AA0BHC,IAAAA,gCAAgC,EAAE,CAAC,yBAAD,CA1B/B;AA2BHC,IAAAA,qBAAqB,EAAE,CAAC,4BAAD,CA3BpB;AA4BHC,IAAAA,iCAAiC,EAAE,CAAC,gBAAD,CA5BhC;AA6BHC,IAAAA,yCAAyC,EAAE,CAAC,8BAAD,CA7BxC;AA8BHC,IAAAA,OAAO,EAAE,CAAC,gCAAD,CA9BN;AA+BHC,IAAAA,QAAQ,EAAE,CAAC,mCAAD,CA/BP;AAgCHC,IAAAA,mBAAmB,EAAE,CAAC,aAAD;AAhClB;AAh4CO,CAAlB;;ACAO,MAAMC,OAAO,GAAG,mBAAhB;;ACAA,SAASC,kBAAT,CAA4BC,OAA5B,EAAqCC,YAArC,EAAmD;AACtD,QAAMC,UAAU,GAAG,EAAnB;;AACA,OAAK,MAAM,CAACC,KAAD,EAAQC,SAAR,CAAX,IAAiCC,MAAM,CAACC,OAAP,CAAeL,YAAf,CAAjC,EAA+D;AAC3D,SAAK,MAAM,CAACM,UAAD,EAAaC,QAAb,CAAX,IAAqCH,MAAM,CAACC,OAAP,CAAeF,SAAf,CAArC,EAAgE;AAC5D,YAAM,CAACK,KAAD,EAAQC,QAAR,EAAkBC,WAAlB,IAAiCH,QAAvC;AACA,YAAM,CAACI,MAAD,EAASC,GAAT,IAAgBJ,KAAK,CAACK,KAAN,CAAY,GAAZ,CAAtB;AACA,YAAMC,gBAAgB,GAAGV,MAAM,CAACW,MAAP,CAAc;AAAEJ,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAd,EAA+BH,QAA/B,CAAzB;;AACA,UAAI,CAACR,UAAU,CAACC,KAAD,CAAf,EAAwB;AACpBD,QAAAA,UAAU,CAACC,KAAD,CAAV,GAAoB,EAApB;AACH;;AACD,YAAMc,YAAY,GAAGf,UAAU,CAACC,KAAD,CAA/B;;AACA,UAAIQ,WAAJ,EAAiB;AACbM,QAAAA,YAAY,CAACV,UAAD,CAAZ,GAA2BW,QAAQ,CAAClB,OAAD,EAAUG,KAAV,EAAiBI,UAAjB,EAA6BQ,gBAA7B,EAA+CJ,WAA/C,CAAnC;AACA;AACH;;AACDM,MAAAA,YAAY,CAACV,UAAD,CAAZ,GAA2BP,OAAO,CAACmB,OAAR,CAAgBT,QAAhB,CAAyBK,gBAAzB,CAA3B;AACH;AACJ;;AACD,SAAOb,UAAP;AACH;;AACD,SAASgB,QAAT,CAAkBlB,OAAlB,EAA2BG,KAA3B,EAAkCI,UAAlC,EAA8CG,QAA9C,EAAwDC,WAAxD,EAAqE;AACjE,QAAMS,mBAAmB,GAAGpB,OAAO,CAACmB,OAAR,CAAgBT,QAAhB,CAAyBA,QAAzB,CAA5B;AACA;;AACA,WAASW,eAAT,CAAyB,GAAGC,IAA5B,EAAkC;AAC9B;AACA,QAAIC,OAAO,GAAGH,mBAAmB,CAACZ,QAApB,CAA6BpP,KAA7B,CAAmC,GAAGkQ,IAAtC,CAAd,CAF8B;;AAI9B,QAAIX,WAAW,CAACtN,SAAhB,EAA2B;AACvBkO,MAAAA,OAAO,GAAGlB,MAAM,CAACW,MAAP,CAAc,EAAd,EAAkBO,OAAlB,EAA2B;AACjCC,QAAAA,IAAI,EAAED,OAAO,CAACZ,WAAW,CAACtN,SAAb,CADoB;AAEjC,SAACsN,WAAW,CAACtN,SAAb,GAAyBoO;AAFQ,OAA3B,CAAV;AAIA,aAAOL,mBAAmB,CAACG,OAAD,CAA1B;AACH;;AACD,QAAIZ,WAAW,CAACzlB,OAAhB,EAAyB;AACrB,YAAM,CAACwmB,QAAD,EAAWC,aAAX,IAA4BhB,WAAW,CAACzlB,OAA9C;AACA8kB,MAAAA,OAAO,CAAC4B,GAAR,CAAYC,IAAZ,CAAkB,WAAU1B,KAAM,IAAGI,UAAW,kCAAiCmB,QAAS,IAAGC,aAAc,IAA3G;AACH;;AACD,QAAIhB,WAAW,CAAChO,UAAhB,EAA4B;AACxBqN,MAAAA,OAAO,CAAC4B,GAAR,CAAYC,IAAZ,CAAiBlB,WAAW,CAAChO,UAA7B;AACH;;AACD,QAAIgO,WAAW,CAACxd,iBAAhB,EAAmC;AAC/B;AACA,YAAMoe,OAAO,GAAGH,mBAAmB,CAACZ,QAApB,CAA6BpP,KAA7B,CAAmC,GAAGkQ,IAAtC,CAAhB;;AACA,WAAK,MAAM,CAACQ,IAAD,EAAOC,KAAP,CAAX,IAA4B1B,MAAM,CAACC,OAAP,CAAeK,WAAW,CAACxd,iBAA3B,CAA5B,EAA2E;AACvE,YAAI2e,IAAI,IAAIP,OAAZ,EAAqB;AACjBvB,UAAAA,OAAO,CAAC4B,GAAR,CAAYC,IAAZ,CAAkB,IAAGC,IAAK,0CAAyC3B,KAAM,IAAGI,UAAW,aAAYwB,KAAM,WAAzG;;AACA,cAAI,EAAEA,KAAK,IAAIR,OAAX,CAAJ,EAAyB;AACrBA,YAAAA,OAAO,CAACQ,KAAD,CAAP,GAAiBR,OAAO,CAACO,IAAD,CAAxB;AACH;;AACD,iBAAOP,OAAO,CAACO,IAAD,CAAd;AACH;AACJ;;AACD,aAAOV,mBAAmB,CAACG,OAAD,CAA1B;AACH,KA/B6B;;;AAiC9B,WAAOH,mBAAmB,CAAC,GAAGE,IAAJ,CAA1B;AACH;;AACD,SAAOjB,MAAM,CAACW,MAAP,CAAcK,eAAd,EAA+BD,mBAA/B,CAAP;AACH;;ACxDM,SAASY,mBAAT,CAA6BhC,OAA7B,EAAsC;AACzC,QAAMiC,GAAG,GAAGlC,kBAAkB,CAACC,OAAD,EAAUkC,SAAV,CAA9B;AACA,SAAO;AACHC,IAAAA,IAAI,EAAEF;AADH,GAAP;AAGH;AACDD,mBAAmB,CAAClC,OAApB,GAA8BA,OAA9B;AACA,AAAO,SAASsC,yBAAT,CAAmCpC,OAAnC,EAA4C;AAC/C,QAAMiC,GAAG,GAAGlC,kBAAkB,CAACC,OAAD,EAAUkC,SAAV,CAA9B;AACA,2CACOD,GADP;AAEIE,IAAAA,IAAI,EAAEF;AAFV;AAIH;AACDG,yBAAyB,CAACtC,OAA1B,GAAoCA,OAApC;;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js index 445a820..abccb14 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js @@ -3,9 +3,15 @@ const Endpoints = { addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", ], + approveWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve", + ], cancelWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel", ], + createOrUpdateEnvironmentSecret: [ + "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", + ], createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}", @@ -26,6 +32,9 @@ const Endpoints = { deleteArtifact: [ "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}", ], + deleteEnvironmentSecret: [ + "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", + ], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}", @@ -40,6 +49,12 @@ const Endpoints = { deleteWorkflowRunLogs: [ "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs", ], + disableSelectedRepositoryGithubActionsOrganization: [ + "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}", + ], + disableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable", + ], downloadArtifact: [ "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}", ], @@ -49,12 +64,47 @@ const Endpoints = { downloadWorkflowRunLogs: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs", ], + enableSelectedRepositoryGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}", + ], + enableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable", + ], + getAllowedActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/selected-actions", + ], + getAllowedActionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/selected-actions", + ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getEnvironmentPublicKey: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key", + ], + getEnvironmentSecret: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", + ], + getGithubActionsPermissionsOrganization: [ + "GET /orgs/{org}/actions/permissions", + ], + getGithubActionsPermissionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions", + ], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getPendingDeploymentsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", + ], + getRepoPermissions: [ + "GET /repos/{owner}/{repo}/actions/permissions", + {}, + { renamed: ["actions", "getGithubActionsPermissionsRepository"] }, + ], getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getReviewsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals", + ], getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], getSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}", @@ -68,6 +118,9 @@ const Endpoints = { "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing", ], listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets", + ], listJobsForWorkflowRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", ], @@ -81,6 +134,9 @@ const Endpoints = { listSelectedReposForOrgSecret: [ "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", ], + listSelectedRepositoriesEnabledGithubActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/repositories", + ], listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], listWorkflowRunArtifacts: [ @@ -94,9 +150,27 @@ const Endpoints = { removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", ], + reviewPendingDeploymentsForRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", + ], + setAllowedActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/selected-actions", + ], + setAllowedActionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions", + ], + setGithubActionsPermissionsOrganization: [ + "PUT /orgs/{org}/actions/permissions", + ], + setGithubActionsPermissionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions", + ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories", ], + setSelectedRepositoriesEnabledGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories", + ], }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], @@ -152,6 +226,10 @@ const Endpoints = { "POST /content_references/{content_reference_id}/attachments", { mediaType: { previews: ["corsair"] } }, ], + createContentAttachmentForRepo: [ + "POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + { mediaType: { previews: ["corsair"] } }, + ], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: [ "POST /app/installations/{installation_id}/access_tokens", @@ -171,6 +249,8 @@ const Endpoints = { "GET /marketplace_listing/stubbed/accounts/{account_id}", ], getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], listAccountsForPlanStubbed: [ "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", @@ -187,15 +267,21 @@ const Endpoints = { listSubscriptionsForAuthenticatedUserStubbed: [ "GET /user/marketplace_purchases/stubbed", ], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: [ + "POST /app/hook/deliveries/{delivery_id}/attempts", + ], removeRepoFromInstallation: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}", ], resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], unsuspendInstallation: [ "DELETE /app/installations/{installation_id}/suspended", ], + updateWebhookConfigForApp: ["PATCH /app/hook/config"], }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], @@ -214,58 +300,48 @@ const Endpoints = { ], }, checks: { - create: [ - "POST /repos/{owner}/{repo}/check-runs", - { mediaType: { previews: ["antiope"] } }, - ], - createSuite: [ - "POST /repos/{owner}/{repo}/check-suites", - { mediaType: { previews: ["antiope"] } }, - ], - get: [ - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}", - { mediaType: { previews: ["antiope"] } }, - ], - getSuite: [ - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}", - { mediaType: { previews: ["antiope"] } }, - ], + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], listAnnotations: [ "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", - { mediaType: { previews: ["antiope"] } }, - ], - listForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", - { mediaType: { previews: ["antiope"] } }, ], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], listForSuite: [ "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", - { mediaType: { previews: ["antiope"] } }, - ], - listSuitesForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", - { mediaType: { previews: ["antiope"] } }, ], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], rerequestSuite: [ "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", - { mediaType: { previews: ["antiope"] } }, ], setSuitesPreferences: [ "PATCH /repos/{owner}/{repo}/check-suites/preferences", - { mediaType: { previews: ["antiope"] } }, - ], - update: [ - "PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}", - { mediaType: { previews: ["antiope"] } }, ], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"], }, codeScanning: { + deleteAnalysis: [ + "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}", + ], getAlert: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { renamedParameters: { alert_id: "alert_number" } }, ], + getAnalysis: [ + "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", + ], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + ], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + {}, + { renamed: ["codeScanning", "listAlertInstances"] }, + ], listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], updateAlert: [ "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", @@ -273,20 +349,40 @@ const Endpoints = { uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"], }, codesOfConduct: { - getAllCodesOfConduct: [ - "GET /codes_of_conduct", - { mediaType: { previews: ["scarlet-witch"] } }, - ], - getConductCode: [ - "GET /codes_of_conduct/{key}", - { mediaType: { previews: ["scarlet-witch"] } }, - ], + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"], getForRepo: [ "GET /repos/{owner}/{repo}/community/code_of_conduct", { mediaType: { previews: ["scarlet-witch"] } }, ], }, emojis: { get: ["GET /emojis"] }, + enterpriseAdmin: { + disableSelectedOrganizationGithubActionsEnterprise: [ + "DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}", + ], + enableSelectedOrganizationGithubActionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}", + ], + getAllowedActionsEnterprise: [ + "GET /enterprises/{enterprise}/actions/permissions/selected-actions", + ], + getGithubActionsPermissionsEnterprise: [ + "GET /enterprises/{enterprise}/actions/permissions", + ], + listSelectedOrganizationsEnabledGithubActionsEnterprise: [ + "GET /enterprises/{enterprise}/actions/permissions/organizations", + ], + setAllowedActionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions/selected-actions", + ], + setGithubActionsPermissionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions", + ], + setSelectedOrganizationsEnabledGithubActionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions/organizations", + ], + }, gists: { checkIsStarred: ["GET /gists/{gist_id}/star"], create: ["POST /gists"], @@ -329,29 +425,31 @@ const Endpoints = { getTemplate: ["GET /gitignore/templates/{name}"], }, interactions: { - getRestrictionsForOrg: [ - "GET /orgs/{org}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, - ], - getRestrictionsForRepo: [ - "GET /repos/{owner}/{repo}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, - ], - removeRestrictionsForOrg: [ - "DELETE /orgs/{org}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: [ + "GET /user/interaction-limits", + {}, + { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }, ], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], removeRestrictionsForRepo: [ "DELETE /repos/{owner}/{repo}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, ], - setRestrictionsForOrg: [ - "PUT /orgs/{org}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, + removeRestrictionsForYourPublicRepos: [ + "DELETE /user/interaction-limits", + {}, + { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }, ], - setRestrictionsForRepo: [ - "PUT /repos/{owner}/{repo}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: [ + "PUT /user/interaction-limits", + {}, + { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }, ], }, issues: { @@ -430,7 +528,12 @@ const Endpoints = { { headers: { "content-type": "text/plain; charset=utf-8" } }, ], }, - meta: { get: ["GET /meta"] }, + meta: { + get: ["GET /meta"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"], + }, migrations: { cancelImport: ["DELETE /repos/{owner}/{repo}/import"], deleteArchiveForAuthenticatedUser: [ @@ -493,6 +596,7 @@ const Endpoints = { }, orgs: { blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], @@ -506,9 +610,14 @@ const Endpoints = { getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: [ + "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}", + ], list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listBlockedUsers: ["GET /orgs/{org}/blocks"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], @@ -517,8 +626,12 @@ const Endpoints = { listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", + ], removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: [ @@ -537,6 +650,75 @@ const Endpoints = { "PATCH /user/memberships/orgs/{org}", ], updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"], + }, + packages: { + deletePackageForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}", + ], + deletePackageForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}", + ], + deletePackageVersionForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + deletePackageVersionForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + getAllPackageVersionsForAPackageOwnedByAnOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + {}, + { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }, + ], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions", + {}, + { + renamed: [ + "packages", + "getAllPackageVersionsForPackageOwnedByAuthenticatedUser", + ], + }, + ], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions", + ], + getAllPackageVersionsForPackageOwnedByOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + ], + getAllPackageVersionsForPackageOwnedByUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions", + ], + getPackageForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}", + ], + getPackageForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}", + ], + getPackageForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}", + ], + getPackageVersionForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + getPackageVersionForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + getPackageVersionForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + restorePackageForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/restore{?token}", + ], + restorePackageForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}", + ], + restorePackageVersionForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", + ], + restorePackageVersionForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", + ], }, projects: { addCollaborator: [ @@ -718,6 +900,10 @@ const Endpoints = { "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }, ], + createForRelease: [ + "POST /repos/{owner}/{repo}/releases/{release_id}/reactions", + { mediaType: { previews: ["squirrel-girl"] } }, + ], createForTeamDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }, @@ -754,7 +940,7 @@ const Endpoints = { "DELETE /reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }, { - deprecated: "octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy", + deprecated: "octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy", }, ], listForCommitComment: [ @@ -811,6 +997,10 @@ const Endpoints = { { mediaType: { previews: ["dorian"] } }, ], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: [ + "GET /repos/{owner}/{repo}/compare/{basehead}", + ], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], createCommitComment: [ "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments", ], @@ -828,6 +1018,9 @@ const Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateEnvironment: [ + "PUT /repos/{owner}/{repo}/environments/{environment_name}", + ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createPagesSite: [ "POST /repos/{owner}/{repo}/pages", @@ -847,6 +1040,10 @@ const Endpoints = { deleteAdminBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", ], + deleteAnEnvironment: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}", + ], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], deleteBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection", ], @@ -883,7 +1080,13 @@ const Endpoints = { "DELETE /repos/{owner}/{repo}/vulnerability-alerts", { mediaType: { previews: ["dorian"] } }, ], - downloadArchive: ["GET /repos/{owner}/{repo}/{archive_format}/{ref}"], + downloadArchive: [ + "GET /repos/{owner}/{repo}/zipball/{ref}", + {}, + { renamed: ["repos", "downloadZipballArchive"] }, + ], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], enableAutomatedSecurityFixes: [ "PUT /repos/{owner}/{repo}/automated-security-fixes", { mediaType: { previews: ["london"] } }, @@ -899,6 +1102,7 @@ const Endpoints = { getAdminBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", ], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], getAllStatusCheckContexts: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", ], @@ -909,6 +1113,7 @@ const Endpoints = { getAppsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", ], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection", @@ -926,10 +1131,7 @@ const Endpoints = { "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { mediaType: { previews: ["zzzax"] } }, ], - getCommunityProfileMetrics: [ - "GET /repos/{owner}/{repo}/community/profile", - { mediaType: { previews: ["black-panther"] } }, - ], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], @@ -937,16 +1139,21 @@ const Endpoints = { getDeploymentStatus: [ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}", ], + getEnvironment: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}", + ], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", ], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], @@ -963,6 +1170,13 @@ const Endpoints = { ], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/config", + ], + getWebhookDelivery: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}", + ], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], listBranches: ["GET /repos/{owner}/{repo}/branches"], listBranchesForHeadCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", @@ -1002,9 +1216,15 @@ const Endpoints = { listReleases: ["GET /repos/{owner}/{repo}/releases"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", + ], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", + ], removeAppAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, @@ -1031,6 +1251,7 @@ const Endpoints = { {}, { mapToData: "users" }, ], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], replaceAllTopics: [ "PUT /repos/{owner}/{repo}/topics", { mediaType: { previews: ["mercy"] } }, @@ -1079,8 +1300,16 @@ const Endpoints = { ], updateStatusCheckPotection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", + {}, + { renamed: ["repos", "updateStatusCheckProtection"] }, + ], + updateStatusCheckProtection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", ], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: [ + "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config", + ], uploadReleaseAsset: [ "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" }, @@ -1095,6 +1324,15 @@ const Endpoints = { topics: ["GET /search/topics", { mediaType: { previews: ["mercy"] } }], users: ["GET /search/users"], }, + secretScanning: { + getAlert: [ + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", + ], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", + ], + }, teams: { addOrUpdateMembershipForUserInOrg: [ "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}", diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js index 0535b19..53d539d 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js @@ -1,17 +1,18 @@ import ENDPOINTS from "./generated/endpoints"; import { VERSION } from "./version"; import { endpointsToMethods } from "./endpoints-to-methods"; -/** - * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary - * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is - * done, we will remove the registerEndpoints methods and return the methods - * directly as with the other plugins. At that point we will also remove the - * legacy workarounds and deprecations. - * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 - */ export function restEndpointMethods(octokit) { - return endpointsToMethods(octokit, ENDPOINTS); + const api = endpointsToMethods(octokit, ENDPOINTS); + return { + rest: api, + }; } restEndpointMethods.VERSION = VERSION; +export function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, ENDPOINTS); + return { + ...api, + rest: api, + }; +} +legacyRestEndpointMethods.VERSION = VERSION; diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js index 3343f54..e789743 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js @@ -1 +1 @@ -export const VERSION = "4.2.0"; +export const VERSION = "5.8.0"; diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts index 61eafe5..81f24d4 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts @@ -3,7 +3,7 @@ import { RestEndpointMethodTypes } from "./parameters-and-response-types"; export declare type RestEndpointMethods = { actions: { /** - * Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://developer.github.com/v3/actions/secrets/#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. + * Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ addSelectedRepoToOrgSecret: { (params?: RestEndpointMethodTypes["actions"]["addSelectedRepoToOrgSecret"]["parameters"]): Promise; @@ -12,6 +12,18 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see ["Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + approveWorkflowRun: { + (params?: RestEndpointMethodTypes["actions"]["approveWorkflowRun"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Cancels a workflow run using its `id`. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. */ @@ -22,6 +34,90 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Creates or updates an environment secret with an encrypted value. Encrypt your secret using + * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access + * token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use + * this endpoint. + * + * #### Example encrypting a secret using Node.js + * + * Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. + * + * ``` + * const sodium = require('tweetsodium'); + * + * const key = "base64-encoded-public-key"; + * const value = "plain-text-secret"; + * + * // Convert the message and key to Uint8Array's (Buffer implements that interface) + * const messageBytes = Buffer.from(value); + * const keyBytes = Buffer.from(key, 'base64'); + * + * // Encrypt using LibSodium. + * const encryptedBytes = sodium.seal(messageBytes, keyBytes); + * + * // Base64 the encrypted secret + * const encrypted = Buffer.from(encryptedBytes).toString('base64'); + * + * console.log(encrypted); + * ``` + * + * + * #### Example encrypting a secret using Python + * + * Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/stable/public/#nacl-public-sealedbox) with Python 3. + * + * ``` + * from base64 import b64encode + * from nacl import encoding, public + * + * def encrypt(public_key: str, secret_value: str) -> str: + * """Encrypt a Unicode string using the public key.""" + * public_key = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder()) + * sealed_box = public.SealedBox(public_key) + * encrypted = sealed_box.encrypt(secret_value.encode("utf-8")) + * return b64encode(encrypted).decode("utf-8") + * ``` + * + * #### Example encrypting a secret using C# + * + * Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. + * + * ``` + * var secretValue = System.Text.Encoding.UTF8.GetBytes("mySecret"); + * var publicKey = Convert.FromBase64String("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU="); + * + * var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); + * + * Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); + * ``` + * + * #### Example encrypting a secret using Ruby + * + * Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. + * + * ```ruby + * require "rbnacl" + * require "base64" + * + * key = Base64.decode64("+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=") + * public_key = RbNaCl::PublicKey.new(key) + * + * box = RbNaCl::Boxes::Sealed.from_public_key(public_key) + * encrypted_secret = box.encrypt("my_secret") + * + * # Print the base64 encoded secret + * puts Base64.strict_encode64(encrypted_secret) + * ``` + */ + createOrUpdateEnvironmentSecret: { + (params?: RestEndpointMethodTypes["actions"]["createOrUpdateEnvironmentSecret"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Creates or updates an organization secret with an encrypted value. Encrypt your secret using * [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access @@ -270,11 +366,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can also replace `{workflow_id}` with the workflow file name. For example, you could use `main.yml`. + * You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. * * You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)." * - * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line)." + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)." */ createWorkflowDispatch: { (params?: RestEndpointMethodTypes["actions"]["createWorkflowDispatch"]["parameters"]): Promise; @@ -293,6 +389,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Deletes a secret in an environment using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. + */ + deleteEnvironmentSecret: { + (params?: RestEndpointMethodTypes["actions"]["deleteEnvironmentSecret"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Deletes a secret in an organization using the secret name. You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ @@ -360,6 +466,30 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + disableSelectedRepositoryGithubActionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["disableSelectedRepositoryGithubActionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + disableWorkflow: { + (params?: RestEndpointMethodTypes["actions"]["disableWorkflow"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in * the response header to find the URL for the download. The `:archive_format` must be `zip`. Anyone with read access to @@ -399,6 +529,54 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + enableSelectedRepositoryGithubActionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["enableSelectedRepositoryGithubActionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `actions:write` permission to use this endpoint. + */ + enableWorkflow: { + (params?: RestEndpointMethodTypes["actions"]["enableWorkflow"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."" + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + getAllowedActionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["getAllowedActionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + getAllowedActionsRepository: { + (params?: RestEndpointMethodTypes["actions"]["getAllowedActionsRepository"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ @@ -409,6 +587,51 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. + */ + getEnvironmentPublicKey: { + (params?: RestEndpointMethodTypes["actions"]["getEnvironmentPublicKey"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a single environment secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. + */ + getEnvironmentSecret: { + (params?: RestEndpointMethodTypes["actions"]["getEnvironmentSecret"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + getGithubActionsPermissionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["getGithubActionsPermissionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. + * + * You must authenticate using an access token with the `repo` scope to use this + * endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + getGithubActionsPermissionsRepository: { + (params?: RestEndpointMethodTypes["actions"]["getGithubActionsPermissionsRepository"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ @@ -439,6 +662,32 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Get all deployment environments for a workflow run that are waiting for protection rules to pass. + * + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + getPendingDeploymentsForRun: { + (params?: RestEndpointMethodTypes["actions"]["getPendingDeploymentsForRun"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository. + * + * You must authenticate using an access token with the `repo` scope to use this + * endpoint. GitHub Apps must have the `administration` repository permission to use this API. + * @deprecated octokit.rest.actions.getRepoPermissions() has been renamed to octokit.rest.actions.getGithubActionsPermissionsRepository() (2020-11-10) + */ + getRepoPermissions: { + (params?: RestEndpointMethodTypes["actions"]["getRepoPermissions"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint. */ @@ -459,6 +708,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + getReviewsForRun: { + (params?: RestEndpointMethodTypes["actions"]["getReviewsForRun"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Gets a specific self-hosted runner configured in an organization. * @@ -485,7 +744,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Gets a specific workflow. You can also replace `:workflow_id` with `:workflow_file_name`. For example, you could use `main.yml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + * Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ getWorkflow: { (params?: RestEndpointMethodTypes["actions"]["getWorkflow"]["parameters"]): Promise; @@ -505,9 +764,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** This GitHub Actions usage endpoint is currently in public beta and subject to change. For more information, see "[GitHub Actions API workflow usage](https://developer.github.com/changes/2020-05-15-actions-api-workflow-usage)." - * - * Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ @@ -519,11 +776,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** This GitHub Actions usage endpoint is currently in public beta and subject to change. For more information, see "[GitHub Actions API workflow usage](https://developer.github.com/changes/2020-05-15-actions-api-workflow-usage)." + * Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * - * Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". - * - * You can also replace `:workflow_id` with `:workflow_file_name`. For example, you could use `main.yml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + * You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ getWorkflowUsage: { (params?: RestEndpointMethodTypes["actions"]["getWorkflowUsage"]["parameters"]): Promise; @@ -543,7 +798,17 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://developer.github.com/v3/#parameters). + * Lists all secrets available in an environment without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint. + */ + listEnvironmentSecrets: { + (params?: RestEndpointMethodTypes["actions"]["listEnvironmentSecrets"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists jobs for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). */ listJobsForWorkflowRun: { (params?: RestEndpointMethodTypes["actions"]["listJobsForWorkflowRun"]["parameters"]): Promise; @@ -616,6 +881,18 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + listSelectedRepositoriesEnabledGithubActionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["listSelectedRepositoriesEnabledGithubActionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Lists all self-hosted runners configured in an organization. * @@ -629,8 +906,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists all self-hosted runners configured in a repository. - * You must authenticate using an access token with the `repo` scope to use this endpoint. + * Lists all self-hosted runners configured in a repository. You must authenticate using an access token with the `repo` scope to use this endpoint. */ listSelfHostedRunnersForRepo: { (params?: RestEndpointMethodTypes["actions"]["listSelfHostedRunnersForRepo"]["parameters"]): Promise; @@ -650,7 +926,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List all workflow runs for a workflow. You can also replace `:workflow_id` with `:workflow_file_name`. For example, you could use `main.yml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://developer.github.com/v3/#parameters). + * List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. */ @@ -662,7 +938,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://developer.github.com/v3/#parameters). + * Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/overview/resources-in-the-rest-api#parameters). * * Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. */ @@ -684,7 +960,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://developer.github.com/v3/actions/secrets/#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. + * Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ removeSelectedRepoFromOrgSecret: { (params?: RestEndpointMethodTypes["actions"]["removeSelectedRepoFromOrgSecret"]["parameters"]): Promise; @@ -694,7 +970,79 @@ export declare type RestEndpointMethods = { }>; }; /** - * Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://developer.github.com/v3/actions/secrets/#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. + * Approve or reject pending deployments that are waiting on approval by a required reviewer. + * + * Anyone with read access to the repository contents and deployments can use this endpoint. + */ + reviewPendingDeploymentsForRun: { + (params?: RestEndpointMethodTypes["actions"]["reviewPendingDeploymentsForRun"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings. + * + * To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + setAllowedActionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["setAllowedActionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)." + * + * If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings. + * + * To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + setAllowedActionsRepository: { + (params?: RestEndpointMethodTypes["actions"]["setAllowedActionsRepository"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization. + * + * If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization. + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + setGithubActionsPermissionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["setGithubActionsPermissionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository. + * + * If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository. + * + * You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. + */ + setGithubActionsPermissionsRepository: { + (params?: RestEndpointMethodTypes["actions"]["setGithubActionsPermissionsRepository"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. */ setSelectedReposForOrgSecret: { (params?: RestEndpointMethodTypes["actions"]["setSelectedReposForOrgSecret"]["parameters"]): Promise; @@ -703,6 +1051,18 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)." + * + * You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. + */ + setSelectedRepositoriesEnabledGithubActionsOrganization: { + (params?: RestEndpointMethodTypes["actions"]["setSelectedRepositoriesEnabledGithubActionsOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; }; activity: { checkRepoIsStarredByAuthenticatedUser: { @@ -713,7 +1073,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://developer.github.com/v3/activity/watching/#set-a-repository-subscription). + * This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/reference/activity#set-a-repository-subscription). */ deleteRepoSubscription: { (params?: RestEndpointMethodTypes["activity"]["deleteRepoSubscription"]["parameters"]): Promise; @@ -723,7 +1083,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://developer.github.com/v3/activity/notifications/#set-a-thread-subscription) endpoint and set `ignore` to `true`. + * Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/reference/activity#set-a-thread-subscription) endpoint and set `ignore` to `true`. */ deleteThreadSubscription: { (params?: RestEndpointMethodTypes["activity"]["deleteThreadSubscription"]["parameters"]): Promise; @@ -736,14 +1096,14 @@ export declare type RestEndpointMethods = { * GitHub provides several timeline resources in [Atom](http://en.wikipedia.org/wiki/Atom_(standard)) format. The Feeds API lists all the feeds available to the authenticated user: * * * **Timeline**: The GitHub global public timeline - * * **User**: The public timeline for any user, using [URI template](https://developer.github.com/v3/#hypermedia) + * * **User**: The public timeline for any user, using [URI template](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) * * **Current user public**: The public timeline for the authenticated user * * **Current user**: The private timeline for the authenticated user * * **Current user actor**: The private timeline for activity created by the authenticated user * * **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. * * **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub. * - * **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://developer.github.com/v3/#basic-authentication) since current feed URIs use the older, non revocable auth tokens. + * **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens. */ getFeeds: { (params?: RestEndpointMethodTypes["activity"]["getFeeds"]["parameters"]): Promise; @@ -767,7 +1127,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://developer.github.com/v3/activity/watching/#get-a-repository-subscription). + * This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/reference/activity#get-a-repository-subscription). * * Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. */ @@ -876,7 +1236,7 @@ export declare type RestEndpointMethods = { /** * Lists repositories the authenticated user has starred. * - * You can also find out _when_ stars were created by passing the following custom [media type](https://developer.github.com/v3/media/) via the `Accept` header: + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ listReposStarredByAuthenticatedUser: { (params?: RestEndpointMethodTypes["activity"]["listReposStarredByAuthenticatedUser"]["parameters"]): Promise; @@ -888,7 +1248,7 @@ export declare type RestEndpointMethods = { /** * Lists repositories a user has starred. * - * You can also find out _when_ stars were created by passing the following custom [media type](https://developer.github.com/v3/media/) via the `Accept` header: + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ listReposStarredByUser: { (params?: RestEndpointMethodTypes["activity"]["listReposStarredByUser"]["parameters"]): Promise; @@ -910,7 +1270,7 @@ export declare type RestEndpointMethods = { /** * Lists the people that have starred the repository. * - * You can also find out _when_ stars were created by passing the following custom [media type](https://developer.github.com/v3/media/) via the `Accept` header: + * You can also find out _when_ stars were created by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `Accept` header: */ listStargazersForRepo: { (params?: RestEndpointMethodTypes["activity"]["listStargazersForRepo"]["parameters"]): Promise; @@ -940,7 +1300,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://developer.github.com/v3/activity/notifications/#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. + * Marks all notifications as "read" removes it from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ markNotificationsAsRead: { (params?: RestEndpointMethodTypes["activity"]["markNotificationsAsRead"]["parameters"]): Promise; @@ -950,7 +1310,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://developer.github.com/v3/activity/notifications/#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. + * Marks all notifications in a repository as "read" removes them from the [default view on GitHub](https://github.com/notifications). If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. */ markRepoNotificationsAsRead: { (params?: RestEndpointMethodTypes["activity"]["markRepoNotificationsAsRead"]["parameters"]): Promise; @@ -967,7 +1327,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription) completely. + * If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/reference/activity#delete-a-repository-subscription) completely. */ setRepoSubscription: { (params?: RestEndpointMethodTypes["activity"]["setRepoSubscription"]["parameters"]): Promise; @@ -981,7 +1341,7 @@ export declare type RestEndpointMethods = { * * You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored. * - * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription) endpoint. + * Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/reference/activity#delete-a-thread-subscription) endpoint. */ setThreadSubscription: { (params?: RestEndpointMethodTypes["activity"]["setThreadSubscription"]["parameters"]): Promise; @@ -991,7 +1351,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ starRepoForAuthenticatedUser: { (params?: RestEndpointMethodTypes["activity"]["starRepoForAuthenticatedUser"]["parameters"]): Promise; @@ -1012,7 +1372,7 @@ export declare type RestEndpointMethods = { /** * Add a single repository to an installation. The authenticated user must have admin access to the repository. * - * You must use a personal access token (which you can create via the [command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or the [OAuth Authorizations API](https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization)) or [Basic Authentication](https://developer.github.com/v3/auth/#basic-authentication) to access this endpoint. + * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ addRepoToInstallation: { (params?: RestEndpointMethodTypes["apps"]["addRepoToInstallation"]["parameters"]): Promise; @@ -1022,7 +1382,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://developer.github.com/v3/auth#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. + * OAuth applications can use a special API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the OAuth application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`. */ checkToken: { (params?: RestEndpointMethodTypes["apps"]["checkToken"]["parameters"]): Promise; @@ -1032,11 +1392,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` of the content reference from the [`content_reference` event](https://developer.github.com/webhooks/event-payloads/#content_reference) to create an attachment. + * **Deprecated:** use `apps.createContentAttachmentForRepo()` (`POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments`) instead. Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. * - * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://developer.github.com/apps/using-content-attachments/)" for details about content attachments. + * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. * - * You must use an [installation access token](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ createContentAttachment: { (params?: RestEndpointMethodTypes["apps"]["createContentAttachment"]["parameters"]): Promise; @@ -1046,7 +1406,21 @@ export declare type RestEndpointMethods = { }>; }; /** - * Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://developer.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. + * Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the `id` and `repository` `full_name` of the content reference from the [`content_reference` event](https://docs.github.com/webhooks/event-payloads/#content_reference) to create an attachment. + * + * The app must create a content attachment within six hours of the content reference URL being posted. See "[Using content attachments](https://docs.github.com/apps/using-content-attachments/)" for details about content attachments. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + createContentAttachmentForRepo: { + (params?: RestEndpointMethodTypes["apps"]["createContentAttachmentForRepo"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. */ createFromManifest: { (params?: RestEndpointMethodTypes["apps"]["createFromManifest"]["parameters"]): Promise; @@ -1058,7 +1432,7 @@ export declare type RestEndpointMethods = { /** * Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the `repository_ids` when creating the token. When you omit `repository_ids`, the response does not contain the `repositories` key. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ createInstallationAccessToken: { (params?: RestEndpointMethodTypes["apps"]["createInstallationAccessToken"]["parameters"]): Promise; @@ -1068,8 +1442,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://developer.github.com/v3/auth#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. - * + * OAuth application owners can revoke a grant for their OAuth application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted. * Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). */ deleteAuthorization: { @@ -1080,9 +1453,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://developer.github.com/v3/apps/#suspend-an-app-installation)" endpoint. + * Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/reference/apps/#suspend-an-app-installation)" endpoint. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ deleteInstallation: { (params?: RestEndpointMethodTypes["apps"]["deleteInstallation"]["parameters"]): Promise; @@ -1092,7 +1465,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://developer.github.com/v3/auth#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. + * OAuth application owners can revoke a single token for an OAuth application. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. */ deleteToken: { (params?: RestEndpointMethodTypes["apps"]["deleteToken"]["parameters"]): Promise; @@ -1102,9 +1475,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://developer.github.com/v3/apps/#list-installations-for-the-authenticated-app)" endpoint. + * Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app)" endpoint. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ getAuthenticated: { (params?: RestEndpointMethodTypes["apps"]["getAuthenticated"]["parameters"]): Promise; @@ -1116,7 +1489,7 @@ export declare type RestEndpointMethods = { /** * **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). * - * If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * If the GitHub App you specify is public, you can access this endpoint without authenticating. If the GitHub App you specify is private, you must authenticate with a [personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ getBySlug: { (params?: RestEndpointMethodTypes["apps"]["getBySlug"]["parameters"]): Promise; @@ -1128,7 +1501,7 @@ export declare type RestEndpointMethods = { /** * Enables an authenticated GitHub App to find an installation's information using the installation id. The installation's account type (`target_type`) will be either an organization or a user account, depending which account the repository belongs to. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ getInstallation: { (params?: RestEndpointMethodTypes["apps"]["getInstallation"]["parameters"]): Promise; @@ -1140,7 +1513,7 @@ export declare type RestEndpointMethods = { /** * Enables an authenticated GitHub App to find the organization's installation information. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ getOrgInstallation: { (params?: RestEndpointMethodTypes["apps"]["getOrgInstallation"]["parameters"]): Promise; @@ -1152,7 +1525,7 @@ export declare type RestEndpointMethods = { /** * Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ getRepoInstallation: { (params?: RestEndpointMethodTypes["apps"]["getRepoInstallation"]["parameters"]): Promise; @@ -1164,7 +1537,7 @@ export declare type RestEndpointMethods = { /** * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * - * GitHub Apps must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://developer.github.com/v3/auth/#basic-authentication) with their client ID and client secret to access this endpoint. + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ getSubscriptionPlanForAccount: { (params?: RestEndpointMethodTypes["apps"]["getSubscriptionPlanForAccount"]["parameters"]): Promise; @@ -1176,7 +1549,7 @@ export declare type RestEndpointMethods = { /** * Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * - * GitHub Apps must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://developer.github.com/v3/auth/#basic-authentication) with their client ID and client secret to access this endpoint. + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ getSubscriptionPlanForAccountStubbed: { (params?: RestEndpointMethodTypes["apps"]["getSubscriptionPlanForAccountStubbed"]["parameters"]): Promise; @@ -1188,7 +1561,7 @@ export declare type RestEndpointMethods = { /** * Enables an authenticated GitHub App to find the user’s installation information. * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ getUserInstallation: { (params?: RestEndpointMethodTypes["apps"]["getUserInstallation"]["parameters"]): Promise; @@ -1197,10 +1570,34 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + getWebhookConfigForApp: { + (params?: RestEndpointMethodTypes["apps"]["getWebhookConfigForApp"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns a delivery for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + getWebhookDelivery: { + (params?: RestEndpointMethodTypes["apps"]["getWebhookDelivery"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * - * GitHub Apps must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://developer.github.com/v3/auth/#basic-authentication) with their client ID and client secret to access this endpoint. + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ listAccountsForPlan: { (params?: RestEndpointMethodTypes["apps"]["listAccountsForPlan"]["parameters"]): Promise; @@ -1212,7 +1609,7 @@ export declare type RestEndpointMethods = { /** * Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change. * - * GitHub Apps must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://developer.github.com/v3/auth/#basic-authentication) with their client ID and client secret to access this endpoint. + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ listAccountsForPlanStubbed: { (params?: RestEndpointMethodTypes["apps"]["listAccountsForPlanStubbed"]["parameters"]): Promise; @@ -1226,7 +1623,7 @@ export declare type RestEndpointMethods = { * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * - * You must use a [user-to-server OAuth access token](https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. + * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. * * The access the user has to each repository is included in the hash under the `permissions` key. */ @@ -1238,7 +1635,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. * * The permissions the installation has are included under the `permissions` key. */ @@ -1252,7 +1649,7 @@ export declare type RestEndpointMethods = { /** * Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access. * - * You must use a [user-to-server OAuth access token](https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. + * You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. * * The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. * @@ -1268,7 +1665,7 @@ export declare type RestEndpointMethods = { /** * Lists all plans that are part of your GitHub Marketplace listing. * - * GitHub Apps must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://developer.github.com/v3/auth/#basic-authentication) with their client ID and client secret to access this endpoint. + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ listPlans: { (params?: RestEndpointMethodTypes["apps"]["listPlans"]["parameters"]): Promise; @@ -1280,7 +1677,7 @@ export declare type RestEndpointMethods = { /** * Lists all plans that are part of your GitHub Marketplace listing. * - * GitHub Apps must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://developer.github.com/v3/auth/#basic-authentication) with their client ID and client secret to access this endpoint. + * GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth Apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint. */ listPlansStubbed: { (params?: RestEndpointMethodTypes["apps"]["listPlansStubbed"]["parameters"]): Promise; @@ -1290,32 +1687,56 @@ export declare type RestEndpointMethods = { }>; }; /** - * List repositories that an app installation can access. - * - * You must use an [installation access token](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * List repositories that an app installation can access. + * + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + */ + listReposAccessibleToInstallation: { + (params?: RestEndpointMethodTypes["apps"]["listReposAccessibleToInstallation"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). + */ + listSubscriptionsForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["apps"]["listSubscriptionsForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/). */ - listReposAccessibleToInstallation: { - (params?: RestEndpointMethodTypes["apps"]["listReposAccessibleToInstallation"]["parameters"]): Promise; + listSubscriptionsForAuthenticatedUserStubbed: { + (params?: RestEndpointMethodTypes["apps"]["listSubscriptionsForAuthenticatedUserStubbed"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; endpoint: EndpointInterface<{ url: string; }>; }; /** - * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * Returns a list of webhook deliveries for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ - listSubscriptionsForAuthenticatedUser: { - (params?: RestEndpointMethodTypes["apps"]["listSubscriptionsForAuthenticatedUser"]["parameters"]): Promise; + listWebhookDeliveries: { + (params?: RestEndpointMethodTypes["apps"]["listWebhookDeliveries"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; endpoint: EndpointInterface<{ url: string; }>; }; /** - * Lists the active subscriptions for the authenticated user. You must use a [user-to-server OAuth access token](https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#identifying-users-on-your-site), created for a user who has authorized your GitHub App, to access this endpoint. . OAuth Apps must authenticate using an [OAuth token](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/). + * Redeliver a delivery for the webhook configured for a GitHub App. + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ - listSubscriptionsForAuthenticatedUserStubbed: { - (params?: RestEndpointMethodTypes["apps"]["listSubscriptionsForAuthenticatedUserStubbed"]["parameters"]): Promise; + redeliverWebhookDelivery: { + (params?: RestEndpointMethodTypes["apps"]["redeliverWebhookDelivery"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; endpoint: EndpointInterface<{ url: string; @@ -1324,7 +1745,7 @@ export declare type RestEndpointMethods = { /** * Remove a single repository from an installation. The authenticated user must have admin access to the repository. * - * You must use a personal access token (which you can create via the [command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line/) or the [OAuth Authorizations API](https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization)) or [Basic Authentication](https://developer.github.com/v3/auth/#basic-authentication) to access this endpoint. + * You must use a personal access token (which you can create via the [command line](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) or [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)) to access this endpoint. */ removeRepoFromInstallation: { (params?: RestEndpointMethodTypes["apps"]["removeRepoFromInstallation"]["parameters"]): Promise; @@ -1334,7 +1755,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://developer.github.com/v3/auth#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. + * OAuth applications can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. */ resetToken: { (params?: RestEndpointMethodTypes["apps"]["resetToken"]["parameters"]): Promise; @@ -1346,9 +1767,9 @@ export declare type RestEndpointMethods = { /** * Revokes the installation token you're using to authenticate as an installation and access this endpoint. * - * Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://developer.github.com/v3/apps/#create-an-installation-access-token-for-an-app)" endpoint. + * Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/reference/apps#create-an-installation-access-token-for-an-app)" endpoint. * - * You must use an [installation access token](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. + * You must use an [installation access token](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation) to access this endpoint. */ revokeInstallationAccessToken: { (params?: RestEndpointMethodTypes["apps"]["revokeInstallationAccessToken"]["parameters"]): Promise; @@ -1358,13 +1779,19 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://developer.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." - * + * Use a non-scoped user-to-server OAuth access token to create a repository scoped and/or permission scoped user-to-server OAuth access token. You can specify which repositories the token can access and which permissions are granted to the token. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`. + */ + scopeToken: { + (params?: RestEndpointMethodTypes["apps"]["scopeToken"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** * Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account. * - * To suspend a GitHub App, you must be an account owner or have admin permissions in the repository or organization where the app is installed. - * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ suspendInstallation: { (params?: RestEndpointMethodTypes["apps"]["suspendInstallation"]["parameters"]): Promise; @@ -1374,13 +1801,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** Suspending a GitHub App installation is currently in beta and subject to change. Before you can suspend a GitHub App, the app owner must enable suspending installations for the app by opting-in to the beta. For more information, see "[Suspending a GitHub App installation](https://developer.github.com/apps/managing-github-apps/suspending-a-github-app-installation/)." - * * Removes a GitHub App installation suspension. * - * To unsuspend a GitHub App, you must be an account owner or have admin permissions in the repository or organization where the app is installed and suspended. - * - * You must use a [JWT](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. */ unsuspendInstallation: { (params?: RestEndpointMethodTypes["apps"]["unsuspendInstallation"]["parameters"]): Promise; @@ -1389,16 +1812,26 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)." + * + * You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. + */ + updateWebhookConfigForApp: { + (params?: RestEndpointMethodTypes["apps"]["updateWebhookConfigForApp"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; }; billing: { /** - * **Warning:** The Billing API is currently in public beta and subject to change. - * * Gets the summary of the free and paid GitHub Actions minutes used. * - * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * - * Access tokens must have the `read:org` scope. + * Access tokens must have the `repo` or `admin:org` scope. */ getGithubActionsBillingOrg: { (params?: RestEndpointMethodTypes["billing"]["getGithubActionsBillingOrg"]["parameters"]): Promise; @@ -1408,11 +1841,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** The Billing API is currently in public beta and subject to change. - * * Gets the summary of the free and paid GitHub Actions minutes used. * - * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". + * Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage returned includes any minute multipliers for macOS and Windows runners, and is rounded up to the nearest whole minute. For more information, see "[Managing billing for GitHub Actions](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)". * * Access tokens must have the `user` scope. */ @@ -1424,13 +1855,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** The Billing API is currently in public beta and subject to change. - * - * Gets the free and paid storage usued for GitHub Packages in gigabytes. + * Gets the free and paid storage used for GitHub Packages in gigabytes. * - * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * - * Access tokens must have the `read:org` scope. + * Access tokens must have the `repo` or `admin:org` scope. */ getGithubPackagesBillingOrg: { (params?: RestEndpointMethodTypes["billing"]["getGithubPackagesBillingOrg"]["parameters"]): Promise; @@ -1440,11 +1869,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** The Billing API is currently in public beta and subject to change. - * * Gets the free and paid storage used for GitHub Packages in gigabytes. * - * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ @@ -1456,13 +1883,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** The Billing API is currently in public beta and subject to change. - * * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * - * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * - * Access tokens must have the `read:org` scope. + * Access tokens must have the `repo` or `admin:org` scope. */ getSharedStorageBillingOrg: { (params?: RestEndpointMethodTypes["billing"]["getSharedStorageBillingOrg"]["parameters"]): Promise; @@ -1472,11 +1897,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Warning:** The Billing API is currently in public beta and subject to change. - * * Gets the estimated paid and estimated total storage used for GitHub Actions and Github Packages. * - * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." + * Paid minutes only apply to packages stored for private repositories. For more information, see "[Managing billing for GitHub Packages](https://help.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-packages)." * * Access tokens must have the `user` scope. */ @@ -1493,6 +1916,8 @@ export declare type RestEndpointMethods = { * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. * * Creates a new check run for a specific commit in a repository. Your GitHub App must have the `checks:write` permission to create check runs. + * + * In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. */ create: { (params?: RestEndpointMethodTypes["checks"]["create"]["parameters"]): Promise; @@ -1504,7 +1929,7 @@ export declare type RestEndpointMethods = { /** * **Note:** The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`. * - * By default, check suites are automatically created when you create a [check run](https://developer.github.com/v3/checks/runs/). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://developer.github.com/v3/checks/suites/#update-repository-preferences-for-check-suites)". Your GitHub App must have the `checks:write` permission to create check suites. + * By default, check suites are automatically created when you create a [check run](https://docs.github.com/rest/reference/checks#check-runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites)". Your GitHub App must have the `checks:write` permission to create check suites. */ createSuite: { (params?: RestEndpointMethodTypes["checks"]["createSuite"]["parameters"]): Promise; @@ -1584,7 +2009,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://developer.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. + * Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared. * * To rerequest a check suite, your GitHub App must have the `checks:read` permission on a private repository or pull access to a public repository. */ @@ -1596,7 +2021,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://developer.github.com/v3/checks/suites/#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. + * Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/rest/reference/checks#create-a-check-suite). You must have admin permissions in the repository to set preferences for check suites. */ setSuitesPreferences: { (params?: RestEndpointMethodTypes["checks"]["setSuitesPreferences"]["parameters"]): Promise; @@ -1620,8 +2045,83 @@ export declare type RestEndpointMethods = { }; codeScanning: { /** - * Gets a single code scanning alert. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. - * GitHub Apps must have the `security_events` read permission to use this endpoint. + * Deletes a specified code scanning analysis from a repository. For + * private repositories, you must use an access token with the `repo` scope. For public repositories, + * you must use an access token with `public_repo` and `repo:security_events` scopes. + * GitHub Apps must have the `security_events` write permission to use this endpoint. + * + * You can delete one analysis at a time. + * To delete a series of analyses, start with the most recent analysis and work backwards. + * Conceptually, the process is similar to the undo function in a text editor. + * + * When you list the analyses for a repository, + * one or more will be identified as deletable in the response: + * + * ``` + * "deletable": true + * ``` + * + * An analysis is deletable when it's the most recent in a set of analyses. + * Typically, a repository will have multiple sets of analyses + * for each enabled code scanning tool, + * where a set is determined by a unique combination of analysis values: + * + * * `ref` + * * `tool` + * * `analysis_key` + * * `environment` + * + * If you attempt to delete an analysis that is not the most recent in a set, + * you'll get a 400 response with the message: + * + * ``` + * Analysis specified is not deletable. + * ``` + * + * The response from a successful `DELETE` operation provides you with + * two alternative URLs for deleting the next analysis in the set + * (see the example default response below). + * Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis + * in the set. This is a useful option if you want to preserve at least one analysis + * for the specified tool in your repository. + * Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. + * When you delete the last analysis in a set the value of `next_analysis_url` and `confirm_delete_url` + * in the 200 response is `null`. + * + * As an example of the deletion process, + * let's imagine that you added a workflow that configured a particular code scanning tool + * to analyze the code in a repository. This tool has added 15 analyses: + * 10 on the default branch, and another 5 on a topic branch. + * You therefore have two separate sets of analyses for this tool. + * You've now decided that you want to remove all of the analyses for the tool. + * To do this you must make 15 separate deletion requests. + * To start, you must find the deletable analysis for one of the sets, + * step through deleting the analyses in that set, + * and then repeat the process for the second set. + * The procedure therefore consists of a nested loop: + * + * **Outer loop**: + * * List the analyses for the repository, filtered by tool. + * * Parse this list to find a deletable analysis. If found: + * + * **Inner loop**: + * * Delete the identified analysis. + * * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration. + * + * The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely. + */ + deleteAnalysis: { + (params?: RestEndpointMethodTypes["codeScanning"]["deleteAnalysis"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * **Deprecation notice**: + * The instances field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The same information can now be retrieved via a GET request to the URL specified by `instances_url`. */ getAlert: { (params?: RestEndpointMethodTypes["codeScanning"]["getAlert"]["parameters"]): Promise; @@ -1631,7 +2131,65 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists all open code scanning alerts for the default branch (usually `master`) and protected branches in a repository. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint. + * Gets a specified code scanning analysis for a repository. + * You must use an access token with the `security_events` scope to use this endpoint. + * GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * The default JSON response contains fields that describe the analysis. + * This includes the Git reference and commit SHA to which the analysis relates, + * the datetime of the analysis, the name of the code scanning tool, + * and the number of alerts. + * + * The `rules_count` field in the default response give the number of rules + * that were run in the analysis. + * For very old analyses this data is not available, + * and `0` is returned in this field. + * + * If you use the Accept header `application/sarif+json`, + * the response contains the analysis data that was uploaded. + * This is formatted as + * [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). + * + * **Deprecation notice**: + * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. + */ + getAnalysis: { + (params?: RestEndpointMethodTypes["codeScanning"]["getAnalysis"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository)." You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. + */ + getSarif: { + (params?: RestEndpointMethodTypes["codeScanning"]["getSarif"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. + */ + listAlertInstances: { + (params?: RestEndpointMethodTypes["codeScanning"]["listAlertInstances"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists all open code scanning alerts for the default branch (usually `main` + * or `master`). You must use an access token with the `security_events` scope to use + * this endpoint. GitHub Apps must have the `security_events` read permission to use + * this endpoint. + * + * The response includes a `most_recent_instance` object. + * This provides details of the most recent instance of this alert + * for the default branch or for the specified Git reference + * (if you used `ref` in the request). */ listAlertsForRepo: { (params?: RestEndpointMethodTypes["codeScanning"]["listAlertsForRepo"]["parameters"]): Promise; @@ -1641,7 +2199,33 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the details of recent code scanning analyses for a repository. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` read permission to use this endpoint. + * Lists all instances of the specified code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` read permission to use this endpoint. + * @deprecated octokit.rest.codeScanning.listAlertsInstances() has been renamed to octokit.rest.codeScanning.listAlertInstances() (2021-04-30) + */ + listAlertsInstances: { + (params?: RestEndpointMethodTypes["codeScanning"]["listAlertsInstances"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists the details of all code scanning analyses for a repository, + * starting with the most recent. + * The response is paginated and you can use the `page` and `per_page` parameters + * to list the analyses you're interested in. + * By default 30 analyses are listed per page. + * + * The `rules_count` field in the response give the number of rules + * that were run in the analysis. + * For very old analyses this data is not available, + * and `0` is returned in this field. + * + * You must use an access token with the `security_events` scope to use this endpoint. + * GitHub Apps must have the `security_events` read permission to use this endpoint. + * + * **Deprecation notice**: + * The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. */ listRecentAnalyses: { (params?: RestEndpointMethodTypes["codeScanning"]["listRecentAnalyses"]["parameters"]): Promise; @@ -1651,8 +2235,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Updates the status of a single code scanning alert. For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. - * GitHub Apps must have the `security_events` write permission to use this endpoint. + * Updates the status of a single code scanning alert. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. */ updateAlert: { (params?: RestEndpointMethodTypes["codeScanning"]["updateAlert"]["parameters"]): Promise; @@ -1662,8 +2245,23 @@ export declare type RestEndpointMethods = { }>; }; /** - * Upload a SARIF file containing the results of a code scanning analysis to make the results available in a repository. - * For private repos, you must use an access token with the `repo` scope. For public repos, you must use an access token with `public_repo` and `repo:security_events` scopes. GitHub Apps must have the `security_events` write permission to use this endpoint. + * Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. You must use an access token with the `security_events` scope to use this endpoint. GitHub Apps must have the `security_events` write permission to use this endpoint. + * + * There are two places where you can upload code scanning results. + * - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." + * - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)." + * + * You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example: + * + * ``` + * gzip -c analysis-data.sarif | base64 -w0 + * ``` + * + * SARIF upload supports a maximum of 5000 results per analysis run. Any results over this limit are ignored and any SARIF uploads with more than 25,000 results are rejected. Typically, but not necessarily, a SARIF file contains a single run of a single tool. If a code scanning tool generates too many results, you should update the analysis configuration to run only the most important rules or queries. + * + * The `202 Accepted`, response includes an `id` value. + * You can use this ID to check the status of the upload by using this for the `/sarifs/{sarif_id}` endpoint. + * For more information, see "[Get information about a SARIF upload](/rest/reference/code-scanning#get-information-about-a-sarif-upload)." */ uploadSarif: { (params?: RestEndpointMethodTypes["codeScanning"]["uploadSarif"]["parameters"]): Promise; @@ -1689,7 +2287,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * This method returns the contents of the repository's code of conduct file, if one is detected. + * Returns the contents of the repository's code of conduct file, if one is detected. + * + * A code of conduct is detected if there is a file named `CODE_OF_CONDUCT` in the root directory of the repository. GitHub detects which code of conduct it is using fuzzy matching. */ getForRepo: { (params?: RestEndpointMethodTypes["codesOfConduct"]["getForRepo"]["parameters"]): Promise; @@ -1711,6 +2311,104 @@ export declare type RestEndpointMethods = { }>; }; }; + enterpriseAdmin: { + /** + * Removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + disableSelectedOrganizationGithubActionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["disableSelectedOrganizationGithubActionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + enableSelectedOrganizationGithubActionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["enableSelectedOrganizationGithubActionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + getAllowedActionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["getAllowedActionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + getGithubActionsPermissionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["getGithubActionsPermissionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + listSelectedOrganizationsEnabledGithubActionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["listSelectedOrganizationsEnabledGithubActionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + setAllowedActionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["setAllowedActionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise. + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + setGithubActionsPermissionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["setGithubActionsPermissionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)." + * + * You must authenticate using an access token with the `admin:enterprise` scope to use this endpoint. + */ + setSelectedOrganizationsEnabledGithubActionsEnterprise: { + (params?: RestEndpointMethodTypes["enterpriseAdmin"]["setSelectedOrganizationsEnabledGithubActionsEnterprise"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + }; gists: { checkIsStarred: { (params?: RestEndpointMethodTypes["gists"]["checkIsStarred"]["parameters"]): Promise; @@ -1827,7 +2525,7 @@ export declare type RestEndpointMethods = { /** * List public gists sorted by most recently updated to least recently updated. * - * Note: With [pagination](https://developer.github.com/v3/#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. + * Note: With [pagination](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. */ listPublic: { (params?: RestEndpointMethodTypes["gists"]["listPublic"]["parameters"]): Promise; @@ -1847,7 +2545,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ star: { (params?: RestEndpointMethodTypes["gists"]["star"]["parameters"]): Promise; @@ -1939,8 +2637,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://developer.github.com/v3/git/refs/#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://developer.github.com/v3/git/refs/#create-a-reference) the tag reference - this call would be unnecessary. - * + * Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/rest/reference/git#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/rest/reference/git#create-a-reference) the tag reference - this call would be unnecessary. * * **Signature verification object** * @@ -1981,7 +2678,7 @@ export declare type RestEndpointMethods = { /** * The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure. * - * If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://developer.github.com/v3/git/commits/#create-a-commit)" and "[Update a reference](https://developer.github.com/v3/git/refs/#update-a-reference)." + * If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/rest/reference/git#create-a-commit)" and "[Update a reference](https://docs.github.com/rest/reference/git#update-a-reference)." */ createTree: { (params?: RestEndpointMethodTypes["git"]["createTree"]["parameters"]): Promise; @@ -2012,7 +2709,6 @@ export declare type RestEndpointMethods = { /** * Gets a Git [commit object](https://git-scm.com/book/en/v1/Git-Internals-Git-Objects#Commit-Objects). * - * * **Signature verification object** * * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: @@ -2052,7 +2748,7 @@ export declare type RestEndpointMethods = { /** * Returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned. * - * **Note:** You need to explicitly [request a pull request](https://developer.github.com/v3/pulls/#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://developer.github.com/v3/git/#checking-mergeability-of-pull-requests)". + * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". */ getRef: { (params?: RestEndpointMethodTypes["git"]["getRef"]["parameters"]): Promise; @@ -2115,7 +2811,7 @@ export declare type RestEndpointMethods = { * * When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`. * - * **Note:** You need to explicitly [request a pull request](https://developer.github.com/v3/pulls/#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://developer.github.com/v3/git/#checking-mergeability-of-pull-requests)". + * **Note:** You need to explicitly [request a pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * * If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. */ @@ -2136,7 +2832,7 @@ export declare type RestEndpointMethods = { }; gitignore: { /** - * List all templates available to pass as an option when [creating a repository](https://developer.github.com/v3/repos/#create-a-repository-for-the-authenticated-user). + * List all templates available to pass as an option when [creating a repository](https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user). */ getAllTemplates: { (params?: RestEndpointMethodTypes["gitignore"]["getAllTemplates"]["parameters"]): Promise; @@ -2147,8 +2843,7 @@ export declare type RestEndpointMethods = { }; /** * The API also allows fetching the source of a single template. - * - * Use the raw [media type](https://developer.github.com/v3/media/) to get the raw contents. + * Use the raw [media type](https://docs.github.com/rest/overview/media-types/) to get the raw contents. */ getTemplate: { (params?: RestEndpointMethodTypes["gitignore"]["getTemplate"]["parameters"]): Promise; @@ -2160,7 +2855,17 @@ export declare type RestEndpointMethods = { }; interactions: { /** - * Shows which group of GitHub users can interact with this organization and when the restriction expires. If there are no restrictions, you will see an empty response. + * Shows which type of GitHub user can interact with your public repositories and when the restriction expires. + */ + getRestrictionsForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response. */ getRestrictionsForOrg: { (params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForOrg"]["parameters"]): Promise; @@ -2170,7 +2875,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Shows which group of GitHub users can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. + * Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response. */ getRestrictionsForRepo: { (params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForRepo"]["parameters"]): Promise; @@ -2179,6 +2884,27 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Shows which type of GitHub user can interact with your public repositories and when the restriction expires. + * @deprecated octokit.rest.interactions.getRestrictionsForYourPublicRepos() has been renamed to octokit.rest.interactions.getRestrictionsForAuthenticatedUser() (2021-02-02) + */ + getRestrictionsForYourPublicRepos: { + (params?: RestEndpointMethodTypes["interactions"]["getRestrictionsForYourPublicRepos"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Removes any interaction restrictions from your public repositories. + */ + removeRestrictionsForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["interactions"]["removeRestrictionsForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions. */ @@ -2190,7 +2916,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. + * Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ removeRestrictionsForRepo: { (params?: RestEndpointMethodTypes["interactions"]["removeRestrictionsForRepo"]["parameters"]): Promise; @@ -2200,7 +2926,28 @@ export declare type RestEndpointMethods = { }>; }; /** - * Temporarily restricts interactions to certain GitHub users in any public repository in the given organization. You must be an organization owner to set these restrictions. + * Removes any interaction restrictions from your public repositories. + * @deprecated octokit.rest.interactions.removeRestrictionsForYourPublicRepos() has been renamed to octokit.rest.interactions.removeRestrictionsForAuthenticatedUser() (2021-02-02) + */ + removeRestrictionsForYourPublicRepos: { + (params?: RestEndpointMethodTypes["interactions"]["removeRestrictionsForYourPublicRepos"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + */ + setRestrictionsForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization. */ setRestrictionsForOrg: { (params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForOrg"]["parameters"]): Promise; @@ -2210,7 +2957,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Temporarily restricts interactions to certain GitHub users within the given repository. You must have owner or admin access to set restrictions. + * Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a `409 Conflict` response and will not be able to use this endpoint to change the interaction limit for a single repository. */ setRestrictionsForRepo: { (params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForRepo"]["parameters"]): Promise; @@ -2219,6 +2966,17 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user. + * @deprecated octokit.rest.interactions.setRestrictionsForYourPublicRepos() has been renamed to octokit.rest.interactions.setRestrictionsForAuthenticatedUser() (2021-02-02) + */ + setRestrictionsForYourPublicRepos: { + (params?: RestEndpointMethodTypes["interactions"]["setRestrictionsForYourPublicRepos"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; }; issues: { /** @@ -2253,9 +3011,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. + * Any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://help.github.com/articles/disabling-issues/), the API returns a `410 Gone` status. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ create: { (params?: RestEndpointMethodTypes["issues"]["create"]["parameters"]): Promise; @@ -2265,7 +3023,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ createComment: { (params?: RestEndpointMethodTypes["issues"]["createComment"]["parameters"]): Promise; @@ -2310,17 +3068,17 @@ export declare type RestEndpointMethods = { }>; }; /** - * The API returns a [`301 Moved Permanently` status](https://developer.github.com/v3/#http-redirects) if the issue was - * [transferred](https://docs.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If + * The API returns a [`301 Moved Permanently` status](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-redirects-redirects) if the issue was + * [transferred](https://help.github.com/articles/transferring-an-issue-to-another-repository/) to another repository. If * the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API * returns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has read * access, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribe - * to the [`issues`](https://developer.github.com/webhooks/event-payloads/#issues) webhook. + * to the [`issues`](https://docs.github.com/webhooks/event-payloads/#issues) webhook. * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull - * request id, use the "[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)" endpoint. + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ get: { (params?: RestEndpointMethodTypes["issues"]["get"]["parameters"]): Promise; @@ -2360,14 +3118,13 @@ export declare type RestEndpointMethods = { /** * List issues assigned to the authenticated user across all visible repositories including owned repositories, member * repositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are not - * necessarily assigned to you. See the [Parameters table](https://developer.github.com/v3/issues/#parameters) for more - * information. + * necessarily assigned to you. * * * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull - * request id, use the "[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)" endpoint. + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ list: { (params?: RestEndpointMethodTypes["issues"]["list"]["parameters"]): Promise; @@ -2377,7 +3134,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists the [available assignees](https://docs.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. + * Lists the [available assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. */ listAssignees: { (params?: RestEndpointMethodTypes["issues"]["listAssignees"]["parameters"]): Promise; @@ -2433,7 +3190,7 @@ export declare type RestEndpointMethods = { * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull - * request id, use the "[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)" endpoint. + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ listForAuthenticatedUser: { (params?: RestEndpointMethodTypes["issues"]["listForAuthenticatedUser"]["parameters"]): Promise; @@ -2448,7 +3205,7 @@ export declare type RestEndpointMethods = { * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull - * request id, use the "[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)" endpoint. + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ listForOrg: { (params?: RestEndpointMethodTypes["issues"]["listForOrg"]["parameters"]): Promise; @@ -2463,7 +3220,7 @@ export declare type RestEndpointMethods = { * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this * reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by * the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull - * request id, use the "[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)" endpoint. + * request id, use the "[List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests)" endpoint. */ listForRepo: { (params?: RestEndpointMethodTypes["issues"]["listForRepo"]["parameters"]): Promise; @@ -2503,7 +3260,7 @@ export declare type RestEndpointMethods = { /** * Users with push access can lock an issue or pull request's conversation. * - * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ lock: { (params?: RestEndpointMethodTypes["issues"]["lock"]["parameters"]): Promise; @@ -2609,7 +3366,7 @@ export declare type RestEndpointMethods = { /** * This method returns the contents of the repository's license file, if one is detected. * - * Similar to [Get repository content](https://developer.github.com/v3/repos/contents/#get-repository-content), this method also supports [custom media types](https://developer.github.com/v3/repos/contents/#custom-media-types) for retrieving the raw license content or rendered license HTML. + * Similar to [Get repository content](https://docs.github.com/rest/reference/repos#get-repository-content), this method also supports [custom media types](https://docs.github.com/rest/overview/media-types) for retrieving the raw license content or rendered license HTML. */ getForRepo: { (params?: RestEndpointMethodTypes["licenses"]["getForRepo"]["parameters"]): Promise; @@ -2640,7 +3397,9 @@ export declare type RestEndpointMethods = { }; meta: { /** - * This endpoint provides a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://docs.github.com/articles/about-github-s-ip-addresses/)." + * Returns meta information about GitHub, including a list of GitHub's IP addresses. For more information, see "[About GitHub's IP addresses](https://help.github.com/articles/about-github-s-ip-addresses/)." + * + * **Note:** The IP addresses shown in the documentation's response are only example values. You must always query the API directly to get the latest list of IP addresses. */ get: { (params?: RestEndpointMethodTypes["meta"]["get"]["parameters"]): Promise; @@ -2649,6 +3408,36 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Get the octocat as ASCII art + */ + getOctocat: { + (params?: RestEndpointMethodTypes["meta"]["getOctocat"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Get a random sentence from the Zen of GitHub + */ + getZen: { + (params?: RestEndpointMethodTypes["meta"]["getZen"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Get Hypermedia links to resources accessible in GitHub's REST API + */ + root: { + (params?: RestEndpointMethodTypes["meta"]["root"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; }; migrations: { /** @@ -2662,7 +3451,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://developer.github.com/v3/migrations/users/#list-user-migrations) and [Get a user migration status](https://developer.github.com/v3/migrations/users/#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. + * Deletes a previous migration archive. Downloadable migration archives are automatically deleted after seven days. Migration metadata, which is returned in the [List user migrations](https://docs.github.com/rest/reference/migrations#list-user-migrations) and [Get a user migration status](https://docs.github.com/rest/reference/migrations#get-a-user-migration-status) endpoints, will continue to be available even after an archive is deleted. */ deleteArchiveForAuthenticatedUser: { (params?: RestEndpointMethodTypes["migrations"]["deleteArchiveForAuthenticatedUser"]["parameters"]): Promise; @@ -2724,7 +3513,7 @@ export declare type RestEndpointMethods = { /** * Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot `. * - * This endpoint and the [Map a commit author](https://developer.github.com/v3/migrations/source_imports/#map-a-commit-author) endpoint allow you to provide correct Git author information. + * This endpoint and the [Map a commit author](https://docs.github.com/rest/reference/migrations#map-a-commit-author) endpoint allow you to provide correct Git author information. */ getCommitAuthors: { (params?: RestEndpointMethodTypes["migrations"]["getCommitAuthors"]["parameters"]): Promise; @@ -2750,11 +3539,11 @@ export declare type RestEndpointMethods = { * * If there are problems, you will see one of these in the `status` field: * - * * `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://developer.github.com/v3/migrations/source_imports/#update-an-import) section. - * * `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com) for more information. - * * `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://developer.github.com/v3/migrations/source_imports/#update-an-import) section. - * * `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://developer.github.com/v3/migrations/source_imports/#cancel-an-import) and [retry](https://developer.github.com/v3/migrations/source_imports/#start-an-import) with the correct URL. - * * `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://developer.github.com/v3/migrations/source_imports/#update-an-import) section. + * * `auth_failed` - the import requires authentication in order to connect to the original repository. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * * `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. Contact [GitHub Support](https://support.github.com/contact?tags=rest-api) for more information. + * * `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. To update authentication for the import, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. + * * `detection_found_nothing` - the importer didn't recognize any source control at the URL. To resolve, [Cancel the import](https://docs.github.com/rest/reference/migrations#cancel-an-import) and [retry](https://docs.github.com/rest/reference/migrations#start-an-import) with the correct URL. + * * `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. To update project choice, please see the [Update an import](https://docs.github.com/rest/reference/migrations#update-an-import) section. * * **The project_choices field** * @@ -2794,7 +3583,7 @@ export declare type RestEndpointMethods = { * * `exported` - the migration finished successfully. * * `failed` - the migration failed. * - * Once the migration has been `exported` you can [download the migration archive](https://developer.github.com/v3/migrations/users/#download-a-user-migration-archive). + * Once the migration has been `exported` you can [download the migration archive](https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive). */ getStatusForAuthenticatedUser: { (params?: RestEndpointMethodTypes["migrations"]["getStatusForAuthenticatedUser"]["parameters"]): Promise; @@ -2871,7 +3660,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://docs.github.com/articles/versioning-large-files/). + * You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/). */ setLfsPreference: { (params?: RestEndpointMethodTypes["migrations"]["setLfsPreference"]["parameters"]): Promise; @@ -2911,7 +3700,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Unlocks a repository. You can lock repositories when you [start a user migration](https://developer.github.com/v3/migrations/users/#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://developer.github.com/v3/repos/#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. + * Unlocks a repository. You can lock repositories when you [start a user migration](https://docs.github.com/rest/reference/migrations#start-a-user-migration). Once the migration is complete you can unlock each repository to begin using it again or [delete the repository](https://docs.github.com/rest/reference/repos#delete-a-repository) if you no longer need the source data. Returns a status of `404 Not Found` if the repository is not locked. */ unlockRepoForAuthenticatedUser: { (params?: RestEndpointMethodTypes["migrations"]["unlockRepoForAuthenticatedUser"]["parameters"]): Promise; @@ -2921,7 +3710,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://developer.github.com/v3/repos/#delete-a-repository) when the migration is complete and you no longer need the source data. + * Unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/rest/reference/repos#delete-a-repository) when the migration is complete and you no longer need the source data. */ unlockRepoForOrg: { (params?: RestEndpointMethodTypes["migrations"]["unlockRepoForOrg"]["parameters"]): Promise; @@ -2950,6 +3739,18 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner. + * + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). + */ + cancelInvitation: { + (params?: RestEndpointMethodTypes["orgs"]["cancelInvitation"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; checkBlockedUser: { (params?: RestEndpointMethodTypes["orgs"]["checkBlockedUser"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -2975,7 +3776,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". + * When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". */ convertMemberToOutsideCollaborator: { (params?: RestEndpointMethodTypes["orgs"]["convertMemberToOutsideCollaborator"]["parameters"]): Promise; @@ -2987,7 +3788,7 @@ export declare type RestEndpointMethods = { /** * Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ createInvitation: { (params?: RestEndpointMethodTypes["orgs"]["createInvitation"]["parameters"]): Promise; @@ -3014,9 +3815,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). + * To see many of the organization response values, you need to be an authenticated organization owner with the `admin:org` scope. When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/). * - * GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see "[Response with GitHub plan information](https://developer.github.com/v3/orgs/#response-with-github-plan-information)." + * GitHub Apps with the `Organization plan` permission can use this endpoint to retrieve information about an organization's GitHub plan. See "[Authenticating with GitHub Apps](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/)" for details. For an example response, see 'Response with GitHub plan information' below." */ get: { (params?: RestEndpointMethodTypes["orgs"]["get"]["parameters"]): Promise; @@ -3033,7 +3834,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * In order to get a user's membership with an organization, the authenticated user must be an organization member. + * In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. */ getMembershipForUser: { (params?: RestEndpointMethodTypes["orgs"]["getMembershipForUser"]["parameters"]): Promise; @@ -3042,6 +3843,9 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns a webhook configured in an organization. To get only the webhook `config` properties, see "[Get a webhook configuration for an organization](/rest/reference/orgs#get-a-webhook-configuration-for-an-organization)." + */ getWebhook: { (params?: RestEndpointMethodTypes["orgs"]["getWebhook"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -3049,10 +3853,32 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/reference/orgs#get-an-organization-webhook)." + * + * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:read` permission. + */ + getWebhookConfigForOrg: { + (params?: RestEndpointMethodTypes["orgs"]["getWebhookConfigForOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns a delivery for a webhook configured in an organization. + */ + getWebhookDelivery: { + (params?: RestEndpointMethodTypes["orgs"]["getWebhookDelivery"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Lists all organizations, in the order that they were created on GitHub. * - * **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://developer.github.com/v3/#link-header) to get the URL for the next page of organizations. + * **Note:** Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of organizations. */ list: { (params?: RestEndpointMethodTypes["orgs"]["list"]["parameters"]): Promise; @@ -3081,6 +3907,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure. + */ + listFailedInvitations: { + (params?: RestEndpointMethodTypes["orgs"]["listFailedInvitations"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * List organizations for the authenticated user. * @@ -3096,9 +3932,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. + * List [public organization memberships](https://help.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user. * - * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://developer.github.com/v3/orgs/#list-organizations-for-the-authenticated-user) API instead. + * This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user) API instead. */ listForUser: { (params?: RestEndpointMethodTypes["orgs"]["listForUser"]["parameters"]): Promise; @@ -3164,6 +4000,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns a list of webhook deliveries for a webhook configured in an organization. + */ + listWebhookDeliveries: { + (params?: RestEndpointMethodTypes["orgs"]["listWebhookDeliveries"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; listWebhooks: { (params?: RestEndpointMethodTypes["orgs"]["listWebhooks"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -3172,7 +4018,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This will trigger a [ping event](https://developer.github.com/webhooks/#ping-event) to be sent to the hook. + * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ pingWebhook: { (params?: RestEndpointMethodTypes["orgs"]["pingWebhook"]["parameters"]): Promise; @@ -3181,6 +4027,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Redeliver a delivery for a webhook configured in an organization. + */ + redeliverWebhookDelivery: { + (params?: RestEndpointMethodTypes["orgs"]["redeliverWebhookDelivery"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. */ @@ -3223,7 +4079,7 @@ export declare type RestEndpointMethods = { /** * Only authenticated organization owners can add a member to the organization or update the member's role. * - * * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://developer.github.com/v3/orgs/members/#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. + * * If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * * * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent. * @@ -3241,7 +4097,7 @@ export declare type RestEndpointMethods = { /** * The user can publicize their own membership. (A user cannot publicize the membership for another user.) * - * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." */ setPublicMembershipForAuthenticatedUser: { (params?: RestEndpointMethodTypes["orgs"]["setPublicMembershipForAuthenticatedUser"]["parameters"]): Promise; @@ -3276,6 +4132,9 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Updates a webhook configured in an organization. When you update a webhook, the `secret` will be overwritten. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for an organization](/rest/reference/orgs#update-a-webhook-configuration-for-an-organization)." + */ updateWebhook: { (params?: RestEndpointMethodTypes["orgs"]["updateWebhook"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -3283,6 +4142,287 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/reference/orgs#update-an-organization-webhook)." + * + * Access tokens must have the `admin:org_hook` scope, and GitHub Apps must have the `organization_hooks:write` permission. + */ + updateWebhookConfigForOrg: { + (params?: RestEndpointMethodTypes["orgs"]["updateWebhookConfigForOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + }; + packages: { + /** + * Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:delete` scopes. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + deletePackageForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["deletePackageForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. + */ + deletePackageForOrg: { + (params?: RestEndpointMethodTypes["packages"]["deletePackageForOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + deletePackageVersionForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["deletePackageVersionForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:delete` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container you want to delete. + */ + deletePackageVersionForOrg: { + (params?: RestEndpointMethodTypes["packages"]["deletePackageVersionForOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns all package versions for a package owned by an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + * @deprecated octokit.rest.packages.getAllPackageVersionsForAPackageOwnedByAnOrg() has been renamed to octokit.rest.packages.getAllPackageVersionsForPackageOwnedByOrg() (2021-03-24) + */ + getAllPackageVersionsForAPackageOwnedByAnOrg: { + (params?: RestEndpointMethodTypes["packages"]["getAllPackageVersionsForAPackageOwnedByAnOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns all package versions for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + * @deprecated octokit.rest.packages.getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser() has been renamed to octokit.rest.packages.getAllPackageVersionsForPackageOwnedByAuthenticatedUser() (2021-03-24) + */ + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns all package versions for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns all package versions for a package owned by an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getAllPackageVersionsForPackageOwnedByOrg: { + (params?: RestEndpointMethodTypes["packages"]["getAllPackageVersionsForPackageOwnedByOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns all package versions for a public package owned by a specified user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getAllPackageVersionsForPackageOwnedByUser: { + (params?: RestEndpointMethodTypes["packages"]["getAllPackageVersionsForPackageOwnedByUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a specific package for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getPackageForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["getPackageForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a specific package in an organization. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getPackageForOrganization: { + (params?: RestEndpointMethodTypes["packages"]["getPackageForOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a specific package metadata for a public package owned by a user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getPackageForUser: { + (params?: RestEndpointMethodTypes["packages"]["getPackageForUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a specific package version for a package owned by the authenticated user. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getPackageVersionForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["getPackageVersionForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a specific package version in an organization. + * + * You must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getPackageVersionForOrganization: { + (params?: RestEndpointMethodTypes["packages"]["getPackageVersionForOrganization"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a specific package version for a public package owned by a specified user. + * + * At this time, to use this endpoint, you must authenticate using an access token with the `packages:read` scope. + * If `package_type` is not `container`, your token must also include the `repo` scope. + */ + getPackageVersionForUser: { + (params?: RestEndpointMethodTypes["packages"]["getPackageVersionForUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Restores a package owned by the authenticated user. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scopes. If `package_type` is not `container`, your token must also include the `repo` scope. + */ + restorePackageForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["restorePackageForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Restores an entire package in an organization. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. + */ + restorePackageForOrg: { + (params?: RestEndpointMethodTypes["packages"]["restorePackageForOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Restores a package version owned by the authenticated user. + * + * You can restore a deleted package version under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must authenticate using an access token with the `packages:read` and `packages:write` scopes. If `package_type` is not `container`, your token must also include the `repo` scope. + */ + restorePackageVersionForAuthenticatedUser: { + (params?: RestEndpointMethodTypes["packages"]["restorePackageVersionForAuthenticatedUser"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Restores a specific package version in an organization. + * + * You can restore a deleted package under the following conditions: + * - The package was deleted within the last 30 days. + * - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first. + * + * To use this endpoint, you must have admin permissions in the organization and authenticate using an access token with the `packages:read` and `packages:write` scopes. In addition: + * - If `package_type` is not `container`, your token must also include the `repo` scope. + * - If `package_type` is `container`, you must also have admin permissions to the container that you want to restore. + */ + restorePackageVersionForOrg: { + (params?: RestEndpointMethodTypes["packages"]["restorePackageVersionForOrg"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; }; projects: { /** @@ -3295,11 +4435,6 @@ export declare type RestEndpointMethods = { url: string; }>; }; - /** - * **Note**: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. - * - * Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests)" endpoint. - */ createCard: { (params?: RestEndpointMethodTypes["projects"]["createCard"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -3508,13 +4643,13 @@ export declare type RestEndpointMethods = { }>; }; /** - * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. * * You can create a new pull request. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-rate-limits)" for details. */ create: { (params?: RestEndpointMethodTypes["pulls"]["create"]["parameters"]): Promise; @@ -3526,7 +4661,7 @@ export declare type RestEndpointMethods = { /** * Creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ createReplyForReviewComment: { (params?: RestEndpointMethodTypes["pulls"]["createReplyForReviewComment"]["parameters"]): Promise; @@ -3536,11 +4671,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. * * Pull request reviews created in the `PENDING` state do not include the `submitted_at` property in the response. * - * **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://developer.github.com/v3/media/#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://developer.github.com/v3/pulls/#get-a-pull-request) endpoint. + * **Note:** To comment on a specific line in a file, you need to first determine the _position_ of that line in the diff. The GitHub REST API v3 offers the `application/vnd.github.v3.diff` [media type](https://docs.github.com/rest/overview/media-types#commits-commit-comparison-and-pull-requests). To see a pull request diff, add this media type to the `Accept` header of a call to the [single pull request](https://docs.github.com/rest/reference/pulls#get-a-pull-request) endpoint. * * The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. */ @@ -3552,31 +4687,13 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. + * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/rest/reference/issues#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. * - * Creates a review comment in the pull request diff. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://developer.github.com/v3/issues/comments/#create-an-issue-comment)." We recommend creating a review comment using `line`, `side`, and optionally `start_line` and `start_side` if your comment applies to more than one line in the pull request diff. - * - * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see [Multi-line comment summary](https://developer.github.com/v3/pulls/comments/#multi-line-comment-summary-3). + * You can still create a review comment using the `position` parameter. When you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required. For more information, see the [`comfort-fade` preview notice](https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request-preview-notices). * * **Note:** The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://developer.github.com/v3/pulls/comments/#parameters-2) table. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ createReviewComment: { (params?: RestEndpointMethodTypes["pulls"]["createReviewComment"]["parameters"]): Promise; @@ -3603,7 +4720,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** To dismiss a pull request review on a [protected branch](https://developer.github.com/v3/repos/branches/), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. + * **Note:** To dismiss a pull request review on a [protected branch](https://docs.github.com/rest/reference/repos#branches), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews. */ dismissReview: { (params?: RestEndpointMethodTypes["pulls"]["dismissReview"]["parameters"]): Promise; @@ -3613,21 +4730,21 @@ export declare type RestEndpointMethods = { }>; }; /** - * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists details of a pull request by providing its number. * - * When you get, [create](https://developer.github.com/v3/pulls/#create-a-pull-request), or [edit](https://developer.github.com/v3/pulls/#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://developer.github.com/v3/git/#checking-mergeability-of-pull-requests)". + * When you get, [create](https://docs.github.com/rest/reference/pulls/#create-a-pull-request), or [edit](https://docs.github.com/rest/reference/pulls#update-a-pull-request) a pull request, GitHub creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". * * The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit. * * The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request: * - * * If merged as a [merge commit](https://docs.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. - * * If merged via a [squash](https://docs.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. - * * If [rebased](https://docs.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to. + * * If merged as a [merge commit](https://help.github.com/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit. + * * If merged via a [squash](https://help.github.com/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch. + * * If [rebased](https://help.github.com/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to. * - * Pass the appropriate [media type](https://developer.github.com/v3/media/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. */ get: { (params?: RestEndpointMethodTypes["pulls"]["get"]["parameters"]): Promise; @@ -3644,27 +4761,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Provides details for a review comment. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://developer.github.com/v3/pulls/comments/#parameters-2) table. - * - * The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://developer.github.com/v3/reactions) reactions. */ getReviewComment: { (params?: RestEndpointMethodTypes["pulls"]["getReviewComment"]["parameters"]): Promise; @@ -3674,7 +4771,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ list: { (params?: RestEndpointMethodTypes["pulls"]["list"]["parameters"]): Promise; @@ -3694,7 +4791,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://developer.github.com/v3/repos/commits/#list-commits) endpoint. + * Lists a maximum of 250 commits for a pull request. To receive a complete commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/rest/reference/repos#list-commits) endpoint. */ listCommits: { (params?: RestEndpointMethodTypes["pulls"]["listCommits"]["parameters"]): Promise; @@ -3721,27 +4818,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Lists all review comments for a pull request. By default, review comments are in ascending order by ID. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://developer.github.com/v3/pulls/comments/#parameters-2) table. - * - * The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://developer.github.com/v3/reactions) reactions. */ listReviewComments: { (params?: RestEndpointMethodTypes["pulls"]["listReviewComments"]["parameters"]): Promise; @@ -3751,27 +4828,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * * Lists review comments for all pull requests in a repository. By default, review comments are in ascending order by ID. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://developer.github.com/v3/pulls/comments/#parameters-2) table. - * - * The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](https://developer.github.com/v3/reactions) reactions. */ listReviewCommentsForRepo: { (params?: RestEndpointMethodTypes["pulls"]["listReviewCommentsForRepo"]["parameters"]): Promise; @@ -3791,7 +4848,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ merge: { (params?: RestEndpointMethodTypes["pulls"]["merge"]["parameters"]): Promise; @@ -3808,7 +4865,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ requestReviewers: { (params?: RestEndpointMethodTypes["pulls"]["requestReviewers"]["parameters"]): Promise; @@ -3825,7 +4882,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request. */ @@ -3853,29 +4910,11 @@ export declare type RestEndpointMethods = { (params?: RestEndpointMethodTypes["pulls"]["updateReview"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; endpoint: EndpointInterface<{ - url: string; - }>; - }; - /** - * **Note:** Multi-line comments on pull requests are currently in public beta and subject to change. - * - * Enables you to edit a review comment. - * - * **Multi-line comment summary** - * - * **Note:** New parameters and response fields are available for developers to preview. During the preview period, these response fields may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2019-10-03-multi-line-comments) for full details. - * - * Use the `comfort-fade` preview header and the `line` parameter to show multi-line comment-supported fields in the response. - * - * If you use the `comfort-fade` preview header, your response will show: - * - * * For multi-line comments, values for `start_line`, `original_start_line`, `start_side`, `line`, `original_line`, and `side`. - * * For single-line comments, values for `line`, `original_line`, and `side` and a `null` value for `start_line`, `original_start_line`, and `start_side`. - * - * If you don't use the `comfort-fade` preview header, multi-line and single-line comments will appear the same way in the response with a single `position` attribute. Your response will show: - * - * * For multi-line comments, the last line of the comment range for the `position` attribute. - * * For single-line comments, the diff-positioned way of referencing comments for the `position` attribute. For more information, see `position` in the [input parameters](https://developer.github.com/v3/pulls/comments/#parameters-2) table. + url: string; + }>; + }; + /** + * Enables you to edit a review comment. */ updateReviewComment: { (params?: RestEndpointMethodTypes["pulls"]["updateReviewComment"]["parameters"]): Promise; @@ -3901,7 +4940,7 @@ export declare type RestEndpointMethods = { }; reactions: { /** - * Create a reaction to a [commit comment](https://developer.github.com/v3/repos/comments/). A response with a `Status: 200 OK` means that you already added the reaction type to this commit comment. + * Create a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. */ createForCommitComment: { (params?: RestEndpointMethodTypes["reactions"]["createForCommitComment"]["parameters"]): Promise; @@ -3911,7 +4950,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Create a reaction to an [issue](https://developer.github.com/v3/issues/). A response with a `Status: 200 OK` means that you already added the reaction type to this issue. + * Create a reaction to an [issue](https://docs.github.com/rest/reference/issues/). A response with an HTTP `200` status means that you already added the reaction type to this issue. */ createForIssue: { (params?: RestEndpointMethodTypes["reactions"]["createForIssue"]["parameters"]): Promise; @@ -3921,7 +4960,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Create a reaction to an [issue comment](https://developer.github.com/v3/issues/comments/). A response with a `Status: 200 OK` means that you already added the reaction type to this issue comment. + * Create a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. */ createForIssueComment: { (params?: RestEndpointMethodTypes["reactions"]["createForIssueComment"]["parameters"]): Promise; @@ -3931,7 +4970,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Create a reaction to a [pull request review comment](https://developer.github.com/v3/pulls/comments/). A response with a `Status: 200 OK` means that you already added the reaction type to this pull request review comment. + * Create a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#comments). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. */ createForPullRequestReviewComment: { (params?: RestEndpointMethodTypes["reactions"]["createForPullRequestReviewComment"]["parameters"]): Promise; @@ -3941,7 +4980,17 @@ export declare type RestEndpointMethods = { }>; }; /** - * Create a reaction to a [team discussion comment](https://developer.github.com/v3/teams/discussion_comments/). OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion comment. + * Create a reaction to a [release](https://docs.github.com/rest/reference/repos#releases). A response with a `Status: 200 OK` means that you already added the reaction type to this release. + */ + createForRelease: { + (params?: RestEndpointMethodTypes["reactions"]["createForRelease"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Create a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. */ @@ -3953,7 +5002,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Create a reaction to a [team discussion](https://developer.github.com/v3/teams/discussions/). OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with a `Status: 200 OK` means that you already added the reaction type to this team discussion. + * Create a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). A response with an HTTP `200` status means that you already added the reaction type to this team discussion. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. */ @@ -3967,7 +5016,7 @@ export declare type RestEndpointMethods = { /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`. * - * Delete a reaction to a [commit comment](https://developer.github.com/v3/repos/comments/). + * Delete a reaction to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ deleteForCommitComment: { (params?: RestEndpointMethodTypes["reactions"]["deleteForCommitComment"]["parameters"]): Promise; @@ -3979,7 +5028,7 @@ export declare type RestEndpointMethods = { /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`. * - * Delete a reaction to an [issue](https://developer.github.com/v3/issues/). + * Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/). */ deleteForIssue: { (params?: RestEndpointMethodTypes["reactions"]["deleteForIssue"]["parameters"]): Promise; @@ -3991,7 +5040,7 @@ export declare type RestEndpointMethods = { /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`. * - * Delete a reaction to an [issue comment](https://developer.github.com/v3/issues/comments/). + * Delete a reaction to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ deleteForIssueComment: { (params?: RestEndpointMethodTypes["reactions"]["deleteForIssueComment"]["parameters"]): Promise; @@ -4003,7 +5052,7 @@ export declare type RestEndpointMethods = { /** * **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.` * - * Delete a reaction to a [pull request review comment](https://developer.github.com/v3/pulls/comments/). + * Delete a reaction to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ deleteForPullRequestComment: { (params?: RestEndpointMethodTypes["reactions"]["deleteForPullRequestComment"]["parameters"]): Promise; @@ -4015,7 +5064,7 @@ export declare type RestEndpointMethods = { /** * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`. * - * Delete a reaction to a [team discussion](https://developer.github.com/v3/teams/discussions/). OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Delete a reaction to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ deleteForTeamDiscussion: { (params?: RestEndpointMethodTypes["reactions"]["deleteForTeamDiscussion"]["parameters"]): Promise; @@ -4027,7 +5076,7 @@ export declare type RestEndpointMethods = { /** * **Note:** You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`. * - * Delete a reaction to a [team discussion comment](https://developer.github.com/v3/teams/discussion_comments/). OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Delete a reaction to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ deleteForTeamDiscussionComment: { (params?: RestEndpointMethodTypes["reactions"]["deleteForTeamDiscussionComment"]["parameters"]): Promise; @@ -4039,8 +5088,8 @@ export declare type RestEndpointMethods = { /** * **Deprecation Notice:** This endpoint route is deprecated and will be removed from the Reactions API. We recommend migrating your existing code to use the new delete reactions endpoints. For more information, see this [blog post](https://developer.github.com/changes/2020-02-26-new-delete-reactions-endpoints/). * - * OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://developer.github.com/v3/teams/discussions/) or [team discussion comment](https://developer.github.com/v3/teams/discussion_comments/). - * @deprecated octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy + * OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), when deleting a [team discussion](https://docs.github.com/rest/reference/teams#discussions) or [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments). + * @deprecated octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy */ deleteLegacy: { (params?: RestEndpointMethodTypes["reactions"]["deleteLegacy"]["parameters"]): Promise; @@ -4050,7 +5099,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the reactions to a [commit comment](https://developer.github.com/v3/repos/comments/). + * List the reactions to a [commit comment](https://docs.github.com/rest/reference/repos#comments). */ listForCommitComment: { (params?: RestEndpointMethodTypes["reactions"]["listForCommitComment"]["parameters"]): Promise; @@ -4060,7 +5109,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the reactions to an [issue](https://developer.github.com/v3/issues/). + * List the reactions to an [issue](https://docs.github.com/rest/reference/issues). */ listForIssue: { (params?: RestEndpointMethodTypes["reactions"]["listForIssue"]["parameters"]): Promise; @@ -4070,7 +5119,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the reactions to an [issue comment](https://developer.github.com/v3/issues/comments/). + * List the reactions to an [issue comment](https://docs.github.com/rest/reference/issues#comments). */ listForIssueComment: { (params?: RestEndpointMethodTypes["reactions"]["listForIssueComment"]["parameters"]): Promise; @@ -4080,7 +5129,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the reactions to a [pull request review comment](https://developer.github.com/v3/pulls/comments/). + * List the reactions to a [pull request review comment](https://docs.github.com/rest/reference/pulls#review-comments). */ listForPullRequestReviewComment: { (params?: RestEndpointMethodTypes["reactions"]["listForPullRequestReviewComment"]["parameters"]): Promise; @@ -4090,7 +5139,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the reactions to a [team discussion comment](https://developer.github.com/v3/teams/discussion_comments/). OAuth access tokens require the `read:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * List the reactions to a [team discussion comment](https://docs.github.com/rest/reference/teams#discussion-comments/). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`. */ @@ -4102,7 +5151,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List the reactions to a [team discussion](https://developer.github.com/v3/teams/discussions/). OAuth access tokens require the `read:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * List the reactions to a [team discussion](https://docs.github.com/rest/reference/teams#discussions). OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`. */ @@ -4123,7 +5172,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified apps push access for this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * @@ -4139,17 +5188,17 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. * - * For more information the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + * For more information the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". * - * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * - * The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://developer.github.com/v3/repos/invitations/). + * The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the [repository invitations API endpoints](https://docs.github.com/rest/reference/repos#invitations). * * **Rate limits** * - * To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. + * You are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository. */ addCollaborator: { (params?: RestEndpointMethodTypes["repos"]["addCollaborator"]["parameters"]): Promise; @@ -4159,7 +5208,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ addStatusCheckContexts: { (params?: RestEndpointMethodTypes["repos"]["addStatusCheckContexts"]["parameters"]): Promise; @@ -4169,7 +5218,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified teams push access for this branch. You can also give push access to child teams. * @@ -4185,7 +5234,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Grants the specified people push access for this branch. * @@ -4213,7 +5262,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * Shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ checkVulnerabilityAlerts: { (params?: RestEndpointMethodTypes["repos"]["checkVulnerabilityAlerts"]["parameters"]): Promise; @@ -4223,18 +5272,17 @@ export declare type RestEndpointMethods = { }>; }; /** - * Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. + * **Deprecated**: Use `repos.compareCommitsWithBasehead()` (`GET /repos/{owner}/{repo}/compare/{basehead}`) instead. Both `:base` and `:head` must be branch names in `:repo`. To compare branches across other repositories in the same network as `:repo`, use the format `:branch`. * - * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://developer.github.com/v3/media/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. * * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. * * **Working with large comparisons** * - * The response will include a comparison of up to 250 commits. If you are working with a larger commit range, you can use the [List commits](https://developer.github.com/v3/repos/commits/#list-commits) to enumerate all commits in the range. + * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." * - * For comparisons with extremely large diffs, you may receive an error response indicating that the diff took too long - * to generate. You can typically resolve this error by using a smaller commit range. + * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. * * **Signature verification object** * @@ -4272,10 +5320,69 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * The `basehead` param is comprised of two parts: `base` and `head`. Both must be branch names in `repo`. To compare branches across other repositories in the same network as `repo`, use the format `:branch`. + * + * The response from the API is equivalent to running the `git log base..head` command; however, commits are returned in chronological order. Pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch diff and patch formats. + * + * The response also includes details on the files that were changed between the two commits. This includes the status of the change (for example, if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file. + * + * **Working with large comparisons** + * + * To process a response with a large number of commits, you can use (`per_page` or `page`) to paginate the results. When using paging, the list of changed files is only returned with page 1, but includes all changed files for the entire comparison. For more information on working with pagination, see "[Traversing with pagination](/rest/guides/traversing-with-pagination)." + * + * When calling this API without any paging parameters (`per_page` or `page`), the returned list is limited to 250 commits and the last commit in the list is the most recent of the entire comparison. When a paging parameter is specified, the first commit in the returned list of each page is the earliest. + * + * **Signature verification object** + * + * The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object: + * + * | Name | Type | Description | + * | ---- | ---- | ----------- | + * | `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. | + * | `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. | + * | `signature` | `string` | The signature that was extracted from the commit. | + * | `payload` | `string` | The value that was signed. | + * + * These are the possible values for `reason` in the `verification` object: + * + * | Value | Description | + * | ----- | ----------- | + * | `expired_key` | The key that made the signature is expired. | + * | `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. | + * | `gpgverify_error` | There was an error communicating with the signature verification service. | + * | `gpgverify_unavailable` | The signature verification service is currently unavailable. | + * | `unsigned` | The object does not include a signature. | + * | `unknown_signature_type` | A non-PGP signature was found in the commit. | + * | `no_user` | No user was associated with the `committer` email address in the commit. | + * | `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on her/his account. | + * | `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. | + * | `unknown_key` | The key that made the signature has not been registered with any user's account. | + * | `malformed_signature` | There was an error parsing the signature. | + * | `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. | + * | `valid` | None of the above errors applied, so the signature is considered to be verified. | + */ + compareCommitsWithBasehead: { + (params?: RestEndpointMethodTypes["repos"]["compareCommitsWithBasehead"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Users with admin access to the repository can create an autolink. + */ + createAutolink: { + (params?: RestEndpointMethodTypes["repos"]["createAutolink"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Create a comment for a commit using its `:commit_sha`. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ createCommitComment: { (params?: RestEndpointMethodTypes["repos"]["createCommitComment"]["parameters"]): Promise; @@ -4285,7 +5392,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. */ @@ -4333,7 +5440,7 @@ export declare type RestEndpointMethods = { * the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API will * return a failure response. * - * By default, [commit statuses](https://developer.github.com/v3/repos/statuses) for every submitted context must be in a `success` + * By default, [commit statuses](https://docs.github.com/rest/reference/repos#statuses) for every submitted context must be in a `success` * state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or to * specify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you do * not require any contexts or create any commit statuses, the deployment will always succeed. @@ -4385,11 +5492,14 @@ export declare type RestEndpointMethods = { }>; }; /** - * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://developer.github.com/webhooks/event-payloads/#repository_dispatch)." + * You can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/webhooks/event-payloads/#repository_dispatch)." * - * The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. For a test example, see the [input example](https://developer.github.com/v3/repos/#example-4). + * The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow. * - * To give you write access to the repository, you must use a personal access token with the `repo` scope. For more information, see "[Creating a personal access token for the command line](https://docs.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. + * This endpoint requires write access to the repository by providing either: + * + * - Personal access tokens with `repo` scope. For more information, see "[Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line)" in the GitHub Help documentation. + * - GitHub Apps with both `metadata:read` and `contents:read&write` permissions. * * This input example shows how you can use the `client_payload` as a test to debug your workflow. */ @@ -4405,10 +5515,10 @@ export declare type RestEndpointMethods = { * * **OAuth scope requirements** * - * When using [OAuth](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * - * * `public_repo` scope or `repo` scope to create a public repository - * * `repo` scope to create a private repository + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. + * * `repo` scope to create a private repository. */ createForAuthenticatedUser: { (params?: RestEndpointMethodTypes["repos"]["createForAuthenticatedUser"]["parameters"]): Promise; @@ -4420,7 +5530,7 @@ export declare type RestEndpointMethods = { /** * Create a fork for the authenticated user. * - * **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://github.com/contact) or [GitHub Premium Support](https://premium.githubsupport.com). + * **Note**: Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Support](https://support.github.com/contact?tags=rest-api). */ createFork: { (params?: RestEndpointMethodTypes["repos"]["createFork"]["parameters"]): Promise; @@ -4434,9 +5544,9 @@ export declare type RestEndpointMethods = { * * **OAuth scope requirements** * - * When using [OAuth](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * - * * `public_repo` scope or `repo` scope to create a public repository + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ createInOrg: { @@ -4446,6 +5556,22 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)." + * + * **Note:** Although you can use this operation to specify that only branches that match specified name patterns can deploy to this environment, you must use the UI to set the name patterns. For more information, see "[Environments](/actions/reference/environments#deployment-branches)." + * + * **Note:** To create or update secrets for an environment, see "[Secrets](/rest/reference/actions#secrets)." + * + * You must authenticate using an access token with the repo scope to use this endpoint. + */ + createOrUpdateEnvironment: { + (params?: RestEndpointMethodTypes["repos"]["createOrUpdateEnvironment"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Creates a new file or replaces an existing file in a repository. */ @@ -4469,7 +5595,7 @@ export declare type RestEndpointMethods = { /** * Users with push access to the repository can create a release. * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. */ createRelease: { (params?: RestEndpointMethodTypes["repos"]["createRelease"]["parameters"]): Promise; @@ -4479,13 +5605,13 @@ export declare type RestEndpointMethods = { }>; }; /** - * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://developer.github.com/v3/repos/#get-a-repository) endpoint and check that the `is_template` key is `true`. + * Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`. * * **OAuth scope requirements** * - * When using [OAuth](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: + * When using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include: * - * * `public_repo` scope or `repo` scope to create a public repository + * * `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository. * * `repo` scope to create a private repository */ createUsingTemplate: { @@ -4527,7 +5653,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Disables the ability to restrict who can push to this branch. */ @@ -4539,7 +5665,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. */ @@ -4551,7 +5677,29 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * You must authenticate using an access token with the repo scope to use this endpoint. + */ + deleteAnEnvironment: { + (params?: RestEndpointMethodTypes["repos"]["deleteAnEnvironment"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * This deletes a single autolink reference by ID that was configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + deleteAutolink: { + (params?: RestEndpointMethodTypes["repos"]["deleteAutolink"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ deleteBranchProtection: { (params?: RestEndpointMethodTypes["repos"]["deleteBranchProtection"]["parameters"]): Promise; @@ -4568,7 +5716,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. */ @@ -4597,7 +5745,7 @@ export declare type RestEndpointMethods = { * * Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment. * * Mark the active deployment as inactive by adding any non-successful deployment status. * - * For more information, see "[Create a deployment](https://developer.github.com/v3/repos/deployments/#create-a-deployment)" and "[Create a deployment status](https://developer.github.com/v3/repos/deployments/#create-a-deployment-status)." + * For more information, see "[Create a deployment](https://docs.github.com/rest/reference/repos/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/rest/reference/repos#create-a-deployment-status)." */ deleteDeployment: { (params?: RestEndpointMethodTypes["repos"]["deleteDeployment"]["parameters"]): Promise; @@ -4637,7 +5785,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ deletePullRequestReviewProtection: { (params?: RestEndpointMethodTypes["repos"]["deletePullRequestReviewProtection"]["parameters"]): Promise; @@ -4671,7 +5819,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/en/articles/configuring-automated-security-fixes)". + * Disables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ disableAutomatedSecurityFixes: { (params?: RestEndpointMethodTypes["repos"]["disableAutomatedSecurityFixes"]["parameters"]): Promise; @@ -4681,7 +5829,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * Disables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ disableVulnerabilityAlerts: { (params?: RestEndpointMethodTypes["repos"]["disableVulnerabilityAlerts"]["parameters"]): Promise; @@ -4691,12 +5839,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * Gets a redirect URL to download an archive for a repository. The `:archive_format` can be either `tarball` or - * `zipball`. The `:ref` must be a valid Git reference. If you omit `:ref`, the repository’s default branch (usually + * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use * the `Location` header to make a second `GET` request. - * * **Note**: For private repositories, these links are temporary and expire after five minutes. + * @deprecated octokit.rest.repos.downloadArchive() has been renamed to octokit.rest.repos.downloadZipballArchive() (2020-09-17) */ downloadArchive: { (params?: RestEndpointMethodTypes["repos"]["downloadArchive"]["parameters"]): Promise; @@ -4706,7 +5853,33 @@ export declare type RestEndpointMethods = { }>; }; /** - * Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/en/articles/configuring-automated-security-fixes)". + * Gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually + * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use + * the `Location` header to make a second `GET` request. + * **Note**: For private repositories, these links are temporary and expire after five minutes. + */ + downloadTarballArchive: { + (params?: RestEndpointMethodTypes["repos"]["downloadTarballArchive"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually + * `master`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use + * the `Location` header to make a second `GET` request. + * **Note**: For private repositories, these links are temporary and expire after five minutes. + */ + downloadZipballArchive: { + (params?: RestEndpointMethodTypes["repos"]["downloadZipballArchive"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Enables automated security fixes for a repository. The authenticated user must have admin access to the repository. For more information, see "[Configuring automated security fixes](https://help.github.com/en/articles/configuring-automated-security-fixes)". */ enableAutomatedSecurityFixes: { (params?: RestEndpointMethodTypes["repos"]["enableAutomatedSecurityFixes"]["parameters"]): Promise; @@ -4716,7 +5889,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". + * Enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://help.github.com/en/articles/about-security-alerts-for-vulnerable-dependencies)". */ enableVulnerabilityAlerts: { (params?: RestEndpointMethodTypes["repos"]["enableVulnerabilityAlerts"]["parameters"]): Promise; @@ -4738,7 +5911,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists who has access to this protected branch. * @@ -4752,7 +5925,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ getAdminBranchProtection: { (params?: RestEndpointMethodTypes["repos"]["getAdminBranchProtection"]["parameters"]): Promise; @@ -4762,7 +5935,19 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Get all environments for a repository. + * + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + getAllEnvironments: { + (params?: RestEndpointMethodTypes["repos"]["getAllEnvironments"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ getAllStatusCheckContexts: { (params?: RestEndpointMethodTypes["repos"]["getAllStatusCheckContexts"]["parameters"]): Promise; @@ -4779,7 +5964,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the GitHub Apps that have push access to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. */ @@ -4790,6 +5975,18 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * This returns a single autolink reference by ID that was configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + getAutolink: { + (params?: RestEndpointMethodTypes["repos"]["getAutolink"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; getBranch: { (params?: RestEndpointMethodTypes["repos"]["getBranch"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -4798,7 +5995,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ getBranchProtection: { (params?: RestEndpointMethodTypes["repos"]["getBranchProtection"]["parameters"]): Promise; @@ -4840,7 +6037,7 @@ export declare type RestEndpointMethods = { /** * Users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. * - * The most recent status for each context is returned, up to 100. This field [paginates](https://developer.github.com/v3/#pagination) if there are over 100 contexts. + * The most recent status for each context is returned, up to 100. This field [paginates](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination) if there are over 100 contexts. * * Additionally, a combined `state` is returned. The `state` is one of: * @@ -4860,9 +6057,9 @@ export declare type RestEndpointMethods = { * * **Note:** If there are more than 300 files in the commit diff, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing. * - * You can pass the appropriate [media type](https://developer.github.com/v3/media/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property. + * You can pass the appropriate [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) to fetch `diff` and `patch` formats. Diffs with binary data will have no `patch` property. * - * To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://developer.github.com/v3/media/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. + * To return only the SHA-1 hash of the commit reference, you can provide the `sha` custom [media type](https://docs.github.com/rest/overview/media-types/#commits-commit-comparison-and-pull-requests) in the `Accept` header. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag. * * **Signature verification object** * @@ -4918,9 +6115,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * - * When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/articles/signing-commits-with-gpg) in GitHub Help. + * When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://help.github.com/articles/signing-commits-with-gpg) in GitHub Help. * * **Note**: You must enable branch protection to require signed commits. */ @@ -4932,7 +6129,18 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint will return all community profile metrics, including an overall health score, repository description, the presence of documentation, detected code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, README, and CONTRIBUTING files. + * This endpoint will return all community profile metrics, including an + * overall health score, repository description, the presence of documentation, detected + * code of conduct, detected license, and the presence of ISSUE\_TEMPLATE, PULL\_REQUEST\_TEMPLATE, + * README, and CONTRIBUTING files. + * + * The `health_percentage` score is defined as a percentage of how many of + * these four documents are present: README, CONTRIBUTING, LICENSE, and + * CODE_OF_CONDUCT. For example, if all four documents are present, then + * the `health_percentage` is `100`. If only one is present, then the + * `health_percentage` is `25`. + * + * `content_reports_enabled` is only returned for organization-owned repositories. */ getCommunityProfileMetrics: { (params?: RestEndpointMethodTypes["repos"]["getCommunityProfileMetrics"]["parameters"]): Promise; @@ -4943,17 +6151,17 @@ export declare type RestEndpointMethods = { }; /** * Gets the contents of a file or directory in a repository. Specify the file path or directory in `:path`. If you omit - * `:path`, you will receive the contents of all files in the repository. + * `:path`, you will receive the contents of the repository's root directory. See the description below regarding what the API response includes for directories. * - * Files and symlinks support [a custom media type](https://developer.github.com/v3/repos/contents/#custom-media-types) for + * Files and symlinks support [a custom media type](https://docs.github.com/rest/reference/repos#custom-media-types) for * retrieving the raw content or rendered HTML (when supported). All content types support [a custom media - * type](https://developer.github.com/v3/repos/contents/#custom-media-types) to ensure the content is returned in a consistent + * type](https://docs.github.com/rest/reference/repos#custom-media-types) to ensure the content is returned in a consistent * object format. * * **Note**: - * * To get a repository's contents recursively, you can [recursively get the tree](https://developer.github.com/v3/git/trees/). + * * To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/rest/reference/git#trees). * * This API has an upper limit of 1,000 files for a directory. If you need to retrieve more files, use the [Git Trees - * API](https://developer.github.com/v3/git/trees/#get-a-tree). + * API](https://docs.github.com/rest/reference/git#get-a-tree). * * This API supports files up to 1 megabyte in size. * * #### If the content is a directory @@ -5021,6 +6229,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an access token with the `repo` scope. GitHub Apps must have the `actions:read` permission to use this endpoint. + */ + getEnvironment: { + (params?: RestEndpointMethodTypes["repos"]["getEnvironment"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; getLatestPagesBuild: { (params?: RestEndpointMethodTypes["repos"]["getLatestPagesBuild"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -5054,6 +6272,20 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Gets a health check of the DNS settings for the `CNAME` record configured for a repository's GitHub Pages. + * + * The first request to this endpoint returns a `202 Accepted` status and starts an asynchronous background task to get the results for the domain. After the background task completes, subsequent requests to this endpoint return a `200 OK` status with the health check results in the response. + * + * Users must have admin or owner permissions. GitHub Apps must have the `pages:write` and `administration:write` permission to use this endpoint. + */ + getPagesHealthCheck: { + (params?: RestEndpointMethodTypes["repos"]["getPagesHealthCheck"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; /** * Returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`. * @@ -5067,7 +6299,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ getPullRequestReviewProtection: { (params?: RestEndpointMethodTypes["repos"]["getPullRequestReviewProtection"]["parameters"]): Promise; @@ -5095,7 +6327,7 @@ export declare type RestEndpointMethods = { /** * Gets the preferred README for a repository. * - * READMEs support [custom media types](https://developer.github.com/v3/repos/contents/#custom-media-types) for retrieving the raw content or rendered HTML. + * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. */ getReadme: { (params?: RestEndpointMethodTypes["repos"]["getReadme"]["parameters"]): Promise; @@ -5105,7 +6337,19 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://developer.github.com/v3/#hypermedia). + * Gets the README from a repository directory. + * + * READMEs support [custom media types](https://docs.github.com/rest/reference/repos#custom-media-types) for retrieving the raw content or rendered HTML. + */ + getReadmeInDirectory: { + (params?: RestEndpointMethodTypes["repos"]["getReadmeInDirectory"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * **Note:** This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a [hypermedia resource](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia). */ getRelease: { (params?: RestEndpointMethodTypes["repos"]["getRelease"]["parameters"]): Promise; @@ -5115,7 +6359,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://developer.github.com/v3/media/#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. + * To download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/rest/overview/media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. */ getReleaseAsset: { (params?: RestEndpointMethodTypes["repos"]["getReleaseAsset"]["parameters"]): Promise; @@ -5135,7 +6379,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ getStatusChecksProtection: { (params?: RestEndpointMethodTypes["repos"]["getStatusChecksProtection"]["parameters"]): Promise; @@ -5145,7 +6389,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the teams who have push access to this branch. The list includes child teams. */ @@ -5177,7 +6421,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Lists the people who have push access to this branch. */ @@ -5198,6 +6442,9 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/reference/repos#get-a-webhook-configuration-for-a-repository)." + */ getWebhook: { (params?: RestEndpointMethodTypes["repos"]["getWebhook"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -5205,6 +6452,40 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/reference/orgs#get-a-repository-webhook)." + * + * Access tokens must have the `read:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:read` permission. + */ + getWebhookConfigForRepo: { + (params?: RestEndpointMethodTypes["repos"]["getWebhookConfigForRepo"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Returns a delivery for a webhook configured in a repository. + */ + getWebhookDelivery: { + (params?: RestEndpointMethodTypes["repos"]["getWebhookDelivery"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * This returns a list of autolinks configured for the given repository. + * + * Information about autolinks are only available to repository administrators. + */ + listAutolinks: { + (params?: RestEndpointMethodTypes["repos"]["listAutolinks"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; listBranches: { (params?: RestEndpointMethodTypes["repos"]["listBranches"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -5213,7 +6494,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. */ @@ -5247,7 +6528,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Commit Comments use [these custom media types](https://developer.github.com/v3/repos/comments/#custom-media-types). You can read more about the use of media types in the API [here](https://developer.github.com/v3/media/). + * Commit Comments use [these custom media types](https://docs.github.com/rest/reference/repos#custom-media-types). You can read more about the use of media types in the API [here](https://docs.github.com/rest/overview/media-types/). * * Comments are ordered by ascending ID. */ @@ -5369,7 +6650,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists public repositories for the specified user. + * Lists public repositories for the specified user. Note: For GitHub AE, this endpoint will list internal repositories for the specified user. */ listForUser: { (params?: RestEndpointMethodTypes["repos"]["listForUser"]["parameters"]): Promise; @@ -5425,7 +6706,9 @@ export declare type RestEndpointMethods = { /** * Lists all public repositories in the order that they were created. * - * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://developer.github.com/v3/#link-header) to get the URL for the next page of repositories. + * Note: + * - For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise. + * - Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of repositories. */ listPublic: { (params?: RestEndpointMethodTypes["repos"]["listPublic"]["parameters"]): Promise; @@ -5435,7 +6718,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists all pull requests containing the provided commit SHA, which can be from any point in the commit history. The results will include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests) endpoint. + * Lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, additionally returns open pull requests associated with the commit. The results may include open and closed pull requests. Additional preview headers may be required to see certain details for associated pull requests, such as whether a pull request is in a draft state. For more information about previews that might affect this endpoint, see the [List pull requests](https://docs.github.com/rest/reference/pulls#list-pull-requests) endpoint. */ listPullRequestsAssociatedWithCommit: { (params?: RestEndpointMethodTypes["repos"]["listPullRequestsAssociatedWithCommit"]["parameters"]): Promise; @@ -5452,7 +6735,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://developer.github.com/v3/repos/#list-repository-tags). + * This returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/rest/reference/repos#list-repository-tags). * * Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. */ @@ -5477,6 +6760,16 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Returns a list of webhook deliveries for a webhook configured in a repository. + */ + listWebhookDeliveries: { + (params?: RestEndpointMethodTypes["repos"]["listWebhookDeliveries"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; listWebhooks: { (params?: RestEndpointMethodTypes["repos"]["listWebhooks"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -5492,7 +6785,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * This will trigger a [ping event](https://developer.github.com/webhooks/#ping-event) to be sent to the hook. + * This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event) to be sent to the hook. */ pingWebhook: { (params?: RestEndpointMethodTypes["repos"]["pingWebhook"]["parameters"]): Promise; @@ -5502,7 +6795,17 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Redeliver a webhook delivery for a webhook configured in a repository. + */ + redeliverWebhookDelivery: { + (params?: RestEndpointMethodTypes["repos"]["redeliverWebhookDelivery"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of an app to push to this branch. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * @@ -5525,7 +6828,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ removeStatusCheckContexts: { (params?: RestEndpointMethodTypes["repos"]["removeStatusCheckContexts"]["parameters"]): Promise; @@ -5535,7 +6838,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ removeStatusCheckProtection: { (params?: RestEndpointMethodTypes["repos"]["removeStatusCheckProtection"]["parameters"]): Promise; @@ -5545,7 +6848,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of a team to push to this branch. You can also remove push access for child teams. * @@ -5561,7 +6864,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Removes the ability of a user to push to this branch. * @@ -5576,6 +6879,30 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Renames a branch in a repository. + * + * **Note:** Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/github/administering-a-repository/renaming-a-branch)". + * + * The permissions required to use this endpoint depends on whether you are renaming the default branch. + * + * To rename a non-default branch: + * + * * Users must have push access. + * * GitHub Apps must have the `contents:write` repository permission. + * + * To rename the default branch: + * + * * Users must have admin or owner permissions. + * * GitHub Apps must have the `administration:write` repository permission. + */ + renameBranch: { + (params?: RestEndpointMethodTypes["repos"]["renameBranch"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; replaceAllTopics: { (params?: RestEndpointMethodTypes["repos"]["replaceAllTopics"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -5596,7 +6923,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. */ @@ -5608,7 +6935,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only installed GitHub Apps with `write` access to the `contents` permission can be added as authorized actors on a protected branch. * @@ -5624,7 +6951,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. */ setStatusCheckContexts: { (params?: RestEndpointMethodTypes["repos"]["setStatusCheckContexts"]["parameters"]): Promise; @@ -5634,7 +6961,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. * @@ -5650,7 +6977,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people. * @@ -5678,7 +7005,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/articles/about-repository-transfers/). + * A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://help.github.com/articles/about-repository-transfers/). */ transfer: { (params?: RestEndpointMethodTypes["repos"]["transfer"]["parameters"]): Promise; @@ -5688,7 +7015,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * **Note**: To edit a repository's topics, use the [Replace all repository topics](https://developer.github.com/v3/repos/#replace-all-repository-topics) endpoint. + * **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/rest/reference/repos#replace-all-repository-topics) endpoint. */ update: { (params?: RestEndpointMethodTypes["repos"]["update"]["parameters"]): Promise; @@ -5698,7 +7025,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Protecting a branch requires admin or owner permissions to the repository. * @@ -5738,7 +7065,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled. * @@ -5772,9 +7099,10 @@ export declare type RestEndpointMethods = { }>; }; /** - * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + * @deprecated octokit.rest.repos.updateStatusCheckPotection() has been renamed to octokit.rest.repos.updateStatusCheckProtection() (2020-09-17) */ updateStatusCheckPotection: { (params?: RestEndpointMethodTypes["repos"]["updateStatusCheckPotection"]["parameters"]): Promise; @@ -5783,6 +7111,21 @@ export declare type RestEndpointMethods = { url: string; }>; }; + /** + * Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * + * Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. + */ + updateStatusCheckProtection: { + (params?: RestEndpointMethodTypes["repos"]["updateStatusCheckProtection"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/reference/repos#update-a-webhook-configuration-for-a-repository)." + */ updateWebhook: { (params?: RestEndpointMethodTypes["repos"]["updateWebhook"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -5791,8 +7134,20 @@ export declare type RestEndpointMethods = { }>; }; /** - * This endpoint makes use of [a Hypermedia relation](https://developer.github.com/v3/#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in - * the response of the [Create a release endpoint](https://developer.github.com/v3/repos/releases/#create-a-release) to upload a release asset. + * Updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/reference/orgs#update-a-repository-webhook)." + * + * Access tokens must have the `write:repo_hook` or `repo` scope, and GitHub Apps must have the `repository_hooks:write` permission. + */ + updateWebhookConfigForRepo: { + (params?: RestEndpointMethodTypes["repos"]["updateWebhookConfigForRepo"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * This endpoint makes use of [a Hypermedia relation](https://docs.github.com/rest/overview/resources-in-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned in + * the response of the [Create a release endpoint](https://docs.github.com/rest/reference/repos#create-a-release) to upload a release asset. * * You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint. * @@ -5806,8 +7161,8 @@ export declare type RestEndpointMethods = { * When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted. * * **Notes:** - * * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://developer.github.com/v3/repos/releases/#list-assets-for-a-release)" - * endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://github.com/contact). + * * GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List assets for a release](https://docs.github.com/rest/reference/repos#list-assets-for-a-release)" + * endpoint lists the renamed filenames. For more information and help, contact [GitHub Support](https://support.github.com/contact?tags=rest-api). * * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. */ uploadReleaseAsset: { @@ -5820,9 +7175,9 @@ export declare type RestEndpointMethods = { }; search: { /** - * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://developer.github.com/v3/#pagination). + * Searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * - * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). + * When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this: * @@ -5847,10 +7202,10 @@ export declare type RestEndpointMethods = { }>; }; /** - * Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://developer.github.com/v3/#pagination). + * Find commits via various criteria on the default branch (usually `master`). This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text match - * metadata](https://developer.github.com/v3/search/#text-match-metadata). + * metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this: * @@ -5864,16 +7219,18 @@ export declare type RestEndpointMethods = { }>; }; /** - * Find issues by state and keyword. This method returns up to 100 results [per page](https://developer.github.com/v3/#pagination). + * Find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * * When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlighted - * search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). + * search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this. * * `q=windows+label:bug+language:python+state:open&sort=created&order=asc` * - * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, whick means the oldest issues appear first in the search results. + * This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results. + * + * **Note:** For [user-to-server](https://docs.github.com/developers/apps/identifying-and-authorizing-users-for-github-apps#user-to-server-requests) GitHub App requests, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." */ issuesAndPullRequests: { (params?: RestEndpointMethodTypes["search"]["issuesAndPullRequests"]["parameters"]): Promise; @@ -5883,9 +7240,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://developer.github.com/v3/#pagination). + * Find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * - * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). + * When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this: * @@ -5901,9 +7258,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Find repositories via various criteria. This method returns up to 100 results [per page](https://developer.github.com/v3/#pagination). + * Find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * - * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). + * When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this: * @@ -5923,9 +7280,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://developer.github.com/v3/#pagination). See "[Searching topics](https://docs.github.com/articles/searching-topics/)" for a detailed list of qualifiers. + * Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). See "[Searching topics](https://help.github.com/articles/searching-topics/)" for a detailed list of qualifiers. * - * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). + * When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this: * @@ -5941,9 +7298,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Find users via various criteria. This method returns up to 100 results [per page](https://developer.github.com/v3/#pagination). + * Find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/rest/overview/resources-in-the-rest-api#pagination). * - * When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://developer.github.com/v3/search/#text-match-metadata). + * When searching for users, you can get text match metadata for the issue **login**, **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/rest/reference/search#text-match-metadata). * * For example, if you're looking for a list of popular users, you might try this query: * @@ -5959,13 +7316,51 @@ export declare type RestEndpointMethods = { }>; }; }; + secretScanning: { + /** + * Gets a single secret scanning alert detected in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. + */ + getAlert: { + (params?: RestEndpointMethodTypes["secretScanning"]["getAlert"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Lists all secret scanning alerts for a private repository, from newest to oldest. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` read permission to use this endpoint. + */ + listAlertsForRepo: { + (params?: RestEndpointMethodTypes["secretScanning"]["listAlertsForRepo"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + /** + * Updates the status of a secret scanning alert in a private repository. To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with the `repo` scope or `security_events` scope. + * + * GitHub Apps must have the `secret_scanning_alerts` write permission to use this endpoint. + */ + updateAlert: { + (params?: RestEndpointMethodTypes["secretScanning"]["updateAlert"]["parameters"]): Promise; + defaults: RequestInterface["defaults"]; + endpoint: EndpointInterface<{ + url: string; + }>; + }; + }; teams: { /** - * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team. * - * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. * @@ -5993,11 +7388,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. * - * For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". + * For more information about the permission levels, see "[Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". */ addOrUpdateRepoPermissionsInOrg: { (params?: RestEndpointMethodTypes["teams"]["addOrUpdateRepoPermissionsInOrg"]["parameters"]): Promise; @@ -6021,7 +7416,7 @@ export declare type RestEndpointMethods = { /** * Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked. * - * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://developer.github.com/v3/media/) via the `application/vnd.github.v3.repository+json` accept header. + * You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/overview/media-types/) via the `application/vnd.github.v3.repository+json` accept header. * * If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status. * @@ -6035,9 +7430,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." + * To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://help.github.com/en/articles/setting-team-creation-permissions-in-your-organization)." * - * When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". + * When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams)". */ create: { (params?: RestEndpointMethodTypes["teams"]["create"]["parameters"]): Promise; @@ -6047,9 +7442,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Creates a new comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. */ @@ -6061,9 +7456,9 @@ export declare type RestEndpointMethods = { }>; }; /** - * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Creates a new discussion post on a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * - * This endpoint triggers [notifications](https://docs.github.com/articles/about-notifications/). Creating content too quickly using this endpoint may result in abuse rate limiting. See "[Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits)" and "[Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits)" for details. + * This endpoint triggers [notifications](https://docs.github.com/en/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. See "[Secondary rate limits](https://docs.github.com/rest/overview/resources-in-the-rest-api#secondary-rate-limits)" and "[Dealing with secondary rate limits](https://docs.github.com/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits)" for details. * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`. */ @@ -6075,7 +7470,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Deletes a comment on a team discussion. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ @@ -6087,7 +7482,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Delete a discussion from a team's page. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ @@ -6125,7 +7520,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Get a specific comment on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ @@ -6137,7 +7532,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Get a specific discussion on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ @@ -6155,7 +7550,10 @@ export declare type RestEndpointMethods = { * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`. * - * **Note:** The `role` for organization owners returns as `maintainer`. For more information about `maintainer` roles, see [Create a team](https://developer.github.com/v3/teams/#create-a-team). + * **Note:** + * The response contains the `state` of the membership and the member's `role`. + * + * The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see see [Create a team](https://docs.github.com/rest/reference/teams#create-a-team). */ getMembershipForUserInOrg: { (params?: RestEndpointMethodTypes["teams"]["getMembershipForUserInOrg"]["parameters"]): Promise; @@ -6187,7 +7585,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * List all comments on a team discussion. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`. */ @@ -6199,7 +7597,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * List all discussions on a team's page. OAuth access tokens require the `read:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`. */ @@ -6211,7 +7609,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://developer.github.com/apps/building-oauth-apps/). + * List all of the teams across all of the organizations to which the authenticated user belongs. This method requires `user`, `repo`, or `read:org` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/) when authenticating via [OAuth](https://docs.github.com/apps/building-oauth-apps/). */ listForAuthenticatedUser: { (params?: RestEndpointMethodTypes["teams"]["listForAuthenticatedUser"]["parameters"]): Promise; @@ -6269,11 +7667,11 @@ export declare type RestEndpointMethods = { }>; }; /** - * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. + * Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://help.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. * * To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team. * - * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." + * **Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://help.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)." * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. */ @@ -6309,7 +7707,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Edits the body text of a discussion comment. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`. */ @@ -6321,7 +7719,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Edits the title and body text of a discussion post. Only the parameters you provide are updated. OAuth access tokens require the `write:discussion` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). * * **Note:** You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`. */ @@ -6363,11 +7761,6 @@ export declare type RestEndpointMethods = { url: string; }>; }; - /** - * If the user is blocked: - * - * If the user is not blocked: - */ checkBlocked: { (params?: RestEndpointMethodTypes["users"]["checkBlocked"]["parameters"]): Promise; defaults: RequestInterface["defaults"]; @@ -6390,7 +7783,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Adds a GPG key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ createGpgKeyForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["createGpgKeyForAuthenticated"]["parameters"]): Promise; @@ -6400,7 +7793,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Adds a public SSH key to the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth, or OAuth with at least `write:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ createPublicSshKeyForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["createPublicSshKeyForAuthenticated"]["parameters"]): Promise; @@ -6420,7 +7813,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Removes a GPG key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ deleteGpgKeyForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["deleteGpgKeyForAuthenticated"]["parameters"]): Promise; @@ -6430,7 +7823,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Removes a public SSH key from the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `admin:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ deletePublicSshKeyForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["deletePublicSshKeyForAuthenticated"]["parameters"]): Promise; @@ -6440,7 +7833,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." + * Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/overview/resources-in-the-rest-api#http-verbs)." * * Following a user requires the user to be logged in and authenticated with basic auth or OAuth with the `user:follow` scope. */ @@ -6466,11 +7859,11 @@ export declare type RestEndpointMethods = { /** * Provides publicly available information about someone with a GitHub account. * - * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see "[Response with GitHub plan information](https://developer.github.com/v3/users/#response-with-github-plan-information)." + * GitHub Apps with the `Plan` user permission can use this endpoint to retrieve information about a user's GitHub plan. The GitHub App must be authenticated as a user. See "[Identifying and authorizing users for GitHub Apps](https://docs.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/)" for details about authentication. For an example response, see 'Response with GitHub plan information' below" * - * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://developer.github.com/v3/#authentication). + * The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/overview/resources-in-the-rest-api#authentication). * - * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://developer.github.com/v3/users/emails/)". + * The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/reference/users#emails)". */ getByUsername: { (params?: RestEndpointMethodTypes["users"]["getByUsername"]["parameters"]): Promise; @@ -6497,7 +7890,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * View extended details for a single GPG key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ getGpgKeyForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["getGpgKeyForAuthenticated"]["parameters"]): Promise; @@ -6507,7 +7900,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * View extended details for a single public SSH key. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ getPublicSshKeyForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["getPublicSshKeyForAuthenticated"]["parameters"]): Promise; @@ -6519,7 +7912,7 @@ export declare type RestEndpointMethods = { /** * Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts. * - * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://developer.github.com/v3/#link-header) to get the URL for the next page of users. + * Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/overview/resources-in-the-rest-api#link-header) to get the URL for the next page of users. */ list: { (params?: RestEndpointMethodTypes["users"]["list"]["parameters"]): Promise; @@ -6589,7 +7982,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Lists the current user's GPG keys. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:gpg_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ listGpgKeysForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["listGpgKeysForAuthenticated"]["parameters"]): Promise; @@ -6609,7 +8002,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://developer.github.com/v3/users/emails/#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. + * Lists your publicly visible email address, which you can set with the [Set primary email visibility for the authenticated user](https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user) endpoint. This endpoint is accessible with the `user:email` scope. */ listPublicEmailsForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["listPublicEmailsForAuthenticated"]["parameters"]): Promise; @@ -6629,7 +8022,7 @@ export declare type RestEndpointMethods = { }>; }; /** - * Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + * Lists the public SSH keys for the authenticated user's GitHub account. Requires that you are authenticated via Basic Auth or via OAuth with at least `read:public_key` [scope](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). */ listPublicSshKeysForAuthenticated: { (params?: RestEndpointMethodTypes["users"]["listPublicSshKeysForAuthenticated"]["parameters"]): Promise; diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts index da02796..abb3287 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts @@ -2,396 +2,504 @@ import { Endpoints, RequestParameters } from "@octokit/types"; export declare type RestEndpointMethodTypes = { actions: { addSelectedRepoToOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/actions/secrets/:secret_name/repositories/:repository_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"]["response"]; + }; + approveWorkflowRun: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"]["response"]; }; cancelWorkflowRun: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/actions/runs/:run_id/cancel"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"]["response"]; + }; + createOrUpdateEnvironmentSecret: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"]["response"]; }; createOrUpdateOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/actions/secrets/:secret_name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/secrets/{secret_name}"]["response"]; }; createOrUpdateRepoSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/actions/secrets/:secret_name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"]["response"]; }; createRegistrationTokenForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/actions/runners/registration-token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/actions/runners/registration-token"]["response"]; }; createRegistrationTokenForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/actions/runners/registration-token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/runners/registration-token"]["response"]; }; createRemoveTokenForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/actions/runners/remove-token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/actions/runners/remove-token"]["response"]; }; createRemoveTokenForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/actions/runners/remove-token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/runners/remove-token"]["response"]; }; createWorkflowDispatch: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/actions/workflows/:workflow_id/dispatches"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"]["response"]; }; deleteArtifact: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/actions/artifacts/:artifact_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"]["response"]; + }; + deleteEnvironmentSecret: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"]["response"]; }; deleteOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/actions/secrets/:secret_name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/actions/secrets/{secret_name}"]["response"]; }; deleteRepoSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/actions/secrets/:secret_name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"]["response"]; }; deleteSelfHostedRunnerFromOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/actions/runners/:runner_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/actions/runners/{runner_id}"]["response"]; }; deleteSelfHostedRunnerFromRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/actions/runners/:runner_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"]["response"]; }; deleteWorkflowRun: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/actions/runs/:run_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"]["response"]; }; deleteWorkflowRunLogs: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/actions/runs/:run_id/logs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"]["response"]; + }; + disableSelectedRepositoryGithubActionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"]["response"]; + }; + disableWorkflow: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"]["response"]; }; downloadArtifact: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"]["response"]; }; downloadJobLogsForWorkflowRun: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/jobs/:job_id/logs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"]["response"]; }; downloadWorkflowRunLogs: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/logs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"]["response"]; + }; + enableSelectedRepositoryGithubActionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"]["response"]; + }; + enableWorkflow: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"]["response"]; + }; + getAllowedActionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/permissions/selected-actions"]["response"]; + }; + getAllowedActionsRepository: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"]["response"]; }; getArtifact: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/artifacts/:artifact_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"]["response"]; + }; + getEnvironmentPublicKey: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"]["response"]; + }; + getEnvironmentSecret: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"]["response"]; + }; + getGithubActionsPermissionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/permissions"]["response"]; + }; + getGithubActionsPermissionsRepository: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/permissions"]["response"]; }; getJobForWorkflowRun: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/jobs/:job_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"]["response"]; }; getOrgPublicKey: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/secrets/public-key"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/secrets/public-key"]["response"]; }; getOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/secrets/:secret_name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/secrets/{secret_name}"]["response"]; + }; + getPendingDeploymentsForRun: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"]["response"]; + }; + getRepoPermissions: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/permissions"]["response"]; }; getRepoPublicKey: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/secrets/public-key"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/secrets/public-key"]["response"]; }; getRepoSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/secrets/:secret_name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"]["response"]; + }; + getReviewsForRun: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"]["response"]; }; getSelfHostedRunnerForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/runners/:runner_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/runners/{runner_id}"]["response"]; }; getSelfHostedRunnerForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runners/:runner_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"]["response"]; }; getWorkflow: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/workflows/:workflow_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"]["response"]; }; getWorkflowRun: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}"]["response"]; }; getWorkflowRunUsage: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/timing"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"]["response"]; }; getWorkflowUsage: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/workflows/:workflow_id/timing"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"]["response"]; }; listArtifactsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/artifacts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/artifacts"]["response"]; + }; + listEnvironmentSecrets: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repositories/{repository_id}/environments/{environment_name}/secrets"]["response"]; }; listJobsForWorkflowRun: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/jobs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"]["response"]; }; listOrgSecrets: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/secrets"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/secrets"]["response"]; }; listRepoSecrets: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/secrets"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/secrets"]["response"]; }; listRepoWorkflows: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/workflows"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/workflows"]["response"]; }; listRunnerApplicationsForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/runners/downloads"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/runners/downloads"]["response"]; }; listRunnerApplicationsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runners/downloads"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runners/downloads"]["response"]; }; listSelectedReposForOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/secrets/:secret_name/repositories"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"]["response"]; + }; + listSelectedRepositoriesEnabledGithubActionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/permissions/repositories"]["response"]; }; listSelfHostedRunnersForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/actions/runners"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/actions/runners"]["response"]; }; listSelfHostedRunnersForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runners"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runners"]["response"]; }; listWorkflowRunArtifacts: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runs/:run_id/artifacts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"]["response"]; }; listWorkflowRuns: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"]["response"]; }; listWorkflowRunsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/actions/runs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/actions/runs"]["response"]; }; reRunWorkflow: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/actions/runs/:run_id/rerun"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"]["response"]; }; removeSelectedRepoFromOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/actions/secrets/:secret_name/repositories/:repository_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"]["response"]; + }; + reviewPendingDeploymentsForRun: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"]["response"]; + }; + setAllowedActionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/permissions/selected-actions"]["response"]; + }; + setAllowedActionsRepository: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"]["response"]; + }; + setGithubActionsPermissionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/permissions"]["response"]; + }; + setGithubActionsPermissionsRepository: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/actions/permissions"]["response"]; }; setSelectedReposForOrgSecret: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/actions/secrets/:secret_name/repositories"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"]["response"]; + }; + setSelectedRepositoriesEnabledGithubActionsOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/actions/permissions/repositories"]["response"]; }; }; activity: { checkRepoIsStarredByAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/starred/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/starred/{owner}/{repo}"]["response"]; }; deleteRepoSubscription: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/subscription"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/subscription"]["response"]; }; deleteThreadSubscription: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /notifications/threads/:thread_id/subscription"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /notifications/threads/{thread_id}/subscription"]["response"]; }; getFeeds: { parameters: RequestParameters & Omit; response: Endpoints["GET /feeds"]["response"]; }; getRepoSubscription: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/subscription"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/subscription"]["response"]; }; getThread: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /notifications/threads/:thread_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /notifications/threads/{thread_id}"]["response"]; }; getThreadSubscriptionForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /notifications/threads/:thread_id/subscription"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /notifications/threads/{thread_id}/subscription"]["response"]; }; listEventsForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/events"]["response"]; }; listNotificationsForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /notifications"]["response"]; }; listOrgEventsForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/events/orgs/:org"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/events/orgs/{org}"]["response"]; }; listPublicEvents: { parameters: RequestParameters & Omit; response: Endpoints["GET /events"]["response"]; }; listPublicEventsForRepoNetwork: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /networks/:owner/:repo/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /networks/{owner}/{repo}/events"]["response"]; }; listPublicEventsForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/events/public"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/events/public"]["response"]; }; listPublicOrgEvents: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/events"]["response"]; }; listReceivedEventsForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/received_events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/received_events"]["response"]; }; listReceivedPublicEventsForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/received_events/public"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/received_events/public"]["response"]; }; listRepoEvents: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/events"]["response"]; }; listRepoNotificationsForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/notifications"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/notifications"]["response"]; }; listReposStarredByAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/starred"]["response"]; }; listReposStarredByUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/starred"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/starred"]["response"]; }; listReposWatchedByUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/subscriptions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/subscriptions"]["response"]; }; listStargazersForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/stargazers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/stargazers"]["response"]; }; listWatchedReposForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/subscriptions"]["response"]; }; listWatchersForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/subscribers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/subscribers"]["response"]; }; markNotificationsAsRead: { parameters: RequestParameters & Omit; response: Endpoints["PUT /notifications"]["response"]; }; markRepoNotificationsAsRead: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/notifications"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/notifications"]["response"]; }; markThreadAsRead: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /notifications/threads/:thread_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /notifications/threads/{thread_id}"]["response"]; }; setRepoSubscription: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/subscription"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/subscription"]["response"]; }; setThreadSubscription: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /notifications/threads/:thread_id/subscription"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /notifications/threads/{thread_id}/subscription"]["response"]; }; starRepoForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /user/starred/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /user/starred/{owner}/{repo}"]["response"]; }; unstarRepoForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/starred/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/starred/{owner}/{repo}"]["response"]; }; }; apps: { addRepoToInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /user/installations/:installation_id/repositories/:repository_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /user/installations/{installation_id}/repositories/{repository_id}"]["response"]; }; checkToken: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /applications/:client_id/token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /applications/{client_id}/token"]["response"]; }; createContentAttachment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /content_references/:content_reference_id/attachments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /content_references/{content_reference_id}/attachments"]["response"]; + }; + createContentAttachmentForRepo: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments"]["response"]; }; createFromManifest: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /app-manifests/:code/conversions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /app-manifests/{code}/conversions"]["response"]; }; createInstallationAccessToken: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /app/installations/:installation_id/access_tokens"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /app/installations/{installation_id}/access_tokens"]["response"]; }; deleteAuthorization: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /applications/:client_id/grant"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /applications/{client_id}/grant"]["response"]; }; deleteInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /app/installations/:installation_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /app/installations/{installation_id}"]["response"]; }; deleteToken: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /applications/:client_id/token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /applications/{client_id}/token"]["response"]; }; getAuthenticated: { parameters: RequestParameters & Omit; response: Endpoints["GET /app"]["response"]; }; getBySlug: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /apps/:app_slug"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /apps/{app_slug}"]["response"]; }; getInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /app/installations/:installation_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /app/installations/{installation_id}"]["response"]; }; getOrgInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/installation"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/installation"]["response"]; }; getRepoInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/installation"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/installation"]["response"]; }; getSubscriptionPlanForAccount: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /marketplace_listing/accounts/:account_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /marketplace_listing/accounts/{account_id}"]["response"]; }; getSubscriptionPlanForAccountStubbed: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /marketplace_listing/stubbed/accounts/:account_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /marketplace_listing/stubbed/accounts/{account_id}"]["response"]; }; getUserInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/installation"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/installation"]["response"]; + }; + getWebhookConfigForApp: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /app/hook/config"]["response"]; + }; + getWebhookDelivery: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /app/hook/deliveries/{delivery_id}"]["response"]; }; listAccountsForPlan: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /marketplace_listing/plans/:plan_id/accounts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /marketplace_listing/plans/{plan_id}/accounts"]["response"]; }; listAccountsForPlanStubbed: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /marketplace_listing/stubbed/plans/:plan_id/accounts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"]["response"]; }; listInstallationReposForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/installations/:installation_id/repositories"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/installations/{installation_id}/repositories"]["response"]; }; listInstallations: { parameters: RequestParameters & Omit; @@ -421,119 +529,155 @@ export declare type RestEndpointMethodTypes = { parameters: RequestParameters & Omit; response: Endpoints["GET /user/marketplace_purchases/stubbed"]["response"]; }; + listWebhookDeliveries: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /app/hook/deliveries"]["response"]; + }; + redeliverWebhookDelivery: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /app/hook/deliveries/{delivery_id}/attempts"]["response"]; + }; removeRepoFromInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/installations/:installation_id/repositories/:repository_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/installations/{installation_id}/repositories/{repository_id}"]["response"]; }; resetToken: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /applications/:client_id/token"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /applications/{client_id}/token"]["response"]; }; revokeInstallationAccessToken: { parameters: RequestParameters & Omit; response: Endpoints["DELETE /installation/token"]["response"]; }; + scopeToken: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /applications/{client_id}/token/scoped"]["response"]; + }; suspendInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /app/installations/:installation_id/suspended"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /app/installations/{installation_id}/suspended"]["response"]; }; unsuspendInstallation: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /app/installations/:installation_id/suspended"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /app/installations/{installation_id}/suspended"]["response"]; + }; + updateWebhookConfigForApp: { + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /app/hook/config"]["response"]; }; }; billing: { getGithubActionsBillingOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/settings/billing/actions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/settings/billing/actions"]["response"]; }; getGithubActionsBillingUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/settings/billing/actions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/settings/billing/actions"]["response"]; }; getGithubPackagesBillingOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/settings/billing/packages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/settings/billing/packages"]["response"]; }; getGithubPackagesBillingUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/settings/billing/packages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/settings/billing/packages"]["response"]; }; getSharedStorageBillingOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/settings/billing/shared-storage"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/settings/billing/shared-storage"]["response"]; }; getSharedStorageBillingUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/settings/billing/shared-storage"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/settings/billing/shared-storage"]["response"]; }; }; checks: { create: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/check-runs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/check-runs"]["response"]; }; createSuite: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/check-suites"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/check-suites"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/check-runs/:check_run_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"]["response"]; }; getSuite: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/check-suites/:check_suite_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"]["response"]; }; listAnnotations: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/check-runs/:check_run_id/annotations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"]["response"]; }; listForRef: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-runs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"]["response"]; }; listForSuite: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"]["response"]; }; listSuitesForRef: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/check-suites"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"]["response"]; }; rerequestSuite: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/check-suites/:check_suite_id/rerequest"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"]["response"]; }; setSuitesPreferences: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/check-suites/preferences"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/check-suites/preferences"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/check-runs/:check_run_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]["response"]; }; }; codeScanning: { + deleteAnalysis: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"]["response"]; + }; getAlert: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/code-scanning/alerts/:alert_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"]["response"]; + }; + getAnalysis: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"]["response"]; + }; + getSarif: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"]["response"]; + }; + listAlertInstances: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"]["response"]; }; listAlertsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/code-scanning/alerts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts"]["response"]; + }; + listAlertsInstances: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"]["response"]; }; listRecentAnalyses: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/code-scanning/analyses"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/code-scanning/analyses"]["response"]; }; updateAlert: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/code-scanning/alerts/:alert_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"]["response"]; }; uploadSarif: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/code-scanning/sarifs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/code-scanning/sarifs"]["response"]; }; }; codesOfConduct: { @@ -542,12 +686,12 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["GET /codes_of_conduct"]["response"]; }; getConductCode: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /codes_of_conduct/:key"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /codes_of_conduct/{key}"]["response"]; }; getForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/community/code_of_conduct"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/community/code_of_conduct"]["response"]; }; }; emojis: { @@ -556,62 +700,96 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["GET /emojis"]["response"]; }; }; + enterpriseAdmin: { + disableSelectedOrganizationGithubActionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"]["response"]; + }; + enableSelectedOrganizationGithubActionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"]["response"]; + }; + getAllowedActionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /enterprises/{enterprise}/actions/permissions/selected-actions"]["response"]; + }; + getGithubActionsPermissionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /enterprises/{enterprise}/actions/permissions"]["response"]; + }; + listSelectedOrganizationsEnabledGithubActionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /enterprises/{enterprise}/actions/permissions/organizations"]["response"]; + }; + setAllowedActionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"]["response"]; + }; + setGithubActionsPermissionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /enterprises/{enterprise}/actions/permissions"]["response"]; + }; + setSelectedOrganizationsEnabledGithubActionsEnterprise: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /enterprises/{enterprise}/actions/permissions/organizations"]["response"]; + }; + }; gists: { checkIsStarred: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id/star"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}/star"]["response"]; }; create: { parameters: RequestParameters & Omit; response: Endpoints["POST /gists"]["response"]; }; createComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /gists/:gist_id/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /gists/{gist_id}/comments"]["response"]; }; delete: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /gists/:gist_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /gists/{gist_id}"]["response"]; }; deleteComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /gists/:gist_id/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /gists/{gist_id}/comments/{comment_id}"]["response"]; }; fork: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /gists/:gist_id/forks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /gists/{gist_id}/forks"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}"]["response"]; }; getComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}/comments/{comment_id}"]["response"]; }; getRevision: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id/:sha"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}/{sha}"]["response"]; }; list: { parameters: RequestParameters & Omit; response: Endpoints["GET /gists"]["response"]; }; listComments: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}/comments"]["response"]; }; listCommits: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id/commits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}/commits"]["response"]; }; listForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/gists"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/gists"]["response"]; }; listForks: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gists/:gist_id/forks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gists/{gist_id}/forks"]["response"]; }; listPublic: { parameters: RequestParameters & Omit; @@ -622,74 +800,74 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["GET /gists/starred"]["response"]; }; star: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /gists/:gist_id/star"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /gists/{gist_id}/star"]["response"]; }; unstar: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /gists/:gist_id/star"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /gists/{gist_id}/star"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /gists/:gist_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /gists/{gist_id}"]["response"]; }; updateComment: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /gists/:gist_id/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /gists/{gist_id}/comments/{comment_id}"]["response"]; }; }; git: { createBlob: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/git/blobs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/git/blobs"]["response"]; }; createCommit: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/git/commits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/git/commits"]["response"]; }; createRef: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/git/refs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/git/refs"]["response"]; }; createTag: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/git/tags"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/git/tags"]["response"]; }; createTree: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/git/trees"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/git/trees"]["response"]; }; deleteRef: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/git/refs/:ref"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/git/refs/{ref}"]["response"]; }; getBlob: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/git/blobs/:file_sha"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"]["response"]; }; getCommit: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/git/commits/:commit_sha"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"]["response"]; }; getRef: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/git/ref/:ref"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/git/ref/{ref}"]["response"]; }; getTag: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/git/tags/:tag_sha"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"]["response"]; }; getTree: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/git/trees/:tree_sha"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"]["response"]; }; listMatchingRefs: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/git/matching-refs/:ref"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"]["response"]; }; updateRef: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/git/refs/:ref"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]["response"]; }; }; gitignore: { @@ -698,206 +876,230 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["GET /gitignore/templates"]["response"]; }; getTemplate: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /gitignore/templates/:name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /gitignore/templates/{name}"]["response"]; }; }; interactions: { + getRestrictionsForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/interaction-limits"]["response"]; + }; getRestrictionsForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/interaction-limits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/interaction-limits"]["response"]; }; getRestrictionsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/interaction-limits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/interaction-limits"]["response"]; + }; + getRestrictionsForYourPublicRepos: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/interaction-limits"]["response"]; + }; + removeRestrictionsForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/interaction-limits"]["response"]; }; removeRestrictionsForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/interaction-limits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/interaction-limits"]["response"]; }; removeRestrictionsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/interaction-limits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/interaction-limits"]["response"]; + }; + removeRestrictionsForYourPublicRepos: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/interaction-limits"]["response"]; + }; + setRestrictionsForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /user/interaction-limits"]["response"]; }; setRestrictionsForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/interaction-limits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/interaction-limits"]["response"]; }; setRestrictionsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/interaction-limits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/interaction-limits"]["response"]; + }; + setRestrictionsForYourPublicRepos: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /user/interaction-limits"]["response"]; }; }; issues: { addAssignees: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/issues/:issue_number/assignees"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"]["response"]; }; addLabels: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/issues/:issue_number/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"]["response"]; }; checkUserCanBeAssigned: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/assignees/:assignee"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/assignees/{assignee}"]["response"]; }; create: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/issues"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/issues"]["response"]; }; createComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/issues/:issue_number/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"]["response"]; }; createLabel: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/labels"]["response"]; }; createMilestone: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/milestones"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/milestones"]["response"]; }; deleteComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"]["response"]; }; deleteLabel: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/labels/:name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/labels/{name}"]["response"]; }; deleteMilestone: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/milestones/:milestone_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}"]["response"]; }; getComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"]["response"]; }; getEvent: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/events/:event_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/events/{event_id}"]["response"]; }; getLabel: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/labels/:name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/labels/{name}"]["response"]; }; getMilestone: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/milestones/:milestone_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/milestones/{milestone_number}"]["response"]; }; list: { parameters: RequestParameters & Omit; response: Endpoints["GET /issues"]["response"]; }; listAssignees: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/assignees"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/assignees"]["response"]; }; listComments: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"]["response"]; }; listCommentsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/comments"]["response"]; }; listEvents: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/events"]["response"]; }; listEventsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/events"]["response"]; }; listEventsForTimeline: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/timeline"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"]["response"]; }; listForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/issues"]["response"]; }; listForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/issues"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/issues"]["response"]; }; listForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues"]["response"]; }; listLabelsForMilestone: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/milestones/:milestone_number/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"]["response"]; }; listLabelsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/labels"]["response"]; }; listLabelsOnIssue: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"]["response"]; }; listMilestones: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/milestones"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/milestones"]["response"]; }; lock: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/issues/:issue_number/lock"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"]["response"]; }; removeAllLabels: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/:issue_number/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"]["response"]; }; removeAssignees: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/:issue_number/assignees"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"]["response"]; }; removeLabel: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/:issue_number/labels/:name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"]["response"]; }; setLabels: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/issues/:issue_number/labels"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"]["response"]; }; unlock: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/:issue_number/lock"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/issues/:issue_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/issues/{issue_number}"]["response"]; }; updateComment: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/issues/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"]["response"]; }; updateLabel: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/labels/:name"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/labels/{name}"]["response"]; }; updateMilestone: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/milestones/:milestone_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]["response"]; }; }; licenses: { get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /licenses/:license"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /licenses/{license}"]["response"]; }; getAllCommonlyUsed: { parameters: RequestParameters & Omit; response: Endpoints["GET /licenses"]["response"]; }; getForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/license"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/license"]["response"]; }; }; markdown: { @@ -915,449 +1117,567 @@ export declare type RestEndpointMethodTypes = { parameters: RequestParameters & Omit; response: Endpoints["GET /meta"]["response"]; }; + getOctocat: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /octocat"]["response"]; + }; + getZen: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /zen"]["response"]; + }; + root: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /"]["response"]; + }; }; migrations: { cancelImport: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/import"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/import"]["response"]; }; deleteArchiveForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/migrations/:migration_id/archive"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/migrations/{migration_id}/archive"]["response"]; }; deleteArchiveForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/migrations/:migration_id/archive"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/migrations/{migration_id}/archive"]["response"]; }; downloadArchiveForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/migrations/:migration_id/archive"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/migrations/{migration_id}/archive"]["response"]; }; getArchiveForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/migrations/:migration_id/archive"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/migrations/{migration_id}/archive"]["response"]; }; getCommitAuthors: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/import/authors"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/import/authors"]["response"]; }; getImportStatus: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/import"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/import"]["response"]; }; getLargeFiles: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/import/large_files"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/import/large_files"]["response"]; }; getStatusForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/migrations/:migration_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/migrations/{migration_id}"]["response"]; }; getStatusForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/migrations/:migration_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/migrations/{migration_id}"]["response"]; }; listForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/migrations"]["response"]; }; listForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/migrations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/migrations"]["response"]; }; listReposForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/migrations/:migration_id/repositories"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/migrations/{migration_id}/repositories"]["response"]; }; listReposForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/migrations/:migration_id/repositories"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/migrations/{migration_id}/repositories"]["response"]; }; mapCommitAuthor: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/import/authors/:author_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"]["response"]; }; setLfsPreference: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/import/lfs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/import/lfs"]["response"]; }; startForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["POST /user/migrations"]["response"]; }; startForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/migrations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/migrations"]["response"]; }; startImport: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/import"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/import"]["response"]; }; unlockRepoForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/migrations/:migration_id/repos/:repo_name/lock"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"]["response"]; }; unlockRepoForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/migrations/:migration_id/repos/:repo_name/lock"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]["response"]; }; updateImport: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/import"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/import"]["response"]; }; }; orgs: { blockUser: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/blocks/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/blocks/{username}"]["response"]; + }; + cancelInvitation: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/invitations/{invitation_id}"]["response"]; }; checkBlockedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/blocks/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/blocks/{username}"]["response"]; }; checkMembershipForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/members/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/members/{username}"]["response"]; }; checkPublicMembershipForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/public_members/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/public_members/{username}"]["response"]; }; convertMemberToOutsideCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/outside_collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/outside_collaborators/{username}"]["response"]; }; createInvitation: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/invitations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/invitations"]["response"]; }; createWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/hooks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/hooks"]["response"]; }; deleteWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/hooks/:hook_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/hooks/{hook_id}"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}"]["response"]; }; getMembershipForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/memberships/orgs/:org"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/memberships/orgs/{org}"]["response"]; }; getMembershipForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/memberships/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/memberships/{username}"]["response"]; }; getWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/hooks/:hook_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/hooks/{hook_id}"]["response"]; + }; + getWebhookConfigForOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/hooks/{hook_id}/config"]["response"]; + }; + getWebhookDelivery: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"]["response"]; }; list: { parameters: RequestParameters & Omit; response: Endpoints["GET /organizations"]["response"]; }; listAppInstallations: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/installations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/installations"]["response"]; }; listBlockedUsers: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/blocks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/blocks"]["response"]; + }; + listFailedInvitations: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/failed_invitations"]["response"]; }; listForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/orgs"]["response"]; }; listForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/orgs"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/orgs"]["response"]; }; listInvitationTeams: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/invitations/:invitation_id/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/invitations/{invitation_id}/teams"]["response"]; }; listMembers: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/members"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/members"]["response"]; }; listMembershipsForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/memberships/orgs"]["response"]; }; listOutsideCollaborators: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/outside_collaborators"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/outside_collaborators"]["response"]; }; listPendingInvitations: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/invitations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/invitations"]["response"]; }; listPublicMembers: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/public_members"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/public_members"]["response"]; + }; + listWebhookDeliveries: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/hooks/{hook_id}/deliveries"]["response"]; }; listWebhooks: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/hooks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/hooks"]["response"]; }; pingWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/hooks/:hook_id/pings"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/hooks/{hook_id}/pings"]["response"]; + }; + redeliverWebhookDelivery: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"]["response"]; }; removeMember: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/members/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/members/{username}"]["response"]; }; removeMembershipForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/memberships/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/memberships/{username}"]["response"]; }; removeOutsideCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/outside_collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/outside_collaborators/{username}"]["response"]; }; removePublicMembershipForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/public_members/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/public_members/{username}"]["response"]; }; setMembershipForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/memberships/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/memberships/{username}"]["response"]; }; setPublicMembershipForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/public_members/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/public_members/{username}"]["response"]; }; unblockUser: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/blocks/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/blocks/{username}"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /orgs/:org"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /orgs/{org}"]["response"]; }; updateMembershipForAuthenticatedUser: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /user/memberships/orgs/:org"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /user/memberships/orgs/{org}"]["response"]; }; updateWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /orgs/:org/hooks/:hook_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /orgs/{org}/hooks/{hook_id}"]["response"]; + }; + updateWebhookConfigForOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /orgs/{org}/hooks/{hook_id}/config"]["response"]; + }; + }; + packages: { + deletePackageForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/packages/{package_type}/{package_name}"]["response"]; + }; + deletePackageForOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/packages/{package_type}/{package_name}"]["response"]; + }; + deletePackageVersionForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"]["response"]; + }; + deletePackageVersionForOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"]["response"]; + }; + getAllPackageVersionsForAPackageOwnedByAnOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"]["response"]; + }; + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/packages/{package_type}/{package_name}/versions"]["response"]; + }; + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/packages/{package_type}/{package_name}/versions"]["response"]; + }; + getAllPackageVersionsForPackageOwnedByOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"]["response"]; + }; + getAllPackageVersionsForPackageOwnedByUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/packages/{package_type}/{package_name}/versions"]["response"]; + }; + getPackageForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/packages/{package_type}/{package_name}"]["response"]; + }; + getPackageForOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/packages/{package_type}/{package_name}"]["response"]; + }; + getPackageForUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/packages/{package_type}/{package_name}"]["response"]; + }; + getPackageVersionForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"]["response"]; + }; + getPackageVersionForOrganization: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"]["response"]; + }; + getPackageVersionForUser: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"]["response"]; + }; + restorePackageForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /user/packages/{package_type}/{package_name}/restore{?token}"]["response"]; + }; + restorePackageForOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"]["response"]; + }; + restorePackageVersionForAuthenticatedUser: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]["response"]; + }; + restorePackageVersionForOrg: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]["response"]; }; }; projects: { addCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /projects/:project_id/collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /projects/{project_id}/collaborators/{username}"]["response"]; }; createCard: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /projects/columns/:column_id/cards"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /projects/columns/{column_id}/cards"]["response"]; }; createColumn: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /projects/:project_id/columns"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /projects/{project_id}/columns"]["response"]; }; createForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["POST /user/projects"]["response"]; }; createForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/projects"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/projects"]["response"]; }; createForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/projects"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/projects"]["response"]; }; delete: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /projects/:project_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /projects/{project_id}"]["response"]; }; deleteCard: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /projects/columns/cards/:card_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /projects/columns/cards/{card_id}"]["response"]; }; deleteColumn: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /projects/columns/:column_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /projects/columns/{column_id}"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/:project_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/{project_id}"]["response"]; }; getCard: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/columns/cards/:card_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/columns/cards/{card_id}"]["response"]; }; getColumn: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/columns/:column_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/columns/{column_id}"]["response"]; }; getPermissionForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/:project_id/collaborators/:username/permission"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/{project_id}/collaborators/{username}/permission"]["response"]; }; listCards: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/columns/:column_id/cards"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/columns/{column_id}/cards"]["response"]; }; listCollaborators: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/:project_id/collaborators"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/{project_id}/collaborators"]["response"]; }; listColumns: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /projects/:project_id/columns"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /projects/{project_id}/columns"]["response"]; }; listForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/projects"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/projects"]["response"]; }; listForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/projects"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/projects"]["response"]; }; listForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/projects"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/projects"]["response"]; }; moveCard: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /projects/columns/cards/:card_id/moves"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /projects/columns/cards/{card_id}/moves"]["response"]; }; moveColumn: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /projects/columns/:column_id/moves"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /projects/columns/{column_id}/moves"]["response"]; }; removeCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /projects/:project_id/collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /projects/{project_id}/collaborators/{username}"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /projects/:project_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /projects/{project_id}"]["response"]; }; updateCard: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /projects/columns/cards/:card_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /projects/columns/cards/{card_id}"]["response"]; }; updateColumn: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /projects/columns/:column_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /projects/columns/{column_id}"]["response"]; }; }; pulls: { checkIfMerged: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/merge"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"]["response"]; }; create: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls"]["response"]; }; createReplyForReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"]["response"]; }; createReview: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls/:pull_number/reviews"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"]["response"]; }; createReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls/:pull_number/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"]["response"]; }; deletePendingReview: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"]["response"]; }; deleteReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/pulls/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"]["response"]; }; dismissReview: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}"]["response"]; }; getReview: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"]["response"]; }; getReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"]["response"]; }; list: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls"]["response"]; }; listCommentsForReview: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"]["response"]; }; listCommits: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/commits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"]["response"]; }; listFiles: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/files"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"]["response"]; }; listRequestedReviewers: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"]["response"]; }; listReviewComments: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"]["response"]; }; listReviewCommentsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/comments"]["response"]; }; listReviews: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/:pull_number/reviews"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"]["response"]; }; merge: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/pulls/:pull_number/merge"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"]["response"]; }; removeRequestedReviewers: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/pulls/:pull_number/requested_reviewers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"]["response"]; }; requestReviewers: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls/:pull_number/requested_reviewers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"]["response"]; }; submitReview: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/pulls/:pull_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"]["response"]; }; updateBranch: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/pulls/:pull_number/update-branch"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"]["response"]; }; updateReview: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"]["response"]; }; updateReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/pulls/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]["response"]; }; }; rateLimit: { @@ -1368,638 +1688,722 @@ export declare type RestEndpointMethodTypes = { }; reactions: { createForCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/comments/:comment_id/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"]["response"]; }; createForIssue: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/issues/:issue_number/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"]["response"]; }; createForIssueComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/issues/comments/:comment_id/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"]["response"]; }; createForPullRequestReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pulls/comments/:comment_id/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"]["response"]; + }; + createForRelease: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"]["response"]; }; createForTeamDiscussionCommentInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"]["response"]; }; createForTeamDiscussionInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]["response"]; }; deleteForCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/comments/:comment_id/reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"]["response"]; }; deleteForIssue: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/:issue_number/reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"]["response"]; }; deleteForIssueComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/issues/comments/:comment_id/reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"]["response"]; }; deleteForPullRequestComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/pulls/comments/:comment_id/reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"]["response"]; }; deleteForTeamDiscussion: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"]["response"]; }; deleteForTeamDiscussionComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"]["response"]; }; deleteLegacy: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /reactions/:reaction_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /reactions/{reaction_id}"]["response"]; }; listForCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/comments/:comment_id/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"]["response"]; }; listForIssue: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/:issue_number/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"]["response"]; }; listForIssueComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/issues/comments/:comment_id/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"]["response"]; }; listForPullRequestReviewComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pulls/comments/:comment_id/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"]["response"]; }; listForTeamDiscussionCommentInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"]["response"]; }; listForTeamDiscussionInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]["response"]; }; }; repos: { acceptInvitation: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /user/repository_invitations/:invitation_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /user/repository_invitations/{invitation_id}"]["response"]; }; addAppAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/branches/:branch/protection/restrictions/apps"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"]["response"]; }; addCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/collaborators/{username}"]["response"]; }; addStatusCheckContexts: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"]["response"]; }; addTeamAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/branches/:branch/protection/restrictions/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"]["response"]; }; addUserAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/branches/:branch/protection/restrictions/users"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"]["response"]; }; checkCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/collaborators/{username}"]["response"]; }; checkVulnerabilityAlerts: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/vulnerability-alerts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/vulnerability-alerts"]["response"]; }; compareCommits: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/compare/:base...:head"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/compare/{base}...{head}"]["response"]; + }; + compareCommitsWithBasehead: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/compare/{basehead}"]["response"]; + }; + createAutolink: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/autolinks"]["response"]; }; createCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/commits/:commit_sha/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"]["response"]; }; createCommitSignatureProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/branches/:branch/protection/required_signatures"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"]["response"]; }; createCommitStatus: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/statuses/:sha"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/statuses/{sha}"]["response"]; }; createDeployKey: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/keys"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/keys"]["response"]; }; createDeployment: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/deployments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/deployments"]["response"]; }; createDeploymentStatus: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/deployments/:deployment_id/statuses"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"]["response"]; }; createDispatchEvent: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/dispatches"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/dispatches"]["response"]; }; createForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["POST /user/repos"]["response"]; }; createFork: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/forks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/forks"]["response"]; }; createInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/repos"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/repos"]["response"]; + }; + createOrUpdateEnvironment: { + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/environments/{environment_name}"]["response"]; }; createOrUpdateFileContents: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/contents/:path"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/contents/{path}"]["response"]; }; createPagesSite: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pages"]["response"]; }; createRelease: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/releases"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/releases"]["response"]; }; createUsingTemplate: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:template_owner/:template_repo/generate"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{template_owner}/{template_repo}/generate"]["response"]; }; createWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/hooks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/hooks"]["response"]; }; declineInvitation: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/repository_invitations/:invitation_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/repository_invitations/{invitation_id}"]["response"]; }; delete: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}"]["response"]; }; deleteAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"]["response"]; }; deleteAdminBranchProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/enforce_admins"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"]["response"]; + }; + deleteAnEnvironment: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/environments/{environment_name}"]["response"]; + }; + deleteAutolink: { + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"]["response"]; }; deleteBranchProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"]["response"]; }; deleteCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/comments/{comment_id}"]["response"]; }; deleteCommitSignatureProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/required_signatures"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"]["response"]; }; deleteDeployKey: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/keys/:key_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/keys/{key_id}"]["response"]; }; deleteDeployment: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/deployments/:deployment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"]["response"]; }; deleteFile: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/contents/:path"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/contents/{path}"]["response"]; }; deleteInvitation: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/invitations/:invitation_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"]["response"]; }; deletePagesSite: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/pages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/pages"]["response"]; }; deletePullRequestReviewProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"]["response"]; }; deleteRelease: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/releases/:release_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/releases/{release_id}"]["response"]; }; deleteReleaseAsset: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/releases/assets/:asset_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"]["response"]; }; deleteWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/hooks/:hook_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"]["response"]; }; disableAutomatedSecurityFixes: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/automated-security-fixes"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/automated-security-fixes"]["response"]; }; disableVulnerabilityAlerts: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/vulnerability-alerts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/vulnerability-alerts"]["response"]; }; downloadArchive: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/:archive_format/:ref"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/zipball/{ref}"]["response"]; + }; + downloadTarballArchive: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/tarball/{ref}"]["response"]; + }; + downloadZipballArchive: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/zipball/{ref}"]["response"]; }; enableAutomatedSecurityFixes: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/automated-security-fixes"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/automated-security-fixes"]["response"]; }; enableVulnerabilityAlerts: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/vulnerability-alerts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/vulnerability-alerts"]["response"]; }; get: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}"]["response"]; }; getAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/restrictions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"]["response"]; }; getAdminBranchProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/enforce_admins"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"]["response"]; + }; + getAllEnvironments: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/environments"]["response"]; }; getAllStatusCheckContexts: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"]["response"]; }; getAllTopics: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/topics"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/topics"]["response"]; }; getAppsWithAccessToProtectedBranch: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/restrictions/apps"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"]["response"]; + }; + getAutolink: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"]["response"]; }; getBranch: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}"]["response"]; }; getBranchProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection"]["response"]; }; getClones: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/traffic/clones"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/traffic/clones"]["response"]; }; getCodeFrequencyStats: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/stats/code_frequency"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/stats/code_frequency"]["response"]; }; getCollaboratorPermissionLevel: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/collaborators/:username/permission"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/collaborators/{username}/permission"]["response"]; }; getCombinedStatusForRef: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/status"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/status"]["response"]; }; getCommit: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}"]["response"]; }; getCommitActivityStats: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/stats/commit_activity"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/stats/commit_activity"]["response"]; }; getCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/comments/{comment_id}"]["response"]; }; getCommitSignatureProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/required_signatures"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"]["response"]; }; getCommunityProfileMetrics: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/community/profile"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/community/profile"]["response"]; }; getContent: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/contents/:path"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/contents/{path}"]["response"]; }; getContributorsStats: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/stats/contributors"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/stats/contributors"]["response"]; }; getDeployKey: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/keys/:key_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/keys/{key_id}"]["response"]; }; getDeployment: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/deployments/:deployment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/deployments/{deployment_id}"]["response"]; }; getDeploymentStatus: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"]["response"]; + }; + getEnvironment: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/environments/{environment_name}"]["response"]; }; getLatestPagesBuild: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pages/builds/latest"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pages/builds/latest"]["response"]; }; getLatestRelease: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/releases/latest"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/releases/latest"]["response"]; }; getPages: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pages"]["response"]; }; getPagesBuild: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pages/builds/:build_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pages/builds/{build_id}"]["response"]; + }; + getPagesHealthCheck: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pages/health"]["response"]; }; getParticipationStats: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/stats/participation"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/stats/participation"]["response"]; }; getPullRequestReviewProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"]["response"]; }; getPunchCardStats: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/stats/punch_card"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/stats/punch_card"]["response"]; }; getReadme: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/readme"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/readme"]["response"]; + }; + getReadmeInDirectory: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/readme/{dir}"]["response"]; }; getRelease: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/releases/:release_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/releases/{release_id}"]["response"]; }; getReleaseAsset: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/releases/assets/:asset_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"]["response"]; }; getReleaseByTag: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/releases/tags/:tag"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/releases/tags/{tag}"]["response"]; }; getStatusChecksProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"]["response"]; }; getTeamsWithAccessToProtectedBranch: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/restrictions/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"]["response"]; }; getTopPaths: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/traffic/popular/paths"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/traffic/popular/paths"]["response"]; }; getTopReferrers: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/traffic/popular/referrers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/traffic/popular/referrers"]["response"]; }; getUsersWithAccessToProtectedBranch: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches/:branch/protection/restrictions/users"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"]["response"]; }; getViews: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/traffic/views"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/traffic/views"]["response"]; }; getWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/hooks/:hook_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/hooks/{hook_id}"]["response"]; + }; + getWebhookConfigForRepo: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"]["response"]; + }; + getWebhookDelivery: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"]["response"]; + }; + listAutolinks: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/autolinks"]["response"]; }; listBranches: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/branches"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/branches"]["response"]; }; listBranchesForHeadCommit: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/branches-where-head"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"]["response"]; }; listCollaborators: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/collaborators"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/collaborators"]["response"]; }; listCommentsForCommit: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"]["response"]; }; listCommitCommentsForRepo: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/comments"]["response"]; }; listCommitStatusesForRef: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:ref/statuses"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{ref}/statuses"]["response"]; }; listCommits: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]; }; listContributors: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/contributors"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/contributors"]["response"]; }; listDeployKeys: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/keys"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/keys"]["response"]; }; listDeploymentStatuses: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/deployments/:deployment_id/statuses"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"]["response"]; }; listDeployments: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/deployments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/deployments"]["response"]; }; listForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/repos"]["response"]; }; listForOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/repos"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/repos"]["response"]; }; listForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/repos"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/repos"]["response"]; }; listForks: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/forks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/forks"]["response"]; }; listInvitations: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/invitations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/invitations"]["response"]; }; listInvitationsForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/repository_invitations"]["response"]; }; listLanguages: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/languages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/languages"]["response"]; }; listPagesBuilds: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/pages/builds"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/pages/builds"]["response"]; }; listPublic: { parameters: RequestParameters & Omit; response: Endpoints["GET /repositories"]["response"]; }; listPullRequestsAssociatedWithCommit: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/commits/:commit_sha/pulls"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"]["response"]; }; listReleaseAssets: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/releases/:release_id/assets"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/releases/{release_id}/assets"]["response"]; }; listReleases: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/releases"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/releases"]["response"]; }; listTags: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/tags"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/tags"]["response"]; }; listTeams: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/teams"]["response"]; + }; + listWebhookDeliveries: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"]["response"]; }; listWebhooks: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /repos/:owner/:repo/hooks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/hooks"]["response"]; }; merge: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/merges"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/merges"]["response"]; }; pingWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/hooks/:hook_id/pings"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"]["response"]; + }; + redeliverWebhookDelivery: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"]["response"]; }; removeAppAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/apps"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"]["response"]; }; removeCollaborator: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/collaborators/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/collaborators/{username}"]["response"]; }; removeStatusCheckContexts: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"]["response"]; }; removeStatusCheckProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"]["response"]; }; removeTeamAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"]["response"]; }; removeUserAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/users"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"]["response"]; + }; + renameBranch: { + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/rename"]["response"]; }; replaceAllTopics: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/topics"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/topics"]["response"]; }; requestPagesBuild: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/pages/builds"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/pages/builds"]["response"]; }; setAdminBranchProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/branches/:branch/protection/enforce_admins"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"]["response"]; }; setAppAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/apps"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"]["response"]; }; setStatusCheckContexts: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"]["response"]; }; setTeamAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"]["response"]; }; setUserAccessRestrictions: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/users"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"]["response"]; }; testPushWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/hooks/:hook_id/tests"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"]["response"]; }; transfer: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/transfer"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /repos/{owner}/{repo}/transfer"]["response"]; }; update: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}"]["response"]; }; updateBranchProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/branches/:branch/protection"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/branches/{branch}/protection"]["response"]; }; updateCommitComment: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/comments/:comment_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/comments/{comment_id}"]["response"]; }; updateInformationAboutPagesSite: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /repos/:owner/:repo/pages"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /repos/{owner}/{repo}/pages"]["response"]; }; updateInvitation: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/invitations/:invitation_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"]["response"]; }; updatePullRequestReviewProtection: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"]["response"]; }; updateRelease: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/releases/:release_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/releases/{release_id}"]["response"]; }; updateReleaseAsset: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/releases/assets/:asset_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"]["response"]; }; updateStatusCheckPotection: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"]["response"]; + }; + updateStatusCheckProtection: { + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"]["response"]; }; updateWebhook: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /repos/:owner/:repo/hooks/:hook_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"]["response"]; + }; + updateWebhookConfigForRepo: { + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"]["response"]; }; uploadReleaseAsset: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /repos/:owner/:repo/releases/:release_id/assets{?name,label}"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST {origin}/repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}"]["response"]; }; }; search: { @@ -2032,126 +2436,140 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["GET /search/users"]["response"]; }; }; + secretScanning: { + getAlert: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]["response"]; + }; + listAlertsForRepo: { + parameters: RequestParameters & Omit; + response: Endpoints["GET /repos/{owner}/{repo}/secret-scanning/alerts"]["response"]; + }; + updateAlert: { + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"]["response"]; + }; + }; teams: { addOrUpdateMembershipForUserInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/teams/:team_slug/memberships/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"]["response"]; }; addOrUpdateProjectPermissionsInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/teams/:team_slug/projects/:project_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"]["response"]; }; addOrUpdateRepoPermissionsInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /orgs/:org/teams/:team_slug/repos/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"]["response"]; }; checkPermissionsForProjectInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/projects/:project_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"]["response"]; }; checkPermissionsForRepoInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/repos/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"]["response"]; }; create: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/teams"]["response"]; }; createDiscussionCommentInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"]["response"]; }; createDiscussionInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["POST /orgs/:org/teams/:team_slug/discussions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["POST /orgs/{org}/teams/{team_slug}/discussions"]["response"]; }; deleteDiscussionCommentInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"]["response"]; }; deleteDiscussionInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"]["response"]; }; deleteInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}"]["response"]; }; getByName: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}"]["response"]; }; getDiscussionCommentInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"]["response"]; }; getDiscussionInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"]["response"]; }; getMembershipForUserInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/memberships/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"]["response"]; }; list: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams"]["response"]; }; listChildInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/teams"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/teams"]["response"]; }; listDiscussionCommentsInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"]["response"]; }; listDiscussionsInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/discussions"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/discussions"]["response"]; }; listForAuthenticatedUser: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/teams"]["response"]; }; listMembersInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/members"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/members"]["response"]; }; listPendingInvitationsInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/invitations"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/invitations"]["response"]; }; listProjectsInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/projects"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/projects"]["response"]; }; listReposInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /orgs/:org/teams/:team_slug/repos"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /orgs/{org}/teams/{team_slug}/repos"]["response"]; }; removeMembershipForUserInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/memberships/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"]["response"]; }; removeProjectInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/projects/:project_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"]["response"]; }; removeRepoInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /orgs/:org/teams/:team_slug/repos/:owner/:repo"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"]["response"]; }; updateDiscussionCommentInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"]["response"]; }; updateDiscussionInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /orgs/:org/teams/:team_slug/discussions/:discussion_number"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"]["response"]; }; updateInOrg: { - parameters: RequestParameters & Omit; - response: Endpoints["PATCH /orgs/:org/teams/:team_slug"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PATCH /orgs/{org}/teams/{team_slug}"]["response"]; }; }; users: { @@ -2160,20 +2578,20 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["POST /user/emails"]["response"]; }; block: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /user/blocks/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /user/blocks/{username}"]["response"]; }; checkBlocked: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/blocks/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/blocks/{username}"]["response"]; }; checkFollowingForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/following/:target_user"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/following/{target_user}"]["response"]; }; checkPersonIsFollowedByAuthenticated: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/following/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/following/{username}"]["response"]; }; createGpgKeyForAuthenticated: { parameters: RequestParameters & Omit; @@ -2188,36 +2606,36 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["DELETE /user/emails"]["response"]; }; deleteGpgKeyForAuthenticated: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/gpg_keys/:gpg_key_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/gpg_keys/{gpg_key_id}"]["response"]; }; deletePublicSshKeyForAuthenticated: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/keys/:key_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/keys/{key_id}"]["response"]; }; follow: { - parameters: RequestParameters & Omit; - response: Endpoints["PUT /user/following/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["PUT /user/following/{username}"]["response"]; }; getAuthenticated: { parameters: RequestParameters & Omit; response: Endpoints["GET /user"]["response"]; }; getByUsername: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}"]["response"]; }; getContextForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/hovercard"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/hovercard"]["response"]; }; getGpgKeyForAuthenticated: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/gpg_keys/:gpg_key_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/gpg_keys/{gpg_key_id}"]["response"]; }; getPublicSshKeyForAuthenticated: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /user/keys/:key_id"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /user/keys/{key_id}"]["response"]; }; list: { parameters: RequestParameters & Omit; @@ -2240,28 +2658,28 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["GET /user/followers"]["response"]; }; listFollowersForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/followers"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/followers"]["response"]; }; listFollowingForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/following"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/following"]["response"]; }; listGpgKeysForAuthenticated: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/gpg_keys"]["response"]; }; listGpgKeysForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/gpg_keys"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/gpg_keys"]["response"]; }; listPublicEmailsForAuthenticated: { parameters: RequestParameters & Omit; response: Endpoints["GET /user/public_emails"]["response"]; }; listPublicKeysForUser: { - parameters: RequestParameters & Omit; - response: Endpoints["GET /users/:username/keys"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["GET /users/{username}/keys"]["response"]; }; listPublicSshKeysForAuthenticated: { parameters: RequestParameters & Omit; @@ -2272,12 +2690,12 @@ export declare type RestEndpointMethodTypes = { response: Endpoints["PATCH /user/email/visibility"]["response"]; }; unblock: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/blocks/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/blocks/{username}"]["response"]; }; unfollow: { - parameters: RequestParameters & Omit; - response: Endpoints["DELETE /user/following/:username"]["response"]; + parameters: RequestParameters & Omit; + response: Endpoints["DELETE /user/following/{username}"]["response"]; }; updateAuthenticated: { parameters: RequestParameters & Omit; diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts index 455e998..a81f3b0 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/index.d.ts @@ -1,17 +1,11 @@ import { Octokit } from "@octokit/core"; export { RestEndpointMethodTypes } from "./generated/parameters-and-response-types"; import { Api } from "./types"; -/** - * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary - * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is - * done, we will remove the registerEndpoints methods and return the methods - * directly as with the other plugins. At that point we will also remove the - * legacy workarounds and deprecations. - * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 - */ export declare function restEndpointMethods(octokit: Octokit): Api; export declare namespace restEndpointMethods { var VERSION: string; } +export declare function legacyRestEndpointMethods(octokit: Octokit): Api["rest"] & Api; +export declare namespace legacyRestEndpointMethods { + var VERSION: string; +} diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts index e9b177b..3628f02 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts @@ -1,6 +1,8 @@ import { Route, RequestParameters } from "@octokit/types"; import { RestEndpointMethods } from "./generated/method-types"; -export declare type Api = RestEndpointMethods; +export declare type Api = { + rest: RestEndpointMethods; +}; export declare type EndpointDecorations = { mapToData?: string; deprecated?: string; diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts index 88f0f9a..98c0eab 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "4.2.0"; +export declare const VERSION = "5.8.0"; diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js index bac1f84..907d6be 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js @@ -3,9 +3,15 @@ const Endpoints = { addSelectedRepoToOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", ], + approveWorkflowRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve", + ], cancelWorkflowRun: [ "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel", ], + createOrUpdateEnvironmentSecret: [ + "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", + ], createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], createOrUpdateRepoSecret: [ "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}", @@ -26,6 +32,9 @@ const Endpoints = { deleteArtifact: [ "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}", ], + deleteEnvironmentSecret: [ + "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", + ], deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], deleteRepoSecret: [ "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}", @@ -40,6 +49,12 @@ const Endpoints = { deleteWorkflowRunLogs: [ "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs", ], + disableSelectedRepositoryGithubActionsOrganization: [ + "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}", + ], + disableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable", + ], downloadArtifact: [ "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}", ], @@ -49,12 +64,47 @@ const Endpoints = { downloadWorkflowRunLogs: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs", ], + enableSelectedRepositoryGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}", + ], + enableWorkflow: [ + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable", + ], + getAllowedActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/selected-actions", + ], + getAllowedActionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions/selected-actions", + ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getEnvironmentPublicKey: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key", + ], + getEnvironmentSecret: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", + ], + getGithubActionsPermissionsOrganization: [ + "GET /orgs/{org}/actions/permissions", + ], + getGithubActionsPermissionsRepository: [ + "GET /repos/{owner}/{repo}/actions/permissions", + ], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getPendingDeploymentsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", + ], + getRepoPermissions: [ + "GET /repos/{owner}/{repo}/actions/permissions", + {}, + { renamed: ["actions", "getGithubActionsPermissionsRepository"] }, + ], getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getReviewsForRun: [ + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals", + ], getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], getSelfHostedRunnerForRepo: [ "GET /repos/{owner}/{repo}/actions/runners/{runner_id}", @@ -68,6 +118,9 @@ const Endpoints = { "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing", ], listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: [ + "GET /repositories/{repository_id}/environments/{environment_name}/secrets", + ], listJobsForWorkflowRun: [ "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", ], @@ -81,6 +134,9 @@ const Endpoints = { listSelectedReposForOrgSecret: [ "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", ], + listSelectedRepositoriesEnabledGithubActionsOrganization: [ + "GET /orgs/{org}/actions/permissions/repositories", + ], listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], listWorkflowRunArtifacts: [ @@ -94,9 +150,27 @@ const Endpoints = { removeSelectedRepoFromOrgSecret: [ "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", ], + reviewPendingDeploymentsForRun: [ + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", + ], + setAllowedActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/selected-actions", + ], + setAllowedActionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions", + ], + setGithubActionsPermissionsOrganization: [ + "PUT /orgs/{org}/actions/permissions", + ], + setGithubActionsPermissionsRepository: [ + "PUT /repos/{owner}/{repo}/actions/permissions", + ], setSelectedReposForOrgSecret: [ "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories", ], + setSelectedRepositoriesEnabledGithubActionsOrganization: [ + "PUT /orgs/{org}/actions/permissions/repositories", + ], }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], @@ -152,6 +226,10 @@ const Endpoints = { "POST /content_references/{content_reference_id}/attachments", { mediaType: { previews: ["corsair"] } }, ], + createContentAttachmentForRepo: [ + "POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", + { mediaType: { previews: ["corsair"] } }, + ], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: [ "POST /app/installations/{installation_id}/access_tokens", @@ -171,6 +249,8 @@ const Endpoints = { "GET /marketplace_listing/stubbed/accounts/{account_id}", ], getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], listAccountsForPlanStubbed: [ "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", @@ -187,15 +267,21 @@ const Endpoints = { listSubscriptionsForAuthenticatedUserStubbed: [ "GET /user/marketplace_purchases/stubbed", ], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: [ + "POST /app/hook/deliveries/{delivery_id}/attempts", + ], removeRepoFromInstallation: [ "DELETE /user/installations/{installation_id}/repositories/{repository_id}", ], resetToken: ["PATCH /applications/{client_id}/token"], revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], unsuspendInstallation: [ "DELETE /app/installations/{installation_id}/suspended", ], + updateWebhookConfigForApp: ["PATCH /app/hook/config"], }, billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], @@ -214,58 +300,48 @@ const Endpoints = { ], }, checks: { - create: [ - "POST /repos/{owner}/{repo}/check-runs", - { mediaType: { previews: ["antiope"] } }, - ], - createSuite: [ - "POST /repos/{owner}/{repo}/check-suites", - { mediaType: { previews: ["antiope"] } }, - ], - get: [ - "GET /repos/{owner}/{repo}/check-runs/{check_run_id}", - { mediaType: { previews: ["antiope"] } }, - ], - getSuite: [ - "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}", - { mediaType: { previews: ["antiope"] } }, - ], + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], listAnnotations: [ "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", - { mediaType: { previews: ["antiope"] } }, - ], - listForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", - { mediaType: { previews: ["antiope"] } }, ], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], listForSuite: [ "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", - { mediaType: { previews: ["antiope"] } }, - ], - listSuitesForRef: [ - "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", - { mediaType: { previews: ["antiope"] } }, ], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], rerequestSuite: [ "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", - { mediaType: { previews: ["antiope"] } }, ], setSuitesPreferences: [ "PATCH /repos/{owner}/{repo}/check-suites/preferences", - { mediaType: { previews: ["antiope"] } }, - ], - update: [ - "PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}", - { mediaType: { previews: ["antiope"] } }, ], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"], }, codeScanning: { + deleteAnalysis: [ + "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}", + ], getAlert: [ "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { renamedParameters: { alert_id: "alert_number" } }, ], + getAnalysis: [ + "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", + ], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + ], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: [ + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", + {}, + { renamed: ["codeScanning", "listAlertInstances"] }, + ], listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], updateAlert: [ "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", @@ -273,20 +349,40 @@ const Endpoints = { uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"], }, codesOfConduct: { - getAllCodesOfConduct: [ - "GET /codes_of_conduct", - { mediaType: { previews: ["scarlet-witch"] } }, - ], - getConductCode: [ - "GET /codes_of_conduct/{key}", - { mediaType: { previews: ["scarlet-witch"] } }, - ], + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"], getForRepo: [ "GET /repos/{owner}/{repo}/community/code_of_conduct", { mediaType: { previews: ["scarlet-witch"] } }, ], }, emojis: { get: ["GET /emojis"] }, + enterpriseAdmin: { + disableSelectedOrganizationGithubActionsEnterprise: [ + "DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}", + ], + enableSelectedOrganizationGithubActionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}", + ], + getAllowedActionsEnterprise: [ + "GET /enterprises/{enterprise}/actions/permissions/selected-actions", + ], + getGithubActionsPermissionsEnterprise: [ + "GET /enterprises/{enterprise}/actions/permissions", + ], + listSelectedOrganizationsEnabledGithubActionsEnterprise: [ + "GET /enterprises/{enterprise}/actions/permissions/organizations", + ], + setAllowedActionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions/selected-actions", + ], + setGithubActionsPermissionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions", + ], + setSelectedOrganizationsEnabledGithubActionsEnterprise: [ + "PUT /enterprises/{enterprise}/actions/permissions/organizations", + ], + }, gists: { checkIsStarred: ["GET /gists/{gist_id}/star"], create: ["POST /gists"], @@ -329,29 +425,31 @@ const Endpoints = { getTemplate: ["GET /gitignore/templates/{name}"], }, interactions: { - getRestrictionsForOrg: [ - "GET /orgs/{org}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, - ], - getRestrictionsForRepo: [ - "GET /repos/{owner}/{repo}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, - ], - removeRestrictionsForOrg: [ - "DELETE /orgs/{org}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: [ + "GET /user/interaction-limits", + {}, + { renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] }, ], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], removeRestrictionsForRepo: [ "DELETE /repos/{owner}/{repo}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, ], - setRestrictionsForOrg: [ - "PUT /orgs/{org}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, + removeRestrictionsForYourPublicRepos: [ + "DELETE /user/interaction-limits", + {}, + { renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] }, ], - setRestrictionsForRepo: [ - "PUT /repos/{owner}/{repo}/interaction-limits", - { mediaType: { previews: ["sombra"] } }, + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: [ + "PUT /user/interaction-limits", + {}, + { renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] }, ], }, issues: { @@ -430,7 +528,12 @@ const Endpoints = { { headers: { "content-type": "text/plain; charset=utf-8" } }, ], }, - meta: { get: ["GET /meta"] }, + meta: { + get: ["GET /meta"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"], + }, migrations: { cancelImport: ["DELETE /repos/{owner}/{repo}/import"], deleteArchiveForAuthenticatedUser: [ @@ -493,6 +596,7 @@ const Endpoints = { }, orgs: { blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], @@ -506,9 +610,14 @@ const Endpoints = { getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: [ + "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}", + ], list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listBlockedUsers: ["GET /orgs/{org}/blocks"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], @@ -517,8 +626,12 @@ const Endpoints = { listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPendingInvitations: ["GET /orgs/{org}/invitations"], listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", + ], removeMember: ["DELETE /orgs/{org}/members/{username}"], removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], removeOutsideCollaborator: [ @@ -537,6 +650,75 @@ const Endpoints = { "PATCH /user/memberships/orgs/{org}", ], updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"], + }, + packages: { + deletePackageForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}", + ], + deletePackageForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}", + ], + deletePackageVersionForAuthenticatedUser: [ + "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + deletePackageVersionForOrg: [ + "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + getAllPackageVersionsForAPackageOwnedByAnOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + {}, + { renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] }, + ], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions", + {}, + { + renamed: [ + "packages", + "getAllPackageVersionsForPackageOwnedByAuthenticatedUser", + ], + }, + ], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions", + ], + getAllPackageVersionsForPackageOwnedByOrg: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", + ], + getAllPackageVersionsForPackageOwnedByUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions", + ], + getPackageForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}", + ], + getPackageForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}", + ], + getPackageForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}", + ], + getPackageVersionForAuthenticatedUser: [ + "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + getPackageVersionForOrganization: [ + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + getPackageVersionForUser: [ + "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}", + ], + restorePackageForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/restore{?token}", + ], + restorePackageForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}", + ], + restorePackageVersionForAuthenticatedUser: [ + "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", + ], + restorePackageVersionForOrg: [ + "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", + ], }, projects: { addCollaborator: [ @@ -718,6 +900,10 @@ const Endpoints = { "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", { mediaType: { previews: ["squirrel-girl"] } }, ], + createForRelease: [ + "POST /repos/{owner}/{repo}/releases/{release_id}/reactions", + { mediaType: { previews: ["squirrel-girl"] } }, + ], createForTeamDiscussionCommentInOrg: [ "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", { mediaType: { previews: ["squirrel-girl"] } }, @@ -754,7 +940,7 @@ const Endpoints = { "DELETE /reactions/{reaction_id}", { mediaType: { previews: ["squirrel-girl"] } }, { - deprecated: "octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy", + deprecated: "octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy", }, ], listForCommitComment: [ @@ -811,6 +997,10 @@ const Endpoints = { { mediaType: { previews: ["dorian"] } }, ], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: [ + "GET /repos/{owner}/{repo}/compare/{basehead}", + ], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], createCommitComment: [ "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments", ], @@ -828,6 +1018,9 @@ const Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateEnvironment: [ + "PUT /repos/{owner}/{repo}/environments/{environment_name}", + ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createPagesSite: [ "POST /repos/{owner}/{repo}/pages", @@ -847,6 +1040,10 @@ const Endpoints = { deleteAdminBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", ], + deleteAnEnvironment: [ + "DELETE /repos/{owner}/{repo}/environments/{environment_name}", + ], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], deleteBranchProtection: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection", ], @@ -883,7 +1080,13 @@ const Endpoints = { "DELETE /repos/{owner}/{repo}/vulnerability-alerts", { mediaType: { previews: ["dorian"] } }, ], - downloadArchive: ["GET /repos/{owner}/{repo}/{archive_format}/{ref}"], + downloadArchive: [ + "GET /repos/{owner}/{repo}/zipball/{ref}", + {}, + { renamed: ["repos", "downloadZipballArchive"] }, + ], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], enableAutomatedSecurityFixes: [ "PUT /repos/{owner}/{repo}/automated-security-fixes", { mediaType: { previews: ["london"] } }, @@ -899,6 +1102,7 @@ const Endpoints = { getAdminBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", ], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], getAllStatusCheckContexts: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", ], @@ -909,6 +1113,7 @@ const Endpoints = { getAppsWithAccessToProtectedBranch: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", ], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], getBranchProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection", @@ -926,10 +1131,7 @@ const Endpoints = { "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", { mediaType: { previews: ["zzzax"] } }, ], - getCommunityProfileMetrics: [ - "GET /repos/{owner}/{repo}/community/profile", - { mediaType: { previews: ["black-panther"] } }, - ], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], @@ -937,16 +1139,21 @@ const Endpoints = { getDeploymentStatus: [ "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}", ], + getEnvironment: [ + "GET /repos/{owner}/{repo}/environments/{environment_name}", + ], getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", ], getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], @@ -963,6 +1170,13 @@ const Endpoints = { ], getViews: ["GET /repos/{owner}/{repo}/traffic/views"], getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/config", + ], + getWebhookDelivery: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}", + ], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], listBranches: ["GET /repos/{owner}/{repo}/branches"], listBranchesForHeadCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", @@ -1002,9 +1216,15 @@ const Endpoints = { listReleases: ["GET /repos/{owner}/{repo}/releases"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: [ + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", + ], listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], merge: ["POST /repos/{owner}/{repo}/merges"], pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: [ + "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", + ], removeAppAccessRestrictions: [ "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, @@ -1031,6 +1251,7 @@ const Endpoints = { {}, { mapToData: "users" }, ], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], replaceAllTopics: [ "PUT /repos/{owner}/{repo}/topics", { mediaType: { previews: ["mercy"] } }, @@ -1079,8 +1300,16 @@ const Endpoints = { ], updateStatusCheckPotection: [ "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", + {}, + { renamed: ["repos", "updateStatusCheckProtection"] }, + ], + updateStatusCheckProtection: [ + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", ], updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: [ + "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config", + ], uploadReleaseAsset: [ "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { baseUrl: "https://uploads.github.com" }, @@ -1095,6 +1324,15 @@ const Endpoints = { topics: ["GET /search/topics", { mediaType: { previews: ["mercy"] } }], users: ["GET /search/users"], }, + secretScanning: { + getAlert: [ + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", + ], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + updateAlert: [ + "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", + ], + }, teams: { addOrUpdateMembershipForUserInOrg: [ "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}", @@ -1204,7 +1442,7 @@ const Endpoints = { }, }; -const VERSION = "4.2.0"; +const VERSION = "5.8.0"; function endpointsToMethods(octokit, endpointsMap) { const newMethods = {}; @@ -1267,20 +1505,21 @@ function decorate(octokit, scope, methodName, defaults, decorations) { return Object.assign(withDecorations, requestWithDefaults); } -/** - * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary - * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is - * done, we will remove the registerEndpoints methods and return the methods - * directly as with the other plugins. At that point we will also remove the - * legacy workarounds and deprecations. - * - * See the plan at - * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1 - */ function restEndpointMethods(octokit) { - return endpointsToMethods(octokit, Endpoints); + const api = endpointsToMethods(octokit, Endpoints); + return { + rest: api, + }; } restEndpointMethods.VERSION = VERSION; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return { + ...api, + rest: api, + }; +} +legacyRestEndpointMethods.VERSION = VERSION; -export { restEndpointMethods }; +export { legacyRestEndpointMethods, restEndpointMethods }; //# sourceMappingURL=index.js.map diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map index e3543f4..7287cd7 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/generated/endpoints.js","../dist-src/version.js","../dist-src/endpoints-to-methods.js","../dist-src/index.js"],"sourcesContent":["const Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n cancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\",\n ],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n createRegistrationTokenForOrg: [\n \"POST /orgs/{org}/actions/runners/registration-token\",\n ],\n createRegistrationTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/registration-token\",\n ],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/remove-token\",\n ],\n createWorkflowDispatch: [\n \"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\",\n ],\n deleteArtifact: [\n \"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n deleteSelfHostedRunnerFromOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}\",\n ],\n deleteSelfHostedRunnerFromRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\n \"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n downloadArtifact: [\n \"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\",\n ],\n downloadJobLogsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\",\n ],\n downloadWorkflowRunLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunUsage: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\",\n ],\n getWorkflowUsage: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\",\n ],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listJobsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n ],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n ],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n ],\n listWorkflowRuns: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n ],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\n \"DELETE /notifications/threads/{thread_id}/subscription\",\n ],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\n \"GET /notifications/threads/{thread_id}/subscription\",\n ],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\n \"GET /users/{username}/events/orgs/{org}\",\n ],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\n \"GET /users/{username}/received_events/public\",\n ],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/notifications\",\n ],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\n \"PUT /notifications/threads/{thread_id}/subscription\",\n ],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"],\n },\n apps: {\n addRepoToInstallation: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\n \"POST /content_references/{content_reference_id}/attachments\",\n { mediaType: { previews: [\"corsair\"] } },\n ],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\n \"POST /app/installations/{installation_id}/access_tokens\",\n ],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\n \"GET /marketplace_listing/accounts/{account_id}\",\n ],\n getSubscriptionPlanForAccountStubbed: [\n \"GET /marketplace_listing/stubbed/accounts/{account_id}\",\n ],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n ],\n listInstallationReposForAuthenticatedUser: [\n \"GET /user/installations/{installation_id}/repositories\",\n ],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\n \"GET /user/marketplace_purchases/stubbed\",\n ],\n removeRepoFromInstallation: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\n \"DELETE /app/installations/{installation_id}/suspended\",\n ],\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\n \"GET /users/{username}/settings/billing/actions\",\n ],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\n \"GET /users/{username}/settings/billing/packages\",\n ],\n getSharedStorageBillingOrg: [\n \"GET /orgs/{org}/settings/billing/shared-storage\",\n ],\n getSharedStorageBillingUser: [\n \"GET /users/{username}/settings/billing/shared-storage\",\n ],\n },\n checks: {\n create: [\n \"POST /repos/{owner}/{repo}/check-runs\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n createSuite: [\n \"POST /repos/{owner}/{repo}/check-suites\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n get: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n getSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listAnnotations: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listForSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n listSuitesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n rerequestSuite: [\n \"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n setSuitesPreferences: [\n \"PATCH /repos/{owner}/{repo}/check-suites/preferences\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n update: [\n \"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\",\n { mediaType: { previews: [\"antiope\"] } },\n ],\n },\n codeScanning: {\n getAlert: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n {},\n { renamedParameters: { alert_id: \"alert_number\" } },\n ],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n ],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"],\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\n \"GET /codes_of_conduct\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n getConductCode: [\n \"GET /codes_of_conduct/{key}\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n getForRepo: [\n \"GET /repos/{owner}/{repo}/community/code_of_conduct\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n },\n emojis: { get: [\"GET /emojis\"] },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"],\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"],\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"],\n },\n interactions: {\n getRestrictionsForOrg: [\n \"GET /orgs/{org}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n getRestrictionsForRepo: [\n \"GET /repos/{owner}/{repo}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n removeRestrictionsForOrg: [\n \"DELETE /orgs/{org}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n removeRestrictionsForRepo: [\n \"DELETE /repos/{owner}/{repo}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n setRestrictionsForOrg: [\n \"PUT /orgs/{org}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n setRestrictionsForRepo: [\n \"PUT /repos/{owner}/{repo}/interaction-limits\",\n { mediaType: { previews: [\"sombra\"] } },\n ],\n },\n issues: {\n addAssignees: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n ],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\",\n ],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\n \"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n { mediaType: { previews: [\"mockingbird\"] } },\n ],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n ],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n removeAssignees: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n removeLabel: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\",\n ],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\n \"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"],\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\n \"POST /markdown/raw\",\n { headers: { \"content-type\": \"text/plain; charset=utf-8\" } },\n ],\n },\n meta: { get: [\"GET /meta\"] },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n deleteArchiveForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n downloadArchiveForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getArchiveForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getStatusForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForAuthenticatedUser: [\n \"GET /user/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n unlockRepoForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"],\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\n \"PUT /orgs/{org}/outside_collaborators/{username}\",\n ],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\n \"DELETE /orgs/{org}/outside_collaborators/{username}\",\n ],\n removePublicMembershipForAuthenticatedUser: [\n \"DELETE /orgs/{org}/public_members/{username}\",\n ],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\n \"PUT /orgs/{org}/public_members/{username}\",\n ],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\n \"PATCH /user/memberships/orgs/{org}\",\n ],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n },\n projects: {\n addCollaborator: [\n \"PUT /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createCard: [\n \"POST /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createColumn: [\n \"POST /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForAuthenticatedUser: [\n \"POST /user/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForOrg: [\n \"POST /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForRepo: [\n \"POST /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n delete: [\n \"DELETE /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteCard: [\n \"DELETE /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteColumn: [\n \"DELETE /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n get: [\n \"GET /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getCard: [\n \"GET /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getColumn: [\n \"GET /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getPermissionForUser: [\n \"GET /projects/{project_id}/collaborators/{username}/permission\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCards: [\n \"GET /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCollaborators: [\n \"GET /projects/{project_id}/collaborators\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listColumns: [\n \"GET /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForRepo: [\n \"GET /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForUser: [\n \"GET /users/{username}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveCard: [\n \"POST /projects/columns/cards/{card_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveColumn: [\n \"POST /projects/columns/{column_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n removeCollaborator: [\n \"DELETE /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n update: [\n \"PATCH /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateCard: [\n \"PATCH /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateColumn: [\n \"PATCH /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\",\n ],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n deletePendingReview: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n deleteReviewComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n dismissReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\",\n ],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n listReviewComments: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n requestReviewers: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n submitReview: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\",\n { mediaType: { previews: [\"lydian\"] } },\n ],\n updateReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n updateReviewComment: [\n \"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n },\n rateLimit: { get: [\"GET /rate_limit\"] },\n reactions: {\n createForCommitComment: [\n \"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssueComment: [\n \"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForPullRequestReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForCommitComment: [\n \"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssueComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForPullRequestComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussion: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussionComment: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteLegacy: [\n \"DELETE /reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n {\n deprecated: \"octokit.reactions.deleteLegacy() is deprecated, see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy\",\n },\n ],\n listForCommitComment: [\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssueComment: [\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForPullRequestReviewComment: [\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n addTeamAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n addUserAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\n \"GET /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n createCommitComment: [\n \"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n createCommitSignatureProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\n \"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\n \"POST /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\n \"POST /repos/{template_owner}/{template_repo}/generate\",\n { mediaType: { previews: [\"baptiste\"] } },\n ],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n deleteAdminBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n deleteBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\n \"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\",\n ],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\n \"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n deletePagesSite: [\n \"DELETE /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n deletePullRequestReviewProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\n \"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\n \"DELETE /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n disableVulnerabilityAlerts: [\n \"DELETE /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n downloadArchive: [\"GET /repos/{owner}/{repo}/{archive_format}/{ref}\"],\n enableAutomatedSecurityFixes: [\n \"PUT /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n enableVulnerabilityAlerts: [\n \"PUT /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n getAdminBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n getAllStatusCheckContexts: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n ],\n getAllTopics: [\n \"GET /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n getAppsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n ],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\n \"GET /repos/{owner}/{repo}/collaborators/{username}/permission\",\n ],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n getCommunityProfileMetrics: [\n \"GET /repos/{owner}/{repo}/community/profile\",\n { mediaType: { previews: [\"black-panther\"] } },\n ],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\",\n ],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n getTeamsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n ],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n ],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listReleaseAssets: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n ],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n removeAppAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n removeCollaborator: [\n \"DELETE /repos/{owner}/{repo}/collaborators/{username}\",\n ],\n removeStatusCheckContexts: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n removeStatusCheckProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n removeTeamAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n removeUserAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n replaceAllTopics: [\n \"PUT /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n setAppAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n setStatusCheckContexts: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n setTeamAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n setUserAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\n \"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n updatePullRequestReviewProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\n \"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n updateStatusCheckPotection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n uploadReleaseAsset: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\",\n { baseUrl: \"https://uploads.github.com\" },\n ],\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\", { mediaType: { previews: [\"cloak\"] } }],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", { mediaType: { previews: [\"mercy\"] } }],\n users: [\"GET /search/users\"],\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n addOrUpdateProjectPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n addOrUpdateRepoPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n checkPermissionsForProjectInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n checkPermissionsForRepoInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n deleteDiscussionInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n getDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n getMembershipForUserInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n ],\n listProjectsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n removeProjectInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n ],\n removeRepoInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n updateDiscussionCommentInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n updateDiscussionInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"],\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"],\n },\n};\nexport default Endpoints;\n","export const VERSION = \"4.2.0\";\n","export function endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({ method, url }, defaults);\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n const scopeMethods = newMethods[scope];\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined,\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n","import ENDPOINTS from \"./generated/endpoints\";\nimport { VERSION } from \"./version\";\nimport { endpointsToMethods } from \"./endpoints-to-methods\";\n/**\n * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary\n * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is\n * done, we will remove the registerEndpoints methods and return the methods\n * directly as with the other plugins. At that point we will also remove the\n * legacy workarounds and deprecations.\n *\n * See the plan at\n * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1\n */\nexport function restEndpointMethods(octokit) {\n return endpointsToMethods(octokit, ENDPOINTS);\n}\nrestEndpointMethods.VERSION = VERSION;\n"],"names":["ENDPOINTS"],"mappings":"AAAA,MAAM,SAAS,GAAG;AAClB,IAAI,OAAO,EAAE;AACb,QAAQ,0BAA0B,EAAE;AACpC,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,+CAA+C,CAAC;AAClF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,+DAA+D;AAC3E,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,+CAA+C,CAAC;AAClF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,uEAAuE;AACnF,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,8DAA8D;AAC1E,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,kDAAkD,CAAC;AAC7E,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,gDAAgD;AAC5D,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,oDAAoD,CAAC;AACjF,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,uBAAuB,EAAE;AACjC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,2DAA2D,CAAC;AAClF,QAAQ,oBAAoB,EAAE,CAAC,iDAAiD,CAAC;AACjF,QAAQ,eAAe,EAAE,CAAC,4CAA4C,CAAC;AACvE,QAAQ,YAAY,EAAE,CAAC,+CAA+C,CAAC;AACvE,QAAQ,gBAAgB,EAAE,CAAC,sDAAsD,CAAC;AAClF,QAAQ,aAAa,EAAE,CAAC,yDAAyD,CAAC;AAClF,QAAQ,yBAAyB,EAAE,CAAC,6CAA6C,CAAC;AAClF,QAAQ,0BAA0B,EAAE;AACpC,YAAY,uDAAuD;AACnE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,2DAA2D,CAAC;AAClF,QAAQ,cAAc,EAAE,CAAC,iDAAiD,CAAC;AAC3E,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,kEAAkE;AAC9E,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,6CAA6C,CAAC;AAC7E,QAAQ,sBAAsB,EAAE;AAChC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,iCAAiC,CAAC;AAC3D,QAAQ,eAAe,EAAE,CAAC,2CAA2C,CAAC;AACtE,QAAQ,iBAAiB,EAAE,CAAC,6CAA6C,CAAC;AAC1E,QAAQ,4BAA4B,EAAE,CAAC,2CAA2C,CAAC;AACnF,QAAQ,6BAA6B,EAAE;AACvC,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,2BAA2B,EAAE,CAAC,iCAAiC,CAAC;AACxE,QAAQ,4BAA4B,EAAE,CAAC,2CAA2C,CAAC;AACnF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,wCAAwC,CAAC;AAC3E,QAAQ,aAAa,EAAE,CAAC,wDAAwD,CAAC;AACjF,QAAQ,+BAA+B,EAAE;AACzC,YAAY,+EAA+E;AAC3F,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,4DAA4D;AACxE,SAAS;AACT,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,qCAAqC,EAAE,CAAC,kCAAkC,CAAC;AACnF,QAAQ,sBAAsB,EAAE,CAAC,2CAA2C,CAAC;AAC7E,QAAQ,wBAAwB,EAAE;AAClC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,QAAQ,EAAE,CAAC,YAAY,CAAC;AAChC,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,SAAS,EAAE,CAAC,wCAAwC,CAAC;AAC7D,QAAQ,yCAAyC,EAAE;AACnD,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,8BAA8B,EAAE,CAAC,8BAA8B,CAAC;AACxE,QAAQ,qCAAqC,EAAE,CAAC,oBAAoB,CAAC;AACrE,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,yCAAyC;AACrD,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,aAAa,CAAC;AACzC,QAAQ,8BAA8B,EAAE,CAAC,qCAAqC,CAAC;AAC/E,QAAQ,uBAAuB,EAAE,CAAC,qCAAqC,CAAC;AACxE,QAAQ,mBAAmB,EAAE,CAAC,wBAAwB,CAAC;AACvD,QAAQ,yBAAyB,EAAE,CAAC,uCAAuC,CAAC;AAC5E,QAAQ,+BAA+B,EAAE;AACzC,YAAY,8CAA8C;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,kCAAkC,CAAC;AAC5D,QAAQ,yCAAyC,EAAE;AACnD,YAAY,yCAAyC;AACrD,SAAS;AACT,QAAQ,mCAAmC,EAAE,CAAC,mBAAmB,CAAC;AAClE,QAAQ,sBAAsB,EAAE,CAAC,+BAA+B,CAAC;AACjE,QAAQ,sBAAsB,EAAE,CAAC,qCAAqC,CAAC;AACvE,QAAQ,qBAAqB,EAAE,CAAC,sCAAsC,CAAC;AACvE,QAAQ,oCAAoC,EAAE,CAAC,yBAAyB,CAAC;AACzE,QAAQ,mBAAmB,EAAE,CAAC,uCAAuC,CAAC;AACtE,QAAQ,uBAAuB,EAAE,CAAC,oBAAoB,CAAC;AACvD,QAAQ,2BAA2B,EAAE,CAAC,yCAAyC,CAAC;AAChF,QAAQ,gBAAgB,EAAE,CAAC,0CAA0C,CAAC;AACtE,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,4BAA4B,EAAE,CAAC,kCAAkC,CAAC;AAC1E,QAAQ,8BAA8B,EAAE,CAAC,qCAAqC,CAAC;AAC/E,KAAK;AACL,IAAI,IAAI,EAAE;AACV,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,wEAAwE;AACpF,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,sCAAsC,CAAC;AAC5D,QAAQ,uBAAuB,EAAE;AACjC,YAAY,6DAA6D;AACzE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,kBAAkB,EAAE,CAAC,wCAAwC,CAAC;AACtE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,kBAAkB,EAAE,CAAC,6CAA6C,CAAC;AAC3E,QAAQ,WAAW,EAAE,CAAC,wCAAwC,CAAC;AAC/D,QAAQ,gBAAgB,EAAE,CAAC,UAAU,CAAC;AACtC,QAAQ,SAAS,EAAE,CAAC,sBAAsB,CAAC;AAC3C,QAAQ,eAAe,EAAE,CAAC,0CAA0C,CAAC;AACrE,QAAQ,kBAAkB,EAAE,CAAC,8BAA8B,CAAC;AAC5D,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,gDAAgD;AAC5D,SAAS;AACT,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,oCAAoC,CAAC;AACnE,QAAQ,mBAAmB,EAAE,CAAC,mDAAmD,CAAC;AAClF,QAAQ,0BAA0B,EAAE;AACpC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,yCAAyC,EAAE;AACnD,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,wBAAwB,CAAC;AACrD,QAAQ,qCAAqC,EAAE,CAAC,yBAAyB,CAAC;AAC1E,QAAQ,SAAS,EAAE,CAAC,gCAAgC,CAAC;AACrD,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,iCAAiC,EAAE,CAAC,gCAAgC,CAAC;AAC7E,QAAQ,qCAAqC,EAAE,CAAC,iCAAiC,CAAC;AAClF,QAAQ,4CAA4C,EAAE;AACtD,YAAY,yCAAyC;AACrD,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,uCAAuC,CAAC;AAC7D,QAAQ,6BAA6B,EAAE,CAAC,4BAA4B,CAAC;AACrE,QAAQ,mBAAmB,EAAE,CAAC,oDAAoD,CAAC;AACnF,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,uDAAuD;AACnE,SAAS;AACT,KAAK;AACL,IAAI,OAAO,EAAE;AACb,QAAQ,0BAA0B,EAAE,CAAC,0CAA0C,CAAC;AAChF,QAAQ,2BAA2B,EAAE;AACrC,YAAY,gDAAgD;AAC5D,SAAS;AACT,QAAQ,2BAA2B,EAAE,CAAC,2CAA2C,CAAC;AAClF,QAAQ,4BAA4B,EAAE;AACtC,YAAY,iDAAiD;AAC7D,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,iDAAiD;AAC7D,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,uDAAuD;AACnE,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,QAAQ,MAAM,EAAE;AAChB,YAAY,uCAAuC;AACnD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,yCAAyC;AACrD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,GAAG,EAAE;AACb,YAAY,qDAAqD;AACjE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,QAAQ,EAAE;AAClB,YAAY,yDAAyD;AACrE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,iEAAiE;AAC7E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,oDAAoD;AAChE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,oEAAoE;AAChF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,sDAAsD;AAClE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,oEAAoE;AAChF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,sDAAsD;AAClE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,MAAM,EAAE;AAChB,YAAY,uDAAuD;AACnE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,KAAK;AACL,IAAI,YAAY,EAAE;AAClB,QAAQ,QAAQ,EAAE;AAClB,YAAY,+DAA+D;AAC3E,YAAY,EAAE;AACd,YAAY,EAAE,iBAAiB,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE;AAC/D,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,gDAAgD,CAAC;AAC7E,QAAQ,kBAAkB,EAAE,CAAC,kDAAkD,CAAC;AAChF,QAAQ,WAAW,EAAE;AACrB,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,iDAAiD,CAAC;AACxE,KAAK;AACL,IAAI,cAAc,EAAE;AACpB,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,uBAAuB;AACnC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,6BAA6B;AACzC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,qDAAqD;AACjE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE;AACpC,IAAI,KAAK,EAAE;AACX,QAAQ,cAAc,EAAE,CAAC,2BAA2B,CAAC;AACrD,QAAQ,MAAM,EAAE,CAAC,aAAa,CAAC;AAC/B,QAAQ,aAAa,EAAE,CAAC,gCAAgC,CAAC;AACzD,QAAQ,MAAM,EAAE,CAAC,yBAAyB,CAAC;AAC3C,QAAQ,aAAa,EAAE,CAAC,+CAA+C,CAAC;AACxE,QAAQ,IAAI,EAAE,CAAC,6BAA6B,CAAC;AAC7C,QAAQ,GAAG,EAAE,CAAC,sBAAsB,CAAC;AACrC,QAAQ,UAAU,EAAE,CAAC,4CAA4C,CAAC;AAClE,QAAQ,WAAW,EAAE,CAAC,4BAA4B,CAAC;AACnD,QAAQ,IAAI,EAAE,CAAC,YAAY,CAAC;AAC5B,QAAQ,YAAY,EAAE,CAAC,+BAA+B,CAAC;AACvD,QAAQ,WAAW,EAAE,CAAC,8BAA8B,CAAC;AACrD,QAAQ,WAAW,EAAE,CAAC,6BAA6B,CAAC;AACpD,QAAQ,SAAS,EAAE,CAAC,4BAA4B,CAAC;AACjD,QAAQ,UAAU,EAAE,CAAC,mBAAmB,CAAC;AACzC,QAAQ,WAAW,EAAE,CAAC,oBAAoB,CAAC;AAC3C,QAAQ,IAAI,EAAE,CAAC,2BAA2B,CAAC;AAC3C,QAAQ,MAAM,EAAE,CAAC,8BAA8B,CAAC;AAChD,QAAQ,MAAM,EAAE,CAAC,wBAAwB,CAAC;AAC1C,QAAQ,aAAa,EAAE,CAAC,8CAA8C,CAAC;AACvE,KAAK;AACL,IAAI,GAAG,EAAE;AACT,QAAQ,UAAU,EAAE,CAAC,sCAAsC,CAAC;AAC5D,QAAQ,YAAY,EAAE,CAAC,wCAAwC,CAAC;AAChE,QAAQ,SAAS,EAAE,CAAC,qCAAqC,CAAC;AAC1D,QAAQ,SAAS,EAAE,CAAC,qCAAqC,CAAC;AAC1D,QAAQ,UAAU,EAAE,CAAC,sCAAsC,CAAC;AAC5D,QAAQ,SAAS,EAAE,CAAC,6CAA6C,CAAC;AAClE,QAAQ,OAAO,EAAE,CAAC,gDAAgD,CAAC;AACnE,QAAQ,SAAS,EAAE,CAAC,oDAAoD,CAAC;AACzE,QAAQ,MAAM,EAAE,CAAC,yCAAyC,CAAC;AAC3D,QAAQ,MAAM,EAAE,CAAC,8CAA8C,CAAC;AAChE,QAAQ,OAAO,EAAE,CAAC,gDAAgD,CAAC;AACnE,QAAQ,gBAAgB,EAAE,CAAC,mDAAmD,CAAC;AAC/E,QAAQ,SAAS,EAAE,CAAC,4CAA4C,CAAC;AACjE,KAAK;AACL,IAAI,SAAS,EAAE;AACf,QAAQ,eAAe,EAAE,CAAC,0BAA0B,CAAC;AACrD,QAAQ,WAAW,EAAE,CAAC,iCAAiC,CAAC;AACxD,KAAK;AACL,IAAI,YAAY,EAAE;AAClB,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,8CAA8C;AAC1D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,uCAAuC;AACnD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,iDAAiD;AAC7D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,8CAA8C;AAC1D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,QAAQ,YAAY,EAAE;AACtB,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,yDAAyD,CAAC;AAC9E,QAAQ,sBAAsB,EAAE,CAAC,gDAAgD,CAAC;AAClF,QAAQ,MAAM,EAAE,CAAC,mCAAmC,CAAC;AACrD,QAAQ,aAAa,EAAE;AACvB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,mCAAmC,CAAC;AAC1D,QAAQ,eAAe,EAAE,CAAC,uCAAuC,CAAC;AAClE,QAAQ,aAAa,EAAE;AACvB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,4CAA4C,CAAC;AACnE,QAAQ,eAAe,EAAE;AACzB,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,GAAG,EAAE,CAAC,iDAAiD,CAAC;AAChE,QAAQ,UAAU,EAAE,CAAC,wDAAwD,CAAC;AAC9E,QAAQ,QAAQ,EAAE,CAAC,oDAAoD,CAAC;AACxE,QAAQ,QAAQ,EAAE,CAAC,yCAAyC,CAAC;AAC7D,QAAQ,YAAY,EAAE,CAAC,yDAAyD,CAAC;AACjF,QAAQ,IAAI,EAAE,CAAC,aAAa,CAAC;AAC7B,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,YAAY,EAAE,CAAC,0DAA0D,CAAC;AAClF,QAAQ,mBAAmB,EAAE,CAAC,2CAA2C,CAAC;AAC1E,QAAQ,UAAU,EAAE,CAAC,wDAAwD,CAAC;AAC9E,QAAQ,iBAAiB,EAAE,CAAC,yCAAyC,CAAC;AACtE,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,0DAA0D;AACtE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;AACxD,SAAS;AACT,QAAQ,wBAAwB,EAAE,CAAC,kBAAkB,CAAC;AACtD,QAAQ,UAAU,EAAE,CAAC,wBAAwB,CAAC;AAC9C,QAAQ,WAAW,EAAE,CAAC,kCAAkC,CAAC;AACzD,QAAQ,sBAAsB,EAAE;AAChC,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,kCAAkC,CAAC;AAC/D,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,sCAAsC,CAAC;AAChE,QAAQ,IAAI,EAAE,CAAC,sDAAsD,CAAC;AACtE,QAAQ,eAAe,EAAE;AACzB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,8DAA8D;AAC1E,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,kEAAkE;AAC9E,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,wDAAwD,CAAC;AAC7E,QAAQ,MAAM,EAAE,CAAC,yDAAyD,CAAC;AAC3E,QAAQ,MAAM,EAAE,CAAC,mDAAmD,CAAC;AACrE,QAAQ,aAAa,EAAE,CAAC,0DAA0D,CAAC;AACnF,QAAQ,WAAW,EAAE,CAAC,2CAA2C,CAAC;AAClE,QAAQ,eAAe,EAAE;AACzB,YAAY,2DAA2D;AACvE,SAAS;AACT,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,GAAG,EAAE,CAAC,yBAAyB,CAAC;AACxC,QAAQ,kBAAkB,EAAE,CAAC,eAAe,CAAC;AAC7C,QAAQ,UAAU,EAAE,CAAC,mCAAmC,CAAC;AACzD,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,MAAM,EAAE,CAAC,gBAAgB,CAAC;AAClC,QAAQ,SAAS,EAAE;AACnB,YAAY,oBAAoB;AAChC,YAAY,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,2BAA2B,EAAE,EAAE;AACxE,SAAS;AACT,KAAK;AACL,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE;AAChC,IAAI,UAAU,EAAE;AAChB,QAAQ,YAAY,EAAE,CAAC,qCAAqC,CAAC;AAC7D,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,gDAAgD;AAC5D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,sDAAsD;AAClE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,mDAAmD;AAC/D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,6CAA6C;AACzD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,0CAA0C,CAAC;AACtE,QAAQ,eAAe,EAAE,CAAC,kCAAkC,CAAC;AAC7D,QAAQ,aAAa,EAAE,CAAC,8CAA8C,CAAC;AACvE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,2CAA2C;AACvD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,sBAAsB;AAClC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,4BAA4B;AACxC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,wDAAwD;AACpE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,kDAAkD;AAC9D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,wDAAwD,CAAC;AACnF,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,yBAAyB,EAAE,CAAC,uBAAuB,CAAC;AAC5D,QAAQ,WAAW,EAAE,CAAC,6BAA6B,CAAC;AACpD,QAAQ,WAAW,EAAE,CAAC,kCAAkC,CAAC;AACzD,QAAQ,8BAA8B,EAAE;AACxC,YAAY,+DAA+D;AAC3E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,qEAAqE;AACjF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,oCAAoC,CAAC;AAC5D,KAAK;AACL,IAAI,IAAI,EAAE;AACV,QAAQ,SAAS,EAAE,CAAC,mCAAmC,CAAC;AACxD,QAAQ,gBAAgB,EAAE,CAAC,mCAAmC,CAAC;AAC/D,QAAQ,sBAAsB,EAAE,CAAC,oCAAoC,CAAC;AACtE,QAAQ,4BAA4B,EAAE,CAAC,2CAA2C,CAAC;AACnF,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,8BAA8B,CAAC;AAC1D,QAAQ,aAAa,EAAE,CAAC,wBAAwB,CAAC;AACjD,QAAQ,aAAa,EAAE,CAAC,oCAAoC,CAAC;AAC7D,QAAQ,GAAG,EAAE,CAAC,iBAAiB,CAAC;AAChC,QAAQ,iCAAiC,EAAE,CAAC,kCAAkC,CAAC;AAC/E,QAAQ,oBAAoB,EAAE,CAAC,wCAAwC,CAAC;AACxE,QAAQ,UAAU,EAAE,CAAC,iCAAiC,CAAC;AACvD,QAAQ,IAAI,EAAE,CAAC,oBAAoB,CAAC;AACpC,QAAQ,oBAAoB,EAAE,CAAC,+BAA+B,CAAC;AAC/D,QAAQ,gBAAgB,EAAE,CAAC,wBAAwB,CAAC;AACpD,QAAQ,wBAAwB,EAAE,CAAC,gBAAgB,CAAC;AACpD,QAAQ,WAAW,EAAE,CAAC,4BAA4B,CAAC;AACnD,QAAQ,mBAAmB,EAAE,CAAC,mDAAmD,CAAC;AAClF,QAAQ,WAAW,EAAE,CAAC,yBAAyB,CAAC;AAChD,QAAQ,mCAAmC,EAAE,CAAC,4BAA4B,CAAC;AAC3E,QAAQ,wBAAwB,EAAE,CAAC,uCAAuC,CAAC;AAC3E,QAAQ,sBAAsB,EAAE,CAAC,6BAA6B,CAAC;AAC/D,QAAQ,iBAAiB,EAAE,CAAC,gCAAgC,CAAC;AAC7D,QAAQ,YAAY,EAAE,CAAC,uBAAuB,CAAC;AAC/C,QAAQ,WAAW,EAAE,CAAC,wCAAwC,CAAC;AAC/D,QAAQ,YAAY,EAAE,CAAC,uCAAuC,CAAC;AAC/D,QAAQ,uBAAuB,EAAE,CAAC,2CAA2C,CAAC;AAC9E,QAAQ,yBAAyB,EAAE;AACnC,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,0CAA0C,EAAE;AACpD,YAAY,8CAA8C;AAC1D,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,wCAAwC,CAAC;AACxE,QAAQ,uCAAuC,EAAE;AACjD,YAAY,2CAA2C;AACvD,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,sCAAsC,CAAC;AAC7D,QAAQ,MAAM,EAAE,CAAC,mBAAmB,CAAC;AACrC,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,oCAAoC;AAChD,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,mCAAmC,CAAC;AAC5D,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,eAAe,EAAE;AACzB,YAAY,qDAAqD;AACjE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,qBAAqB;AACjC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,2BAA2B;AACvC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,aAAa,EAAE;AACvB,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,MAAM,EAAE;AAChB,YAAY,+BAA+B;AAC3C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,sCAAsC;AAClD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,GAAG,EAAE;AACb,YAAY,4BAA4B;AACxC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,OAAO,EAAE;AACjB,YAAY,uCAAuC;AACnD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,SAAS,EAAE;AACnB,YAAY,mCAAmC;AAC/C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,gEAAgE;AAC5E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,SAAS,EAAE;AACnB,YAAY,yCAAyC;AACrD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0BAA0B;AACtC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,gCAAgC;AAC5C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,QAAQ,EAAE;AAClB,YAAY,8CAA8C;AAC1D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,wDAAwD;AACpE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,MAAM,EAAE;AAChB,YAAY,8BAA8B;AAC1C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,yCAAyC;AACrD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,aAAa,EAAE,CAAC,qDAAqD,CAAC;AAC9E,QAAQ,MAAM,EAAE,CAAC,kCAAkC,CAAC;AACpD,QAAQ,2BAA2B,EAAE;AACrC,YAAY,8EAA8E;AAC1F,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,wDAAwD,CAAC;AAChF,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,aAAa,EAAE;AACvB,YAAY,8EAA8E;AAC1F,SAAS;AACT,QAAQ,GAAG,EAAE,CAAC,+CAA+C,CAAC;AAC9D,QAAQ,SAAS,EAAE;AACnB,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,uDAAuD,CAAC;AACnF,QAAQ,IAAI,EAAE,CAAC,iCAAiC,CAAC;AACjD,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,uDAAuD,CAAC;AAC9E,QAAQ,SAAS,EAAE,CAAC,qDAAqD,CAAC;AAC1E,QAAQ,sBAAsB,EAAE;AAChC,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,yBAAyB,EAAE,CAAC,0CAA0C,CAAC;AAC/E,QAAQ,WAAW,EAAE,CAAC,uDAAuD,CAAC;AAC9E,QAAQ,KAAK,EAAE,CAAC,qDAAqD,CAAC;AACtE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,MAAM,EAAE,CAAC,iDAAiD,CAAC;AACnE,QAAQ,YAAY,EAAE;AACtB,YAAY,6DAA6D;AACzE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,yDAAyD;AACrE,SAAS;AACT,KAAK;AACL,IAAI,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE;AAC3C,IAAI,SAAS,EAAE;AACf,QAAQ,sBAAsB,EAAE;AAChC,YAAY,4DAA4D;AACxE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,4DAA4D;AACxE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,mEAAmE;AAC/E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,kEAAkE;AAC9E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,mCAAmC,EAAE;AAC7C,YAAY,wGAAwG;AACpH,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,8EAA8E;AAC1F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,4EAA4E;AACxF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,4EAA4E;AACxF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,mFAAmF;AAC/F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,kFAAkF;AAC9F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,uBAAuB,EAAE;AACjC,YAAY,8FAA8F;AAC1G,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,wHAAwH;AACpI,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,iCAAiC;AAC7C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,YAAY;AACZ,gBAAgB,UAAU,EAAE,yHAAyH;AACrJ,aAAa;AACb,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,2DAA2D;AACvE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,2DAA2D;AACvE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,kEAAkE;AAC9E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,iEAAiE;AAC7E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,uGAAuG;AACnH,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,6EAA6E;AACzF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,gBAAgB,EAAE,CAAC,oDAAoD,CAAC;AAChF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,2EAA2E;AACvF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AACjC,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,oDAAoD,CAAC;AAC/E,QAAQ,sBAAsB,EAAE;AAChC,YAAY,yFAAyF;AACrG,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;AACrC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,4EAA4E;AACxF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,4EAA4E;AACxF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,oDAAoD,CAAC;AACjF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,gDAAgD;AAC5D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,mDAAmD,CAAC;AAC7E,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,6EAA6E;AACzF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,kBAAkB,EAAE,CAAC,2CAA2C,CAAC;AACzE,QAAQ,eAAe,EAAE,CAAC,iCAAiC,CAAC;AAC5D,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,sBAAsB,EAAE;AAChC,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,uCAAuC,CAAC;AACtE,QAAQ,0BAA0B,EAAE,CAAC,kBAAkB,CAAC;AACxD,QAAQ,UAAU,EAAE,CAAC,kCAAkC,CAAC;AACxD,QAAQ,WAAW,EAAE,CAAC,wBAAwB,CAAC;AAC/C,QAAQ,0BAA0B,EAAE,CAAC,2CAA2C,CAAC;AACjF,QAAQ,eAAe,EAAE;AACzB,YAAY,kCAAkC;AAC9C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;AACvD,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,uDAAuD;AACnE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE;AACrD,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,kCAAkC,CAAC;AAC3D,QAAQ,iBAAiB,EAAE,CAAC,qDAAqD,CAAC;AAClF,QAAQ,MAAM,EAAE,CAAC,8BAA8B,CAAC;AAChD,QAAQ,wBAAwB,EAAE;AAClC,YAAY,wEAAwE;AACpF,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,0EAA0E;AACtF,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,oDAAoD,CAAC;AACnF,QAAQ,+BAA+B,EAAE;AACzC,YAAY,+EAA+E;AAC3F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,4CAA4C,CAAC;AACvE,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,8CAA8C,CAAC;AACpE,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;AACvD,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,yFAAyF;AACrG,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,oDAAoD,CAAC;AAC7E,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,8CAA8C,CAAC;AACvE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,uDAAuD;AACnE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,mDAAmD;AAC/D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,kDAAkD,CAAC;AAC7E,QAAQ,4BAA4B,EAAE;AACtC,YAAY,oDAAoD;AAChE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,gDAAgD;AAC5D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,GAAG,EAAE,CAAC,2BAA2B,CAAC;AAC1C,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,qEAAqE;AACjF,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,uEAAuE;AACnF,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,wFAAwF;AACpG,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,kCAAkC;AAC9C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,0EAA0E;AACtF,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,6CAA6C,CAAC;AAClE,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,0CAA0C,CAAC;AAC/D,QAAQ,qBAAqB,EAAE,CAAC,gDAAgD,CAAC;AACjF,QAAQ,8BAA8B,EAAE;AACxC,YAAY,+DAA+D;AAC3E,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,gDAAgD,CAAC;AACnF,QAAQ,SAAS,EAAE,CAAC,yCAAyC,CAAC;AAC9D,QAAQ,sBAAsB,EAAE,CAAC,iDAAiD,CAAC;AACnF,QAAQ,gBAAgB,EAAE,CAAC,iDAAiD,CAAC;AAC7E,QAAQ,4BAA4B,EAAE;AACtC,YAAY,4EAA4E;AACxF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,6CAA6C;AACzD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,2CAA2C,CAAC;AACjE,QAAQ,oBAAoB,EAAE,CAAC,8CAA8C,CAAC;AAC9E,QAAQ,YAAY,EAAE,CAAC,yCAAyC,CAAC;AACjE,QAAQ,aAAa,EAAE,CAAC,uDAAuD,CAAC;AAChF,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,+CAA+C,CAAC;AAC9E,QAAQ,gBAAgB,EAAE,CAAC,2CAA2C,CAAC;AACvE,QAAQ,QAAQ,EAAE,CAAC,iCAAiC,CAAC;AACrD,QAAQ,aAAa,EAAE,CAAC,mDAAmD,CAAC;AAC5E,QAAQ,qBAAqB,EAAE,CAAC,+CAA+C,CAAC;AAChF,QAAQ,8BAA8B,EAAE;AACxC,YAAY,sFAAsF;AAClG,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,4CAA4C,CAAC;AACzE,QAAQ,SAAS,EAAE,CAAC,kCAAkC,CAAC;AACvD,QAAQ,UAAU,EAAE,CAAC,iDAAiD,CAAC;AACvE,QAAQ,eAAe,EAAE,CAAC,sDAAsD,CAAC;AACjF,QAAQ,eAAe,EAAE,CAAC,+CAA+C,CAAC;AAC1E,QAAQ,yBAAyB,EAAE;AACnC,YAAY,+EAA+E;AAC3F,SAAS;AACT,QAAQ,mCAAmC,EAAE;AAC7C,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,iDAAiD,CAAC;AACxE,QAAQ,eAAe,EAAE,CAAC,qDAAqD,CAAC;AAChF,QAAQ,mCAAmC,EAAE;AAC7C,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,QAAQ,EAAE,CAAC,yCAAyC,CAAC;AAC7D,QAAQ,UAAU,EAAE,CAAC,2CAA2C,CAAC;AACjE,QAAQ,YAAY,EAAE,CAAC,oCAAoC,CAAC;AAC5D,QAAQ,yBAAyB,EAAE;AACnC,YAAY,oEAAoE;AAChF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,yCAAyC,CAAC;AACtE,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,yBAAyB,EAAE,CAAC,oCAAoC,CAAC;AACzE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,mCAAmC,CAAC;AAC1D,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,cAAc,EAAE,CAAC,gCAAgC,CAAC;AAC1D,QAAQ,sBAAsB,EAAE;AAChC,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,uCAAuC,CAAC;AAClE,QAAQ,wBAAwB,EAAE,CAAC,iBAAiB,CAAC;AACrD,QAAQ,UAAU,EAAE,CAAC,uBAAuB,CAAC;AAC7C,QAAQ,WAAW,EAAE,CAAC,6BAA6B,CAAC;AACpD,QAAQ,SAAS,EAAE,CAAC,iCAAiC,CAAC;AACtD,QAAQ,eAAe,EAAE,CAAC,uCAAuC,CAAC;AAClE,QAAQ,mCAAmC,EAAE,CAAC,kCAAkC,CAAC;AACjF,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,eAAe,EAAE,CAAC,wCAAwC,CAAC;AACnE,QAAQ,UAAU,EAAE,CAAC,mBAAmB,CAAC;AACzC,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,sDAAsD;AAClE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,oCAAoC,CAAC;AAC5D,QAAQ,QAAQ,EAAE,CAAC,gCAAgC,CAAC;AACpD,QAAQ,SAAS,EAAE,CAAC,iCAAiC,CAAC;AACtD,QAAQ,YAAY,EAAE,CAAC,iCAAiC,CAAC;AACzD,QAAQ,KAAK,EAAE,CAAC,mCAAmC,CAAC;AACpD,QAAQ,WAAW,EAAE,CAAC,kDAAkD,CAAC;AACzE,QAAQ,2BAA2B,EAAE;AACrC,YAAY,6EAA6E;AACzF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AACjC,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,uDAAuD;AACnE,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2FAA2F;AACvG,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;AACrC,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,kFAAkF;AAC9F,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,8EAA8E;AAC1F,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,8EAA8E;AAC1F,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,kCAAkC;AAC9C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,yCAAyC,CAAC;AACtE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,wEAAwE;AACpF,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,0EAA0E;AACtF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AACjC,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,wFAAwF;AACpG,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;AACrC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2EAA2E;AACvF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2EAA2E;AACvF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,kDAAkD,CAAC;AAC7E,QAAQ,QAAQ,EAAE,CAAC,qCAAqC,CAAC;AACzD,QAAQ,MAAM,EAAE,CAAC,6BAA6B,CAAC;AAC/C,QAAQ,sBAAsB,EAAE;AAChC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,mDAAmD,CAAC;AAClF,QAAQ,+BAA+B,EAAE,CAAC,iCAAiC,CAAC;AAC5E,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,wFAAwF;AACpG,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,mDAAmD,CAAC;AAC5E,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,iFAAiF;AAC7F,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,6CAA6C,CAAC;AACtE,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,sEAAsE;AAClF,YAAY,EAAE,OAAO,EAAE,4BAA4B,EAAE;AACrD,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,QAAQ,IAAI,EAAE,CAAC,kBAAkB,CAAC;AAClC,QAAQ,OAAO,EAAE,CAAC,qBAAqB,EAAE,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;AAChF,QAAQ,qBAAqB,EAAE,CAAC,oBAAoB,CAAC;AACrD,QAAQ,MAAM,EAAE,CAAC,oBAAoB,CAAC;AACtC,QAAQ,KAAK,EAAE,CAAC,0BAA0B,CAAC;AAC3C,QAAQ,MAAM,EAAE,CAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;AAC9E,QAAQ,KAAK,EAAE,CAAC,mBAAmB,CAAC;AACpC,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,yDAAyD;AACrE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,yDAAyD;AACrE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,MAAM,EAAE,CAAC,wBAAwB,CAAC;AAC1C,QAAQ,4BAA4B,EAAE;AACtC,YAAY,6EAA6E;AACzF,SAAS;AACT,QAAQ,qBAAqB,EAAE,CAAC,gDAAgD,CAAC;AACjF,QAAQ,4BAA4B,EAAE;AACtC,YAAY,gGAAgG;AAC5G,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,sCAAsC,CAAC;AAC7D,QAAQ,SAAS,EAAE,CAAC,mCAAmC,CAAC;AACxD,QAAQ,yBAAyB,EAAE;AACnC,YAAY,6FAA6F;AACzG,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,IAAI,EAAE,CAAC,uBAAuB,CAAC;AACvC,QAAQ,cAAc,EAAE,CAAC,yCAAyC,CAAC;AACnE,QAAQ,2BAA2B,EAAE;AACrC,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,+CAA+C,CAAC;AAC/E,QAAQ,wBAAwB,EAAE,CAAC,iBAAiB,CAAC;AACrD,QAAQ,gBAAgB,EAAE,CAAC,2CAA2C,CAAC;AACvE,QAAQ,2BAA2B,EAAE;AACrC,YAAY,+CAA+C;AAC3D,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,4CAA4C;AACxD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,yCAAyC,CAAC;AACnE,QAAQ,4BAA4B,EAAE;AACtC,YAAY,6DAA6D;AACzE,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,+FAA+F;AAC3G,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,qEAAqE;AACjF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,qCAAqC,CAAC;AAC5D,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,wBAAwB,EAAE,CAAC,mBAAmB,CAAC;AACvD,QAAQ,KAAK,EAAE,CAAC,6BAA6B,CAAC;AAC9C,QAAQ,YAAY,EAAE,CAAC,6BAA6B,CAAC;AACrD,QAAQ,qBAAqB,EAAE,CAAC,+CAA+C,CAAC;AAChF,QAAQ,oCAAoC,EAAE,CAAC,gCAAgC,CAAC;AAChF,QAAQ,4BAA4B,EAAE,CAAC,qBAAqB,CAAC;AAC7D,QAAQ,kCAAkC,EAAE,CAAC,iBAAiB,CAAC;AAC/D,QAAQ,2BAA2B,EAAE,CAAC,qBAAqB,CAAC;AAC5D,QAAQ,4BAA4B,EAAE,CAAC,oCAAoC,CAAC;AAC5E,QAAQ,kCAAkC,EAAE,CAAC,4BAA4B,CAAC;AAC1E,QAAQ,MAAM,EAAE,CAAC,gCAAgC,CAAC;AAClD,QAAQ,gBAAgB,EAAE,CAAC,WAAW,CAAC;AACvC,QAAQ,aAAa,EAAE,CAAC,uBAAuB,CAAC;AAChD,QAAQ,iBAAiB,EAAE,CAAC,iCAAiC,CAAC;AAC9D,QAAQ,yBAAyB,EAAE,CAAC,iCAAiC,CAAC;AACtE,QAAQ,+BAA+B,EAAE,CAAC,yBAAyB,CAAC;AACpE,QAAQ,IAAI,EAAE,CAAC,YAAY,CAAC;AAC5B,QAAQ,0BAA0B,EAAE,CAAC,kBAAkB,CAAC;AACxD,QAAQ,0BAA0B,EAAE,CAAC,kBAAkB,CAAC;AACxD,QAAQ,2BAA2B,EAAE,CAAC,qBAAqB,CAAC;AAC5D,QAAQ,iCAAiC,EAAE,CAAC,qBAAqB,CAAC;AAClE,QAAQ,oBAAoB,EAAE,CAAC,iCAAiC,CAAC;AACjE,QAAQ,oBAAoB,EAAE,CAAC,iCAAiC,CAAC;AACjE,QAAQ,2BAA2B,EAAE,CAAC,oBAAoB,CAAC;AAC3D,QAAQ,kBAAkB,EAAE,CAAC,gCAAgC,CAAC;AAC9D,QAAQ,gCAAgC,EAAE,CAAC,yBAAyB,CAAC;AACrE,QAAQ,qBAAqB,EAAE,CAAC,4BAA4B,CAAC;AAC7D,QAAQ,iCAAiC,EAAE,CAAC,gBAAgB,CAAC;AAC7D,QAAQ,yCAAyC,EAAE,CAAC,8BAA8B,CAAC;AACnF,QAAQ,OAAO,EAAE,CAAC,gCAAgC,CAAC;AACnD,QAAQ,QAAQ,EAAE,CAAC,mCAAmC,CAAC;AACvD,QAAQ,mBAAmB,EAAE,CAAC,aAAa,CAAC;AAC5C,KAAK;AACL,CAAC;;ACprCM,MAAM,OAAO,GAAG,mBAAmB,CAAC;;ACApC,SAAS,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE;AAC1D,IAAI,MAAM,UAAU,GAAG,EAAE,CAAC;AAC1B,IAAI,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACnE,QAAQ,KAAK,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AACxE,YAAY,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC;AAC5D,YAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACnD,YAAY,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9E,YAAY,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AACpC,gBAAgB,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AACvC,aAAa;AACb,YAAY,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AACnD,YAAY,IAAI,WAAW,EAAE;AAC7B,gBAAgB,YAAY,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;AAC/G,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,YAAY,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAClF,SAAS;AACT,KAAK;AACL,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC;AACD,SAAS,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE;AACrE,IAAI,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACnE;AACA,IAAI,SAAS,eAAe,CAAC,GAAG,IAAI,EAAE;AACtC;AACA,QAAQ,IAAI,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AAClE;AACA,QAAQ,IAAI,WAAW,CAAC,SAAS,EAAE;AACnC,YAAY,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE;AACjD,gBAAgB,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;AACpD,gBAAgB,CAAC,WAAW,CAAC,SAAS,GAAG,SAAS;AAClD,aAAa,CAAC,CAAC;AACf,YAAY,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAChD,SAAS;AACT,QAAQ,IAAI,WAAW,CAAC,OAAO,EAAE;AACjC,YAAY,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC;AAClE,YAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5H,SAAS;AACT,QAAQ,IAAI,WAAW,CAAC,UAAU,EAAE;AACpC,YAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,WAAW,CAAC,iBAAiB,EAAE;AAC3C;AACA,YAAY,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AACxE,YAAY,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE;AACvF,gBAAgB,IAAI,IAAI,IAAI,OAAO,EAAE;AACrC,oBAAoB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACzI,oBAAoB,IAAI,EAAE,KAAK,IAAI,OAAO,CAAC,EAAE;AAC7C,wBAAwB,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACvD,qBAAqB;AACrB,oBAAoB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAChD,SAAS;AACT;AACA,QAAQ,OAAO,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;AAC5C,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;AAC/D,CAAC;;ACxDD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AAAO,SAAS,mBAAmB,CAAC,OAAO,EAAE;AAC7C,IAAI,OAAO,kBAAkB,CAAC,OAAO,EAAEA,SAAS,CAAC,CAAC;AAClD,CAAC;AACD,mBAAmB,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/generated/endpoints.js","../dist-src/version.js","../dist-src/endpoints-to-methods.js","../dist-src/index.js"],"sourcesContent":["const Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n approveWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\",\n ],\n cancelWorkflowRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\",\n ],\n createOrUpdateEnvironmentSecret: [\n \"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\n \"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n createRegistrationTokenForOrg: [\n \"POST /orgs/{org}/actions/runners/registration-token\",\n ],\n createRegistrationTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/registration-token\",\n ],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\n \"POST /repos/{owner}/{repo}/actions/runners/remove-token\",\n ],\n createWorkflowDispatch: [\n \"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\",\n ],\n deleteArtifact: [\n \"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\",\n ],\n deleteEnvironmentSecret: [\n \"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\n \"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\",\n ],\n deleteSelfHostedRunnerFromOrg: [\n \"DELETE /orgs/{org}/actions/runners/{runner_id}\",\n ],\n deleteSelfHostedRunnerFromRepo: [\n \"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\n \"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n disableSelectedRepositoryGithubActionsOrganization: [\n \"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\",\n ],\n disableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\",\n ],\n downloadArtifact: [\n \"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\",\n ],\n downloadJobLogsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\",\n ],\n downloadWorkflowRunLogs: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\",\n ],\n enableSelectedRepositoryGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\",\n ],\n enableWorkflow: [\n \"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\",\n ],\n getAllowedActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/selected-actions\",\n ],\n getAllowedActionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\",\n ],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\",\n ],\n getEnvironmentSecret: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\",\n ],\n getGithubActionsPermissionsOrganization: [\n \"GET /orgs/{org}/actions/permissions\",\n ],\n getGithubActionsPermissionsRepository: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n ],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\",\n ],\n getRepoPermissions: [\n \"GET /repos/{owner}/{repo}/actions/permissions\",\n {},\n { renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"] },\n ],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\",\n ],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\",\n ],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunUsage: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\",\n ],\n getWorkflowUsage: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\",\n ],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\n \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\",\n ],\n listJobsForWorkflowRun: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\",\n ],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\n \"GET /repos/{owner}/{repo}/actions/runners/downloads\",\n ],\n listSelectedReposForOrgSecret: [\n \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"GET /orgs/{org}/actions/permissions/repositories\",\n ],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\n \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\",\n ],\n listWorkflowRuns: [\n \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\",\n ],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n reRunWorkflow: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\"],\n removeSelectedRepoFromOrgSecret: [\n \"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\",\n ],\n reviewPendingDeploymentsForRun: [\n \"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\",\n ],\n setAllowedActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/selected-actions\",\n ],\n setAllowedActionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\",\n ],\n setGithubActionsPermissionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions\",\n ],\n setGithubActionsPermissionsRepository: [\n \"PUT /repos/{owner}/{repo}/actions/permissions\",\n ],\n setSelectedReposForOrgSecret: [\n \"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\",\n ],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\n \"PUT /orgs/{org}/actions/permissions/repositories\",\n ],\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\n \"DELETE /notifications/threads/{thread_id}/subscription\",\n ],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\n \"GET /notifications/threads/{thread_id}/subscription\",\n ],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\n \"GET /users/{username}/events/orgs/{org}\",\n ],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\n \"GET /users/{username}/received_events/public\",\n ],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\n \"GET /repos/{owner}/{repo}/notifications\",\n ],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\n \"PUT /notifications/threads/{thread_id}/subscription\",\n ],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"],\n },\n apps: {\n addRepoToInstallation: [\n \"PUT /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\n \"POST /content_references/{content_reference_id}/attachments\",\n { mediaType: { previews: [\"corsair\"] } },\n ],\n createContentAttachmentForRepo: [\n \"POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\",\n { mediaType: { previews: [\"corsair\"] } },\n ],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\n \"POST /app/installations/{installation_id}/access_tokens\",\n ],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\n \"GET /marketplace_listing/accounts/{account_id}\",\n ],\n getSubscriptionPlanForAccountStubbed: [\n \"GET /marketplace_listing/stubbed/accounts/{account_id}\",\n ],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\n \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n ],\n listInstallationReposForAuthenticatedUser: [\n \"GET /user/installations/{installation_id}/repositories\",\n ],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\n \"GET /user/marketplace_purchases/stubbed\",\n ],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\n \"POST /app/hook/deliveries/{delivery_id}/attempts\",\n ],\n removeRepoFromInstallation: [\n \"DELETE /user/installations/{installation_id}/repositories/{repository_id}\",\n ],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\n \"DELETE /app/installations/{installation_id}/suspended\",\n ],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"],\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\n \"GET /users/{username}/settings/billing/actions\",\n ],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\n \"GET /users/{username}/settings/billing/packages\",\n ],\n getSharedStorageBillingOrg: [\n \"GET /orgs/{org}/settings/billing/shared-storage\",\n ],\n getSharedStorageBillingUser: [\n \"GET /users/{username}/settings/billing/shared-storage\",\n ],\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\n \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\",\n ],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\n \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\",\n ],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestSuite: [\n \"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\",\n ],\n setSuitesPreferences: [\n \"PATCH /repos/{owner}/{repo}/check-suites/preferences\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n },\n codeScanning: {\n deleteAnalysis: [\n \"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\",\n ],\n getAlert: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n {},\n { renamedParameters: { alert_id: \"alert_number\" } },\n ],\n getAnalysis: [\n \"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\",\n ],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n ],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\n \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\",\n {},\n { renamed: [\"codeScanning\", \"listAlertInstances\"] },\n ],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\",\n ],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"],\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"],\n getForRepo: [\n \"GET /repos/{owner}/{repo}/community/code_of_conduct\",\n { mediaType: { previews: [\"scarlet-witch\"] } },\n ],\n },\n emojis: { get: [\"GET /emojis\"] },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\n \"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\",\n ],\n enableSelectedOrganizationGithubActionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\",\n ],\n getAllowedActionsEnterprise: [\n \"GET /enterprises/{enterprise}/actions/permissions/selected-actions\",\n ],\n getGithubActionsPermissionsEnterprise: [\n \"GET /enterprises/{enterprise}/actions/permissions\",\n ],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\n \"GET /enterprises/{enterprise}/actions/permissions/organizations\",\n ],\n setAllowedActionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\",\n ],\n setGithubActionsPermissionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions\",\n ],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\n \"PUT /enterprises/{enterprise}/actions/permissions/organizations\",\n ],\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"],\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"],\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"],\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\n \"GET /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"] },\n ],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\n \"DELETE /repos/{owner}/{repo}/interaction-limits\",\n ],\n removeRestrictionsForYourPublicRepos: [\n \"DELETE /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"] },\n ],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\n \"PUT /user/interaction-limits\",\n {},\n { renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"] },\n ],\n },\n issues: {\n addAssignees: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\",\n ],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\",\n ],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\n \"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\",\n { mediaType: { previews: [\"mockingbird\"] } },\n ],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\n \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\",\n ],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\",\n ],\n removeAssignees: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\",\n ],\n removeLabel: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\",\n ],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\n \"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\",\n ],\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"],\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\n \"POST /markdown/raw\",\n { headers: { \"content-type\": \"text/plain; charset=utf-8\" } },\n ],\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"],\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n deleteArchiveForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n downloadArchiveForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getArchiveForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}/archive\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\n \"GET /user/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n getStatusForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForAuthenticatedUser: [\n \"GET /user/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/migrations\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForOrg: [\n \"GET /orgs/{org}/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n listReposForUser: [\n \"GET /user/migrations/{migration_id}/repositories\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\n \"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n unlockRepoForOrg: [\n \"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\",\n { mediaType: { previews: [\"wyandotte\"] } },\n ],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"],\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\n \"PUT /orgs/{org}/outside_collaborators/{username}\",\n ],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\n \"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\",\n ],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\",\n ],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\n \"DELETE /orgs/{org}/outside_collaborators/{username}\",\n ],\n removePublicMembershipForAuthenticatedUser: [\n \"DELETE /orgs/{org}/public_members/{username}\",\n ],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\n \"PUT /orgs/{org}/public_members/{username}\",\n ],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\n \"PATCH /user/memberships/orgs/{org}\",\n ],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"],\n },\n packages: {\n deletePackageForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}\",\n ],\n deletePackageForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}\",\n ],\n deletePackageVersionForAuthenticatedUser: [\n \"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n deletePackageVersionForOrg: [\n \"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n {},\n { renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"] },\n ],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n {},\n {\n renamed: [\n \"packages\",\n \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\",\n ],\n },\n ],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions\",\n ],\n getAllPackageVersionsForPackageOwnedByOrg: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\",\n ],\n getAllPackageVersionsForPackageOwnedByUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions\",\n ],\n getPackageForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}\",\n ],\n getPackageForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}\",\n ],\n getPackageForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}\",\n ],\n getPackageVersionForAuthenticatedUser: [\n \"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getPackageVersionForOrganization: [\n \"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n getPackageVersionForUser: [\n \"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\",\n ],\n restorePackageForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\",\n ],\n restorePackageVersionForAuthenticatedUser: [\n \"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n restorePackageVersionForOrg: [\n \"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\",\n ],\n },\n projects: {\n addCollaborator: [\n \"PUT /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createCard: [\n \"POST /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createColumn: [\n \"POST /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForAuthenticatedUser: [\n \"POST /user/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForOrg: [\n \"POST /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n createForRepo: [\n \"POST /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n delete: [\n \"DELETE /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteCard: [\n \"DELETE /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n deleteColumn: [\n \"DELETE /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n get: [\n \"GET /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getCard: [\n \"GET /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getColumn: [\n \"GET /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n getPermissionForUser: [\n \"GET /projects/{project_id}/collaborators/{username}/permission\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCards: [\n \"GET /projects/columns/{column_id}/cards\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listCollaborators: [\n \"GET /projects/{project_id}/collaborators\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listColumns: [\n \"GET /projects/{project_id}/columns\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForOrg: [\n \"GET /orgs/{org}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForRepo: [\n \"GET /repos/{owner}/{repo}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listForUser: [\n \"GET /users/{username}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveCard: [\n \"POST /projects/columns/cards/{card_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n moveColumn: [\n \"POST /projects/columns/{column_id}/moves\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n removeCollaborator: [\n \"DELETE /projects/{project_id}/collaborators/{username}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n update: [\n \"PATCH /projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateCard: [\n \"PATCH /projects/columns/cards/{card_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n updateColumn: [\n \"PATCH /projects/columns/{column_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\",\n ],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n deletePendingReview: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n deleteReviewComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n dismissReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\",\n ],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n listReviewComments: [\n \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\",\n ],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\n \"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n requestReviewers: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\",\n ],\n submitReview: [\n \"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\",\n ],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\",\n { mediaType: { previews: [\"lydian\"] } },\n ],\n updateReview: [\n \"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\",\n ],\n updateReviewComment: [\n \"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\",\n ],\n },\n rateLimit: { get: [\"GET /rate_limit\"] },\n reactions: {\n createForCommitComment: [\n \"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssue: [\n \"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForIssueComment: [\n \"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForPullRequestReviewComment: [\n \"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForRelease: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n createForTeamDiscussionInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForCommitComment: [\n \"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssue: [\n \"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForIssueComment: [\n \"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForPullRequestComment: [\n \"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussion: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteForTeamDiscussionComment: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n deleteLegacy: [\n \"DELETE /reactions/{reaction_id}\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n {\n deprecated: \"octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy\",\n },\n ],\n listForCommitComment: [\n \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssue: [\n \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForIssueComment: [\n \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForPullRequestReviewComment: [\n \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n listForTeamDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\",\n { mediaType: { previews: [\"squirrel-girl\"] } },\n ],\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n addTeamAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n addUserAccessRestrictions: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\n \"GET /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\n \"GET /repos/{owner}/{repo}/compare/{basehead}\",\n ],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\n \"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n createCommitSignatureProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\n \"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\n \"PUT /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\n \"POST /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\n \"POST /repos/{template_owner}/{template_repo}/generate\",\n { mediaType: { previews: [\"baptiste\"] } },\n ],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n deleteAdminBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n deleteAnEnvironment: [\n \"DELETE /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\n \"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\",\n ],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\n \"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n deletePagesSite: [\n \"DELETE /repos/{owner}/{repo}/pages\",\n { mediaType: { previews: [\"switcheroo\"] } },\n ],\n deletePullRequestReviewProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\n \"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\n \"DELETE /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n disableVulnerabilityAlerts: [\n \"DELETE /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n downloadArchive: [\n \"GET /repos/{owner}/{repo}/zipball/{ref}\",\n {},\n { renamed: [\"repos\", \"downloadZipballArchive\"] },\n ],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\n \"PUT /repos/{owner}/{repo}/automated-security-fixes\",\n { mediaType: { previews: [\"london\"] } },\n ],\n enableVulnerabilityAlerts: [\n \"PUT /repos/{owner}/{repo}/vulnerability-alerts\",\n { mediaType: { previews: [\"dorian\"] } },\n ],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\",\n ],\n getAdminBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n ],\n getAllTopics: [\n \"GET /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n getAppsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n ],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\n \"GET /repos/{owner}/{repo}/collaborators/{username}/permission\",\n ],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\",\n { mediaType: { previews: [\"zzzax\"] } },\n ],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\",\n ],\n getEnvironment: [\n \"GET /repos/{owner}/{repo}/environments/{environment_name}\",\n ],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n getTeamsWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n ],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\n \"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n ],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\",\n ],\n getWebhookDelivery: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\",\n ],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\",\n ],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\n \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\",\n ],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\n \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\",\n ],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\n \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\",\n { mediaType: { previews: [\"groot\"] } },\n ],\n listReleaseAssets: [\n \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\",\n ],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\n \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\",\n ],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\n \"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\",\n ],\n removeAppAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n removeCollaborator: [\n \"DELETE /repos/{owner}/{repo}/collaborators/{username}\",\n ],\n removeStatusCheckContexts: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n removeStatusCheckProtection: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n removeTeamAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n removeUserAccessRestrictions: [\n \"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\n \"PUT /repos/{owner}/{repo}/topics\",\n { mediaType: { previews: [\"mercy\"] } },\n ],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\n \"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\",\n ],\n setAppAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\",\n {},\n { mapToData: \"apps\" },\n ],\n setStatusCheckContexts: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\",\n {},\n { mapToData: \"contexts\" },\n ],\n setTeamAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\",\n {},\n { mapToData: \"teams\" },\n ],\n setUserAccessRestrictions: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\",\n {},\n { mapToData: \"users\" },\n ],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\n \"PUT /repos/{owner}/{repo}/branches/{branch}/protection\",\n ],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\n \"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\",\n ],\n updatePullRequestReviewProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\",\n ],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\n \"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\",\n ],\n updateStatusCheckPotection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n {},\n { renamed: [\"repos\", \"updateStatusCheckProtection\"] },\n ],\n updateStatusCheckProtection: [\n \"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\",\n ],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\n \"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\",\n ],\n uploadReleaseAsset: [\n \"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\",\n { baseUrl: \"https://uploads.github.com\" },\n ],\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\", { mediaType: { previews: [\"cloak\"] } }],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", { mediaType: { previews: [\"mercy\"] } }],\n users: [\"GET /search/users\"],\n },\n secretScanning: {\n getAlert: [\n \"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\",\n ],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\n \"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\",\n ],\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n addOrUpdateProjectPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n addOrUpdateRepoPermissionsInOrg: [\n \"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n checkPermissionsForProjectInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n checkPermissionsForRepoInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\n \"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n deleteDiscussionInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n getDiscussionInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n getMembershipForUserInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\",\n ],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/invitations\",\n ],\n listProjectsInOrg: [\n \"GET /orgs/{org}/teams/{team_slug}/projects\",\n { mediaType: { previews: [\"inertia\"] } },\n ],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\",\n ],\n removeProjectInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\",\n ],\n removeRepoInOrg: [\n \"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\",\n ],\n updateDiscussionCommentInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\",\n ],\n updateDiscussionInOrg: [\n \"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\",\n ],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"],\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"],\n },\n};\nexport default Endpoints;\n","export const VERSION = \"5.8.0\";\n","export function endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({ method, url }, defaults);\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n const scopeMethods = newMethods[scope];\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n return newMethods;\n}\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args);\n // There are currently no other decorations than `.mapToData`\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined,\n });\n return requestWithDefaults(options);\n }\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n delete options[name];\n }\n }\n return requestWithDefaults(options);\n }\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n return requestWithDefaults(...args);\n }\n return Object.assign(withDecorations, requestWithDefaults);\n}\n","import ENDPOINTS from \"./generated/endpoints\";\nimport { VERSION } from \"./version\";\nimport { endpointsToMethods } from \"./endpoints-to-methods\";\nexport function restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, ENDPOINTS);\n return {\n rest: api,\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nexport function legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, ENDPOINTS);\n return {\n ...api,\n rest: api,\n };\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n"],"names":["ENDPOINTS"],"mappings":"AAAA,MAAM,SAAS,GAAG;AAClB,IAAI,OAAO,EAAE;AACb,QAAQ,0BAA0B,EAAE;AACpC,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,yFAAyF;AACrG,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,+CAA+C,CAAC;AAClF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,+DAA+D;AAC3E,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,+CAA+C,CAAC;AAClF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,uEAAuE;AACnF,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,8DAA8D;AAC1E,SAAS;AACT,QAAQ,uBAAuB,EAAE;AACjC,YAAY,4FAA4F;AACxG,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,kDAAkD,CAAC;AAC7E,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,gDAAgD;AAC5D,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,oDAAoD,CAAC;AACjF,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,kDAAkD,EAAE;AAC5D,YAAY,qEAAqE;AACjF,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,uBAAuB,EAAE;AACjC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,iDAAiD,EAAE;AAC3D,YAAY,kEAAkE;AAC9E,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,kEAAkE;AAC9E,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,2DAA2D,CAAC;AAClF,QAAQ,uBAAuB,EAAE;AACjC,YAAY,sFAAsF;AAClG,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,yFAAyF;AACrG,SAAS;AACT,QAAQ,uCAAuC,EAAE;AACjD,YAAY,qCAAqC;AACjD,SAAS;AACT,QAAQ,qCAAqC,EAAE;AAC/C,YAAY,+CAA+C;AAC3D,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,iDAAiD,CAAC;AACjF,QAAQ,eAAe,EAAE,CAAC,4CAA4C,CAAC;AACvE,QAAQ,YAAY,EAAE,CAAC,+CAA+C,CAAC;AACvE,QAAQ,2BAA2B,EAAE;AACrC,YAAY,qEAAqE;AACjF,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,+CAA+C;AAC3D,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,uCAAuC,CAAC,EAAE;AAC7E,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,sDAAsD,CAAC;AAClF,QAAQ,aAAa,EAAE,CAAC,yDAAyD,CAAC;AAClF,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,yBAAyB,EAAE,CAAC,6CAA6C,CAAC;AAClF,QAAQ,0BAA0B,EAAE;AACpC,YAAY,uDAAuD;AACnE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,2DAA2D,CAAC;AAClF,QAAQ,cAAc,EAAE,CAAC,iDAAiD,CAAC;AAC3E,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,kEAAkE;AAC9E,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,6CAA6C,CAAC;AAC7E,QAAQ,sBAAsB,EAAE;AAChC,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,iCAAiC,CAAC;AAC3D,QAAQ,eAAe,EAAE,CAAC,2CAA2C,CAAC;AACtE,QAAQ,iBAAiB,EAAE,CAAC,6CAA6C,CAAC;AAC1E,QAAQ,4BAA4B,EAAE,CAAC,2CAA2C,CAAC;AACnF,QAAQ,6BAA6B,EAAE;AACvC,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,wDAAwD,EAAE;AAClE,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,2BAA2B,EAAE,CAAC,iCAAiC,CAAC;AACxE,QAAQ,4BAA4B,EAAE,CAAC,2CAA2C,CAAC;AACnF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,wCAAwC,CAAC;AAC3E,QAAQ,aAAa,EAAE,CAAC,wDAAwD,CAAC;AACjF,QAAQ,+BAA+B,EAAE;AACzC,YAAY,+EAA+E;AAC3F,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,6BAA6B,EAAE;AACvC,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,uCAAuC,EAAE;AACjD,YAAY,qCAAqC;AACjD,SAAS;AACT,QAAQ,qCAAqC,EAAE;AAC/C,YAAY,+CAA+C;AAC3D,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,uDAAuD,EAAE;AACjE,YAAY,kDAAkD;AAC9D,SAAS;AACT,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,qCAAqC,EAAE,CAAC,kCAAkC,CAAC;AACnF,QAAQ,sBAAsB,EAAE,CAAC,2CAA2C,CAAC;AAC7E,QAAQ,wBAAwB,EAAE;AAClC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,QAAQ,EAAE,CAAC,YAAY,CAAC;AAChC,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,SAAS,EAAE,CAAC,wCAAwC,CAAC;AAC7D,QAAQ,yCAAyC,EAAE;AACnD,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,8BAA8B,EAAE,CAAC,8BAA8B,CAAC;AACxE,QAAQ,qCAAqC,EAAE,CAAC,oBAAoB,CAAC;AACrE,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,yCAAyC;AACrD,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,aAAa,CAAC;AACzC,QAAQ,8BAA8B,EAAE,CAAC,qCAAqC,CAAC;AAC/E,QAAQ,uBAAuB,EAAE,CAAC,qCAAqC,CAAC;AACxE,QAAQ,mBAAmB,EAAE,CAAC,wBAAwB,CAAC;AACvD,QAAQ,yBAAyB,EAAE,CAAC,uCAAuC,CAAC;AAC5E,QAAQ,+BAA+B,EAAE;AACzC,YAAY,8CAA8C;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,kCAAkC,CAAC;AAC5D,QAAQ,yCAAyC,EAAE;AACnD,YAAY,yCAAyC;AACrD,SAAS;AACT,QAAQ,mCAAmC,EAAE,CAAC,mBAAmB,CAAC;AAClE,QAAQ,sBAAsB,EAAE,CAAC,+BAA+B,CAAC;AACjE,QAAQ,sBAAsB,EAAE,CAAC,qCAAqC,CAAC;AACvE,QAAQ,qBAAqB,EAAE,CAAC,sCAAsC,CAAC;AACvE,QAAQ,oCAAoC,EAAE,CAAC,yBAAyB,CAAC;AACzE,QAAQ,mBAAmB,EAAE,CAAC,uCAAuC,CAAC;AACtE,QAAQ,uBAAuB,EAAE,CAAC,oBAAoB,CAAC;AACvD,QAAQ,2BAA2B,EAAE,CAAC,yCAAyC,CAAC;AAChF,QAAQ,gBAAgB,EAAE,CAAC,0CAA0C,CAAC;AACtE,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,4BAA4B,EAAE,CAAC,kCAAkC,CAAC;AAC1E,QAAQ,8BAA8B,EAAE,CAAC,qCAAqC,CAAC;AAC/E,KAAK;AACL,IAAI,IAAI,EAAE;AACV,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,wEAAwE;AACpF,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,sCAAsC,CAAC;AAC5D,QAAQ,uBAAuB,EAAE;AACjC,YAAY,6DAA6D;AACzE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,kFAAkF;AAC9F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,kBAAkB,EAAE,CAAC,wCAAwC,CAAC;AACtE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,kBAAkB,EAAE,CAAC,6CAA6C,CAAC;AAC3E,QAAQ,WAAW,EAAE,CAAC,wCAAwC,CAAC;AAC/D,QAAQ,gBAAgB,EAAE,CAAC,UAAU,CAAC;AACtC,QAAQ,SAAS,EAAE,CAAC,sBAAsB,CAAC;AAC3C,QAAQ,eAAe,EAAE,CAAC,0CAA0C,CAAC;AACrE,QAAQ,kBAAkB,EAAE,CAAC,8BAA8B,CAAC;AAC5D,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,gDAAgD;AAC5D,SAAS;AACT,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,oCAAoC,CAAC;AACnE,QAAQ,sBAAsB,EAAE,CAAC,sBAAsB,CAAC;AACxD,QAAQ,kBAAkB,EAAE,CAAC,wCAAwC,CAAC;AACtE,QAAQ,mBAAmB,EAAE,CAAC,mDAAmD,CAAC;AAClF,QAAQ,0BAA0B,EAAE;AACpC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,yCAAyC,EAAE;AACnD,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,wBAAwB,CAAC;AACrD,QAAQ,qCAAqC,EAAE,CAAC,yBAAyB,CAAC;AAC1E,QAAQ,SAAS,EAAE,CAAC,gCAAgC,CAAC;AACrD,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,iCAAiC,EAAE,CAAC,gCAAgC,CAAC;AAC7E,QAAQ,qCAAqC,EAAE,CAAC,iCAAiC,CAAC;AAClF,QAAQ,4CAA4C,EAAE;AACtD,YAAY,yCAAyC;AACrD,SAAS;AACT,QAAQ,qBAAqB,EAAE,CAAC,0BAA0B,CAAC;AAC3D,QAAQ,wBAAwB,EAAE;AAClC,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,uCAAuC,CAAC;AAC7D,QAAQ,6BAA6B,EAAE,CAAC,4BAA4B,CAAC;AACrE,QAAQ,UAAU,EAAE,CAAC,6CAA6C,CAAC;AACnE,QAAQ,mBAAmB,EAAE,CAAC,oDAAoD,CAAC;AACnF,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,uDAAuD;AACnE,SAAS;AACT,QAAQ,yBAAyB,EAAE,CAAC,wBAAwB,CAAC;AAC7D,KAAK;AACL,IAAI,OAAO,EAAE;AACb,QAAQ,0BAA0B,EAAE,CAAC,0CAA0C,CAAC;AAChF,QAAQ,2BAA2B,EAAE;AACrC,YAAY,gDAAgD;AAC5D,SAAS;AACT,QAAQ,2BAA2B,EAAE,CAAC,2CAA2C,CAAC;AAClF,QAAQ,4BAA4B,EAAE;AACtC,YAAY,iDAAiD;AAC7D,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,iDAAiD;AAC7D,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,uDAAuD;AACnE,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,QAAQ,MAAM,EAAE,CAAC,uCAAuC,CAAC;AACzD,QAAQ,WAAW,EAAE,CAAC,yCAAyC,CAAC;AAChE,QAAQ,GAAG,EAAE,CAAC,qDAAqD,CAAC;AACpE,QAAQ,QAAQ,EAAE,CAAC,yDAAyD,CAAC;AAC7E,QAAQ,eAAe,EAAE;AACzB,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,oDAAoD,CAAC;AAC1E,QAAQ,YAAY,EAAE;AACtB,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,sDAAsD,CAAC;AAClF,QAAQ,cAAc,EAAE;AACxB,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,MAAM,EAAE,CAAC,uDAAuD,CAAC;AACzE,KAAK;AACL,IAAI,YAAY,EAAE;AAClB,QAAQ,cAAc,EAAE;AACxB,YAAY,oFAAoF;AAChG,SAAS;AACT,QAAQ,QAAQ,EAAE;AAClB,YAAY,+DAA+D;AAC3E,YAAY,EAAE;AACd,YAAY,EAAE,iBAAiB,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE;AAC/D,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,QAAQ,EAAE,CAAC,2DAA2D,CAAC;AAC/E,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,yEAAyE;AACrF,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,gDAAgD,CAAC;AAC7E,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,yEAAyE;AACrF,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC,EAAE;AAC/D,SAAS;AACT,QAAQ,kBAAkB,EAAE,CAAC,kDAAkD,CAAC;AAChF,QAAQ,WAAW,EAAE;AACrB,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,iDAAiD,CAAC;AACxE,KAAK;AACL,IAAI,cAAc,EAAE;AACpB,QAAQ,oBAAoB,EAAE,CAAC,uBAAuB,CAAC;AACvD,QAAQ,cAAc,EAAE,CAAC,6BAA6B,CAAC;AACvD,QAAQ,UAAU,EAAE;AACpB,YAAY,qDAAqD;AACjE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE;AACpC,IAAI,eAAe,EAAE;AACrB,QAAQ,kDAAkD,EAAE;AAC5D,YAAY,6EAA6E;AACzF,SAAS;AACT,QAAQ,iDAAiD,EAAE;AAC3D,YAAY,0EAA0E;AACtF,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,qCAAqC,EAAE;AAC/C,YAAY,mDAAmD;AAC/D,SAAS;AACT,QAAQ,uDAAuD,EAAE;AACjE,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,qCAAqC,EAAE;AAC/C,YAAY,mDAAmD;AAC/D,SAAS;AACT,QAAQ,sDAAsD,EAAE;AAChE,YAAY,iEAAiE;AAC7E,SAAS;AACT,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,cAAc,EAAE,CAAC,2BAA2B,CAAC;AACrD,QAAQ,MAAM,EAAE,CAAC,aAAa,CAAC;AAC/B,QAAQ,aAAa,EAAE,CAAC,gCAAgC,CAAC;AACzD,QAAQ,MAAM,EAAE,CAAC,yBAAyB,CAAC;AAC3C,QAAQ,aAAa,EAAE,CAAC,+CAA+C,CAAC;AACxE,QAAQ,IAAI,EAAE,CAAC,6BAA6B,CAAC;AAC7C,QAAQ,GAAG,EAAE,CAAC,sBAAsB,CAAC;AACrC,QAAQ,UAAU,EAAE,CAAC,4CAA4C,CAAC;AAClE,QAAQ,WAAW,EAAE,CAAC,4BAA4B,CAAC;AACnD,QAAQ,IAAI,EAAE,CAAC,YAAY,CAAC;AAC5B,QAAQ,YAAY,EAAE,CAAC,+BAA+B,CAAC;AACvD,QAAQ,WAAW,EAAE,CAAC,8BAA8B,CAAC;AACrD,QAAQ,WAAW,EAAE,CAAC,6BAA6B,CAAC;AACpD,QAAQ,SAAS,EAAE,CAAC,4BAA4B,CAAC;AACjD,QAAQ,UAAU,EAAE,CAAC,mBAAmB,CAAC;AACzC,QAAQ,WAAW,EAAE,CAAC,oBAAoB,CAAC;AAC3C,QAAQ,IAAI,EAAE,CAAC,2BAA2B,CAAC;AAC3C,QAAQ,MAAM,EAAE,CAAC,8BAA8B,CAAC;AAChD,QAAQ,MAAM,EAAE,CAAC,wBAAwB,CAAC;AAC1C,QAAQ,aAAa,EAAE,CAAC,8CAA8C,CAAC;AACvE,KAAK;AACL,IAAI,GAAG,EAAE;AACT,QAAQ,UAAU,EAAE,CAAC,sCAAsC,CAAC;AAC5D,QAAQ,YAAY,EAAE,CAAC,wCAAwC,CAAC;AAChE,QAAQ,SAAS,EAAE,CAAC,qCAAqC,CAAC;AAC1D,QAAQ,SAAS,EAAE,CAAC,qCAAqC,CAAC;AAC1D,QAAQ,UAAU,EAAE,CAAC,sCAAsC,CAAC;AAC5D,QAAQ,SAAS,EAAE,CAAC,6CAA6C,CAAC;AAClE,QAAQ,OAAO,EAAE,CAAC,gDAAgD,CAAC;AACnE,QAAQ,SAAS,EAAE,CAAC,oDAAoD,CAAC;AACzE,QAAQ,MAAM,EAAE,CAAC,yCAAyC,CAAC;AAC3D,QAAQ,MAAM,EAAE,CAAC,8CAA8C,CAAC;AAChE,QAAQ,OAAO,EAAE,CAAC,gDAAgD,CAAC;AACnE,QAAQ,gBAAgB,EAAE,CAAC,mDAAmD,CAAC;AAC/E,QAAQ,SAAS,EAAE,CAAC,4CAA4C,CAAC;AACjE,KAAK;AACL,IAAI,SAAS,EAAE;AACf,QAAQ,eAAe,EAAE,CAAC,0BAA0B,CAAC;AACrD,QAAQ,WAAW,EAAE,CAAC,iCAAiC,CAAC;AACxD,KAAK;AACL,IAAI,YAAY,EAAE;AAClB,QAAQ,mCAAmC,EAAE,CAAC,8BAA8B,CAAC;AAC7E,QAAQ,qBAAqB,EAAE,CAAC,oCAAoC,CAAC;AACrE,QAAQ,sBAAsB,EAAE,CAAC,8CAA8C,CAAC;AAChF,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,8BAA8B;AAC1C,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,qCAAqC,CAAC,EAAE;AAChF,SAAS;AACT,QAAQ,sCAAsC,EAAE,CAAC,iCAAiC,CAAC;AACnF,QAAQ,wBAAwB,EAAE,CAAC,uCAAuC,CAAC;AAC3E,QAAQ,yBAAyB,EAAE;AACnC,YAAY,iDAAiD;AAC7D,SAAS;AACT,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,iCAAiC;AAC7C,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,wCAAwC,CAAC,EAAE;AACnF,SAAS;AACT,QAAQ,mCAAmC,EAAE,CAAC,8BAA8B,CAAC;AAC7E,QAAQ,qBAAqB,EAAE,CAAC,oCAAoC,CAAC;AACrE,QAAQ,sBAAsB,EAAE,CAAC,8CAA8C,CAAC;AAChF,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,8BAA8B;AAC1C,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,qCAAqC,CAAC,EAAE;AAChF,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,QAAQ,YAAY,EAAE;AACtB,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,yDAAyD,CAAC;AAC9E,QAAQ,sBAAsB,EAAE,CAAC,gDAAgD,CAAC;AAClF,QAAQ,MAAM,EAAE,CAAC,mCAAmC,CAAC;AACrD,QAAQ,aAAa,EAAE;AACvB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,mCAAmC,CAAC;AAC1D,QAAQ,eAAe,EAAE,CAAC,uCAAuC,CAAC;AAClE,QAAQ,aAAa,EAAE;AACvB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,4CAA4C,CAAC;AACnE,QAAQ,eAAe,EAAE;AACzB,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,GAAG,EAAE,CAAC,iDAAiD,CAAC;AAChE,QAAQ,UAAU,EAAE,CAAC,wDAAwD,CAAC;AAC9E,QAAQ,QAAQ,EAAE,CAAC,oDAAoD,CAAC;AACxE,QAAQ,QAAQ,EAAE,CAAC,yCAAyC,CAAC;AAC7D,QAAQ,YAAY,EAAE,CAAC,yDAAyD,CAAC;AACjF,QAAQ,IAAI,EAAE,CAAC,aAAa,CAAC;AAC7B,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,YAAY,EAAE,CAAC,0DAA0D,CAAC;AAClF,QAAQ,mBAAmB,EAAE,CAAC,2CAA2C,CAAC;AAC1E,QAAQ,UAAU,EAAE,CAAC,wDAAwD,CAAC;AAC9E,QAAQ,iBAAiB,EAAE,CAAC,yCAAyC,CAAC;AACtE,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,0DAA0D;AACtE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE;AACxD,SAAS;AACT,QAAQ,wBAAwB,EAAE,CAAC,kBAAkB,CAAC;AACtD,QAAQ,UAAU,EAAE,CAAC,wBAAwB,CAAC;AAC9C,QAAQ,WAAW,EAAE,CAAC,kCAAkC,CAAC;AACzD,QAAQ,sBAAsB,EAAE;AAChC,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,kCAAkC,CAAC;AAC/D,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,sCAAsC,CAAC;AAChE,QAAQ,IAAI,EAAE,CAAC,sDAAsD,CAAC;AACtE,QAAQ,eAAe,EAAE;AACzB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,8DAA8D;AAC1E,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,kEAAkE;AAC9E,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,wDAAwD,CAAC;AAC7E,QAAQ,MAAM,EAAE,CAAC,yDAAyD,CAAC;AAC3E,QAAQ,MAAM,EAAE,CAAC,mDAAmD,CAAC;AACrE,QAAQ,aAAa,EAAE,CAAC,0DAA0D,CAAC;AACnF,QAAQ,WAAW,EAAE,CAAC,2CAA2C,CAAC;AAClE,QAAQ,eAAe,EAAE;AACzB,YAAY,2DAA2D;AACvE,SAAS;AACT,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,GAAG,EAAE,CAAC,yBAAyB,CAAC;AACxC,QAAQ,kBAAkB,EAAE,CAAC,eAAe,CAAC;AAC7C,QAAQ,UAAU,EAAE,CAAC,mCAAmC,CAAC;AACzD,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,MAAM,EAAE,CAAC,gBAAgB,CAAC;AAClC,QAAQ,SAAS,EAAE;AACnB,YAAY,oBAAoB;AAChC,YAAY,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,2BAA2B,EAAE,EAAE;AACxE,SAAS;AACT,KAAK;AACL,IAAI,IAAI,EAAE;AACV,QAAQ,GAAG,EAAE,CAAC,WAAW,CAAC;AAC1B,QAAQ,UAAU,EAAE,CAAC,cAAc,CAAC;AACpC,QAAQ,MAAM,EAAE,CAAC,UAAU,CAAC;AAC5B,QAAQ,IAAI,EAAE,CAAC,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,UAAU,EAAE;AAChB,QAAQ,YAAY,EAAE,CAAC,qCAAqC,CAAC;AAC7D,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,gDAAgD;AAC5D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,sDAAsD;AAClE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,mDAAmD;AAC/D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,6CAA6C;AACzD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,0CAA0C,CAAC;AACtE,QAAQ,eAAe,EAAE,CAAC,kCAAkC,CAAC;AAC7D,QAAQ,aAAa,EAAE,CAAC,8CAA8C,CAAC;AACvE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,2CAA2C;AACvD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,sBAAsB;AAClC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,4BAA4B;AACxC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,wDAAwD;AACpE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,kDAAkD;AAC9D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,wDAAwD,CAAC;AACnF,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,yBAAyB,EAAE,CAAC,uBAAuB,CAAC;AAC5D,QAAQ,WAAW,EAAE,CAAC,6BAA6B,CAAC;AACpD,QAAQ,WAAW,EAAE,CAAC,kCAAkC,CAAC;AACzD,QAAQ,8BAA8B,EAAE;AACxC,YAAY,+DAA+D;AAC3E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,qEAAqE;AACjF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE;AACtD,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,oCAAoC,CAAC;AAC5D,KAAK;AACL,IAAI,IAAI,EAAE;AACV,QAAQ,SAAS,EAAE,CAAC,mCAAmC,CAAC;AACxD,QAAQ,gBAAgB,EAAE,CAAC,gDAAgD,CAAC;AAC5E,QAAQ,gBAAgB,EAAE,CAAC,mCAAmC,CAAC;AAC/D,QAAQ,sBAAsB,EAAE,CAAC,oCAAoC,CAAC;AACtE,QAAQ,4BAA4B,EAAE,CAAC,2CAA2C,CAAC;AACnF,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,8BAA8B,CAAC;AAC1D,QAAQ,aAAa,EAAE,CAAC,wBAAwB,CAAC;AACjD,QAAQ,aAAa,EAAE,CAAC,oCAAoC,CAAC;AAC7D,QAAQ,GAAG,EAAE,CAAC,iBAAiB,CAAC;AAChC,QAAQ,iCAAiC,EAAE,CAAC,kCAAkC,CAAC;AAC/E,QAAQ,oBAAoB,EAAE,CAAC,wCAAwC,CAAC;AACxE,QAAQ,UAAU,EAAE,CAAC,iCAAiC,CAAC;AACvD,QAAQ,sBAAsB,EAAE,CAAC,wCAAwC,CAAC;AAC1E,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,IAAI,EAAE,CAAC,oBAAoB,CAAC;AACpC,QAAQ,oBAAoB,EAAE,CAAC,+BAA+B,CAAC;AAC/D,QAAQ,gBAAgB,EAAE,CAAC,wBAAwB,CAAC;AACpD,QAAQ,qBAAqB,EAAE,CAAC,oCAAoC,CAAC;AACrE,QAAQ,wBAAwB,EAAE,CAAC,gBAAgB,CAAC;AACpD,QAAQ,WAAW,EAAE,CAAC,4BAA4B,CAAC;AACnD,QAAQ,mBAAmB,EAAE,CAAC,mDAAmD,CAAC;AAClF,QAAQ,WAAW,EAAE,CAAC,yBAAyB,CAAC;AAChD,QAAQ,mCAAmC,EAAE,CAAC,4BAA4B,CAAC;AAC3E,QAAQ,wBAAwB,EAAE,CAAC,uCAAuC,CAAC;AAC3E,QAAQ,sBAAsB,EAAE,CAAC,6BAA6B,CAAC;AAC/D,QAAQ,iBAAiB,EAAE,CAAC,gCAAgC,CAAC;AAC7D,QAAQ,qBAAqB,EAAE,CAAC,4CAA4C,CAAC;AAC7E,QAAQ,YAAY,EAAE,CAAC,uBAAuB,CAAC;AAC/C,QAAQ,WAAW,EAAE,CAAC,wCAAwC,CAAC;AAC/D,QAAQ,wBAAwB,EAAE;AAClC,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,uCAAuC,CAAC;AAC/D,QAAQ,uBAAuB,EAAE,CAAC,2CAA2C,CAAC;AAC9E,QAAQ,yBAAyB,EAAE;AACnC,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,0CAA0C,EAAE;AACpD,YAAY,8CAA8C;AAC1D,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,wCAAwC,CAAC;AACxE,QAAQ,uCAAuC,EAAE;AACjD,YAAY,2CAA2C;AACvD,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,sCAAsC,CAAC;AAC7D,QAAQ,MAAM,EAAE,CAAC,mBAAmB,CAAC;AACrC,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,oCAAoC;AAChD,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,mCAAmC,CAAC;AAC5D,QAAQ,yBAAyB,EAAE,CAAC,0CAA0C,CAAC;AAC/E,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,qDAAqD;AACjE,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,wCAAwC,EAAE;AAClD,YAAY,mFAAmF;AAC/F,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,yFAAyF;AACrG,SAAS;AACT,QAAQ,4CAA4C,EAAE;AACtD,YAAY,iEAAiE;AAC7E,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,UAAU,EAAE,2CAA2C,CAAC,EAAE;AAClF,SAAS;AACT,QAAQ,2DAA2D,EAAE;AACrE,YAAY,2DAA2D;AACvE,YAAY,EAAE;AACd,YAAY;AACZ,gBAAgB,OAAO,EAAE;AACzB,oBAAoB,UAAU;AAC9B,oBAAoB,yDAAyD;AAC7E,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,QAAQ,uDAAuD,EAAE;AACjE,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,yCAAyC,EAAE;AACnD,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,0CAA0C,EAAE;AACpD,YAAY,uEAAuE;AACnF,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,8DAA8D;AAC1E,SAAS;AACT,QAAQ,qCAAqC,EAAE;AAC/C,YAAY,gFAAgF;AAC5F,SAAS;AACT,QAAQ,gCAAgC,EAAE;AAC1C,YAAY,sFAAsF;AAClG,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,4FAA4F;AACxG,SAAS;AACT,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,yEAAyE;AACrF,SAAS;AACT,QAAQ,yCAAyC,EAAE;AACnD,YAAY,yFAAyF;AACrG,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,+FAA+F;AAC3G,SAAS;AACT,KAAK;AACL,IAAI,QAAQ,EAAE;AACd,QAAQ,eAAe,EAAE;AACzB,YAAY,qDAAqD;AACjE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,qBAAqB;AACjC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,2BAA2B;AACvC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,aAAa,EAAE;AACvB,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,MAAM,EAAE;AAChB,YAAY,+BAA+B;AAC3C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,sCAAsC;AAClD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,GAAG,EAAE;AACb,YAAY,4BAA4B;AACxC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,OAAO,EAAE;AACjB,YAAY,uCAAuC;AACnD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,SAAS,EAAE;AACnB,YAAY,mCAAmC;AAC/C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,gEAAgE;AAC5E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,SAAS,EAAE;AACnB,YAAY,yCAAyC;AACrD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0BAA0B;AACtC,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,gCAAgC;AAC5C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,QAAQ,EAAE;AAClB,YAAY,8CAA8C;AAC1D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,0CAA0C;AACtD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,wDAAwD;AACpE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,MAAM,EAAE;AAChB,YAAY,8BAA8B;AAC1C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,UAAU,EAAE;AACpB,YAAY,yCAAyC;AACrD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,qCAAqC;AACjD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,aAAa,EAAE,CAAC,qDAAqD,CAAC;AAC9E,QAAQ,MAAM,EAAE,CAAC,kCAAkC,CAAC;AACpD,QAAQ,2BAA2B,EAAE;AACrC,YAAY,8EAA8E;AAC1F,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,wDAAwD,CAAC;AAChF,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,aAAa,EAAE;AACvB,YAAY,8EAA8E;AAC1F,SAAS;AACT,QAAQ,GAAG,EAAE,CAAC,+CAA+C,CAAC;AAC9D,QAAQ,SAAS,EAAE;AACnB,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,gBAAgB,EAAE,CAAC,uDAAuD,CAAC;AACnF,QAAQ,IAAI,EAAE,CAAC,iCAAiC,CAAC;AACjD,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,uDAAuD,CAAC;AAC9E,QAAQ,SAAS,EAAE,CAAC,qDAAqD,CAAC;AAC1E,QAAQ,sBAAsB,EAAE;AAChC,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,yBAAyB,EAAE,CAAC,0CAA0C,CAAC;AAC/E,QAAQ,WAAW,EAAE,CAAC,uDAAuD,CAAC;AAC9E,QAAQ,KAAK,EAAE,CAAC,qDAAqD,CAAC;AACtE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,MAAM,EAAE,CAAC,iDAAiD,CAAC;AACnE,QAAQ,YAAY,EAAE;AACtB,YAAY,6DAA6D;AACzE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,yDAAyD;AACrE,SAAS;AACT,KAAK;AACL,IAAI,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE;AAC3C,IAAI,SAAS,EAAE;AACf,QAAQ,sBAAsB,EAAE;AAChC,YAAY,4DAA4D;AACxE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,4DAA4D;AACxE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,mEAAmE;AAC/E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,kEAAkE;AAC9E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,4DAA4D;AACxE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,mCAAmC,EAAE;AAC7C,YAAY,wGAAwG;AACpH,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,8EAA8E;AAC1F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,4EAA4E;AACxF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,4EAA4E;AACxF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,mFAAmF;AAC/F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,kFAAkF;AAC9F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,uBAAuB,EAAE;AACjC,YAAY,8FAA8F;AAC1G,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,8BAA8B,EAAE;AACxC,YAAY,wHAAwH;AACpI,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,iCAAiC;AAC7C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,YAAY;AACZ,gBAAgB,UAAU,EAAE,qIAAqI;AACjK,aAAa;AACb,SAAS;AACT,QAAQ,oBAAoB,EAAE;AAC9B,YAAY,2DAA2D;AACvE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,2DAA2D;AACvE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,kEAAkE;AAC9E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,iEAAiE;AAC7E,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,uGAAuG;AACnH,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,6EAA6E;AACzF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE;AAC1D,SAAS;AACT,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,gBAAgB,EAAE,CAAC,oDAAoD,CAAC;AAChF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,2EAA2E;AACvF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AACjC,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,oDAAoD,CAAC;AAC/E,QAAQ,sBAAsB,EAAE;AAChC,YAAY,yFAAyF;AACrG,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;AACrC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,4EAA4E;AACxF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,4EAA4E;AACxF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,oDAAoD,CAAC;AACjF,QAAQ,wBAAwB,EAAE;AAClC,YAAY,gDAAgD;AAC5D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,mDAAmD,CAAC;AAC7E,QAAQ,0BAA0B,EAAE;AACpC,YAAY,8CAA8C;AAC1D,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,sCAAsC,CAAC;AAChE,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,6EAA6E;AACzF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,kBAAkB,EAAE,CAAC,2CAA2C,CAAC;AACzE,QAAQ,eAAe,EAAE,CAAC,iCAAiC,CAAC;AAC5D,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,sBAAsB,EAAE;AAChC,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,uCAAuC,CAAC;AACtE,QAAQ,0BAA0B,EAAE,CAAC,kBAAkB,CAAC;AACxD,QAAQ,UAAU,EAAE,CAAC,kCAAkC,CAAC;AACxD,QAAQ,WAAW,EAAE,CAAC,wBAAwB,CAAC;AAC/C,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,0BAA0B,EAAE,CAAC,2CAA2C,CAAC;AACjF,QAAQ,eAAe,EAAE;AACzB,YAAY,kCAAkC;AAC9C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;AACvD,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,uDAAuD;AACnE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE;AACrD,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,kCAAkC,CAAC;AAC3D,QAAQ,iBAAiB,EAAE,CAAC,qDAAqD,CAAC;AAClF,QAAQ,MAAM,EAAE,CAAC,8BAA8B,CAAC;AAChD,QAAQ,wBAAwB,EAAE;AAClC,YAAY,wEAAwE;AACpF,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,0EAA0E;AACtF,SAAS;AACT,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,8DAA8D;AAC1E,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,sDAAsD,CAAC;AAChF,QAAQ,sBAAsB,EAAE;AAChC,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,oDAAoD,CAAC;AACnF,QAAQ,+BAA+B,EAAE;AACzC,YAAY,+EAA+E;AAC3F,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,4CAA4C,CAAC;AACvE,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,UAAU,EAAE,CAAC,8CAA8C,CAAC;AACpE,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,oCAAoC;AAChD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE;AACvD,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,yFAAyF;AACrG,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,oDAAoD,CAAC;AAC7E,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,8CAA8C,CAAC;AACvE,QAAQ,6BAA6B,EAAE;AACvC,YAAY,uDAAuD;AACnE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,mDAAmD;AAC/D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,yCAAyC;AACrD,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,wBAAwB,CAAC,EAAE;AAC5D,SAAS;AACT,QAAQ,sBAAsB,EAAE,CAAC,yCAAyC,CAAC;AAC3E,QAAQ,sBAAsB,EAAE,CAAC,yCAAyC,CAAC;AAC3E,QAAQ,4BAA4B,EAAE;AACtC,YAAY,oDAAoD;AAChE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,gDAAgD;AAC5D,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnD,SAAS;AACT,QAAQ,GAAG,EAAE,CAAC,2BAA2B,CAAC;AAC1C,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,qEAAqE;AACjF,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,uEAAuE;AACnF,SAAS;AACT,QAAQ,kBAAkB,EAAE,CAAC,wCAAwC,CAAC;AACtE,QAAQ,yBAAyB,EAAE;AACnC,YAAY,wFAAwF;AACpG,SAAS;AACT,QAAQ,YAAY,EAAE;AACtB,YAAY,kCAAkC;AAC9C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,0EAA0E;AACtF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,mDAAmD,CAAC;AAC1E,QAAQ,SAAS,EAAE,CAAC,6CAA6C,CAAC;AAClE,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,SAAS,EAAE,CAAC,0CAA0C,CAAC;AAC/D,QAAQ,qBAAqB,EAAE,CAAC,gDAAgD,CAAC;AACjF,QAAQ,8BAA8B,EAAE;AACxC,YAAY,+DAA+D;AAC3E,SAAS;AACT,QAAQ,uBAAuB,EAAE,CAAC,gDAAgD,CAAC;AACnF,QAAQ,SAAS,EAAE,CAAC,yCAAyC,CAAC;AAC9D,QAAQ,sBAAsB,EAAE,CAAC,iDAAiD,CAAC;AACnF,QAAQ,gBAAgB,EAAE,CAAC,iDAAiD,CAAC;AAC7E,QAAQ,4BAA4B,EAAE;AACtC,YAAY,4EAA4E;AACxF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,0BAA0B,EAAE,CAAC,6CAA6C,CAAC;AACnF,QAAQ,UAAU,EAAE,CAAC,2CAA2C,CAAC;AACjE,QAAQ,oBAAoB,EAAE,CAAC,8CAA8C,CAAC;AAC9E,QAAQ,YAAY,EAAE,CAAC,yCAAyC,CAAC;AACjE,QAAQ,aAAa,EAAE,CAAC,uDAAuD,CAAC;AAChF,QAAQ,mBAAmB,EAAE;AAC7B,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,cAAc,EAAE;AACxB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,+CAA+C,CAAC;AAC9E,QAAQ,gBAAgB,EAAE,CAAC,2CAA2C,CAAC;AACvE,QAAQ,QAAQ,EAAE,CAAC,iCAAiC,CAAC;AACrD,QAAQ,aAAa,EAAE,CAAC,mDAAmD,CAAC;AAC5E,QAAQ,mBAAmB,EAAE,CAAC,wCAAwC,CAAC;AACvE,QAAQ,qBAAqB,EAAE,CAAC,+CAA+C,CAAC;AAChF,QAAQ,8BAA8B,EAAE;AACxC,YAAY,sFAAsF;AAClG,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,4CAA4C,CAAC;AACzE,QAAQ,SAAS,EAAE,CAAC,kCAAkC,CAAC;AACvD,QAAQ,oBAAoB,EAAE,CAAC,wCAAwC,CAAC;AACxE,QAAQ,UAAU,EAAE,CAAC,iDAAiD,CAAC;AACvE,QAAQ,eAAe,EAAE,CAAC,sDAAsD,CAAC;AACjF,QAAQ,eAAe,EAAE,CAAC,+CAA+C,CAAC;AAC1E,QAAQ,yBAAyB,EAAE;AACnC,YAAY,+EAA+E;AAC3F,SAAS;AACT,QAAQ,mCAAmC,EAAE;AAC7C,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,iDAAiD,CAAC;AACxE,QAAQ,eAAe,EAAE,CAAC,qDAAqD,CAAC;AAChF,QAAQ,mCAAmC,EAAE;AAC7C,YAAY,2EAA2E;AACvF,SAAS;AACT,QAAQ,QAAQ,EAAE,CAAC,yCAAyC,CAAC;AAC7D,QAAQ,UAAU,EAAE,CAAC,2CAA2C,CAAC;AACjE,QAAQ,uBAAuB,EAAE;AACjC,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,oEAAoE;AAChF,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,YAAY,EAAE,CAAC,oCAAoC,CAAC;AAC5D,QAAQ,yBAAyB,EAAE;AACnC,YAAY,oEAAoE;AAChF,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,yCAAyC,CAAC;AACtE,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,yBAAyB,EAAE,CAAC,oCAAoC,CAAC;AACzE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,kDAAkD;AAC9D,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,mCAAmC,CAAC;AAC1D,QAAQ,gBAAgB,EAAE,CAAC,wCAAwC,CAAC;AACpE,QAAQ,cAAc,EAAE,CAAC,gCAAgC,CAAC;AAC1D,QAAQ,sBAAsB,EAAE;AAChC,YAAY,gEAAgE;AAC5E,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,uCAAuC,CAAC;AAClE,QAAQ,wBAAwB,EAAE,CAAC,iBAAiB,CAAC;AACrD,QAAQ,UAAU,EAAE,CAAC,uBAAuB,CAAC;AAC7C,QAAQ,WAAW,EAAE,CAAC,6BAA6B,CAAC;AACpD,QAAQ,SAAS,EAAE,CAAC,iCAAiC,CAAC;AACtD,QAAQ,eAAe,EAAE,CAAC,uCAAuC,CAAC;AAClE,QAAQ,mCAAmC,EAAE,CAAC,kCAAkC,CAAC;AACjF,QAAQ,aAAa,EAAE,CAAC,qCAAqC,CAAC;AAC9D,QAAQ,eAAe,EAAE,CAAC,wCAAwC,CAAC;AACnE,QAAQ,UAAU,EAAE,CAAC,mBAAmB,CAAC;AACzC,QAAQ,oCAAoC,EAAE;AAC9C,YAAY,sDAAsD;AAClE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,oCAAoC,CAAC;AAC5D,QAAQ,QAAQ,EAAE,CAAC,gCAAgC,CAAC;AACpD,QAAQ,SAAS,EAAE,CAAC,iCAAiC,CAAC;AACtD,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,sDAAsD;AAClE,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,iCAAiC,CAAC;AACzD,QAAQ,KAAK,EAAE,CAAC,mCAAmC,CAAC;AACpD,QAAQ,WAAW,EAAE,CAAC,kDAAkD,CAAC;AACzE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,8EAA8E;AAC1F,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,6EAA6E;AACzF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AACjC,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,uDAAuD;AACnE,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2FAA2F;AACvG,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;AACrC,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,kFAAkF;AAC9F,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,8EAA8E;AAC1F,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,8EAA8E;AAC1F,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,YAAY,EAAE,CAAC,qDAAqD,CAAC;AAC7E,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,kCAAkC;AAC9C,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE;AAClD,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,yCAAyC,CAAC;AACtE,QAAQ,wBAAwB,EAAE;AAClC,YAAY,wEAAwE;AACpF,SAAS;AACT,QAAQ,wBAAwB,EAAE;AAClC,YAAY,0EAA0E;AACtF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE;AACjC,SAAS;AACT,QAAQ,sBAAsB,EAAE;AAChC,YAAY,wFAAwF;AACpG,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE;AACrC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2EAA2E;AACvF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,2EAA2E;AACvF,YAAY,EAAE;AACd,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE;AAClC,SAAS;AACT,QAAQ,eAAe,EAAE,CAAC,kDAAkD,CAAC;AAC7E,QAAQ,QAAQ,EAAE,CAAC,qCAAqC,CAAC;AACzD,QAAQ,MAAM,EAAE,CAAC,6BAA6B,CAAC;AAC/C,QAAQ,sBAAsB,EAAE;AAChC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,mBAAmB,EAAE,CAAC,mDAAmD,CAAC;AAClF,QAAQ,+BAA+B,EAAE,CAAC,iCAAiC,CAAC;AAC5E,QAAQ,gBAAgB,EAAE;AAC1B,YAAY,yDAAyD;AACrE,SAAS;AACT,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,wFAAwF;AACpG,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,mDAAmD,CAAC;AAC5E,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,0BAA0B,EAAE;AACpC,YAAY,iFAAiF;AAC7F,YAAY,EAAE;AACd,YAAY,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,6BAA6B,CAAC,EAAE;AACjE,SAAS;AACT,QAAQ,2BAA2B,EAAE;AACrC,YAAY,iFAAiF;AAC7F,SAAS;AACT,QAAQ,aAAa,EAAE,CAAC,6CAA6C,CAAC;AACtE,QAAQ,0BAA0B,EAAE;AACpC,YAAY,oDAAoD;AAChE,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,sEAAsE;AAClF,YAAY,EAAE,OAAO,EAAE,4BAA4B,EAAE;AACrD,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE;AACZ,QAAQ,IAAI,EAAE,CAAC,kBAAkB,CAAC;AAClC,QAAQ,OAAO,EAAE,CAAC,qBAAqB,EAAE,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;AAChF,QAAQ,qBAAqB,EAAE,CAAC,oBAAoB,CAAC;AACrD,QAAQ,MAAM,EAAE,CAAC,oBAAoB,CAAC;AACtC,QAAQ,KAAK,EAAE,CAAC,0BAA0B,CAAC;AAC3C,QAAQ,MAAM,EAAE,CAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;AAC9E,QAAQ,KAAK,EAAE,CAAC,mBAAmB,CAAC;AACpC,KAAK;AACL,IAAI,cAAc,EAAE;AACpB,QAAQ,QAAQ,EAAE;AAClB,YAAY,iEAAiE;AAC7E,SAAS;AACT,QAAQ,iBAAiB,EAAE,CAAC,kDAAkD,CAAC;AAC/E,QAAQ,WAAW,EAAE;AACrB,YAAY,mEAAmE;AAC/E,SAAS;AACT,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,iCAAiC,EAAE;AAC3C,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,kCAAkC,EAAE;AAC5C,YAAY,yDAAyD;AACrE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,+BAA+B,EAAE;AACzC,YAAY,yDAAyD;AACrE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,wDAAwD;AACpE,SAAS;AACT,QAAQ,MAAM,EAAE,CAAC,wBAAwB,CAAC;AAC1C,QAAQ,4BAA4B,EAAE;AACtC,YAAY,6EAA6E;AACzF,SAAS;AACT,QAAQ,qBAAqB,EAAE,CAAC,gDAAgD,CAAC;AACjF,QAAQ,4BAA4B,EAAE;AACtC,YAAY,gGAAgG;AAC5G,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,sEAAsE;AAClF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,sCAAsC,CAAC;AAC7D,QAAQ,SAAS,EAAE,CAAC,mCAAmC,CAAC;AACxD,QAAQ,yBAAyB,EAAE;AACnC,YAAY,6FAA6F;AACzG,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,mEAAmE;AAC/E,SAAS;AACT,QAAQ,yBAAyB,EAAE;AACnC,YAAY,0DAA0D;AACtE,SAAS;AACT,QAAQ,IAAI,EAAE,CAAC,uBAAuB,CAAC;AACvC,QAAQ,cAAc,EAAE,CAAC,yCAAyC,CAAC;AACnE,QAAQ,2BAA2B,EAAE;AACrC,YAAY,4EAA4E;AACxF,SAAS;AACT,QAAQ,oBAAoB,EAAE,CAAC,+CAA+C,CAAC;AAC/E,QAAQ,wBAAwB,EAAE,CAAC,iBAAiB,CAAC;AACrD,QAAQ,gBAAgB,EAAE,CAAC,2CAA2C,CAAC;AACvE,QAAQ,2BAA2B,EAAE;AACrC,YAAY,+CAA+C;AAC3D,SAAS;AACT,QAAQ,iBAAiB,EAAE;AAC3B,YAAY,4CAA4C;AACxD,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE;AACpD,SAAS;AACT,QAAQ,cAAc,EAAE,CAAC,yCAAyC,CAAC;AACnE,QAAQ,4BAA4B,EAAE;AACtC,YAAY,6DAA6D;AACzE,SAAS;AACT,QAAQ,kBAAkB,EAAE;AAC5B,YAAY,4DAA4D;AACxE,SAAS;AACT,QAAQ,eAAe,EAAE;AACzB,YAAY,2DAA2D;AACvE,SAAS;AACT,QAAQ,4BAA4B,EAAE;AACtC,YAAY,+FAA+F;AAC3G,SAAS;AACT,QAAQ,qBAAqB,EAAE;AAC/B,YAAY,qEAAqE;AACjF,SAAS;AACT,QAAQ,WAAW,EAAE,CAAC,qCAAqC,CAAC;AAC5D,KAAK;AACL,IAAI,KAAK,EAAE;AACX,QAAQ,wBAAwB,EAAE,CAAC,mBAAmB,CAAC;AACvD,QAAQ,KAAK,EAAE,CAAC,6BAA6B,CAAC;AAC9C,QAAQ,YAAY,EAAE,CAAC,6BAA6B,CAAC;AACrD,QAAQ,qBAAqB,EAAE,CAAC,+CAA+C,CAAC;AAChF,QAAQ,oCAAoC,EAAE,CAAC,gCAAgC,CAAC;AAChF,QAAQ,4BAA4B,EAAE,CAAC,qBAAqB,CAAC;AAC7D,QAAQ,kCAAkC,EAAE,CAAC,iBAAiB,CAAC;AAC/D,QAAQ,2BAA2B,EAAE,CAAC,qBAAqB,CAAC;AAC5D,QAAQ,4BAA4B,EAAE,CAAC,oCAAoC,CAAC;AAC5E,QAAQ,kCAAkC,EAAE,CAAC,4BAA4B,CAAC;AAC1E,QAAQ,MAAM,EAAE,CAAC,gCAAgC,CAAC;AAClD,QAAQ,gBAAgB,EAAE,CAAC,WAAW,CAAC;AACvC,QAAQ,aAAa,EAAE,CAAC,uBAAuB,CAAC;AAChD,QAAQ,iBAAiB,EAAE,CAAC,iCAAiC,CAAC;AAC9D,QAAQ,yBAAyB,EAAE,CAAC,iCAAiC,CAAC;AACtE,QAAQ,+BAA+B,EAAE,CAAC,yBAAyB,CAAC;AACpE,QAAQ,IAAI,EAAE,CAAC,YAAY,CAAC;AAC5B,QAAQ,0BAA0B,EAAE,CAAC,kBAAkB,CAAC;AACxD,QAAQ,0BAA0B,EAAE,CAAC,kBAAkB,CAAC;AACxD,QAAQ,2BAA2B,EAAE,CAAC,qBAAqB,CAAC;AAC5D,QAAQ,iCAAiC,EAAE,CAAC,qBAAqB,CAAC;AAClE,QAAQ,oBAAoB,EAAE,CAAC,iCAAiC,CAAC;AACjE,QAAQ,oBAAoB,EAAE,CAAC,iCAAiC,CAAC;AACjE,QAAQ,2BAA2B,EAAE,CAAC,oBAAoB,CAAC;AAC3D,QAAQ,kBAAkB,EAAE,CAAC,gCAAgC,CAAC;AAC9D,QAAQ,gCAAgC,EAAE,CAAC,yBAAyB,CAAC;AACrE,QAAQ,qBAAqB,EAAE,CAAC,4BAA4B,CAAC;AAC7D,QAAQ,iCAAiC,EAAE,CAAC,gBAAgB,CAAC;AAC7D,QAAQ,yCAAyC,EAAE,CAAC,8BAA8B,CAAC;AACnF,QAAQ,OAAO,EAAE,CAAC,gCAAgC,CAAC;AACnD,QAAQ,QAAQ,EAAE,CAAC,mCAAmC,CAAC;AACvD,QAAQ,mBAAmB,EAAE,CAAC,aAAa,CAAC;AAC5C,KAAK;AACL,CAAC;;ACl6CM,MAAM,OAAO,GAAG,mBAAmB,CAAC;;ACApC,SAAS,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE;AAC1D,IAAI,MAAM,UAAU,GAAG,EAAE,CAAC;AAC1B,IAAI,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACnE,QAAQ,KAAK,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AACxE,YAAY,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC;AAC5D,YAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACnD,YAAY,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9E,YAAY,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AACpC,gBAAgB,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AACvC,aAAa;AACb,YAAY,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AACnD,YAAY,IAAI,WAAW,EAAE;AAC7B,gBAAgB,YAAY,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;AAC/G,gBAAgB,SAAS;AACzB,aAAa;AACb,YAAY,YAAY,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAClF,SAAS;AACT,KAAK;AACL,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC;AACD,SAAS,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE;AACrE,IAAI,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACnE;AACA,IAAI,SAAS,eAAe,CAAC,GAAG,IAAI,EAAE;AACtC;AACA,QAAQ,IAAI,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AAClE;AACA,QAAQ,IAAI,WAAW,CAAC,SAAS,EAAE;AACnC,YAAY,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE;AACjD,gBAAgB,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;AACpD,gBAAgB,CAAC,WAAW,CAAC,SAAS,GAAG,SAAS;AAClD,aAAa,CAAC,CAAC;AACf,YAAY,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAChD,SAAS;AACT,QAAQ,IAAI,WAAW,CAAC,OAAO,EAAE;AACjC,YAAY,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC;AAClE,YAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5H,SAAS;AACT,QAAQ,IAAI,WAAW,CAAC,UAAU,EAAE;AACpC,YAAY,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,WAAW,CAAC,iBAAiB,EAAE;AAC3C;AACA,YAAY,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AACxE,YAAY,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE;AACvF,gBAAgB,IAAI,IAAI,IAAI,OAAO,EAAE;AACrC,oBAAoB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACzI,oBAAoB,IAAI,EAAE,KAAK,IAAI,OAAO,CAAC,EAAE;AAC7C,wBAAwB,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACvD,qBAAqB;AACrB,oBAAoB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,iBAAiB;AACjB,aAAa;AACb,YAAY,OAAO,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAChD,SAAS;AACT;AACA,QAAQ,OAAO,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;AAC5C,KAAK;AACL,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;AAC/D,CAAC;;ACxDM,SAAS,mBAAmB,CAAC,OAAO,EAAE;AAC7C,IAAI,MAAM,GAAG,GAAG,kBAAkB,CAAC,OAAO,EAAEA,SAAS,CAAC,CAAC;AACvD,IAAI,OAAO;AACX,QAAQ,IAAI,EAAE,GAAG;AACjB,KAAK,CAAC;AACN,CAAC;AACD,mBAAmB,CAAC,OAAO,GAAG,OAAO,CAAC;AACtC,AAAO,SAAS,yBAAyB,CAAC,OAAO,EAAE;AACnD,IAAI,MAAM,GAAG,GAAG,kBAAkB,CAAC,OAAO,EAAEA,SAAS,CAAC,CAAC;AACvD,IAAI,OAAO;AACX,QAAQ,GAAG,GAAG;AACd,QAAQ,IAAI,EAAE,GAAG;AACjB,KAAK,CAAC;AACN,CAAC;AACD,yBAAyB,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/plugin-rest-endpoint-methods/package.json b/node_modules/@octokit/plugin-rest-endpoint-methods/package.json index a093eca..89da12b 100644 --- a/node_modules/@octokit/plugin-rest-endpoint-methods/package.json +++ b/node_modules/@octokit/plugin-rest-endpoint-methods/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/plugin-rest-endpoint-methods", "description": "Octokit plugin adding one method for all of api.github.com REST API endpoints", - "version": "4.2.0", + "version": "5.8.0", "license": "MIT", "files": [ "dist-*/", @@ -15,15 +15,17 @@ "sdk", "toolkit" ], - "repository": "https://github.com/octokit/plugin-rest-endpoint-methods.js", + "repository": "github:octokit/plugin-rest-endpoint-methods.js", "dependencies": { - "@octokit/types": "^5.5.0", + "@octokit/types": "^6.25.0", "deprecation": "^2.3.1" }, + "peerDependencies": { + "@octokit/core": ">=3" + }, "devDependencies": { "@gimenete/type-writer": "^0.1.5", "@octokit/core": "^3.0.0", - "@octokit/graphql": "^4.3.1", "@pika/pack": "^0.5.0", "@pika/plugin-build-node": "^0.9.0", "@pika/plugin-build-web": "^0.9.0", @@ -32,19 +34,20 @@ "@types/jest": "^26.0.0", "@types/node": "^14.0.4", "fetch-mock": "^9.0.0", - "fs-extra": "^9.0.0", - "jest": "^26.1.0", + "fs-extra": "^10.0.0", + "github-openapi-graphql-query": "^1.0.5", + "jest": "^27.0.0", "lodash.camelcase": "^4.3.0", "lodash.set": "^4.3.2", "lodash.upperfirst": "^4.3.1", "mustache": "^4.0.0", "npm-run-all": "^4.1.5", - "prettier": "^2.0.1", + "prettier": "2.3.2", "semantic-release": "^17.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", - "sort-keys": "^4.0.0", + "sort-keys": "^4.2.0", "string-to-jsdoc-comment": "^1.0.0", - "ts-jest": "^26.1.3", + "ts-jest": "^27.0.0-next.12", "typescript": "^4.0.2" }, "publishConfig": { diff --git a/node_modules/@octokit/request-error/README.md b/node_modules/@octokit/request-error/README.md index 315064c..1bf5384 100644 --- a/node_modules/@octokit/request-error/README.md +++ b/node_modules/@octokit/request-error/README.md @@ -12,11 +12,11 @@ Browsers -Load @octokit/request-error directly from cdn.pika.dev +Load @octokit/request-error directly from cdn.skypack.dev ```html ``` @@ -55,11 +55,11 @@ const error = new RequestError("Oops", 500, { error.message; // Oops error.status; // 500 -error.headers; // { 'x-github-request-id': '1:2:3:4' } error.request.method; // POST error.request.url; // https://api.github.com/foo error.request.body; // { bar: 'baz' } error.request.headers; // { authorization: 'token [REDACTED]' } +error.response; // { url, status, headers, data } ``` ## LICENSE diff --git a/node_modules/@octokit/request-error/dist-node/index.js b/node_modules/@octokit/request-error/dist-node/index.js index 95b9c57..619f462 100644 --- a/node_modules/@octokit/request-error/dist-node/index.js +++ b/node_modules/@octokit/request-error/dist-node/index.js @@ -7,7 +7,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var deprecation = require('deprecation'); var once = _interopDefault(require('once')); -const logOnce = once(deprecation => console.warn(deprecation)); +const logOnceCode = once(deprecation => console.warn(deprecation)); +const logOnceHeaders = once(deprecation => console.warn(deprecation)); /** * Error with extra properties to help with debugging */ @@ -24,14 +25,17 @@ class RequestError extends Error { this.name = "HttpError"; this.status = statusCode; - Object.defineProperty(this, "code", { - get() { - logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } + let headers; + + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options - }); - this.headers = options.headers || {}; // redact request credentials without mutating original request options const requestCopy = Object.assign({}, options.request); @@ -46,7 +50,22 @@ class RequestError extends Error { .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; + this.request = requestCopy; // deprecations + + Object.defineProperty(this, "code", { + get() { + logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + } + + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; + } + + }); } } diff --git a/node_modules/@octokit/request-error/dist-node/index.js.map b/node_modules/@octokit/request-error/dist-node/index.js.map index 2562006..9134ddb 100644 --- a/node_modules/@octokit/request-error/dist-node/index.js.map +++ b/node_modules/@octokit/request-error/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["import { Deprecation } from \"deprecation\";\nimport once from \"once\";\nconst logOnce = once((deprecation) => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\nexport class RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message);\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = \"HttpError\";\n this.status = statusCode;\n Object.defineProperty(this, \"code\", {\n get() {\n logOnce(new Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n },\n });\n this.headers = options.headers || {};\n // redact request credentials without mutating original request options\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\"),\n });\n }\n requestCopy.url = requestCopy.url\n // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\")\n // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n }\n}\n"],"names":["logOnce","once","deprecation","console","warn","RequestError","Error","constructor","message","statusCode","options","captureStackTrace","name","status","Object","defineProperty","get","Deprecation","headers","requestCopy","assign","request","authorization","replace","url"],"mappings":";;;;;;;;;AAEA,MAAMA,OAAO,GAAGC,IAAI,CAAEC,WAAD,IAAiBC,OAAO,CAACC,IAAR,CAAaF,WAAb,CAAlB,CAApB;AACA;;;;AAGO,MAAMG,YAAN,SAA2BC,KAA3B,CAAiC;AACpCC,EAAAA,WAAW,CAACC,OAAD,EAAUC,UAAV,EAAsBC,OAAtB,EAA+B;AACtC,UAAMF,OAAN,EADsC;;AAGtC;;AACA,QAAIF,KAAK,CAACK,iBAAV,EAA6B;AACzBL,MAAAA,KAAK,CAACK,iBAAN,CAAwB,IAAxB,EAA8B,KAAKJ,WAAnC;AACH;;AACD,SAAKK,IAAL,GAAY,WAAZ;AACA,SAAKC,MAAL,GAAcJ,UAAd;AACAK,IAAAA,MAAM,CAACC,cAAP,CAAsB,IAAtB,EAA4B,MAA5B,EAAoC;AAChCC,MAAAA,GAAG,GAAG;AACFhB,QAAAA,OAAO,CAAC,IAAIiB,uBAAJ,CAAgB,0EAAhB,CAAD,CAAP;AACA,eAAOR,UAAP;AACH;;AAJ+B,KAApC;AAMA,SAAKS,OAAL,GAAeR,OAAO,CAACQ,OAAR,IAAmB,EAAlC,CAfsC;;AAiBtC,UAAMC,WAAW,GAAGL,MAAM,CAACM,MAAP,CAAc,EAAd,EAAkBV,OAAO,CAACW,OAA1B,CAApB;;AACA,QAAIX,OAAO,CAACW,OAAR,CAAgBH,OAAhB,CAAwBI,aAA5B,EAA2C;AACvCH,MAAAA,WAAW,CAACD,OAAZ,GAAsBJ,MAAM,CAACM,MAAP,CAAc,EAAd,EAAkBV,OAAO,CAACW,OAAR,CAAgBH,OAAlC,EAA2C;AAC7DI,QAAAA,aAAa,EAAEZ,OAAO,CAACW,OAAR,CAAgBH,OAAhB,CAAwBI,aAAxB,CAAsCC,OAAtC,CAA8C,MAA9C,EAAsD,aAAtD;AAD8C,OAA3C,CAAtB;AAGH;;AACDJ,IAAAA,WAAW,CAACK,GAAZ,GAAkBL,WAAW,CAACK,GAAZ;AAEd;AAFc,KAGbD,OAHa,CAGL,sBAHK,EAGmB,0BAHnB;AAKd;AALc,KAMbA,OANa,CAML,qBANK,EAMkB,yBANlB,CAAlB;AAOA,SAAKF,OAAL,GAAeF,WAAf;AACH;;AAhCmC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["import { Deprecation } from \"deprecation\";\nimport once from \"once\";\nconst logOnceCode = once((deprecation) => console.warn(deprecation));\nconst logOnceHeaders = once((deprecation) => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\nexport class RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message);\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n }\n // redact request credentials without mutating original request options\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\"),\n });\n }\n requestCopy.url = requestCopy.url\n // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\")\n // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n // deprecations\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n },\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n },\n });\n }\n}\n"],"names":["logOnceCode","once","deprecation","console","warn","logOnceHeaders","RequestError","Error","constructor","message","statusCode","options","captureStackTrace","name","status","headers","response","requestCopy","Object","assign","request","authorization","replace","url","defineProperty","get","Deprecation"],"mappings":";;;;;;;;;AAEA,MAAMA,WAAW,GAAGC,IAAI,CAAEC,WAAD,IAAiBC,OAAO,CAACC,IAAR,CAAaF,WAAb,CAAlB,CAAxB;AACA,MAAMG,cAAc,GAAGJ,IAAI,CAAEC,WAAD,IAAiBC,OAAO,CAACC,IAAR,CAAaF,WAAb,CAAlB,CAA3B;AACA;AACA;AACA;;AACO,MAAMI,YAAN,SAA2BC,KAA3B,CAAiC;AACpCC,EAAAA,WAAW,CAACC,OAAD,EAAUC,UAAV,EAAsBC,OAAtB,EAA+B;AACtC,UAAMF,OAAN,EADsC;;AAGtC;;AACA,QAAIF,KAAK,CAACK,iBAAV,EAA6B;AACzBL,MAAAA,KAAK,CAACK,iBAAN,CAAwB,IAAxB,EAA8B,KAAKJ,WAAnC;AACH;;AACD,SAAKK,IAAL,GAAY,WAAZ;AACA,SAAKC,MAAL,GAAcJ,UAAd;AACA,QAAIK,OAAJ;;AACA,QAAI,aAAaJ,OAAb,IAAwB,OAAOA,OAAO,CAACI,OAAf,KAA2B,WAAvD,EAAoE;AAChEA,MAAAA,OAAO,GAAGJ,OAAO,CAACI,OAAlB;AACH;;AACD,QAAI,cAAcJ,OAAlB,EAA2B;AACvB,WAAKK,QAAL,GAAgBL,OAAO,CAACK,QAAxB;AACAD,MAAAA,OAAO,GAAGJ,OAAO,CAACK,QAAR,CAAiBD,OAA3B;AACH,KAhBqC;;;AAkBtC,UAAME,WAAW,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBR,OAAO,CAACS,OAA1B,CAApB;;AACA,QAAIT,OAAO,CAACS,OAAR,CAAgBL,OAAhB,CAAwBM,aAA5B,EAA2C;AACvCJ,MAAAA,WAAW,CAACF,OAAZ,GAAsBG,MAAM,CAACC,MAAP,CAAc,EAAd,EAAkBR,OAAO,CAACS,OAAR,CAAgBL,OAAlC,EAA2C;AAC7DM,QAAAA,aAAa,EAAEV,OAAO,CAACS,OAAR,CAAgBL,OAAhB,CAAwBM,aAAxB,CAAsCC,OAAtC,CAA8C,MAA9C,EAAsD,aAAtD;AAD8C,OAA3C,CAAtB;AAGH;;AACDL,IAAAA,WAAW,CAACM,GAAZ,GAAkBN,WAAW,CAACM,GAAZ;AAEd;AAFc,KAGbD,OAHa,CAGL,sBAHK,EAGmB,0BAHnB;AAKd;AALc,KAMbA,OANa,CAML,qBANK,EAMkB,yBANlB,CAAlB;AAOA,SAAKF,OAAL,GAAeH,WAAf,CA/BsC;;AAiCtCC,IAAAA,MAAM,CAACM,cAAP,CAAsB,IAAtB,EAA4B,MAA5B,EAAoC;AAChCC,MAAAA,GAAG,GAAG;AACFzB,QAAAA,WAAW,CAAC,IAAI0B,uBAAJ,CAAgB,0EAAhB,CAAD,CAAX;AACA,eAAOhB,UAAP;AACH;;AAJ+B,KAApC;AAMAQ,IAAAA,MAAM,CAACM,cAAP,CAAsB,IAAtB,EAA4B,SAA5B,EAAuC;AACnCC,MAAAA,GAAG,GAAG;AACFpB,QAAAA,cAAc,CAAC,IAAIqB,uBAAJ,CAAgB,uFAAhB,CAAD,CAAd;AACA,eAAOX,OAAO,IAAI,EAAlB;AACH;;AAJkC,KAAvC;AAMH;;AA9CmC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/request-error/dist-src/index.js b/node_modules/@octokit/request-error/dist-src/index.js index c880b45..5eb1927 100644 --- a/node_modules/@octokit/request-error/dist-src/index.js +++ b/node_modules/@octokit/request-error/dist-src/index.js @@ -1,6 +1,7 @@ import { Deprecation } from "deprecation"; import once from "once"; -const logOnce = once((deprecation) => console.warn(deprecation)); +const logOnceCode = once((deprecation) => console.warn(deprecation)); +const logOnceHeaders = once((deprecation) => console.warn(deprecation)); /** * Error with extra properties to help with debugging */ @@ -14,13 +15,14 @@ export class RequestError extends Error { } this.name = "HttpError"; this.status = statusCode; - Object.defineProperty(this, "code", { - get() { - logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - }, - }); - this.headers = options.headers || {}; + let headers; + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { @@ -36,5 +38,18 @@ export class RequestError extends Error { // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); this.request = requestCopy; + // deprecations + Object.defineProperty(this, "code", { + get() { + logOnceCode(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + }, + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; + }, + }); } } diff --git a/node_modules/@octokit/request-error/dist-src/types.js b/node_modules/@octokit/request-error/dist-src/types.js index e69de29..cb0ff5c 100644 --- a/node_modules/@octokit/request-error/dist-src/types.js +++ b/node_modules/@octokit/request-error/dist-src/types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@octokit/request-error/dist-types/index.d.ts b/node_modules/@octokit/request-error/dist-types/index.d.ts index baa8a0e..d6e089c 100644 --- a/node_modules/@octokit/request-error/dist-types/index.d.ts +++ b/node_modules/@octokit/request-error/dist-types/index.d.ts @@ -1,4 +1,4 @@ -import { RequestOptions, ResponseHeaders } from "@octokit/types"; +import { RequestOptions, ResponseHeaders, OctokitResponse } from "@octokit/types"; import { RequestErrorOptions } from "./types"; /** * Error with extra properties to help with debugging @@ -15,13 +15,19 @@ export declare class RequestError extends Error { * @deprecated `error.code` is deprecated in favor of `error.status` */ code: number; + /** + * Request options that lead to the error. + */ + request: RequestOptions; /** * error response headers + * + * @deprecated `error.headers` is deprecated in favor of `error.response.headers` */ headers: ResponseHeaders; /** - * Request options that lead to the error. + * Response object if a response was received */ - request: RequestOptions; + response?: OctokitResponse; constructor(message: string, statusCode: number, options: RequestErrorOptions); } diff --git a/node_modules/@octokit/request-error/dist-types/types.d.ts b/node_modules/@octokit/request-error/dist-types/types.d.ts index 865d213..7785231 100644 --- a/node_modules/@octokit/request-error/dist-types/types.d.ts +++ b/node_modules/@octokit/request-error/dist-types/types.d.ts @@ -1,5 +1,9 @@ -import { RequestOptions, ResponseHeaders } from "@octokit/types"; +import { RequestOptions, ResponseHeaders, OctokitResponse } from "@octokit/types"; export declare type RequestErrorOptions = { + /** @deprecated set `response` instead */ headers?: ResponseHeaders; request: RequestOptions; +} | { + response: OctokitResponse; + request: RequestOptions; }; diff --git a/node_modules/@octokit/request-error/dist-web/index.js b/node_modules/@octokit/request-error/dist-web/index.js index feec58e..0fb64be 100644 --- a/node_modules/@octokit/request-error/dist-web/index.js +++ b/node_modules/@octokit/request-error/dist-web/index.js @@ -1,7 +1,8 @@ import { Deprecation } from 'deprecation'; import once from 'once'; -const logOnce = once((deprecation) => console.warn(deprecation)); +const logOnceCode = once((deprecation) => console.warn(deprecation)); +const logOnceHeaders = once((deprecation) => console.warn(deprecation)); /** * Error with extra properties to help with debugging */ @@ -15,13 +16,14 @@ class RequestError extends Error { } this.name = "HttpError"; this.status = statusCode; - Object.defineProperty(this, "code", { - get() { - logOnce(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - }, - }); - this.headers = options.headers || {}; + let headers; + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options const requestCopy = Object.assign({}, options.request); if (options.request.headers.authorization) { @@ -37,6 +39,19 @@ class RequestError extends Error { // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); this.request = requestCopy; + // deprecations + Object.defineProperty(this, "code", { + get() { + logOnceCode(new Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + }, + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; + }, + }); } } diff --git a/node_modules/@octokit/request-error/dist-web/index.js.map b/node_modules/@octokit/request-error/dist-web/index.js.map index 130740d..78f677f 100644 --- a/node_modules/@octokit/request-error/dist-web/index.js.map +++ b/node_modules/@octokit/request-error/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["import { Deprecation } from \"deprecation\";\nimport once from \"once\";\nconst logOnce = once((deprecation) => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\nexport class RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message);\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = \"HttpError\";\n this.status = statusCode;\n Object.defineProperty(this, \"code\", {\n get() {\n logOnce(new Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n },\n });\n this.headers = options.headers || {};\n // redact request credentials without mutating original request options\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\"),\n });\n }\n requestCopy.url = requestCopy.url\n // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\")\n // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n }\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACjE;AACA;AACA;AACO,MAAM,YAAY,SAAS,KAAK,CAAC;AACxC,IAAI,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE;AAC9C,QAAQ,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB;AACA;AACA,QAAQ,IAAI,KAAK,CAAC,iBAAiB,EAAE;AACrC,YAAY,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5D,SAAS;AACT,QAAQ,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;AAChC,QAAQ,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;AACjC,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;AAC5C,YAAY,GAAG,GAAG;AAClB,gBAAgB,OAAO,CAAC,IAAI,WAAW,CAAC,0EAA0E,CAAC,CAAC,CAAC;AACrH,gBAAgB,OAAO,UAAU,CAAC;AAClC,aAAa;AACb,SAAS,CAAC,CAAC;AACX,QAAQ,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;AAC7C;AACA,QAAQ,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/D,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE;AACnD,YAAY,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE;AAC7E,gBAAgB,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC;AACnG,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;AACzC;AACA;AACA,aAAa,OAAO,CAAC,sBAAsB,EAAE,0BAA0B,CAAC;AACxE;AACA;AACA,aAAa,OAAO,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAAC;AACvE,QAAQ,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;AACnC,KAAK;AACL;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["import { Deprecation } from \"deprecation\";\nimport once from \"once\";\nconst logOnceCode = once((deprecation) => console.warn(deprecation));\nconst logOnceHeaders = once((deprecation) => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\nexport class RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message);\n // Maintains proper stack trace (only available on V8)\n /* istanbul ignore next */\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n }\n // redact request credentials without mutating original request options\n const requestCopy = Object.assign({}, options.request);\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\"),\n });\n }\n requestCopy.url = requestCopy.url\n // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\")\n // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy;\n // deprecations\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n },\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n },\n });\n }\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACrE,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AACxE;AACA;AACA;AACO,MAAM,YAAY,SAAS,KAAK,CAAC;AACxC,IAAI,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE;AAC9C,QAAQ,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB;AACA;AACA,QAAQ,IAAI,KAAK,CAAC,iBAAiB,EAAE;AACrC,YAAY,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5D,SAAS;AACT,QAAQ,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;AAChC,QAAQ,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;AACjC,QAAQ,IAAI,OAAO,CAAC;AACpB,QAAQ,IAAI,SAAS,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,WAAW,EAAE;AAC5E,YAAY,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACtC,SAAS;AACT,QAAQ,IAAI,UAAU,IAAI,OAAO,EAAE;AACnC,YAAY,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AAC7C,YAAY,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;AAC/C,SAAS;AACT;AACA,QAAQ,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/D,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE;AACnD,YAAY,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE;AAC7E,gBAAgB,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC;AACnG,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG;AACzC;AACA;AACA,aAAa,OAAO,CAAC,sBAAsB,EAAE,0BAA0B,CAAC;AACxE;AACA;AACA,aAAa,OAAO,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,CAAC;AACvE,QAAQ,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC;AACnC;AACA,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;AAC5C,YAAY,GAAG,GAAG;AAClB,gBAAgB,WAAW,CAAC,IAAI,WAAW,CAAC,0EAA0E,CAAC,CAAC,CAAC;AACzH,gBAAgB,OAAO,UAAU,CAAC;AAClC,aAAa;AACb,SAAS,CAAC,CAAC;AACX,QAAQ,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;AAC/C,YAAY,GAAG,GAAG;AAClB,gBAAgB,cAAc,CAAC,IAAI,WAAW,CAAC,uFAAuF,CAAC,CAAC,CAAC;AACzI,gBAAgB,OAAO,OAAO,IAAI,EAAE,CAAC;AACrC,aAAa;AACb,SAAS,CAAC,CAAC;AACX,KAAK;AACL;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/request-error/package.json b/node_modules/@octokit/request-error/package.json index 14b0ff5..2f5b239 100644 --- a/node_modules/@octokit/request-error/package.json +++ b/node_modules/@octokit/request-error/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/request-error", "description": "Error class for Octokit request errors", - "version": "2.0.2", + "version": "2.1.0", "license": "MIT", "files": [ "dist-*/", @@ -15,16 +15,9 @@ "api", "error" ], - "homepage": "https://github.com/octokit/request-error.js#readme", - "bugs": { - "url": "https://github.com/octokit/request-error.js/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/octokit/request-error.js.git" - }, + "repository": "github:octokit/request-error.js", "dependencies": { - "@octokit/types": "^5.0.1", + "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", "once": "^1.4.0" }, @@ -37,12 +30,12 @@ "@types/jest": "^26.0.0", "@types/node": "^14.0.4", "@types/once": "^1.4.0", - "jest": "^25.1.0", + "jest": "^27.0.0", "pika-plugin-unpkg-field": "^1.1.0", - "prettier": "^2.0.1", + "prettier": "2.3.1", "semantic-release": "^17.0.0", - "ts-jest": "^25.1.0", - "typescript": "^3.4.5" + "ts-jest": "^27.0.0-next.12", + "typescript": "^4.0.0" }, "publishConfig": { "access": "public" diff --git a/node_modules/@octokit/request/README.md b/node_modules/@octokit/request/README.md index ef04ae8..747a670 100644 --- a/node_modules/@octokit/request/README.md +++ b/node_modules/@octokit/request/README.md @@ -38,7 +38,7 @@ the passed options and sends the request using [fetch](https://developer.mozilla 🤩 1:1 mapping of REST API endpoint documentation, e.g. [Add labels to an issue](https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue) becomes ```js -request("POST /repos/:owner/:repo/issues/:number/labels", { +request("POST /repos/{owner}/{repo}/issues/{number}/labels", { mediaType: { previews: ["symmetra"], }, @@ -70,11 +70,11 @@ request("POST /repos/:owner/:repo/issues/:number/labels", { Browsers -Load @octokit/request directly from cdn.pika.dev +Load @octokit/request directly from cdn.skypack.dev ```html ``` @@ -99,7 +99,7 @@ const { request } = require("@octokit/request"); ```js // Following GitHub docs formatting: // https://developer.github.com/v3/repos/#list-organization-repositories -const result = await request("GET /orgs/:org/repos", { +const result = await request("GET /orgs/{org}/repos", { headers: { authorization: "token 0000000000000000000000000000000000000001", }, @@ -139,7 +139,7 @@ Alternatively, pass in a method and a url ```js const result = await request({ method: "GET", - url: "/orgs/:org/repos", + url: "/orgs/{org}/repos", headers: { authorization: "token 0000000000000000000000000000000000000001", }, @@ -166,7 +166,7 @@ For more complex authentication strategies such as GitHub Apps or Basic, we reco ```js const { createAppAuth } = require("@octokit/auth-app"); const auth = createAppAuth({ - id: process.env.APP_ID, + appId: process.env.APP_ID, privateKey: process.env.PRIVATE_KEY, installationId: 123, }); @@ -180,11 +180,14 @@ const requestWithAuth = request.defaults({ }); const { data: app } = await requestWithAuth("GET /app"); -const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { - owner: "octocat", - repo: "hello-world", - title: "Hello from the engine room", -}); +const { data: app } = await requestWithAuth( + "POST /repos/{owner}/{repo}/issues", + { + owner: "octocat", + repo: "hello-world", + title: "Hello from the engine room", + } +); ``` ## request() @@ -215,7 +218,7 @@ const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { String - If route is set it has to be a string consisting of the request method and URL, e.g. GET /orgs/:org + **Required**. If route is set it has to be a string consisting of the request method and URL, e.g. GET /orgs/{org} @@ -226,7 +229,7 @@ const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { String - Required. Any supported http verb, case insensitive. Defaults to https://api.github.com. + The base URL that route or url will be prefixed with, if they use relative paths. Defaults to https://api.github.com. @@ -271,7 +274,7 @@ const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { String - Required. Any supported http verb, case insensitive. Defaults to Get. + Any supported http verb, case insensitive. Defaults to Get. @@ -282,8 +285,8 @@ const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { String - Required. A path or full URL which may contain :variable or {variable} placeholders, - e.g. /orgs/:org/repos. The url is parsed using url-template. + **Required**. A path or full URL which may contain :variable or {variable} placeholders, + e.g. /orgs/{org}/repos. The url is parsed using url-template. @@ -340,6 +343,16 @@ const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { Use an AbortController instance to cancel a request. In node you can only cancel streamed requests. + + + options.request.log + + + object + + + Used for internal logging. Defaults to console. + @@ -356,7 +369,7 @@ const { data: app } = await requestWithAuth("POST /repos/:owner/:repo/issues", { All other options except `options.request.*` will be passed depending on the `method` and `url` options. -1. If the option key is a placeholder in the `url`, it will be used as replacement. For example, if the passed options are `{url: '/orgs/:org/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos` +1. If the option key is a placeholder in the `url`, it will be used as replacement. For example, if the passed options are `{url: '/orgs/{org}/repos', org: 'foo'}` the returned `options.url` is `https://api.github.com/orgs/foo/repos` 2. If the `method` is `GET` or `HEAD`, the option is passed as query parameter 3. Otherwise the parameter is passed in the request body as JSON key. @@ -403,8 +416,8 @@ All other options except `options.request.*` will be passed depending on the `me If an error occurs, the `error` instance has additional properties to help with debugging - `error.status` The http response status code -- `error.headers` The http response headers as an object - `error.request` The request options such as `method`, `url` and `data` +- `error.response` The http response object with `url`, `headers`, and `data` ## `request.defaults()` @@ -421,7 +434,7 @@ const myrequest = require("@octokit/request").defaults({ per_page: 100, }); -myrequest(`GET /orgs/:org/repos`); +myrequest(`GET /orgs/{org}/repos`); ``` You can call `.defaults()` again on the returned method, the defaults will cascade. @@ -450,7 +463,7 @@ by the global default. See https://github.com/octokit/endpoint.js. Example ```js -const options = request.endpoint("GET /orgs/:org/repos", { +const options = request.endpoint("GET /orgs/{org}/repos", { org: "my-project", type: "private", }); diff --git a/node_modules/@octokit/request/dist-node/index.js b/node_modules/@octokit/request/dist-node/index.js index 8518d80..de0944b 100644 --- a/node_modules/@octokit/request/dist-node/index.js +++ b/node_modules/@octokit/request/dist-node/index.js @@ -10,13 +10,15 @@ var isPlainObject = require('is-plain-object'); var nodeFetch = _interopDefault(require('node-fetch')); var requestError = require('@octokit/request-error'); -const VERSION = "5.4.9"; +const VERSION = "5.6.1"; function getBufferResponse(response) { return response.arrayBuffer(); } function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); } @@ -30,7 +32,9 @@ function fetchWrapper(requestOptions) { body: requestOptions.body, headers: requestOptions.headers, redirect: requestOptions.redirect - }, requestOptions.request)).then(response => { + }, // `requestOptions.request.agent` type is incompatible + // see https://github.com/octokit/types.ts/pull/264 + requestOptions.request)).then(async response => { url = response.url; status = response.status; @@ -38,6 +42,12 @@ function fetchWrapper(requestOptions) { headers[keyAndValue[0]] = keyAndValue[1]; } + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } + if (status === 204 || status === 205) { return; } // GitHub API returns 200 for HEAD requests @@ -49,49 +59,43 @@ function fetchWrapper(requestOptions) { } throw new requestError.RequestError(response.statusText, status, { - headers, + response: { + url, + status, + headers, + data: undefined + }, request: requestOptions }); } if (status === 304) { throw new requestError.RequestError("Not modified", status, { - headers, + response: { + url, + status, + headers, + data: await getResponseData(response) + }, request: requestOptions }); } if (status >= 400) { - return response.text().then(message => { - const error = new requestError.RequestError(message, status, { + const data = await getResponseData(response); + const error = new requestError.RequestError(toErrorMessage(data), status, { + response: { + url, + status, headers, - request: requestOptions - }); - - try { - let responseBody = JSON.parse(error.message); - Object.assign(error, responseBody); - let errors = responseBody.errors; // Assumption `errors` would always be in Array format - - error.message = error.message + ": " + errors.map(JSON.stringify).join(", "); - } catch (e) {// ignore, see octokit/rest.js#684 - } - - throw error; + data + }, + request: requestOptions }); + throw error; } - const contentType = response.headers.get("content-type"); - - if (/application\/json/.test(contentType)) { - return response.json(); - } - - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - - return getBufferResponse(response); + return getResponseData(response); }).then(data => { return { status, @@ -100,17 +104,42 @@ function fetchWrapper(requestOptions) { data }; }).catch(error => { - if (error instanceof requestError.RequestError) { - throw error; - } - + if (error instanceof requestError.RequestError) throw error; throw new requestError.RequestError(error.message, 500, { - headers, request: requestOptions }); }); } +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + + if (/application\/json/.test(contentType)) { + return response.json(); + } + + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } + + return getBufferResponse(response); +} + +function toErrorMessage(data) { + if (typeof data === "string") return data; // istanbul ignore else - just in case + + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } + + return data.message; + } // istanbul ignore next - just in case + + + return `Unknown error: ${JSON.stringify(data)}`; +} + function withDefaults(oldEndpoint, newDefaults) { const endpoint = oldEndpoint.defaults(newDefaults); diff --git a/node_modules/@octokit/request/dist-node/index.js.map b/node_modules/@octokit/request/dist-node/index.js.map index 11d9ddc..1a9c9e3 100644 --- a/node_modules/@octokit/request/dist-node/index.js.map +++ b/node_modules/@octokit/request/dist-node/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-buffer-response.js","../dist-src/fetch-wrapper.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"5.4.9\";\n","export default function getBufferResponse(response) {\n return response.arrayBuffer();\n}\n","import { isPlainObject } from \"is-plain-object\";\nimport nodeFetch from \"node-fetch\";\nimport { RequestError } from \"@octokit/request-error\";\nimport getBuffer from \"./get-buffer-response\";\nexport default function fetchWrapper(requestOptions) {\n if (isPlainObject(requestOptions.body) ||\n Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n let headers = {};\n let status;\n let url;\n const fetch = (requestOptions.request && requestOptions.request.fetch) || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect,\n }, requestOptions.request))\n .then((response) => {\n url = response.url;\n status = response.status;\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n if (status === 204 || status === 205) {\n return;\n }\n // GitHub API returns 200 for HEAD requests\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n throw new RequestError(response.statusText, status, {\n headers,\n request: requestOptions,\n });\n }\n if (status === 304) {\n throw new RequestError(\"Not modified\", status, {\n headers,\n request: requestOptions,\n });\n }\n if (status >= 400) {\n return response\n .text()\n .then((message) => {\n const error = new RequestError(message, status, {\n headers,\n request: requestOptions,\n });\n try {\n let responseBody = JSON.parse(error.message);\n Object.assign(error, responseBody);\n let errors = responseBody.errors;\n // Assumption `errors` would always be in Array format\n error.message =\n error.message + \": \" + errors.map(JSON.stringify).join(\", \");\n }\n catch (e) {\n // ignore, see octokit/rest.js#684\n }\n throw error;\n });\n }\n const contentType = response.headers.get(\"content-type\");\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n return getBuffer(response);\n })\n .then((data) => {\n return {\n status,\n url,\n headers,\n data,\n };\n })\n .catch((error) => {\n if (error instanceof RequestError) {\n throw error;\n }\n throw new RequestError(error.message, 500, {\n headers,\n request: requestOptions,\n });\n });\n}\n","import fetchWrapper from \"./fetch-wrapper\";\nexport default function withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n}\n","import { endpoint } from \"@octokit/endpoint\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport withDefaults from \"./with-defaults\";\nexport const request = withDefaults(endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${getUserAgent()}`,\n },\n});\n"],"names":["VERSION","getBufferResponse","response","arrayBuffer","fetchWrapper","requestOptions","isPlainObject","body","Array","isArray","JSON","stringify","headers","status","url","fetch","request","nodeFetch","Object","assign","method","redirect","then","keyAndValue","RequestError","statusText","text","message","error","responseBody","parse","errors","map","join","e","contentType","get","test","json","getBuffer","data","catch","withDefaults","oldEndpoint","newDefaults","endpoint","defaults","newApi","route","parameters","endpointOptions","merge","hook","bind","getUserAgent"],"mappings":";;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAQ,SAASC,iBAAT,CAA2BC,QAA3B,EAAqC;AAChD,SAAOA,QAAQ,CAACC,WAAT,EAAP;AACH;;ACEc,SAASC,YAAT,CAAsBC,cAAtB,EAAsC;AACjD,MAAIC,2BAAa,CAACD,cAAc,CAACE,IAAhB,CAAb,IACAC,KAAK,CAACC,OAAN,CAAcJ,cAAc,CAACE,IAA7B,CADJ,EACwC;AACpCF,IAAAA,cAAc,CAACE,IAAf,GAAsBG,IAAI,CAACC,SAAL,CAAeN,cAAc,CAACE,IAA9B,CAAtB;AACH;;AACD,MAAIK,OAAO,GAAG,EAAd;AACA,MAAIC,MAAJ;AACA,MAAIC,GAAJ;AACA,QAAMC,KAAK,GAAIV,cAAc,CAACW,OAAf,IAA0BX,cAAc,CAACW,OAAf,CAAuBD,KAAlD,IAA4DE,SAA1E;AACA,SAAOF,KAAK,CAACV,cAAc,CAACS,GAAhB,EAAqBI,MAAM,CAACC,MAAP,CAAc;AAC3CC,IAAAA,MAAM,EAAEf,cAAc,CAACe,MADoB;AAE3Cb,IAAAA,IAAI,EAAEF,cAAc,CAACE,IAFsB;AAG3CK,IAAAA,OAAO,EAAEP,cAAc,CAACO,OAHmB;AAI3CS,IAAAA,QAAQ,EAAEhB,cAAc,CAACgB;AAJkB,GAAd,EAK9BhB,cAAc,CAACW,OALe,CAArB,CAAL,CAMFM,IANE,CAMIpB,QAAD,IAAc;AACpBY,IAAAA,GAAG,GAAGZ,QAAQ,CAACY,GAAf;AACAD,IAAAA,MAAM,GAAGX,QAAQ,CAACW,MAAlB;;AACA,SAAK,MAAMU,WAAX,IAA0BrB,QAAQ,CAACU,OAAnC,EAA4C;AACxCA,MAAAA,OAAO,CAACW,WAAW,CAAC,CAAD,CAAZ,CAAP,GAA0BA,WAAW,CAAC,CAAD,CAArC;AACH;;AACD,QAAIV,MAAM,KAAK,GAAX,IAAkBA,MAAM,KAAK,GAAjC,EAAsC;AAClC;AACH,KARmB;;;AAUpB,QAAIR,cAAc,CAACe,MAAf,KAA0B,MAA9B,EAAsC;AAClC,UAAIP,MAAM,GAAG,GAAb,EAAkB;AACd;AACH;;AACD,YAAM,IAAIW,yBAAJ,CAAiBtB,QAAQ,CAACuB,UAA1B,EAAsCZ,MAAtC,EAA8C;AAChDD,QAAAA,OADgD;AAEhDI,QAAAA,OAAO,EAAEX;AAFuC,OAA9C,CAAN;AAIH;;AACD,QAAIQ,MAAM,KAAK,GAAf,EAAoB;AAChB,YAAM,IAAIW,yBAAJ,CAAiB,cAAjB,EAAiCX,MAAjC,EAAyC;AAC3CD,QAAAA,OAD2C;AAE3CI,QAAAA,OAAO,EAAEX;AAFkC,OAAzC,CAAN;AAIH;;AACD,QAAIQ,MAAM,IAAI,GAAd,EAAmB;AACf,aAAOX,QAAQ,CACVwB,IADE,GAEFJ,IAFE,CAEIK,OAAD,IAAa;AACnB,cAAMC,KAAK,GAAG,IAAIJ,yBAAJ,CAAiBG,OAAjB,EAA0Bd,MAA1B,EAAkC;AAC5CD,UAAAA,OAD4C;AAE5CI,UAAAA,OAAO,EAAEX;AAFmC,SAAlC,CAAd;;AAIA,YAAI;AACA,cAAIwB,YAAY,GAAGnB,IAAI,CAACoB,KAAL,CAAWF,KAAK,CAACD,OAAjB,CAAnB;AACAT,UAAAA,MAAM,CAACC,MAAP,CAAcS,KAAd,EAAqBC,YAArB;AACA,cAAIE,MAAM,GAAGF,YAAY,CAACE,MAA1B,CAHA;;AAKAH,UAAAA,KAAK,CAACD,OAAN,GACIC,KAAK,CAACD,OAAN,GAAgB,IAAhB,GAAuBI,MAAM,CAACC,GAAP,CAAWtB,IAAI,CAACC,SAAhB,EAA2BsB,IAA3B,CAAgC,IAAhC,CAD3B;AAEH,SAPD,CAQA,OAAOC,CAAP,EAAU;AAET;;AACD,cAAMN,KAAN;AACH,OAnBM,CAAP;AAoBH;;AACD,UAAMO,WAAW,GAAGjC,QAAQ,CAACU,OAAT,CAAiBwB,GAAjB,CAAqB,cAArB,CAApB;;AACA,QAAI,oBAAoBC,IAApB,CAAyBF,WAAzB,CAAJ,EAA2C;AACvC,aAAOjC,QAAQ,CAACoC,IAAT,EAAP;AACH;;AACD,QAAI,CAACH,WAAD,IAAgB,yBAAyBE,IAAzB,CAA8BF,WAA9B,CAApB,EAAgE;AAC5D,aAAOjC,QAAQ,CAACwB,IAAT,EAAP;AACH;;AACD,WAAOa,iBAAS,CAACrC,QAAD,CAAhB;AACH,GA7DM,EA8DFoB,IA9DE,CA8DIkB,IAAD,IAAU;AAChB,WAAO;AACH3B,MAAAA,MADG;AAEHC,MAAAA,GAFG;AAGHF,MAAAA,OAHG;AAIH4B,MAAAA;AAJG,KAAP;AAMH,GArEM,EAsEFC,KAtEE,CAsEKb,KAAD,IAAW;AAClB,QAAIA,KAAK,YAAYJ,yBAArB,EAAmC;AAC/B,YAAMI,KAAN;AACH;;AACD,UAAM,IAAIJ,yBAAJ,CAAiBI,KAAK,CAACD,OAAvB,EAAgC,GAAhC,EAAqC;AACvCf,MAAAA,OADuC;AAEvCI,MAAAA,OAAO,EAAEX;AAF8B,KAArC,CAAN;AAIH,GA9EM,CAAP;AA+EH;;AC3Fc,SAASqC,YAAT,CAAsBC,WAAtB,EAAmCC,WAAnC,EAAgD;AAC3D,QAAMC,QAAQ,GAAGF,WAAW,CAACG,QAAZ,CAAqBF,WAArB,CAAjB;;AACA,QAAMG,MAAM,GAAG,UAAUC,KAAV,EAAiBC,UAAjB,EAA6B;AACxC,UAAMC,eAAe,GAAGL,QAAQ,CAACM,KAAT,CAAeH,KAAf,EAAsBC,UAAtB,CAAxB;;AACA,QAAI,CAACC,eAAe,CAAClC,OAAjB,IAA4B,CAACkC,eAAe,CAAClC,OAAhB,CAAwBoC,IAAzD,EAA+D;AAC3D,aAAOhD,YAAY,CAACyC,QAAQ,CAACf,KAAT,CAAeoB,eAAf,CAAD,CAAnB;AACH;;AACD,UAAMlC,OAAO,GAAG,CAACgC,KAAD,EAAQC,UAAR,KAAuB;AACnC,aAAO7C,YAAY,CAACyC,QAAQ,CAACf,KAAT,CAAee,QAAQ,CAACM,KAAT,CAAeH,KAAf,EAAsBC,UAAtB,CAAf,CAAD,CAAnB;AACH,KAFD;;AAGA/B,IAAAA,MAAM,CAACC,MAAP,CAAcH,OAAd,EAAuB;AACnB6B,MAAAA,QADmB;AAEnBC,MAAAA,QAAQ,EAAEJ,YAAY,CAACW,IAAb,CAAkB,IAAlB,EAAwBR,QAAxB;AAFS,KAAvB;AAIA,WAAOK,eAAe,CAAClC,OAAhB,CAAwBoC,IAAxB,CAA6BpC,OAA7B,EAAsCkC,eAAtC,CAAP;AACH,GAbD;;AAcA,SAAOhC,MAAM,CAACC,MAAP,CAAc4B,MAAd,EAAsB;AACzBF,IAAAA,QADyB;AAEzBC,IAAAA,QAAQ,EAAEJ,YAAY,CAACW,IAAb,CAAkB,IAAlB,EAAwBR,QAAxB;AAFe,GAAtB,CAAP;AAIH;;MCjBY7B,OAAO,GAAG0B,YAAY,CAACG,iBAAD,EAAW;AAC1CjC,EAAAA,OAAO,EAAE;AACL,kBAAe,sBAAqBZ,OAAQ,IAAGsD,+BAAY,EAAG;AADzD;AADiC,CAAX,CAA5B;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-buffer-response.js","../dist-src/fetch-wrapper.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"5.6.1\";\n","export default function getBufferResponse(response) {\n return response.arrayBuffer();\n}\n","import { isPlainObject } from \"is-plain-object\";\nimport nodeFetch from \"node-fetch\";\nimport { RequestError } from \"@octokit/request-error\";\nimport getBuffer from \"./get-buffer-response\";\nexport default function fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log\n ? requestOptions.request.log\n : console;\n if (isPlainObject(requestOptions.body) ||\n Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n let headers = {};\n let status;\n let url;\n const fetch = (requestOptions.request && requestOptions.request.fetch) || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect,\n }, \n // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request))\n .then(async (response) => {\n url = response.url;\n status = response.status;\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n if (status === 204 || status === 205) {\n return;\n }\n // GitHub API returns 200 for HEAD requests\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n throw new RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined,\n },\n request: requestOptions,\n });\n }\n if (status === 304) {\n throw new RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response),\n },\n request: requestOptions,\n });\n }\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data,\n },\n request: requestOptions,\n });\n throw error;\n }\n return getResponseData(response);\n })\n .then((data) => {\n return {\n status,\n url,\n headers,\n data,\n };\n })\n .catch((error) => {\n if (error instanceof RequestError)\n throw error;\n throw new RequestError(error.message, 500, {\n request: requestOptions,\n });\n });\n}\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n return getBuffer(response);\n}\nfunction toErrorMessage(data) {\n if (typeof data === \"string\")\n return data;\n // istanbul ignore else - just in case\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n return data.message;\n }\n // istanbul ignore next - just in case\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n","import fetchWrapper from \"./fetch-wrapper\";\nexport default function withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n}\n","import { endpoint } from \"@octokit/endpoint\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport withDefaults from \"./with-defaults\";\nexport const request = withDefaults(endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${getUserAgent()}`,\n },\n});\n"],"names":["VERSION","getBufferResponse","response","arrayBuffer","fetchWrapper","requestOptions","log","request","console","isPlainObject","body","Array","isArray","JSON","stringify","headers","status","url","fetch","nodeFetch","Object","assign","method","redirect","then","keyAndValue","matches","link","match","deprecationLink","pop","warn","sunset","RequestError","statusText","data","undefined","getResponseData","error","toErrorMessage","catch","message","contentType","get","test","json","text","getBuffer","errors","map","join","withDefaults","oldEndpoint","newDefaults","endpoint","defaults","newApi","route","parameters","endpointOptions","merge","hook","parse","bind","getUserAgent"],"mappings":";;;;;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;ACAQ,SAASC,iBAAT,CAA2BC,QAA3B,EAAqC;AAChD,SAAOA,QAAQ,CAACC,WAAT,EAAP;AACH;;ACEc,SAASC,YAAT,CAAsBC,cAAtB,EAAsC;AACjD,QAAMC,GAAG,GAAGD,cAAc,CAACE,OAAf,IAA0BF,cAAc,CAACE,OAAf,CAAuBD,GAAjD,GACND,cAAc,CAACE,OAAf,CAAuBD,GADjB,GAENE,OAFN;;AAGA,MAAIC,2BAAa,CAACJ,cAAc,CAACK,IAAhB,CAAb,IACAC,KAAK,CAACC,OAAN,CAAcP,cAAc,CAACK,IAA7B,CADJ,EACwC;AACpCL,IAAAA,cAAc,CAACK,IAAf,GAAsBG,IAAI,CAACC,SAAL,CAAeT,cAAc,CAACK,IAA9B,CAAtB;AACH;;AACD,MAAIK,OAAO,GAAG,EAAd;AACA,MAAIC,MAAJ;AACA,MAAIC,GAAJ;AACA,QAAMC,KAAK,GAAIb,cAAc,CAACE,OAAf,IAA0BF,cAAc,CAACE,OAAf,CAAuBW,KAAlD,IAA4DC,SAA1E;AACA,SAAOD,KAAK,CAACb,cAAc,CAACY,GAAhB,EAAqBG,MAAM,CAACC,MAAP,CAAc;AAC3CC,IAAAA,MAAM,EAAEjB,cAAc,CAACiB,MADoB;AAE3CZ,IAAAA,IAAI,EAAEL,cAAc,CAACK,IAFsB;AAG3CK,IAAAA,OAAO,EAAEV,cAAc,CAACU,OAHmB;AAI3CQ,IAAAA,QAAQ,EAAElB,cAAc,CAACkB;AAJkB,GAAd;AAOjC;AACAlB,EAAAA,cAAc,CAACE,OARkB,CAArB,CAAL,CASFiB,IATE,CASG,MAAOtB,QAAP,IAAoB;AAC1Be,IAAAA,GAAG,GAAGf,QAAQ,CAACe,GAAf;AACAD,IAAAA,MAAM,GAAGd,QAAQ,CAACc,MAAlB;;AACA,SAAK,MAAMS,WAAX,IAA0BvB,QAAQ,CAACa,OAAnC,EAA4C;AACxCA,MAAAA,OAAO,CAACU,WAAW,CAAC,CAAD,CAAZ,CAAP,GAA0BA,WAAW,CAAC,CAAD,CAArC;AACH;;AACD,QAAI,iBAAiBV,OAArB,EAA8B;AAC1B,YAAMW,OAAO,GAAGX,OAAO,CAACY,IAAR,IAAgBZ,OAAO,CAACY,IAAR,CAAaC,KAAb,CAAmB,8BAAnB,CAAhC;AACA,YAAMC,eAAe,GAAGH,OAAO,IAAIA,OAAO,CAACI,GAAR,EAAnC;AACAxB,MAAAA,GAAG,CAACyB,IAAJ,CAAU,uBAAsB1B,cAAc,CAACiB,MAAO,IAAGjB,cAAc,CAACY,GAAI,qDAAoDF,OAAO,CAACiB,MAAO,GAAEH,eAAe,GAAI,SAAQA,eAAgB,EAA5B,GAAgC,EAAG,EAAnM;AACH;;AACD,QAAIb,MAAM,KAAK,GAAX,IAAkBA,MAAM,KAAK,GAAjC,EAAsC;AAClC;AACH,KAbyB;;;AAe1B,QAAIX,cAAc,CAACiB,MAAf,KAA0B,MAA9B,EAAsC;AAClC,UAAIN,MAAM,GAAG,GAAb,EAAkB;AACd;AACH;;AACD,YAAM,IAAIiB,yBAAJ,CAAiB/B,QAAQ,CAACgC,UAA1B,EAAsClB,MAAtC,EAA8C;AAChDd,QAAAA,QAAQ,EAAE;AACNe,UAAAA,GADM;AAEND,UAAAA,MAFM;AAGND,UAAAA,OAHM;AAINoB,UAAAA,IAAI,EAAEC;AAJA,SADsC;AAOhD7B,QAAAA,OAAO,EAAEF;AAPuC,OAA9C,CAAN;AASH;;AACD,QAAIW,MAAM,KAAK,GAAf,EAAoB;AAChB,YAAM,IAAIiB,yBAAJ,CAAiB,cAAjB,EAAiCjB,MAAjC,EAAyC;AAC3Cd,QAAAA,QAAQ,EAAE;AACNe,UAAAA,GADM;AAEND,UAAAA,MAFM;AAGND,UAAAA,OAHM;AAINoB,UAAAA,IAAI,EAAE,MAAME,eAAe,CAACnC,QAAD;AAJrB,SADiC;AAO3CK,QAAAA,OAAO,EAAEF;AAPkC,OAAzC,CAAN;AASH;;AACD,QAAIW,MAAM,IAAI,GAAd,EAAmB;AACf,YAAMmB,IAAI,GAAG,MAAME,eAAe,CAACnC,QAAD,CAAlC;AACA,YAAMoC,KAAK,GAAG,IAAIL,yBAAJ,CAAiBM,cAAc,CAACJ,IAAD,CAA/B,EAAuCnB,MAAvC,EAA+C;AACzDd,QAAAA,QAAQ,EAAE;AACNe,UAAAA,GADM;AAEND,UAAAA,MAFM;AAGND,UAAAA,OAHM;AAINoB,UAAAA;AAJM,SAD+C;AAOzD5B,QAAAA,OAAO,EAAEF;AAPgD,OAA/C,CAAd;AASA,YAAMiC,KAAN;AACH;;AACD,WAAOD,eAAe,CAACnC,QAAD,CAAtB;AACH,GA/DM,EAgEFsB,IAhEE,CAgEIW,IAAD,IAAU;AAChB,WAAO;AACHnB,MAAAA,MADG;AAEHC,MAAAA,GAFG;AAGHF,MAAAA,OAHG;AAIHoB,MAAAA;AAJG,KAAP;AAMH,GAvEM,EAwEFK,KAxEE,CAwEKF,KAAD,IAAW;AAClB,QAAIA,KAAK,YAAYL,yBAArB,EACI,MAAMK,KAAN;AACJ,UAAM,IAAIL,yBAAJ,CAAiBK,KAAK,CAACG,OAAvB,EAAgC,GAAhC,EAAqC;AACvClC,MAAAA,OAAO,EAAEF;AAD8B,KAArC,CAAN;AAGH,GA9EM,CAAP;AA+EH;;AACD,eAAegC,eAAf,CAA+BnC,QAA/B,EAAyC;AACrC,QAAMwC,WAAW,GAAGxC,QAAQ,CAACa,OAAT,CAAiB4B,GAAjB,CAAqB,cAArB,CAApB;;AACA,MAAI,oBAAoBC,IAApB,CAAyBF,WAAzB,CAAJ,EAA2C;AACvC,WAAOxC,QAAQ,CAAC2C,IAAT,EAAP;AACH;;AACD,MAAI,CAACH,WAAD,IAAgB,yBAAyBE,IAAzB,CAA8BF,WAA9B,CAApB,EAAgE;AAC5D,WAAOxC,QAAQ,CAAC4C,IAAT,EAAP;AACH;;AACD,SAAOC,iBAAS,CAAC7C,QAAD,CAAhB;AACH;;AACD,SAASqC,cAAT,CAAwBJ,IAAxB,EAA8B;AAC1B,MAAI,OAAOA,IAAP,KAAgB,QAApB,EACI,OAAOA,IAAP,CAFsB;;AAI1B,MAAI,aAAaA,IAAjB,EAAuB;AACnB,QAAIxB,KAAK,CAACC,OAAN,CAAcuB,IAAI,CAACa,MAAnB,CAAJ,EAAgC;AAC5B,aAAQ,GAAEb,IAAI,CAACM,OAAQ,KAAIN,IAAI,CAACa,MAAL,CAAYC,GAAZ,CAAgBpC,IAAI,CAACC,SAArB,EAAgCoC,IAAhC,CAAqC,IAArC,CAA2C,EAAtE;AACH;;AACD,WAAOf,IAAI,CAACM,OAAZ;AACH,GATyB;;;AAW1B,SAAQ,kBAAiB5B,IAAI,CAACC,SAAL,CAAeqB,IAAf,CAAqB,EAA9C;AACH;;ACrHc,SAASgB,YAAT,CAAsBC,WAAtB,EAAmCC,WAAnC,EAAgD;AAC3D,QAAMC,QAAQ,GAAGF,WAAW,CAACG,QAAZ,CAAqBF,WAArB,CAAjB;;AACA,QAAMG,MAAM,GAAG,UAAUC,KAAV,EAAiBC,UAAjB,EAA6B;AACxC,UAAMC,eAAe,GAAGL,QAAQ,CAACM,KAAT,CAAeH,KAAf,EAAsBC,UAAtB,CAAxB;;AACA,QAAI,CAACC,eAAe,CAACpD,OAAjB,IAA4B,CAACoD,eAAe,CAACpD,OAAhB,CAAwBsD,IAAzD,EAA+D;AAC3D,aAAOzD,YAAY,CAACkD,QAAQ,CAACQ,KAAT,CAAeH,eAAf,CAAD,CAAnB;AACH;;AACD,UAAMpD,OAAO,GAAG,CAACkD,KAAD,EAAQC,UAAR,KAAuB;AACnC,aAAOtD,YAAY,CAACkD,QAAQ,CAACQ,KAAT,CAAeR,QAAQ,CAACM,KAAT,CAAeH,KAAf,EAAsBC,UAAtB,CAAf,CAAD,CAAnB;AACH,KAFD;;AAGAtC,IAAAA,MAAM,CAACC,MAAP,CAAcd,OAAd,EAAuB;AACnB+C,MAAAA,QADmB;AAEnBC,MAAAA,QAAQ,EAAEJ,YAAY,CAACY,IAAb,CAAkB,IAAlB,EAAwBT,QAAxB;AAFS,KAAvB;AAIA,WAAOK,eAAe,CAACpD,OAAhB,CAAwBsD,IAAxB,CAA6BtD,OAA7B,EAAsCoD,eAAtC,CAAP;AACH,GAbD;;AAcA,SAAOvC,MAAM,CAACC,MAAP,CAAcmC,MAAd,EAAsB;AACzBF,IAAAA,QADyB;AAEzBC,IAAAA,QAAQ,EAAEJ,YAAY,CAACY,IAAb,CAAkB,IAAlB,EAAwBT,QAAxB;AAFe,GAAtB,CAAP;AAIH;;MCjBY/C,OAAO,GAAG4C,YAAY,CAACG,iBAAD,EAAW;AAC1CvC,EAAAA,OAAO,EAAE;AACL,kBAAe,sBAAqBf,OAAQ,IAAGgE,+BAAY,EAAG;AADzD;AADiC,CAAX,CAA5B;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/request/dist-src/fetch-wrapper.js b/node_modules/@octokit/request/dist-src/fetch-wrapper.js index e4ae1b0..79653c4 100644 --- a/node_modules/@octokit/request/dist-src/fetch-wrapper.js +++ b/node_modules/@octokit/request/dist-src/fetch-wrapper.js @@ -3,6 +3,9 @@ import nodeFetch from "node-fetch"; import { RequestError } from "@octokit/request-error"; import getBuffer from "./get-buffer-response"; export default function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log + ? requestOptions.request.log + : console; if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); @@ -16,13 +19,21 @@ export default function fetchWrapper(requestOptions) { body: requestOptions.body, headers: requestOptions.headers, redirect: requestOptions.redirect, - }, requestOptions.request)) - .then((response) => { + }, + // `requestOptions.request.agent` type is incompatible + // see https://github.com/octokit/types.ts/pull/264 + requestOptions.request)) + .then(async (response) => { url = response.url; status = response.status; for (const keyAndValue of response.headers) { headers[keyAndValue[0]] = keyAndValue[1]; } + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } if (status === 204 || status === 205) { return; } @@ -32,46 +43,40 @@ export default function fetchWrapper(requestOptions) { return; } throw new RequestError(response.statusText, status, { - headers, + response: { + url, + status, + headers, + data: undefined, + }, request: requestOptions, }); } if (status === 304) { throw new RequestError("Not modified", status, { - headers, + response: { + url, + status, + headers, + data: await getResponseData(response), + }, request: requestOptions, }); } if (status >= 400) { - return response - .text() - .then((message) => { - const error = new RequestError(message, status, { + const data = await getResponseData(response); + const error = new RequestError(toErrorMessage(data), status, { + response: { + url, + status, headers, - request: requestOptions, - }); - try { - let responseBody = JSON.parse(error.message); - Object.assign(error, responseBody); - let errors = responseBody.errors; - // Assumption `errors` would always be in Array format - error.message = - error.message + ": " + errors.map(JSON.stringify).join(", "); - } - catch (e) { - // ignore, see octokit/rest.js#684 - } - throw error; + data, + }, + request: requestOptions, }); + throw error; } - const contentType = response.headers.get("content-type"); - if (/application\/json/.test(contentType)) { - return response.json(); - } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - return getBuffer(response); + return getResponseData(response); }) .then((data) => { return { @@ -82,12 +87,33 @@ export default function fetchWrapper(requestOptions) { }; }) .catch((error) => { - if (error instanceof RequestError) { + if (error instanceof RequestError) throw error; - } throw new RequestError(error.message, 500, { - headers, request: requestOptions, }); }); } +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + if (/application\/json/.test(contentType)) { + return response.json(); + } + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } + return getBuffer(response); +} +function toErrorMessage(data) { + if (typeof data === "string") + return data; + // istanbul ignore else - just in case + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } + return data.message; + } + // istanbul ignore next - just in case + return `Unknown error: ${JSON.stringify(data)}`; +} diff --git a/node_modules/@octokit/request/dist-src/version.js b/node_modules/@octokit/request/dist-src/version.js index 856641b..b331e4c 100644 --- a/node_modules/@octokit/request/dist-src/version.js +++ b/node_modules/@octokit/request/dist-src/version.js @@ -1 +1 @@ -export const VERSION = "5.4.9"; +export const VERSION = "5.6.1"; diff --git a/node_modules/@octokit/request/dist-types/version.d.ts b/node_modules/@octokit/request/dist-types/version.d.ts index cfc9b7a..4465d3b 100644 --- a/node_modules/@octokit/request/dist-types/version.d.ts +++ b/node_modules/@octokit/request/dist-types/version.d.ts @@ -1 +1 @@ -export declare const VERSION = "5.4.9"; +export declare const VERSION = "5.6.1"; diff --git a/node_modules/@octokit/request/dist-web/index.js b/node_modules/@octokit/request/dist-web/index.js index 37fefe4..068c586 100644 --- a/node_modules/@octokit/request/dist-web/index.js +++ b/node_modules/@octokit/request/dist-web/index.js @@ -4,13 +4,16 @@ import { isPlainObject } from 'is-plain-object'; import nodeFetch from 'node-fetch'; import { RequestError } from '@octokit/request-error'; -const VERSION = "5.4.9"; +const VERSION = "5.6.1"; function getBufferResponse(response) { return response.arrayBuffer(); } function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log + ? requestOptions.request.log + : console; if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { requestOptions.body = JSON.stringify(requestOptions.body); @@ -24,13 +27,21 @@ function fetchWrapper(requestOptions) { body: requestOptions.body, headers: requestOptions.headers, redirect: requestOptions.redirect, - }, requestOptions.request)) - .then((response) => { + }, + // `requestOptions.request.agent` type is incompatible + // see https://github.com/octokit/types.ts/pull/264 + requestOptions.request)) + .then(async (response) => { url = response.url; status = response.status; for (const keyAndValue of response.headers) { headers[keyAndValue[0]] = keyAndValue[1]; } + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } if (status === 204 || status === 205) { return; } @@ -40,46 +51,40 @@ function fetchWrapper(requestOptions) { return; } throw new RequestError(response.statusText, status, { - headers, + response: { + url, + status, + headers, + data: undefined, + }, request: requestOptions, }); } if (status === 304) { throw new RequestError("Not modified", status, { - headers, + response: { + url, + status, + headers, + data: await getResponseData(response), + }, request: requestOptions, }); } if (status >= 400) { - return response - .text() - .then((message) => { - const error = new RequestError(message, status, { + const data = await getResponseData(response); + const error = new RequestError(toErrorMessage(data), status, { + response: { + url, + status, headers, - request: requestOptions, - }); - try { - let responseBody = JSON.parse(error.message); - Object.assign(error, responseBody); - let errors = responseBody.errors; - // Assumption `errors` would always be in Array format - error.message = - error.message + ": " + errors.map(JSON.stringify).join(", "); - } - catch (e) { - // ignore, see octokit/rest.js#684 - } - throw error; + data, + }, + request: requestOptions, }); + throw error; } - const contentType = response.headers.get("content-type"); - if (/application\/json/.test(contentType)) { - return response.json(); - } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } - return getBufferResponse(response); + return getResponseData(response); }) .then((data) => { return { @@ -90,15 +95,36 @@ function fetchWrapper(requestOptions) { }; }) .catch((error) => { - if (error instanceof RequestError) { + if (error instanceof RequestError) throw error; - } throw new RequestError(error.message, 500, { - headers, request: requestOptions, }); }); } +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); + if (/application\/json/.test(contentType)) { + return response.json(); + } + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } + return getBufferResponse(response); +} +function toErrorMessage(data) { + if (typeof data === "string") + return data; + // istanbul ignore else - just in case + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } + return data.message; + } + // istanbul ignore next - just in case + return `Unknown error: ${JSON.stringify(data)}`; +} function withDefaults(oldEndpoint, newDefaults) { const endpoint = oldEndpoint.defaults(newDefaults); diff --git a/node_modules/@octokit/request/dist-web/index.js.map b/node_modules/@octokit/request/dist-web/index.js.map index a0f0426..2c904f6 100644 --- a/node_modules/@octokit/request/dist-web/index.js.map +++ b/node_modules/@octokit/request/dist-web/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-buffer-response.js","../dist-src/fetch-wrapper.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"5.4.9\";\n","export default function getBufferResponse(response) {\n return response.arrayBuffer();\n}\n","import { isPlainObject } from \"is-plain-object\";\nimport nodeFetch from \"node-fetch\";\nimport { RequestError } from \"@octokit/request-error\";\nimport getBuffer from \"./get-buffer-response\";\nexport default function fetchWrapper(requestOptions) {\n if (isPlainObject(requestOptions.body) ||\n Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n let headers = {};\n let status;\n let url;\n const fetch = (requestOptions.request && requestOptions.request.fetch) || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect,\n }, requestOptions.request))\n .then((response) => {\n url = response.url;\n status = response.status;\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n if (status === 204 || status === 205) {\n return;\n }\n // GitHub API returns 200 for HEAD requests\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n throw new RequestError(response.statusText, status, {\n headers,\n request: requestOptions,\n });\n }\n if (status === 304) {\n throw new RequestError(\"Not modified\", status, {\n headers,\n request: requestOptions,\n });\n }\n if (status >= 400) {\n return response\n .text()\n .then((message) => {\n const error = new RequestError(message, status, {\n headers,\n request: requestOptions,\n });\n try {\n let responseBody = JSON.parse(error.message);\n Object.assign(error, responseBody);\n let errors = responseBody.errors;\n // Assumption `errors` would always be in Array format\n error.message =\n error.message + \": \" + errors.map(JSON.stringify).join(\", \");\n }\n catch (e) {\n // ignore, see octokit/rest.js#684\n }\n throw error;\n });\n }\n const contentType = response.headers.get(\"content-type\");\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n return getBuffer(response);\n })\n .then((data) => {\n return {\n status,\n url,\n headers,\n data,\n };\n })\n .catch((error) => {\n if (error instanceof RequestError) {\n throw error;\n }\n throw new RequestError(error.message, 500, {\n headers,\n request: requestOptions,\n });\n });\n}\n","import fetchWrapper from \"./fetch-wrapper\";\nexport default function withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n}\n","import { endpoint } from \"@octokit/endpoint\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport withDefaults from \"./with-defaults\";\nexport const request = withDefaults(endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${getUserAgent()}`,\n },\n});\n"],"names":["getBuffer"],"mappings":";;;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACA3B,SAAS,iBAAiB,CAAC,QAAQ,EAAE;AACpD,IAAI,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;;ACEc,SAAS,YAAY,CAAC,cAAc,EAAE;AACrD,IAAI,IAAI,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC;AAC1C,QAAQ,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;AAC5C,QAAQ,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAClE,KAAK;AACL,IAAI,IAAI,OAAO,GAAG,EAAE,CAAC;AACrB,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC;AACxF,IAAI,OAAO,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;AACnD,QAAQ,MAAM,EAAE,cAAc,CAAC,MAAM;AACrC,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,OAAO,EAAE,cAAc,CAAC,OAAO;AACvC,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ;AACzC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;AAC/B,SAAS,IAAI,CAAC,CAAC,QAAQ,KAAK;AAC5B,QAAQ,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;AAC3B,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,QAAQ,KAAK,MAAM,WAAW,IAAI,QAAQ,CAAC,OAAO,EAAE;AACpD,YAAY,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE;AAC9C,YAAY,OAAO;AACnB,SAAS;AACT;AACA,QAAQ,IAAI,cAAc,CAAC,MAAM,KAAK,MAAM,EAAE;AAC9C,YAAY,IAAI,MAAM,GAAG,GAAG,EAAE;AAC9B,gBAAgB,OAAO;AACvB,aAAa;AACb,YAAY,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE;AAChE,gBAAgB,OAAO;AACvB,gBAAgB,OAAO,EAAE,cAAc;AACvC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,IAAI,MAAM,KAAK,GAAG,EAAE;AAC5B,YAAY,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE;AAC3D,gBAAgB,OAAO;AACvB,gBAAgB,OAAO,EAAE,cAAc;AACvC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE;AAC3B,YAAY,OAAO,QAAQ;AAC3B,iBAAiB,IAAI,EAAE;AACvB,iBAAiB,IAAI,CAAC,CAAC,OAAO,KAAK;AACnC,gBAAgB,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE;AAChE,oBAAoB,OAAO;AAC3B,oBAAoB,OAAO,EAAE,cAAc;AAC3C,iBAAiB,CAAC,CAAC;AACnB,gBAAgB,IAAI;AACpB,oBAAoB,IAAI,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACjE,oBAAoB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AACvD,oBAAoB,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;AACrD;AACA,oBAAoB,KAAK,CAAC,OAAO;AACjC,wBAAwB,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrF,iBAAiB;AACjB,gBAAgB,OAAO,CAAC,EAAE;AAC1B;AACA,iBAAiB;AACjB,gBAAgB,MAAM,KAAK,CAAC;AAC5B,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AACjE,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;AACnD,YAAY,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnC,SAAS;AACT,QAAQ,IAAI,CAAC,WAAW,IAAI,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;AACxE,YAAY,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnC,SAAS;AACT,QAAQ,OAAOA,iBAAS,CAAC,QAAQ,CAAC,CAAC;AACnC,KAAK,CAAC;AACN,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK;AACxB,QAAQ,OAAO;AACf,YAAY,MAAM;AAClB,YAAY,GAAG;AACf,YAAY,OAAO;AACnB,YAAY,IAAI;AAChB,SAAS,CAAC;AACV,KAAK,CAAC;AACN,SAAS,KAAK,CAAC,CAAC,KAAK,KAAK;AAC1B,QAAQ,IAAI,KAAK,YAAY,YAAY,EAAE;AAC3C,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,QAAQ,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE;AACnD,YAAY,OAAO;AACnB,YAAY,OAAO,EAAE,cAAc;AACnC,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP,CAAC;;AC3Fc,SAAS,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE;AAC/D,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACvD,IAAI,MAAM,MAAM,GAAG,UAAU,KAAK,EAAE,UAAU,EAAE;AAChD,QAAQ,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAClE,QAAQ,IAAI,CAAC,eAAe,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE;AACvE,YAAY,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AACjE,SAAS;AACT,QAAQ,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK;AAC/C,YAAY,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AACnF,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;AAC/B,YAAY,QAAQ;AACpB,YAAY,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACvD,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AACtE,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AACjC,QAAQ,QAAQ;AAChB,QAAQ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACnD,KAAK,CAAC,CAAC;AACP,CAAC;;ACjBW,MAAC,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE;AAC9C,IAAI,OAAO,EAAE;AACb,QAAQ,YAAY,EAAE,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AACvE,KAAK;AACL,CAAC,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/get-buffer-response.js","../dist-src/fetch-wrapper.js","../dist-src/with-defaults.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"5.6.1\";\n","export default function getBufferResponse(response) {\n return response.arrayBuffer();\n}\n","import { isPlainObject } from \"is-plain-object\";\nimport nodeFetch from \"node-fetch\";\nimport { RequestError } from \"@octokit/request-error\";\nimport getBuffer from \"./get-buffer-response\";\nexport default function fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log\n ? requestOptions.request.log\n : console;\n if (isPlainObject(requestOptions.body) ||\n Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n let headers = {};\n let status;\n let url;\n const fetch = (requestOptions.request && requestOptions.request.fetch) || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect,\n }, \n // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request))\n .then(async (response) => {\n url = response.url;\n status = response.status;\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n if (status === 204 || status === 205) {\n return;\n }\n // GitHub API returns 200 for HEAD requests\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n throw new RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined,\n },\n request: requestOptions,\n });\n }\n if (status === 304) {\n throw new RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response),\n },\n request: requestOptions,\n });\n }\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data,\n },\n request: requestOptions,\n });\n throw error;\n }\n return getResponseData(response);\n })\n .then((data) => {\n return {\n status,\n url,\n headers,\n data,\n };\n })\n .catch((error) => {\n if (error instanceof RequestError)\n throw error;\n throw new RequestError(error.message, 500, {\n request: requestOptions,\n });\n });\n}\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n return getBuffer(response);\n}\nfunction toErrorMessage(data) {\n if (typeof data === \"string\")\n return data;\n // istanbul ignore else - just in case\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n return data.message;\n }\n // istanbul ignore next - just in case\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n","import fetchWrapper from \"./fetch-wrapper\";\nexport default function withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint),\n });\n}\n","import { endpoint } from \"@octokit/endpoint\";\nimport { getUserAgent } from \"universal-user-agent\";\nimport { VERSION } from \"./version\";\nimport withDefaults from \"./with-defaults\";\nexport const request = withDefaults(endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${getUserAgent()}`,\n },\n});\n"],"names":["getBuffer"],"mappings":";;;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACA3B,SAAS,iBAAiB,CAAC,QAAQ,EAAE;AACpD,IAAI,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;;ACEc,SAAS,YAAY,CAAC,cAAc,EAAE;AACrD,IAAI,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,GAAG;AACpE,UAAU,cAAc,CAAC,OAAO,CAAC,GAAG;AACpC,UAAU,OAAO,CAAC;AAClB,IAAI,IAAI,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC;AAC1C,QAAQ,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE;AAC5C,QAAQ,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AAClE,KAAK;AACL,IAAI,IAAI,OAAO,GAAG,EAAE,CAAC;AACrB,IAAI,IAAI,MAAM,CAAC;AACf,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,MAAM,KAAK,GAAG,CAAC,cAAc,CAAC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC;AACxF,IAAI,OAAO,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;AACnD,QAAQ,MAAM,EAAE,cAAc,CAAC,MAAM;AACrC,QAAQ,IAAI,EAAE,cAAc,CAAC,IAAI;AACjC,QAAQ,OAAO,EAAE,cAAc,CAAC,OAAO;AACvC,QAAQ,QAAQ,EAAE,cAAc,CAAC,QAAQ;AACzC,KAAK;AACL;AACA;AACA,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;AAC5B,SAAS,IAAI,CAAC,OAAO,QAAQ,KAAK;AAClC,QAAQ,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;AAC3B,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,QAAQ,KAAK,MAAM,WAAW,IAAI,QAAQ,CAAC,OAAO,EAAE;AACpD,YAAY,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,IAAI,aAAa,IAAI,OAAO,EAAE;AACtC,YAAY,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;AAC/F,YAAY,MAAM,eAAe,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AAC7D,YAAY,GAAG,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,kDAAkD,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAClN,SAAS;AACT,QAAQ,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE;AAC9C,YAAY,OAAO;AACnB,SAAS;AACT;AACA,QAAQ,IAAI,cAAc,CAAC,MAAM,KAAK,MAAM,EAAE;AAC9C,YAAY,IAAI,MAAM,GAAG,GAAG,EAAE;AAC9B,gBAAgB,OAAO;AACvB,aAAa;AACb,YAAY,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE;AAChE,gBAAgB,QAAQ,EAAE;AAC1B,oBAAoB,GAAG;AACvB,oBAAoB,MAAM;AAC1B,oBAAoB,OAAO;AAC3B,oBAAoB,IAAI,EAAE,SAAS;AACnC,iBAAiB;AACjB,gBAAgB,OAAO,EAAE,cAAc;AACvC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,IAAI,MAAM,KAAK,GAAG,EAAE;AAC5B,YAAY,MAAM,IAAI,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE;AAC3D,gBAAgB,QAAQ,EAAE;AAC1B,oBAAoB,GAAG;AACvB,oBAAoB,MAAM;AAC1B,oBAAoB,OAAO;AAC3B,oBAAoB,IAAI,EAAE,MAAM,eAAe,CAAC,QAAQ,CAAC;AACzD,iBAAiB;AACjB,gBAAgB,OAAO,EAAE,cAAc;AACvC,aAAa,CAAC,CAAC;AACf,SAAS;AACT,QAAQ,IAAI,MAAM,IAAI,GAAG,EAAE;AAC3B,YAAY,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAC;AACzD,YAAY,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE;AACzE,gBAAgB,QAAQ,EAAE;AAC1B,oBAAoB,GAAG;AACvB,oBAAoB,MAAM;AAC1B,oBAAoB,OAAO;AAC3B,oBAAoB,IAAI;AACxB,iBAAiB;AACjB,gBAAgB,OAAO,EAAE,cAAc;AACvC,aAAa,CAAC,CAAC;AACf,YAAY,MAAM,KAAK,CAAC;AACxB,SAAS;AACT,QAAQ,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AACzC,KAAK,CAAC;AACN,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK;AACxB,QAAQ,OAAO;AACf,YAAY,MAAM;AAClB,YAAY,GAAG;AACf,YAAY,OAAO;AACnB,YAAY,IAAI;AAChB,SAAS,CAAC;AACV,KAAK,CAAC;AACN,SAAS,KAAK,CAAC,CAAC,KAAK,KAAK;AAC1B,QAAQ,IAAI,KAAK,YAAY,YAAY;AACzC,YAAY,MAAM,KAAK,CAAC;AACxB,QAAQ,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE;AACnD,YAAY,OAAO,EAAE,cAAc;AACnC,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP,CAAC;AACD,eAAe,eAAe,CAAC,QAAQ,EAAE;AACzC,IAAI,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAC7D,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;AAC/C,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,IAAI,CAAC,WAAW,IAAI,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;AACpE,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,OAAOA,iBAAS,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AACD,SAAS,cAAc,CAAC,IAAI,EAAE;AAC9B,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;AAChC,QAAQ,OAAO,IAAI,CAAC;AACpB;AACA,IAAI,IAAI,SAAS,IAAI,IAAI,EAAE;AAC3B,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;AACxC,YAAY,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpF,SAAS;AACT,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL;AACA,IAAI,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;;ACrHc,SAAS,YAAY,CAAC,WAAW,EAAE,WAAW,EAAE;AAC/D,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACvD,IAAI,MAAM,MAAM,GAAG,UAAU,KAAK,EAAE,UAAU,EAAE;AAChD,QAAQ,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAClE,QAAQ,IAAI,CAAC,eAAe,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE;AACvE,YAAY,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;AACjE,SAAS;AACT,QAAQ,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK;AAC/C,YAAY,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AACnF,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;AAC/B,YAAY,QAAQ;AACpB,YAAY,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACvD,SAAS,CAAC,CAAC;AACX,QAAQ,OAAO,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AACtE,KAAK,CAAC;AACN,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AACjC,QAAQ,QAAQ;AAChB,QAAQ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC;AACnD,KAAK,CAAC,CAAC;AACP,CAAC;;ACjBW,MAAC,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE;AAC9C,IAAI,OAAO,EAAE;AACb,QAAQ,YAAY,EAAE,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;AACvE,KAAK;AACL,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/node_modules/@octokit/request/package.json b/node_modules/@octokit/request/package.json index db18c80..0ddee88 100644 --- a/node_modules/@octokit/request/package.json +++ b/node_modules/@octokit/request/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/request", - "description": "Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node", - "version": "5.4.9", + "description": "Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node", + "version": "5.6.1", "license": "MIT", "files": [ "dist-*/", @@ -15,43 +15,34 @@ "api", "request" ], - "homepage": "https://github.com/octokit/request.js#readme", - "bugs": { - "url": "https://github.com/octokit/request.js/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/octokit/request.js.git" - }, + "repository": "github:octokit/request.js", "dependencies": { "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.1", - "once": "^1.4.0", "universal-user-agent": "^6.0.0" }, "devDependencies": { - "@octokit/auth-app": "^2.1.2", + "@octokit/auth-app": "^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.2.4", - "@types/jest": "^26.0.0", + "@types/jest": "^27.0.0", "@types/lolex": "^5.1.0", "@types/node": "^14.0.0", "@types/node-fetch": "^2.3.3", "@types/once": "^1.4.0", "fetch-mock": "^9.3.1", - "jest": "^26.0.1", + "jest": "^27.0.0", "lolex": "^6.0.0", - "prettier": "^2.0.1", + "prettier": "2.3.2", "semantic-release": "^17.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", - "ts-jest": "^26.1.0", + "ts-jest": "^27.0.0", "typescript": "^4.0.2" }, "publishConfig": { diff --git a/node_modules/@octokit/types/README.md b/node_modules/@octokit/types/README.md index 7078945..c48ce42 100644 --- a/node_modules/@octokit/types/README.md +++ b/node_modules/@octokit/types/README.md @@ -27,8 +27,9 @@ See all exported types at https://octokit.github.io/types.ts ```ts import { Endpoints } from "@octokit/types"; -type listUserReposParameters = Endpoints["GET /repos/:owner/:repo"]["parameters"]; -type listUserReposResponse = Endpoints["GET /repos/:owner/:repo"]["response"]; +type listUserReposParameters = + Endpoints["GET /repos/{owner}/{repo}"]["parameters"]; +type listUserReposResponse = Endpoints["GET /repos/{owner}/{repo}"]["response"]; async function listRepos( options: listUserReposParameters diff --git a/node_modules/@octokit/types/dist-node/index.js b/node_modules/@octokit/types/dist-node/index.js index 52f7b68..f51960e 100644 --- a/node_modules/@octokit/types/dist-node/index.js +++ b/node_modules/@octokit/types/dist-node/index.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); -const VERSION = "5.5.0"; +const VERSION = "6.25.0"; exports.VERSION = VERSION; //# sourceMappingURL=index.js.map diff --git a/node_modules/@octokit/types/dist-src/VERSION.js b/node_modules/@octokit/types/dist-src/VERSION.js index b3b230c..e7976aa 100644 --- a/node_modules/@octokit/types/dist-src/VERSION.js +++ b/node_modules/@octokit/types/dist-src/VERSION.js @@ -1 +1 @@ -export const VERSION = "5.5.0"; +export const VERSION = "6.25.0"; diff --git a/node_modules/@octokit/types/dist-types/AuthInterface.d.ts b/node_modules/@octokit/types/dist-types/AuthInterface.d.ts index 0c19b50..8b39d61 100644 --- a/node_modules/@octokit/types/dist-types/AuthInterface.d.ts +++ b/node_modules/@octokit/types/dist-types/AuthInterface.d.ts @@ -23,7 +23,7 @@ export interface AuthInterface(request: RequestInterface, route: Route, parameters?: RequestParameters): Promise>; diff --git a/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts b/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts index df585be..d7b4009 100644 --- a/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts +++ b/node_modules/@octokit/types/dist-types/EndpointInterface.d.ts @@ -19,7 +19,7 @@ export interface EndpointInterface { /** * Transforms a GitHub REST API endpoint into generic request options * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (route: keyof Endpoints | R, parameters?: P): (R extends keyof Endpoints ? Endpoints[R]["request"] : RequestOptions) & Pick; @@ -36,7 +36,7 @@ export interface EndpointInterface { * Merges current endpoint defaults with passed route and parameters, * without transforming them into request options. * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. * */ diff --git a/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts b/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts index 9a2dd7f..28fdfb8 100644 --- a/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts +++ b/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts @@ -1,17 +1,17 @@ import { ResponseHeaders } from "./ResponseHeaders"; import { Url } from "./Url"; -export declare type OctokitResponse = { +export declare type OctokitResponse = { headers: ResponseHeaders; /** * http response code */ - status: number; + status: S; /** * URL of response after all redirects */ url: Url; /** - * This is the data you would see in https://developer.Octokit.com/v3/ + * Response data as documented in the REST API reference documentation at https://docs.github.com/rest/reference */ data: T; }; diff --git a/node_modules/@octokit/types/dist-types/RequestInterface.d.ts b/node_modules/@octokit/types/dist-types/RequestInterface.d.ts index ef4d8d3..851811f 100644 --- a/node_modules/@octokit/types/dist-types/RequestInterface.d.ts +++ b/node_modules/@octokit/types/dist-types/RequestInterface.d.ts @@ -19,7 +19,7 @@ export interface RequestInterface { /** * Sends a request based on endpoint options * - * @param {string} route Request method + URL. Example: `'GET /orgs/:org'` + * @param {string} route Request method + URL. Example: `'GET /orgs/{org}'` * @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`. */ (route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Promise : Promise>; diff --git a/node_modules/@octokit/types/dist-types/RequestParameters.d.ts b/node_modules/@octokit/types/dist-types/RequestParameters.d.ts index 692d193..b056a0e 100644 --- a/node_modules/@octokit/types/dist-types/RequestParameters.d.ts +++ b/node_modules/@octokit/types/dist-types/RequestParameters.d.ts @@ -6,9 +6,9 @@ import { Url } from "./Url"; */ export declare type RequestParameters = { /** - * Base URL to be used when a relative URL is passed, such as `/orgs/:org`. + * Base URL to be used when a relative URL is passed, such as `/orgs/{org}`. * If `baseUrl` is `https://enterprise.acme-inc.com/api/v3`, then the request - * will be sent to `https://enterprise.acme-inc.com/api/v3/orgs/:org`. + * will be sent to `https://enterprise.acme-inc.com/api/v3/orgs/{org}`. */ baseUrl?: Url; /** diff --git a/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts b/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts index 4482a8a..8f5c43a 100644 --- a/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts +++ b/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts @@ -1,5 +1,3 @@ -/// -import { Agent } from "http"; import { Fetch } from "./Fetch"; import { Signal } from "./Signal"; /** @@ -8,8 +6,10 @@ import { Signal } from "./Signal"; export declare type RequestRequestOptions = { /** * Node only. Useful for custom proxy, certificate, or dns lookup. + * + * @see https://nodejs.org/api/http.html#http_class_http_agent */ - agent?: Agent; + agent?: unknown; /** * Custom replacement for built-in fetch method. Useful for testing or request hooks. */ diff --git a/node_modules/@octokit/types/dist-types/Route.d.ts b/node_modules/@octokit/types/dist-types/Route.d.ts index 8079044..dcaac75 100644 --- a/node_modules/@octokit/types/dist-types/Route.d.ts +++ b/node_modules/@octokit/types/dist-types/Route.d.ts @@ -1,4 +1,4 @@ /** - * String consisting of an optional HTTP method and relative path or absolute URL. Examples: `'/orgs/:org'`, `'PUT /orgs/:org'`, `GET https://example.com/foo/bar` + * String consisting of an optional HTTP method and relative path or absolute URL. Examples: `'/orgs/{org}'`, `'PUT /orgs/{org}'`, `GET https://example.com/foo/bar` */ export declare type Route = string; diff --git a/node_modules/@octokit/types/dist-types/Url.d.ts b/node_modules/@octokit/types/dist-types/Url.d.ts index acaad63..3e69916 100644 --- a/node_modules/@octokit/types/dist-types/Url.d.ts +++ b/node_modules/@octokit/types/dist-types/Url.d.ts @@ -1,4 +1,4 @@ /** - * Relative or absolute URL. Examples: `'/orgs/:org'`, `https://example.com/foo/bar` + * Relative or absolute URL. Examples: `'/orgs/{org}'`, `https://example.com/foo/bar` */ export declare type Url = string; diff --git a/node_modules/@octokit/types/dist-types/VERSION.d.ts b/node_modules/@octokit/types/dist-types/VERSION.d.ts index 6c6f30d..7a091e1 100644 --- a/node_modules/@octokit/types/dist-types/VERSION.d.ts +++ b/node_modules/@octokit/types/dist-types/VERSION.d.ts @@ -1 +1 @@ -export declare const VERSION = "5.5.0"; +export declare const VERSION = "6.25.0"; diff --git a/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts b/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts index 9ef8471..cd8775b 100644 --- a/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts +++ b/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts @@ -1,39835 +1,3114 @@ -/// +import { paths } from "@octokit/openapi-types"; import { OctokitResponse } from "../OctokitResponse"; import { RequestHeaders } from "../RequestHeaders"; import { RequestRequestOptions } from "../RequestRequestOptions"; -declare type RequiredPreview = { +declare type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; +declare type ExtractParameters = "parameters" extends keyof T ? UnionToIntersection<{ + [K in keyof T["parameters"]]: T["parameters"][K]; +}[keyof T["parameters"]]> : {}; +declare type ExtractRequestBody = "requestBody" extends keyof T ? "content" extends keyof T["requestBody"] ? "application/json" extends keyof T["requestBody"]["content"] ? T["requestBody"]["content"]["application/json"] : { + data: { + [K in keyof T["requestBody"]["content"]]: T["requestBody"]["content"][K]; + }[keyof T["requestBody"]["content"]]; +} : "application/json" extends keyof T["requestBody"] ? T["requestBody"]["application/json"] : { + data: { + [K in keyof T["requestBody"]]: T["requestBody"][K]; + }[keyof T["requestBody"]]; +} : {}; +declare type ToOctokitParameters = ExtractParameters & ExtractRequestBody; +declare type RequiredPreview = T extends string ? { mediaType: { previews: [T, ...string[]]; }; -}; +} : {}; +declare type Operation = { + parameters: ToOctokitParameters & RequiredPreview; + request: { + method: Method extends keyof MethodsMap ? MethodsMap[Method] : never; + url: Url; + headers: RequestHeaders; + request: RequestRequestOptions; + }; + response: ExtractOctokitResponse; +}; +declare type MethodsMap = { + delete: "DELETE"; + get: "GET"; + patch: "PATCH"; + post: "POST"; + put: "PUT"; +}; +declare type SuccessStatuses = 200 | 201 | 202 | 204; +declare type RedirectStatuses = 301 | 302; +declare type EmptyResponseStatuses = 201 | 204; +declare type KnownJsonResponseTypes = "application/json" | "application/scim+json" | "text/html"; +declare type SuccessResponseDataType = { + [K in SuccessStatuses & keyof Responses]: GetContentKeyIfPresent extends never ? never : OctokitResponse, K>; +}[SuccessStatuses & keyof Responses]; +declare type RedirectResponseDataType = { + [K in RedirectStatuses & keyof Responses]: OctokitResponse; +}[RedirectStatuses & keyof Responses]; +declare type EmptyResponseDataType = { + [K in EmptyResponseStatuses & keyof Responses]: OctokitResponse; +}[EmptyResponseStatuses & keyof Responses]; +declare type GetContentKeyIfPresent = "content" extends keyof T ? DataType : DataType; +declare type DataType = { + [K in KnownJsonResponseTypes & keyof T]: T[K]; +}[KnownJsonResponseTypes & keyof T]; +declare type ExtractOctokitResponse = "responses" extends keyof R ? SuccessResponseDataType extends never ? RedirectResponseDataType extends never ? EmptyResponseDataType : RedirectResponseDataType : SuccessResponseDataType : unknown; export interface Endpoints { /** - * @see https://developer.github.com/v3/apps/#delete-an-installation-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/apps#delete-an-installation-for-the-authenticated-app */ - "DELETE /app/installations/:installation_id": { - parameters: AppsDeleteInstallationEndpoint; - request: AppsDeleteInstallationRequestOptions; - response: OctokitResponse; - }; + "DELETE /app/installations/{installation_id}": Operation<"/app/installations/{installation_id}", "delete">; /** - * @see https://developer.github.com/v3/apps/#unsuspend-an-app-installation + * @see https://docs.github.com/rest/reference/apps#unsuspend-an-app-installation */ - "DELETE /app/installations/:installation_id/suspended": { - parameters: AppsUnsuspendInstallationEndpoint; - request: AppsUnsuspendInstallationRequestOptions; - response: OctokitResponse; - }; + "DELETE /app/installations/{installation_id}/suspended": Operation<"/app/installations/{installation_id}/suspended", "delete">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-authorization + * @see https://docs.github.com/rest/reference/oauth-authorizations#delete-a-grant */ - "DELETE /applications/:client_id/grant": { - parameters: AppsDeleteAuthorizationEndpoint; - request: AppsDeleteAuthorizationRequestOptions; - response: OctokitResponse; - }; + "DELETE /applications/grants/{grant_id}": Operation<"/applications/grants/{grant_id}", "delete">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application + * @see https://docs.github.com/rest/reference/apps#delete-an-app-authorization */ - "DELETE /applications/:client_id/grants/:access_token": { - parameters: AppsRevokeGrantForApplicationEndpoint; - request: AppsRevokeGrantForApplicationRequestOptions; - response: OctokitResponse; - }; + "DELETE /applications/{client_id}/grant": Operation<"/applications/{client_id}/grant", "delete">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-token + * @see https://docs.github.com/rest/reference/apps#revoke-a-grant-for-an-application */ - "DELETE /applications/:client_id/token": { - parameters: AppsDeleteTokenEndpoint; - request: AppsDeleteTokenRequestOptions; - response: OctokitResponse; - }; + "DELETE /applications/{client_id}/grants/{access_token}": Operation<"/applications/{client_id}/grants/{access_token}", "delete">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application + * @see https://docs.github.com/rest/reference/apps#delete-an-app-token */ - "DELETE /applications/:client_id/tokens/:access_token": { - parameters: AppsRevokeAuthorizationForApplicationEndpoint; - request: AppsRevokeAuthorizationForApplicationRequestOptions; - response: OctokitResponse; - }; + "DELETE /applications/{client_id}/token": Operation<"/applications/{client_id}/token", "delete">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant + * @see https://docs.github.com/rest/reference/apps#revoke-an-authorization-for-an-application */ - "DELETE /applications/grants/:grant_id": { - parameters: OauthAuthorizationsDeleteGrantEndpoint; - request: OauthAuthorizationsDeleteGrantRequestOptions; - response: OctokitResponse; - }; + "DELETE /applications/{client_id}/tokens/{access_token}": Operation<"/applications/{client_id}/tokens/{access_token}", "delete">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization + * @see https://docs.github.com/rest/reference/oauth-authorizations#delete-an-authorization */ - "DELETE /authorizations/:authorization_id": { - parameters: OauthAuthorizationsDeleteAuthorizationEndpoint; - request: OauthAuthorizationsDeleteAuthorizationRequestOptions; - response: OctokitResponse; - }; + "DELETE /authorizations/{authorization_id}": Operation<"/authorizations/{authorization_id}", "delete">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#delete-a-self-hosted-runner-group-from-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#disable-a-selected-organization-for-github-actions-in-an-enterprise */ - "DELETE /enterprises/:enterprise/actions/runner-groups/:runner_group_id": { - parameters: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseEndpoint; - request: EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseRequestOptions; - response: OctokitResponse; - }; + "DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}": Operation<"/enterprises/{enterprise}/actions/permissions/organizations/{org_id}", "delete">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#delete-a-self-hosted-runner-group-from-an-enterprise */ - "DELETE /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations/:org_id": { - parameters: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint; - request: EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions; - response: OctokitResponse; - }; + "DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}", "delete">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#remove-a-self-hosted-runner-from-a-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise */ - "DELETE /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners/:runner_id": { - parameters: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseEndpoint; - request: EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}", "delete">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#delete-self-hosted-runner-from-an-enterprise + * @see https://docs.github.com/rest/reference/enterprise-admin#remove-a-self-hosted-runner-from-a-group-for-an-enterprise */ - "DELETE /enterprises/:enterprise/actions/runners/:runner_id": { - parameters: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseEndpoint; - request: EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseRequestOptions; - response: OctokitResponse; - }; + "DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "delete">; /** - * @see https://developer.github.com/v3/gists/#delete-a-gist + * @see https://docs.github.com/rest/reference/enterprise-admin#delete-self-hosted-runner-from-an-enterprise */ - "DELETE /gists/:gist_id": { - parameters: GistsDeleteEndpoint; - request: GistsDeleteRequestOptions; - response: OctokitResponse; - }; + "DELETE /enterprises/{enterprise}/actions/runners/{runner_id}": Operation<"/enterprises/{enterprise}/actions/runners/{runner_id}", "delete">; /** - * @see https://developer.github.com/v3/gists/comments/#delete-a-gist-comment + * @see https://docs.github.com/rest/reference/gists#delete-a-gist */ - "DELETE /gists/:gist_id/comments/:comment_id": { - parameters: GistsDeleteCommentEndpoint; - request: GistsDeleteCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /gists/{gist_id}": Operation<"/gists/{gist_id}", "delete">; /** - * @see https://developer.github.com/v3/gists/#unstar-a-gist + * @see https://docs.github.com/rest/reference/gists#delete-a-gist-comment */ - "DELETE /gists/:gist_id/star": { - parameters: GistsUnstarEndpoint; - request: GistsUnstarRequestOptions; - response: OctokitResponse; - }; + "DELETE /gists/{gist_id}/comments/{comment_id}": Operation<"/gists/{gist_id}/comments/{comment_id}", "delete">; /** - * @see https://developer.github.com/v3/apps/installations/#revoke-an-installation-access-token + * @see https://docs.github.com/rest/reference/gists#unstar-a-gist */ - "DELETE /installation/token": { - parameters: AppsRevokeInstallationAccessTokenEndpoint; - request: AppsRevokeInstallationAccessTokenRequestOptions; - response: OctokitResponse; - }; + "DELETE /gists/{gist_id}/star": Operation<"/gists/{gist_id}/star", "delete">; /** - * @see https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription + * @see https://docs.github.com/rest/reference/apps#revoke-an-installation-access-token */ - "DELETE /notifications/threads/:thread_id/subscription": { - parameters: ActivityDeleteThreadSubscriptionEndpoint; - request: ActivityDeleteThreadSubscriptionRequestOptions; - response: OctokitResponse; - }; + "DELETE /installation/token": Operation<"/installation/token", "delete">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#delete-a-self-hosted-runner-group-from-an-organization + * @see https://docs.github.com/rest/reference/activity#delete-a-thread-subscription */ - "DELETE /orgs/:org/actions/runner-groups/:runner_group_id": { - parameters: ActionsDeleteSelfHostedRunnerGroupFromOrgEndpoint; - request: ActionsDeleteSelfHostedRunnerGroupFromOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /notifications/threads/{thread_id}/subscription": Operation<"/notifications/threads/{thread_id}/subscription", "delete">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization + * @see https://docs.github.com/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization */ - "DELETE /orgs/:org/actions/runner-groups/:runner_group_id/repositories/:repository_id": { - parameters: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgEndpoint; - request: ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}": Operation<"/orgs/{org}/actions/permissions/repositories/{repository_id}", "delete">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#remove-a-self-hosted-runner-from-a-group-for-an-organization + * @see https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-organization */ - "DELETE /orgs/:org/actions/runner-groups/:runner_group_id/runners/:runner_id": { - parameters: ActionsRemoveSelfHostedRunnerFromGroupForOrgEndpoint; - request: ActionsRemoveSelfHostedRunnerFromGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}", "delete">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#delete-a-self-hosted-runner-from-an-organization + * @see https://docs.github.com/rest/reference/actions#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization */ - "DELETE /orgs/:org/actions/runners/:runner_id": { - parameters: ActionsDeleteSelfHostedRunnerFromOrgEndpoint; - request: ActionsDeleteSelfHostedRunnerFromOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}", "delete">; /** - * @see https://developer.github.com/v3/actions/secrets/#delete-an-organization-secret + * @see https://docs.github.com/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization */ - "DELETE /orgs/:org/actions/secrets/:secret_name": { - parameters: ActionsDeleteOrgSecretEndpoint; - request: ActionsDeleteOrgSecretRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "delete">; /** - * @see https://developer.github.com/v3/actions/secrets/#remove-selected-repository-from-an-organization-secret + * @see https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization */ - "DELETE /orgs/:org/actions/secrets/:secret_name/repositories/:repository_id": { - parameters: ActionsRemoveSelectedRepoFromOrgSecretEndpoint; - request: ActionsRemoveSelectedRepoFromOrgSecretRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/runners/{runner_id}": Operation<"/orgs/{org}/actions/runners/{runner_id}", "delete">; /** - * @see https://developer.github.com/v3/orgs/blocking/#unblock-a-user-from-an-organization + * @see https://docs.github.com/rest/reference/actions#delete-an-organization-secret */ - "DELETE /orgs/:org/blocks/:username": { - parameters: OrgsUnblockUserEndpoint; - request: OrgsUnblockUserRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/secrets/{secret_name}": Operation<"/orgs/{org}/actions/secrets/{secret_name}", "delete">; /** - * @see https://developer.github.com/v3/orgs/#remove-a-saml-sso-authorization-for-an-organization + * @see https://docs.github.com/rest/reference/actions#remove-selected-repository-from-an-organization-secret */ - "DELETE /orgs/:org/credential-authorizations/:credential_id": { - parameters: OrgsRemoveSamlSsoAuthorizationEndpoint; - request: OrgsRemoveSamlSsoAuthorizationRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", "delete">; /** - * @see https://developer.github.com/v3/orgs/hooks/#delete-an-organization-webhook + * @see https://docs.github.com/rest/reference/orgs#unblock-a-user-from-an-organization */ - "DELETE /orgs/:org/hooks/:hook_id": { - parameters: OrgsDeleteWebhookEndpoint; - request: OrgsDeleteWebhookRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "delete">; /** - * @see https://developer.github.com/v3/interactions/orgs/#remove-interaction-restrictions-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#remove-a-saml-sso-authorization-for-an-organization */ - "DELETE /orgs/:org/interaction-limits": { - parameters: InteractionsRemoveRestrictionsForOrgEndpoint; - request: InteractionsRemoveRestrictionsForOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/credential-authorizations/{credential_id}": Operation<"/orgs/{org}/credential-authorizations/{credential_id}", "delete">; /** - * @see https://developer.github.com/v3/orgs/members/#remove-an-organization-member + * @see https://docs.github.com/rest/reference/orgs#delete-an-organization-webhook */ - "DELETE /orgs/:org/members/:username": { - parameters: OrgsRemoveMemberEndpoint; - request: OrgsRemoveMemberRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/hooks/{hook_id}": Operation<"/orgs/{org}/hooks/{hook_id}", "delete">; /** - * @see https://developer.github.com/v3/orgs/members/#remove-organization-membership-for-a-user + * @see https://docs.github.com/rest/reference/interactions#remove-interaction-restrictions-for-an-organization */ - "DELETE /orgs/:org/memberships/:username": { - parameters: OrgsRemoveMembershipForUserEndpoint; - request: OrgsRemoveMembershipForUserRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/interaction-limits": Operation<"/orgs/{org}/interaction-limits", "delete">; /** - * @see https://developer.github.com/v3/migrations/orgs/#delete-an-organization-migration-archive + * @see https://docs.github.com/rest/reference/orgs#cancel-an-organization-invitation */ - "DELETE /orgs/:org/migrations/:migration_id/archive": { - parameters: MigrationsDeleteArchiveForOrgEndpoint; - request: MigrationsDeleteArchiveForOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/invitations/{invitation_id}": Operation<"/orgs/{org}/invitations/{invitation_id}", "delete">; /** - * @see https://developer.github.com/v3/migrations/orgs/#unlock-an-organization-repository + * @see https://docs.github.com/rest/reference/orgs#remove-an-organization-member */ - "DELETE /orgs/:org/migrations/:migration_id/repos/:repo_name/lock": { - parameters: MigrationsUnlockRepoForOrgEndpoint; - request: MigrationsUnlockRepoForOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/members/{username}": Operation<"/orgs/{org}/members/{username}", "delete">; /** - * @see https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator-from-an-organization + * @see https://docs.github.com/rest/reference/orgs#remove-organization-membership-for-a-user */ - "DELETE /orgs/:org/outside_collaborators/:username": { - parameters: OrgsRemoveOutsideCollaboratorEndpoint; - request: OrgsRemoveOutsideCollaboratorRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/memberships/{username}": Operation<"/orgs/{org}/memberships/{username}", "delete">; /** - * @see https://developer.github.com/v3/orgs/members/#remove-public-organization-membership-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/migrations#delete-an-organization-migration-archive */ - "DELETE /orgs/:org/public_members/:username": { - parameters: OrgsRemovePublicMembershipForAuthenticatedUserEndpoint; - request: OrgsRemovePublicMembershipForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/migrations/{migration_id}/archive": Operation<"/orgs/{org}/migrations/{migration_id}/archive", "delete", "wyandotte">; /** - * @see https://developer.github.com/v3/teams/#delete-a-team + * @see https://docs.github.com/rest/reference/migrations#unlock-an-organization-repository */ - "DELETE /orgs/:org/teams/:team_slug": { - parameters: TeamsDeleteInOrgEndpoint; - request: TeamsDeleteInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock": Operation<"/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", "delete", "wyandotte">; /** - * @see https://developer.github.com/v3/teams/discussions/#delete-a-discussion + * @see https://docs.github.com/rest/reference/orgs#remove-outside-collaborator-from-an-organization */ - "DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number": { - parameters: TeamsDeleteDiscussionInOrgEndpoint; - request: TeamsDeleteDiscussionInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/outside_collaborators/{username}": Operation<"/orgs/{org}/outside_collaborators/{username}", "delete">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#delete-a-discussion-comment + * @see https://docs.github.com/rest/reference/packages#delete-a-package-for-an-organization */ - "DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number": { - parameters: TeamsDeleteDiscussionCommentInOrgEndpoint; - request: TeamsDeleteDiscussionCommentInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/packages/{package_type}/{package_name}": Operation<"/orgs/{org}/packages/{package_type}/{package_name}", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-team-discussion-comment-reaction + * @see https://docs.github.com/rest/reference/packages#delete-a-package-version-for-an-organization */ - "DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id": { - parameters: ReactionsDeleteForTeamDiscussionCommentEndpoint; - request: ReactionsDeleteForTeamDiscussionCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}": Operation<"/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-team-discussion-reaction + * @see https://docs.github.com/rest/reference/orgs#remove-public-organization-membership-for-the-authenticated-user */ - "DELETE /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions/:reaction_id": { - parameters: ReactionsDeleteForTeamDiscussionEndpoint; - request: ReactionsDeleteForTeamDiscussionRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/public_members/{username}": Operation<"/orgs/{org}/public_members/{username}", "delete">; /** - * @see https://developer.github.com/v3/teams/members/#remove-team-membership-for-a-user + * @see https://docs.github.com/rest/reference/teams#delete-a-team */ - "DELETE /orgs/:org/teams/:team_slug/memberships/:username": { - parameters: TeamsRemoveMembershipForUserInOrgEndpoint; - request: TeamsRemoveMembershipForUserInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}": Operation<"/orgs/{org}/teams/{team_slug}", "delete">; /** - * @see https://developer.github.com/v3/teams/#remove-a-project-from-a-team + * @see https://docs.github.com/rest/reference/teams#delete-a-discussion */ - "DELETE /orgs/:org/teams/:team_slug/projects/:project_id": { - parameters: TeamsRemoveProjectInOrgEndpoint; - request: TeamsRemoveProjectInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}", "delete">; /** - * @see https://developer.github.com/v3/teams/#remove-a-repository-from-a-team + * @see https://docs.github.com/rest/reference/teams#delete-a-discussion-comment */ - "DELETE /orgs/:org/teams/:team_slug/repos/:owner/:repo": { - parameters: TeamsRemoveRepoInOrgEndpoint; - request: TeamsRemoveRepoInOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}", "delete">; /** - * @see https://developer.github.com/v3/projects/#delete-a-project + * @see https://docs.github.com/rest/reference/reactions#delete-team-discussion-comment-reaction */ - "DELETE /projects/:project_id": { - parameters: ProjectsDeleteEndpoint; - request: ProjectsDeleteRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/projects/collaborators/#remove-project-collaborator + * @see https://docs.github.com/rest/reference/reactions#delete-team-discussion-reaction */ - "DELETE /projects/:project_id/collaborators/:username": { - parameters: ProjectsRemoveCollaboratorEndpoint; - request: ProjectsRemoveCollaboratorRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/projects/columns/#delete-a-project-column + * @see https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user */ - "DELETE /projects/columns/:column_id": { - parameters: ProjectsDeleteColumnEndpoint; - request: ProjectsDeleteColumnRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}": Operation<"/orgs/{org}/teams/{team_slug}/memberships/{username}", "delete">; /** - * @see https://developer.github.com/v3/projects/cards/#delete-a-project-card + * @see https://docs.github.com/rest/reference/teams#remove-a-project-from-a-team */ - "DELETE /projects/columns/cards/:card_id": { - parameters: ProjectsDeleteCardEndpoint; - request: ProjectsDeleteCardRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}": Operation<"/orgs/{org}/teams/{team_slug}/projects/{project_id}", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-a-reaction-legacy + * @see https://docs.github.com/rest/reference/teams/#remove-a-repository-from-a-team */ - "DELETE /reactions/:reaction_id": { - parameters: ReactionsDeleteLegacyEndpoint; - request: ReactionsDeleteLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}": Operation<"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}", "delete">; /** - * @see https://developer.github.com/v3/repos/#delete-a-repository + * @see https://docs.github.com/rest/reference/projects#delete-a-project-card */ - "DELETE /repos/:owner/:repo": { - parameters: ReposDeleteEndpoint; - request: ReposDeleteRequestOptions; - response: OctokitResponse; - }; + "DELETE /projects/columns/cards/{card_id}": Operation<"/projects/columns/cards/{card_id}", "delete", "inertia">; /** - * @see https://developer.github.com/v3/actions/artifacts/#delete-an-artifact + * @see https://docs.github.com/rest/reference/projects#delete-a-project-column */ - "DELETE /repos/:owner/:repo/actions/artifacts/:artifact_id": { - parameters: ActionsDeleteArtifactEndpoint; - request: ActionsDeleteArtifactRequestOptions; - response: OctokitResponse; - }; + "DELETE /projects/columns/{column_id}": Operation<"/projects/columns/{column_id}", "delete", "inertia">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#delete-a-self-hosted-runner-from-a-repository + * @see https://docs.github.com/rest/reference/projects#delete-a-project */ - "DELETE /repos/:owner/:repo/actions/runners/:runner_id": { - parameters: ActionsDeleteSelfHostedRunnerFromRepoEndpoint; - request: ActionsDeleteSelfHostedRunnerFromRepoRequestOptions; - response: OctokitResponse; - }; + "DELETE /projects/{project_id}": Operation<"/projects/{project_id}", "delete", "inertia">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#delete-a-workflow-run + * @see https://docs.github.com/rest/reference/projects#remove-project-collaborator */ - "DELETE /repos/:owner/:repo/actions/runs/:run_id": { - parameters: ActionsDeleteWorkflowRunEndpoint; - request: ActionsDeleteWorkflowRunRequestOptions; - response: OctokitResponse; - }; + "DELETE /projects/{project_id}/collaborators/{username}": Operation<"/projects/{project_id}/collaborators/{username}", "delete", "inertia">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#delete-workflow-run-logs + * @see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy */ - "DELETE /repos/:owner/:repo/actions/runs/:run_id/logs": { - parameters: ActionsDeleteWorkflowRunLogsEndpoint; - request: ActionsDeleteWorkflowRunLogsRequestOptions; - response: OctokitResponse; - }; + "DELETE /reactions/{reaction_id}": Operation<"/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/actions/secrets/#delete-a-repository-secret + * @see https://docs.github.com/rest/reference/repos#delete-a-repository */ - "DELETE /repos/:owner/:repo/actions/secrets/:secret_name": { - parameters: ActionsDeleteRepoSecretEndpoint; - request: ActionsDeleteRepoSecretRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}": Operation<"/repos/{owner}/{repo}", "delete">; /** - * @see https://developer.github.com/v3/repos/#disable-automated-security-fixes + * @see https://docs.github.com/rest/reference/actions#delete-an-artifact */ - "DELETE /repos/:owner/:repo/automated-security-fixes": { - parameters: ReposDisableAutomatedSecurityFixesEndpoint; - request: ReposDisableAutomatedSecurityFixesRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}": Operation<"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#delete-branch-protection + * @see https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository */ - "DELETE /repos/:owner/:repo/branches/:branch/protection": { - parameters: ReposDeleteBranchProtectionEndpoint; - request: ReposDeleteBranchProtectionRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}": Operation<"/repos/{owner}/{repo}/actions/runners/{runner_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#delete-admin-branch-protection + * @see https://docs.github.com/rest/reference/actions#delete-a-workflow-run */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/enforce_admins": { - parameters: ReposDeleteAdminBranchProtectionEndpoint; - request: ReposDeleteAdminBranchProtectionRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#delete-pull-request-review-protection + * @see https://docs.github.com/rest/reference/actions#delete-workflow-run-logs */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews": { - parameters: ReposDeletePullRequestReviewProtectionEndpoint; - request: ReposDeletePullRequestReviewProtectionRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/logs", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#delete-commit-signature-protection + * @see https://docs.github.com/rest/reference/actions#delete-a-repository-secret */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/required_signatures": { - parameters: ReposDeleteCommitSignatureProtectionEndpoint; - request: ReposDeleteCommitSignatureProtectionRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}": Operation<"/repos/{owner}/{repo}/actions/secrets/{secret_name}", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#remove-status-check-protection + * @see https://docs.github.com/v3/repos#delete-autolink */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks": { - parameters: ReposRemoveStatusCheckProtectionEndpoint; - request: ReposRemoveStatusCheckProtectionRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}": Operation<"/repos/{owner}/{repo}/autolinks/{autolink_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#remove-status-check-contexts + * @see https://docs.github.com/rest/reference/repos#disable-automated-security-fixes */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts": { - parameters: ReposRemoveStatusCheckContextsEndpoint; - request: ReposRemoveStatusCheckContextsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/automated-security-fixes": Operation<"/repos/{owner}/{repo}/automated-security-fixes", "delete", "london">; /** - * @see https://developer.github.com/v3/repos/branches/#delete-access-restrictions + * @see https://docs.github.com/rest/reference/repos#delete-branch-protection */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions": { - parameters: ReposDeleteAccessRestrictionsEndpoint; - request: ReposDeleteAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#remove-app-access-restrictions + * @see https://docs.github.com/rest/reference/repos#delete-admin-branch-protection */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/apps": { - parameters: ReposRemoveAppAccessRestrictionsEndpoint; - request: ReposRemoveAppAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#remove-team-access-restrictions + * @see https://docs.github.com/rest/reference/repos#delete-pull-request-review-protection */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/teams": { - parameters: ReposRemoveTeamAccessRestrictionsEndpoint; - request: ReposRemoveTeamAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", "delete">; /** - * @see https://developer.github.com/v3/repos/branches/#remove-user-access-restrictions + * @see https://docs.github.com/rest/reference/repos#delete-commit-signature-protection */ - "DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/users": { - parameters: ReposRemoveUserAccessRestrictionsEndpoint; - request: ReposRemoveUserAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", "delete", "zzzax">; /** - * @see https://developer.github.com/v3/repos/collaborators/#remove-a-repository-collaborator + * @see https://docs.github.com/rest/reference/repos#remove-status-check-protection */ - "DELETE /repos/:owner/:repo/collaborators/:username": { - parameters: ReposRemoveCollaboratorEndpoint; - request: ReposRemoveCollaboratorRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", "delete">; /** - * @see https://developer.github.com/v3/repos/comments/#delete-a-commit-comment + * @see https://docs.github.com/rest/reference/repos#remove-status-check-contexts */ - "DELETE /repos/:owner/:repo/comments/:comment_id": { - parameters: ReposDeleteCommitCommentEndpoint; - request: ReposDeleteCommitCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-a-commit-comment-reaction + * @see https://docs.github.com/rest/reference/repos#delete-access-restrictions */ - "DELETE /repos/:owner/:repo/comments/:comment_id/reactions/:reaction_id": { - parameters: ReactionsDeleteForCommitCommentEndpoint; - request: ReactionsDeleteForCommitCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions", "delete">; /** - * @see https://developer.github.com/v3/repos/contents/#delete-a-file + * @see https://docs.github.com/rest/reference/repos#remove-app-access-restrictions */ - "DELETE /repos/:owner/:repo/contents/:path": { - parameters: ReposDeleteFileEndpoint; - request: ReposDeleteFileRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", "delete">; /** - * @see https://developer.github.com/v3/repos/deployments/#delete-a-deployment + * @see https://docs.github.com/rest/reference/repos#remove-team-access-restrictions */ - "DELETE /repos/:owner/:repo/deployments/:deployment_id": { - parameters: ReposDeleteDeploymentEndpoint; - request: ReposDeleteDeploymentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", "delete">; /** - * @see https://developer.github.com/v3/git/refs/#delete-a-reference + * @see https://docs.github.com/rest/reference/repos#remove-user-access-restrictions */ - "DELETE /repos/:owner/:repo/git/refs/:ref": { - parameters: GitDeleteRefEndpoint; - request: GitDeleteRefRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", "delete">; /** - * @see https://developer.github.com/v3/repos/hooks/#delete-a-repository-webhook + * @see https://docs.github.com/rest/reference/code-scanning#delete-a-code-scanning-analysis-from-a-repository */ - "DELETE /repos/:owner/:repo/hooks/:hook_id": { - parameters: ReposDeleteWebhookEndpoint; - request: ReposDeleteWebhookRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}": Operation<"/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", "delete">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#cancel-an-import + * @see https://docs.github.com/rest/reference/repos#remove-a-repository-collaborator */ - "DELETE /repos/:owner/:repo/import": { - parameters: MigrationsCancelImportEndpoint; - request: MigrationsCancelImportRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/collaborators/{username}": Operation<"/repos/{owner}/{repo}/collaborators/{username}", "delete">; /** - * @see https://developer.github.com/v3/interactions/repos/#remove-interaction-restrictions-for-a-repository + * @see https://docs.github.com/rest/reference/repos#delete-a-commit-comment */ - "DELETE /repos/:owner/:repo/interaction-limits": { - parameters: InteractionsRemoveRestrictionsForRepoEndpoint; - request: InteractionsRemoveRestrictionsForRepoRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/comments/{comment_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/invitations/#delete-a-repository-invitation + * @see https://docs.github.com/rest/reference/reactions#delete-a-commit-comment-reaction */ - "DELETE /repos/:owner/:repo/invitations/:invitation_id": { - parameters: ReposDeleteInvitationEndpoint; - request: ReposDeleteInvitationRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}": Operation<"/repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue + * @see https://docs.github.com/rest/reference/repos#delete-a-file */ - "DELETE /repos/:owner/:repo/issues/:issue_number/assignees": { - parameters: IssuesRemoveAssigneesEndpoint; - request: IssuesRemoveAssigneesRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/contents/{path}": Operation<"/repos/{owner}/{repo}/contents/{path}", "delete">; /** - * @see https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue + * @see https://docs.github.com/rest/reference/repos#delete-a-deployment */ - "DELETE /repos/:owner/:repo/issues/:issue_number/labels": { - parameters: IssuesRemoveAllLabelsEndpoint; - request: IssuesRemoveAllLabelsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/deployments/{deployment_id}": Operation<"/repos/{owner}/{repo}/deployments/{deployment_id}", "delete">; /** - * @see https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue + * @see https://docs.github.com/rest/reference/repos#delete-an-environment */ - "DELETE /repos/:owner/:repo/issues/:issue_number/labels/:name": { - parameters: IssuesRemoveLabelEndpoint; - request: IssuesRemoveLabelRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/environments/{environment_name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}", "delete">; /** - * @see https://developer.github.com/v3/issues/#unlock-an-issue + * @see https://docs.github.com/rest/reference/git#delete-a-reference */ - "DELETE /repos/:owner/:repo/issues/:issue_number/lock": { - parameters: IssuesUnlockEndpoint; - request: IssuesUnlockRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/git/refs/{ref}": Operation<"/repos/{owner}/{repo}/git/refs/{ref}", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-an-issue-reaction + * @see https://docs.github.com/rest/reference/repos#delete-a-repository-webhook */ - "DELETE /repos/:owner/:repo/issues/:issue_number/reactions/:reaction_id": { - parameters: ReactionsDeleteForIssueEndpoint; - request: ReactionsDeleteForIssueRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/hooks/{hook_id}": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}", "delete">; /** - * @see https://developer.github.com/v3/issues/comments/#delete-an-issue-comment + * @see https://docs.github.com/rest/reference/migrations#cancel-an-import */ - "DELETE /repos/:owner/:repo/issues/comments/:comment_id": { - parameters: IssuesDeleteCommentEndpoint; - request: IssuesDeleteCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-an-issue-comment-reaction + * @see https://docs.github.com/rest/reference/interactions#remove-interaction-restrictions-for-a-repository */ - "DELETE /repos/:owner/:repo/issues/comments/:comment_id/reactions/:reaction_id": { - parameters: ReactionsDeleteForIssueCommentEndpoint; - request: ReactionsDeleteForIssueCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/interaction-limits": Operation<"/repos/{owner}/{repo}/interaction-limits", "delete">; /** - * @see https://developer.github.com/v3/repos/keys/#delete-a-deploy-key + * @see https://docs.github.com/rest/reference/repos#delete-a-repository-invitation */ - "DELETE /repos/:owner/:repo/keys/:key_id": { - parameters: ReposDeleteDeployKeyEndpoint; - request: ReposDeleteDeployKeyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/invitations/{invitation_id}": Operation<"/repos/{owner}/{repo}/invitations/{invitation_id}", "delete">; /** - * @see https://developer.github.com/v3/issues/labels/#delete-a-label + * @see https://docs.github.com/rest/reference/issues#delete-an-issue-comment */ - "DELETE /repos/:owner/:repo/labels/:name": { - parameters: IssuesDeleteLabelEndpoint; - request: IssuesDeleteLabelRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/issues/comments/{comment_id}", "delete">; /** - * @see https://developer.github.com/v3/issues/milestones/#delete-a-milestone + * @see https://docs.github.com/rest/reference/reactions#delete-an-issue-comment-reaction */ - "DELETE /repos/:owner/:repo/milestones/:milestone_number": { - parameters: IssuesDeleteMilestoneEndpoint; - request: IssuesDeleteMilestoneRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}": Operation<"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/repos/pages/#delete-a-github-pages-site + * @see https://docs.github.com/rest/reference/issues#remove-assignees-from-an-issue */ - "DELETE /repos/:owner/:repo/pages": { - parameters: ReposDeletePagesSiteEndpoint; - request: ReposDeletePagesSiteRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/assignees", "delete">; /** - * @see https://developer.github.com/v3/pulls/review_requests/#remove-requested-reviewers-from-a-pull-request + * @see https://docs.github.com/rest/reference/issues#remove-all-labels-from-an-issue */ - "DELETE /repos/:owner/:repo/pulls/:pull_number/requested_reviewers": { - parameters: PullsRemoveRequestedReviewersEndpoint; - request: PullsRemoveRequestedReviewersRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/labels", "delete">; /** - * @see https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review-for-a-pull-request + * @see https://docs.github.com/rest/reference/issues#remove-a-label-from-an-issue */ - "DELETE /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id": { - parameters: PullsDeletePendingReviewEndpoint; - request: PullsDeletePendingReviewRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/labels/{name}", "delete">; /** - * @see https://developer.github.com/v3/pulls/comments/#delete-a-review-comment-for-a-pull-request + * @see https://docs.github.com/rest/reference/issues#unlock-an-issue */ - "DELETE /repos/:owner/:repo/pulls/comments/:comment_id": { - parameters: PullsDeleteReviewCommentEndpoint; - request: PullsDeleteReviewCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/lock", "delete">; /** - * @see https://developer.github.com/v3/reactions/#delete-a-pull-request-comment-reaction + * @see https://docs.github.com/rest/reference/reactions#delete-an-issue-reaction */ - "DELETE /repos/:owner/:repo/pulls/comments/:comment_id/reactions/:reaction_id": { - parameters: ReactionsDeleteForPullRequestCommentEndpoint; - request: ReactionsDeleteForPullRequestCommentRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/repos/releases/#delete-a-release + * @see https://docs.github.com/rest/reference/repos#delete-a-deploy-key */ - "DELETE /repos/:owner/:repo/releases/:release_id": { - parameters: ReposDeleteReleaseEndpoint; - request: ReposDeleteReleaseRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/keys/{key_id}": Operation<"/repos/{owner}/{repo}/keys/{key_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/releases/#delete-a-release-asset + * @see https://docs.github.com/rest/reference/issues#delete-a-label */ - "DELETE /repos/:owner/:repo/releases/assets/:asset_id": { - parameters: ReposDeleteReleaseAssetEndpoint; - request: ReposDeleteReleaseAssetRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/labels/{name}": Operation<"/repos/{owner}/{repo}/labels/{name}", "delete">; /** - * @see https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription + * @see https://docs.github.com/rest/reference/issues#delete-a-milestone */ - "DELETE /repos/:owner/:repo/subscription": { - parameters: ActivityDeleteRepoSubscriptionEndpoint; - request: ActivityDeleteRepoSubscriptionRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/milestones/{milestone_number}": Operation<"/repos/{owner}/{repo}/milestones/{milestone_number}", "delete">; /** - * @see https://developer.github.com/v3/repos/#disable-vulnerability-alerts + * @see https://docs.github.com/rest/reference/repos#delete-a-github-pages-site */ - "DELETE /repos/:owner/:repo/vulnerability-alerts": { - parameters: ReposDisableVulnerabilityAlertsEndpoint; - request: ReposDisableVulnerabilityAlertsRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/pages": Operation<"/repos/{owner}/{repo}/pages", "delete", "switcheroo">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#delete-a-scim-group-from-an-enterprise + * @see https://docs.github.com/rest/reference/pulls#delete-a-review-comment-for-a-pull-request */ - "DELETE /scim/v2/enterprises/:enterprise/Groups/:scim_group_id": { - parameters: EnterpriseAdminDeleteScimGroupFromEnterpriseEndpoint; - request: EnterpriseAdminDeleteScimGroupFromEnterpriseRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/pulls/comments/{comment_id}", "delete">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#delete-a-scim-user-from-an-enterprise + * @see https://docs.github.com/rest/reference/reactions#delete-a-pull-request-comment-reaction */ - "DELETE /scim/v2/enterprises/:enterprise/Users/:scim_user_id": { - parameters: EnterpriseAdminDeleteUserFromEnterpriseEndpoint; - request: EnterpriseAdminDeleteUserFromEnterpriseRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}": Operation<"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}", "delete", "squirrel-girl">; /** - * @see https://developer.github.com/v3/scim/#delete-a-scim-user-from-an-organization + * @see https://docs.github.com/rest/reference/pulls#remove-requested-reviewers-from-a-pull-request */ - "DELETE /scim/v2/organizations/:org/Users/:scim_user_id": { - parameters: ScimDeleteUserFromOrgEndpoint; - request: ScimDeleteUserFromOrgRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "delete">; /** - * @see https://developer.github.com/v3/teams/#delete-a-team-legacy + * @see https://docs.github.com/rest/reference/pulls#delete-a-pending-review-for-a-pull-request */ - "DELETE /teams/:team_id": { - parameters: TeamsDeleteLegacyEndpoint; - request: TeamsDeleteLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}", "delete">; /** - * @see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy + * @see https://docs.github.com/rest/reference/repos#delete-a-release-asset */ - "DELETE /teams/:team_id/discussions/:discussion_number": { - parameters: TeamsDeleteDiscussionLegacyEndpoint; - request: TeamsDeleteDiscussionLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}": Operation<"/repos/{owner}/{repo}/releases/assets/{asset_id}", "delete">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#delete-a-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/repos#delete-a-release */ - "DELETE /teams/:team_id/discussions/:discussion_number/comments/:comment_number": { - parameters: TeamsDeleteDiscussionCommentLegacyEndpoint; - request: TeamsDeleteDiscussionCommentLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/releases/{release_id}": Operation<"/repos/{owner}/{repo}/releases/{release_id}", "delete">; /** - * @see https://developer.github.com/v3/teams/members/#remove-team-member-legacy + * @see https://docs.github.com/rest/reference/activity#delete-a-repository-subscription */ - "DELETE /teams/:team_id/members/:username": { - parameters: TeamsRemoveMemberLegacyEndpoint; - request: TeamsRemoveMemberLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/subscription": Operation<"/repos/{owner}/{repo}/subscription", "delete">; /** - * @see https://developer.github.com/v3/teams/members/#remove-team-membership-for-a-user-legacy + * @see https://docs.github.com/rest/reference/repos#disable-vulnerability-alerts */ - "DELETE /teams/:team_id/memberships/:username": { - parameters: TeamsRemoveMembershipForUserLegacyEndpoint; - request: TeamsRemoveMembershipForUserLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repos/{owner}/{repo}/vulnerability-alerts": Operation<"/repos/{owner}/{repo}/vulnerability-alerts", "delete", "dorian">; /** - * @see https://developer.github.com/v3/teams/#remove-a-project-from-a-team-legacy + * @see https://docs.github.com/rest/reference/actions#delete-an-environment-secret */ - "DELETE /teams/:team_id/projects/:project_id": { - parameters: TeamsRemoveProjectLegacyEndpoint; - request: TeamsRemoveProjectLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", "delete">; /** - * @see https://developer.github.com/v3/teams/#remove-a-repository-from-a-team-legacy + * @see https://docs.github.com/rest/reference/enterprise-admin#delete-a-scim-group-from-an-enterprise */ - "DELETE /teams/:team_id/repos/:owner/:repo": { - parameters: TeamsRemoveRepoLegacyEndpoint; - request: TeamsRemoveRepoLegacyRequestOptions; - response: OctokitResponse; - }; + "DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}": Operation<"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}", "delete">; /** - * @see https://developer.github.com/v3/users/blocking/#unblock-a-user + * @see https://docs.github.com/rest/reference/enterprise-admin#delete-a-scim-user-from-an-enterprise */ - "DELETE /user/blocks/:username": { - parameters: UsersUnblockEndpoint; - request: UsersUnblockRequestOptions; - response: OctokitResponse; - }; + "DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}": Operation<"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}", "delete">; /** - * @see https://developer.github.com/v3/users/emails/#delete-an-email-address-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/scim#delete-a-scim-user-from-an-organization */ - "DELETE /user/emails": { - parameters: UsersDeleteEmailForAuthenticatedEndpoint; - request: UsersDeleteEmailForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "DELETE /scim/v2/organizations/{org}/Users/{scim_user_id}": Operation<"/scim/v2/organizations/{org}/Users/{scim_user_id}", "delete">; /** - * @see https://developer.github.com/v3/users/followers/#unfollow-a-user + * @see https://docs.github.com/rest/reference/teams/#delete-a-team-legacy */ - "DELETE /user/following/:username": { - parameters: UsersUnfollowEndpoint; - request: UsersUnfollowRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}": Operation<"/teams/{team_id}", "delete">; /** - * @see https://developer.github.com/v3/users/gpg_keys/#delete-a-gpg-key-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/teams#delete-a-discussion-legacy */ - "DELETE /user/gpg_keys/:gpg_key_id": { - parameters: UsersDeleteGpgKeyForAuthenticatedEndpoint; - request: UsersDeleteGpgKeyForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}/discussions/{discussion_number}": Operation<"/teams/{team_id}/discussions/{discussion_number}", "delete">; /** - * @see https://developer.github.com/v3/apps/installations/#remove-a-repository-from-an-app-installation + * @see https://docs.github.com/rest/reference/teams#delete-a-discussion-comment-legacy */ - "DELETE /user/installations/:installation_id/repositories/:repository_id": { - parameters: AppsRemoveRepoFromInstallationEndpoint; - request: AppsRemoveRepoFromInstallationRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}", "delete">; /** - * @see https://developer.github.com/v3/users/keys/#delete-a-public-ssh-key-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/teams#remove-team-member-legacy */ - "DELETE /user/keys/:key_id": { - parameters: UsersDeletePublicSshKeyForAuthenticatedEndpoint; - request: UsersDeletePublicSshKeyForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}/members/{username}": Operation<"/teams/{team_id}/members/{username}", "delete">; /** - * @see https://developer.github.com/v3/migrations/users/#delete-a-user-migration-archive + * @see https://docs.github.com/rest/reference/teams#remove-team-membership-for-a-user-legacy */ - "DELETE /user/migrations/:migration_id/archive": { - parameters: MigrationsDeleteArchiveForAuthenticatedUserEndpoint; - request: MigrationsDeleteArchiveForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}/memberships/{username}": Operation<"/teams/{team_id}/memberships/{username}", "delete">; /** - * @see https://developer.github.com/v3/migrations/users/#unlock-a-user-repository + * @see https://docs.github.com/rest/reference/teams/#remove-a-project-from-a-team-legacy */ - "DELETE /user/migrations/:migration_id/repos/:repo_name/lock": { - parameters: MigrationsUnlockRepoForAuthenticatedUserEndpoint; - request: MigrationsUnlockRepoForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}/projects/{project_id}": Operation<"/teams/{team_id}/projects/{project_id}", "delete">; /** - * @see https://developer.github.com/v3/repos/invitations/#decline-a-repository-invitation + * @see https://docs.github.com/rest/reference/teams/#remove-a-repository-from-a-team-legacy */ - "DELETE /user/repository_invitations/:invitation_id": { - parameters: ReposDeclineInvitationEndpoint; - request: ReposDeclineInvitationRequestOptions; - response: OctokitResponse; - }; + "DELETE /teams/{team_id}/repos/{owner}/{repo}": Operation<"/teams/{team_id}/repos/{owner}/{repo}", "delete">; /** - * @see https://developer.github.com/v3/activity/starring/#unstar-a-repository-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#unblock-a-user */ - "DELETE /user/starred/:owner/:repo": { - parameters: ActivityUnstarRepoForAuthenticatedUserEndpoint; - request: ActivityUnstarRepoForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/blocks/{username}": Operation<"/user/blocks/{username}", "delete">; /** - * @see https://developer.github.com/v3/apps/#get-the-authenticated-app + * @see https://docs.github.com/rest/reference/users#delete-an-email-address-for-the-authenticated-user */ - "GET /app": { - parameters: AppsGetAuthenticatedEndpoint; - request: AppsGetAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/emails": Operation<"/user/emails", "delete">; /** - * @see https://developer.github.com/v3/apps/#list-installations-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/users#unfollow-a-user */ - "GET /app/installations": { - parameters: AppsListInstallationsEndpoint; - request: AppsListInstallationsRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/following/{username}": Operation<"/user/following/{username}", "delete">; /** - * @see https://developer.github.com/v3/apps/#get-an-installation-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/users#delete-a-gpg-key-for-the-authenticated-user */ - "GET /app/installations/:installation_id": { - parameters: AppsGetInstallationEndpoint; - request: AppsGetInstallationRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/gpg_keys/{gpg_key_id}": Operation<"/user/gpg_keys/{gpg_key_id}", "delete">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization + * @see https://docs.github.com/rest/reference/apps#remove-a-repository-from-an-app-installation */ - "GET /applications/:client_id/tokens/:access_token": { - parameters: AppsCheckAuthorizationEndpoint; - request: AppsCheckAuthorizationRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/installations/{installation_id}/repositories/{repository_id}": Operation<"/user/installations/{installation_id}/repositories/{repository_id}", "delete">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#list-your-grants + * @see https://docs.github.com/rest/reference/interactions#remove-interaction-restrictions-from-your-public-repositories */ - "GET /applications/grants": { - parameters: OauthAuthorizationsListGrantsEndpoint; - request: OauthAuthorizationsListGrantsRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/interaction-limits": Operation<"/user/interaction-limits", "delete">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant + * @see https://docs.github.com/rest/reference/users#delete-a-public-ssh-key-for-the-authenticated-user */ - "GET /applications/grants/:grant_id": { - parameters: OauthAuthorizationsGetGrantEndpoint; - request: OauthAuthorizationsGetGrantRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/keys/{key_id}": Operation<"/user/keys/{key_id}", "delete">; /** - * @see https://developer.github.com/v3/apps/#get-an-app + * @see https://docs.github.com/rest/reference/migrations#delete-a-user-migration-archive */ - "GET /apps/:app_slug": { - parameters: AppsGetBySlugEndpoint; - request: AppsGetBySlugRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/migrations/{migration_id}/archive": Operation<"/user/migrations/{migration_id}/archive", "delete", "wyandotte">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations + * @see https://docs.github.com/rest/reference/migrations#unlock-a-user-repository */ - "GET /authorizations": { - parameters: OauthAuthorizationsListAuthorizationsEndpoint; - request: OauthAuthorizationsListAuthorizationsRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock": Operation<"/user/migrations/{migration_id}/repos/{repo_name}/lock", "delete", "wyandotte">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization + * @see https://docs.github.com/rest/reference/packages#delete-a-package-for-the-authenticated-user */ - "GET /authorizations/:authorization_id": { - parameters: OauthAuthorizationsGetAuthorizationEndpoint; - request: OauthAuthorizationsGetAuthorizationRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/packages/{package_type}/{package_name}": Operation<"/user/packages/{package_type}/{package_name}", "delete">; /** - * @see https://developer.github.com/v3/codes_of_conduct/#get-all-codes-of-conduct + * @see https://docs.github.com/rest/reference/packages#delete-a-package-version-for-the-authenticated-user */ - "GET /codes_of_conduct": { - parameters: CodesOfConductGetAllCodesOfConductEndpoint; - request: CodesOfConductGetAllCodesOfConductRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}": Operation<"/user/packages/{package_type}/{package_name}/versions/{package_version_id}", "delete">; /** - * @see https://developer.github.com/v3/codes_of_conduct/#get-a-code-of-conduct + * @see https://docs.github.com/rest/reference/repos#decline-a-repository-invitation */ - "GET /codes_of_conduct/:key": { - parameters: CodesOfConductGetConductCodeEndpoint; - request: CodesOfConductGetConductCodeRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/repository_invitations/{invitation_id}": Operation<"/user/repository_invitations/{invitation_id}", "delete">; /** - * @see https://developer.github.com/v3/emojis/#get-emojis + * @see https://docs.github.com/rest/reference/activity#unstar-a-repository-for-the-authenticated-user */ - "GET /emojis": { - parameters: EmojisGetEndpoint; - request: EmojisGetRequestOptions; - response: OctokitResponse; - }; + "DELETE /user/starred/{owner}/{repo}": Operation<"/user/starred/{owner}/{repo}", "delete">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-self-hosted-runner-groups-for-an-enterprise + * @see https://docs.github.com/rest/overview/resources-in-the-rest-api#root-endpoint */ - "GET /enterprises/:enterprise/actions/runner-groups": { - parameters: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseEndpoint; - request: EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /": Operation<"/", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#get-a-self-hosted-runner-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/apps#get-the-authenticated-app */ - "GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id": { - parameters: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseEndpoint; - request: EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /app": Operation<"/app", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise + * @see https://docs.github.com/rest/reference/apps#get-a-webhook-configuration-for-an-app */ - "GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations": { - parameters: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint; - request: EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /app/hook/config": Operation<"/app/hook/config", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-self-hosted-runners-in-a-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/apps#list-deliveries-for-an-app-webhook */ - "GET /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners": { - parameters: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseEndpoint; - request: EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /app/hook/deliveries": Operation<"/app/hook/deliveries", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-self-hosted-runners-for-an-enterprise + * @see https://docs.github.com/rest/reference/apps#get-a-delivery-for-an-app-webhook */ - "GET /enterprises/:enterprise/actions/runners": { - parameters: EnterpriseAdminListSelfHostedRunnersForEnterpriseEndpoint; - request: EnterpriseAdminListSelfHostedRunnersForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /app/hook/deliveries/{delivery_id}": Operation<"/app/hook/deliveries/{delivery_id}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#get-a-self-hosted-runner-for-an-enterprise + * @see https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app */ - "GET /enterprises/:enterprise/actions/runners/:runner_id": { - parameters: EnterpriseAdminGetSelfHostedRunnerForEnterpriseEndpoint; - request: EnterpriseAdminGetSelfHostedRunnerForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /app/installations": Operation<"/app/installations", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#list-runner-applications-for-an-enterprise + * @see https://docs.github.com/rest/reference/apps#get-an-installation-for-the-authenticated-app */ - "GET /enterprises/:enterprise/actions/runners/downloads": { - parameters: EnterpriseAdminListRunnerApplicationsForEnterpriseEndpoint; - request: EnterpriseAdminListRunnerApplicationsForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /app/installations/{installation_id}": Operation<"/app/installations/{installation_id}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/billing/#get-github-actions-billing-for-an-enterprise + * @see https://docs.github.com/rest/reference/oauth-authorizations#list-your-grants */ - "GET /enterprises/:enterprise/settings/billing/actions": { - parameters: EnterpriseAdminGetGithubActionsBillingGheEndpoint; - request: EnterpriseAdminGetGithubActionsBillingGheRequestOptions; - response: OctokitResponse; - }; + "GET /applications/grants": Operation<"/applications/grants", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/billing/#get-github-packages-billing-for-an-enterprise + * @see https://docs.github.com/rest/reference/oauth-authorizations#get-a-single-grant */ - "GET /enterprises/:enterprise/settings/billing/packages": { - parameters: EnterpriseAdminGetGithubPackagesBillingGheEndpoint; - request: EnterpriseAdminGetGithubPackagesBillingGheRequestOptions; - response: OctokitResponse; - }; + "GET /applications/grants/{grant_id}": Operation<"/applications/grants/{grant_id}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/billing/#get-shared-storage-billing-for-an-enterprise + * @see https://docs.github.com/rest/reference/apps#check-an-authorization */ - "GET /enterprises/:enterprise/settings/billing/shared-storage": { - parameters: EnterpriseAdminGetSharedStorageBillingGheEndpoint; - request: EnterpriseAdminGetSharedStorageBillingGheRequestOptions; - response: OctokitResponse; - }; + "GET /applications/{client_id}/tokens/{access_token}": Operation<"/applications/{client_id}/tokens/{access_token}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/billing/#get-github-actions-billing-for-an-enterprise - * @deprecated "enterprise_id" is deprecated, use "enterprise" instead + * @see https://docs.github.com/rest/reference/apps/#get-an-app */ - "GET /enterprises/:enterprise_id/settings/billing/actions": { - parameters: EnterpriseAdminGetGithubActionsBillingGheDeprecatedEnterpriseIdEndpoint; - request: EnterpriseAdminGetGithubActionsBillingGheRequestOptions; - response: OctokitResponse; - }; + "GET /apps/{app_slug}": Operation<"/apps/{app_slug}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/billing/#get-github-packages-billing-for-an-enterprise - * @deprecated "enterprise_id" is deprecated, use "enterprise" instead + * @see https://docs.github.com/rest/reference/oauth-authorizations#list-your-authorizations */ - "GET /enterprises/:enterprise_id/settings/billing/packages": { - parameters: EnterpriseAdminGetGithubPackagesBillingGheDeprecatedEnterpriseIdEndpoint; - request: EnterpriseAdminGetGithubPackagesBillingGheRequestOptions; - response: OctokitResponse; - }; + "GET /authorizations": Operation<"/authorizations", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/billing/#get-shared-storage-billing-for-an-enterprise - * @deprecated "enterprise_id" is deprecated, use "enterprise" instead + * @see https://docs.github.com/rest/reference/oauth-authorizations#get-a-single-authorization */ - "GET /enterprises/:enterprise_id/settings/billing/shared-storage": { - parameters: EnterpriseAdminGetSharedStorageBillingGheDeprecatedEnterpriseIdEndpoint; - request: EnterpriseAdminGetSharedStorageBillingGheRequestOptions; - response: OctokitResponse; - }; + "GET /authorizations/{authorization_id}": Operation<"/authorizations/{authorization_id}", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-public-events + * @see https://docs.github.com/rest/reference/codes-of-conduct#get-all-codes-of-conduct */ - "GET /events": { - parameters: ActivityListPublicEventsEndpoint; - request: ActivityListPublicEventsRequestOptions; - response: OctokitResponse; - }; + "GET /codes_of_conduct": Operation<"/codes_of_conduct", "get">; /** - * @see https://developer.github.com/v3/activity/feeds/#get-feeds + * @see https://docs.github.com/rest/reference/codes-of-conduct#get-a-code-of-conduct */ - "GET /feeds": { - parameters: ActivityGetFeedsEndpoint; - request: ActivityGetFeedsRequestOptions; - response: OctokitResponse; - }; + "GET /codes_of_conduct/{key}": Operation<"/codes_of_conduct/{key}", "get">; /** - * @see https://developer.github.com/v3/gists/#list-gists-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/emojis#get-emojis */ - "GET /gists": { - parameters: GistsListEndpoint; - request: GistsListRequestOptions; - response: OctokitResponse; - }; + "GET /emojis": Operation<"/emojis", "get">; /** - * @see https://developer.github.com/v3/gists/#get-a-gist + * @see https://docs.github.com/rest/reference/enterprise-admin#get-github-actions-permissions-for-an-enterprise */ - "GET /gists/:gist_id": { - parameters: GistsGetEndpoint; - request: GistsGetRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/permissions": Operation<"/enterprises/{enterprise}/actions/permissions", "get">; /** - * @see https://developer.github.com/v3/gists/#get-a-gist-revision + * @see https://docs.github.com/rest/reference/enterprise-admin#list-selected-organizations-enabled-for-github-actions-in-an-enterprise */ - "GET /gists/:gist_id/:sha": { - parameters: GistsGetRevisionEndpoint; - request: GistsGetRevisionRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/permissions/organizations": Operation<"/enterprises/{enterprise}/actions/permissions/organizations", "get">; /** - * @see https://developer.github.com/v3/gists/comments/#list-gist-comments + * @see https://docs.github.com/rest/reference/enterprise-admin#get-allowed-actions-for-an-enterprise */ - "GET /gists/:gist_id/comments": { - parameters: GistsListCommentsEndpoint; - request: GistsListCommentsRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/permissions/selected-actions": Operation<"/enterprises/{enterprise}/actions/permissions/selected-actions", "get">; /** - * @see https://developer.github.com/v3/gists/comments/#get-a-gist-comment + * @see https://docs.github.com/rest/reference/enterprise-admin#list-self-hosted-runner-groups-for-an-enterprise */ - "GET /gists/:gist_id/comments/:comment_id": { - parameters: GistsGetCommentEndpoint; - request: GistsGetCommentRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runner-groups": Operation<"/enterprises/{enterprise}/actions/runner-groups", "get">; /** - * @see https://developer.github.com/v3/gists/#list-gist-commits + * @see https://docs.github.com/rest/reference/enterprise-admin#get-a-self-hosted-runner-group-for-an-enterprise */ - "GET /gists/:gist_id/commits": { - parameters: GistsListCommitsEndpoint; - request: GistsListCommitsRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}", "get">; /** - * @see https://developer.github.com/v3/gists/#list-gist-forks + * @see https://docs.github.com/rest/reference/enterprise-admin#list-organization-access-to-a-self-hosted-runner-group-in-a-enterprise */ - "GET /gists/:gist_id/forks": { - parameters: GistsListForksEndpoint; - request: GistsListForksRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "get">; /** - * @see https://developer.github.com/v3/gists/#check-if-a-gist-is-starred + * @see https://docs.github.com/rest/reference/enterprise-admin#list-self-hosted-runners-in-a-group-for-an-enterprise */ - "GET /gists/:gist_id/star": { - parameters: GistsCheckIsStarredEndpoint; - request: GistsCheckIsStarredRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "get">; /** - * @see https://developer.github.com/v3/gists/#list-public-gists + * @see https://docs.github.com/rest/reference/enterprise-admin#list-self-hosted-runners-for-an-enterprise */ - "GET /gists/public": { - parameters: GistsListPublicEndpoint; - request: GistsListPublicRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runners": Operation<"/enterprises/{enterprise}/actions/runners", "get">; /** - * @see https://developer.github.com/v3/gists/#list-starred-gists + * @see https://docs.github.com/rest/reference/enterprise-admin#list-runner-applications-for-an-enterprise */ - "GET /gists/starred": { - parameters: GistsListStarredEndpoint; - request: GistsListStarredRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runners/downloads": Operation<"/enterprises/{enterprise}/actions/runners/downloads", "get">; /** - * @see https://developer.github.com/v3/gitignore/#get-all-gitignore-templates + * @see https://docs.github.com/rest/reference/enterprise-admin#get-a-self-hosted-runner-for-an-enterprise */ - "GET /gitignore/templates": { - parameters: GitignoreGetAllTemplatesEndpoint; - request: GitignoreGetAllTemplatesRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/actions/runners/{runner_id}": Operation<"/enterprises/{enterprise}/actions/runners/{runner_id}", "get">; /** - * @see https://developer.github.com/v3/gitignore/#get-a-gitignore-template + * @see https://docs.github.com/rest/reference/enterprise-admin#get-the-audit-log-for-an-enterprise */ - "GET /gitignore/templates/:name": { - parameters: GitignoreGetTemplateEndpoint; - request: GitignoreGetTemplateRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/audit-log": Operation<"/enterprises/{enterprise}/audit-log", "get">; /** - * @see https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-app-installation + * @see https://docs.github.com/rest/reference/billing#get-github-actions-billing-for-an-enterprise */ - "GET /installation/repositories": { - parameters: AppsListReposAccessibleToInstallationEndpoint; - request: AppsListReposAccessibleToInstallationRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/settings/billing/actions": Operation<"/enterprises/{enterprise}/settings/billing/actions", "get">; /** - * @see https://developer.github.com/v3/issues/#list-issues-assigned-to-the-authenticated-user + * @see https://docs.github.com/rest/reference/billing#get-github-packages-billing-for-an-enterprise */ - "GET /issues": { - parameters: IssuesListEndpoint; - request: IssuesListRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/settings/billing/packages": Operation<"/enterprises/{enterprise}/settings/billing/packages", "get">; /** - * @see https://developer.github.com/v3/licenses/#get-all-commonly-used-licenses + * @see https://docs.github.com/rest/reference/billing#get-shared-storage-billing-for-an-enterprise */ - "GET /licenses": { - parameters: LicensesGetAllCommonlyUsedEndpoint; - request: LicensesGetAllCommonlyUsedRequestOptions; - response: OctokitResponse; - }; + "GET /enterprises/{enterprise}/settings/billing/shared-storage": Operation<"/enterprises/{enterprise}/settings/billing/shared-storage", "get">; /** - * @see https://developer.github.com/v3/licenses/#get-a-license + * @see https://docs.github.com/rest/reference/activity#list-public-events */ - "GET /licenses/:license": { - parameters: LicensesGetEndpoint; - request: LicensesGetRequestOptions; - response: OctokitResponse; - }; + "GET /events": Operation<"/events", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#get-a-subscription-plan-for-an-account + * @see https://docs.github.com/rest/reference/activity#get-feeds */ - "GET /marketplace_listing/accounts/:account_id": { - parameters: AppsGetSubscriptionPlanForAccountEndpoint; - request: AppsGetSubscriptionPlanForAccountRequestOptions; - response: OctokitResponse; - }; + "GET /feeds": Operation<"/feeds", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-plans + * @see https://docs.github.com/rest/reference/gists#list-gists-for-the-authenticated-user */ - "GET /marketplace_listing/plans": { - parameters: AppsListPlansEndpoint; - request: AppsListPlansRequestOptions; - response: OctokitResponse; - }; + "GET /gists": Operation<"/gists", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-accounts-for-a-plan + * @see https://docs.github.com/rest/reference/gists#list-public-gists */ - "GET /marketplace_listing/plans/:plan_id/accounts": { - parameters: AppsListAccountsForPlanEndpoint; - request: AppsListAccountsForPlanRequestOptions; - response: OctokitResponse; - }; + "GET /gists/public": Operation<"/gists/public", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#get-a-subscription-plan-for-an-account-stubbed + * @see https://docs.github.com/rest/reference/gists#list-starred-gists */ - "GET /marketplace_listing/stubbed/accounts/:account_id": { - parameters: AppsGetSubscriptionPlanForAccountStubbedEndpoint; - request: AppsGetSubscriptionPlanForAccountStubbedRequestOptions; - response: OctokitResponse; - }; + "GET /gists/starred": Operation<"/gists/starred", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-plans-stubbed + * @see https://docs.github.com/rest/reference/gists#get-a-gist */ - "GET /marketplace_listing/stubbed/plans": { - parameters: AppsListPlansStubbedEndpoint; - request: AppsListPlansStubbedRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}": Operation<"/gists/{gist_id}", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-accounts-for-a-plan-stubbed + * @see https://docs.github.com/rest/reference/gists#list-gist-comments */ - "GET /marketplace_listing/stubbed/plans/:plan_id/accounts": { - parameters: AppsListAccountsForPlanStubbedEndpoint; - request: AppsListAccountsForPlanStubbedRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}/comments": Operation<"/gists/{gist_id}/comments", "get">; /** - * @see https://developer.github.com/v3/meta/#get-github-meta-information + * @see https://docs.github.com/rest/reference/gists#get-a-gist-comment */ - "GET /meta": { - parameters: MetaGetEndpoint; - request: MetaGetRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}/comments/{comment_id}": Operation<"/gists/{gist_id}/comments/{comment_id}", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories + * @see https://docs.github.com/rest/reference/gists#list-gist-commits */ - "GET /networks/:owner/:repo/events": { - parameters: ActivityListPublicEventsForRepoNetworkEndpoint; - request: ActivityListPublicEventsForRepoNetworkRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}/commits": Operation<"/gists/{gist_id}/commits", "get">; /** - * @see https://developer.github.com/v3/activity/notifications/#list-notifications-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/gists#list-gist-forks */ - "GET /notifications": { - parameters: ActivityListNotificationsForAuthenticatedUserEndpoint; - request: ActivityListNotificationsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}/forks": Operation<"/gists/{gist_id}/forks", "get">; /** - * @see https://developer.github.com/v3/activity/notifications/#get-a-thread + * @see https://docs.github.com/rest/reference/gists#check-if-a-gist-is-starred */ - "GET /notifications/threads/:thread_id": { - parameters: ActivityGetThreadEndpoint; - request: ActivityGetThreadRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}/star": Operation<"/gists/{gist_id}/star", "get">; /** - * @see https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/gists#get-a-gist-revision */ - "GET /notifications/threads/:thread_id/subscription": { - parameters: ActivityGetThreadSubscriptionForAuthenticatedUserEndpoint; - request: ActivityGetThreadSubscriptionForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /gists/{gist_id}/{sha}": Operation<"/gists/{gist_id}/{sha}", "get">; /** - * @see https://developer.github.com/v3/orgs/#list-organizations + * @see https://docs.github.com/rest/reference/gitignore#get-all-gitignore-templates */ - "GET /organizations": { - parameters: OrgsListEndpoint; - request: OrgsListRequestOptions; - response: OctokitResponse; - }; + "GET /gitignore/templates": Operation<"/gitignore/templates", "get">; /** - * @see https://developer.github.com/v3/orgs/#get-an-organization + * @see https://docs.github.com/rest/reference/gitignore#get-a-gitignore-template */ - "GET /orgs/:org": { - parameters: OrgsGetEndpoint; - request: OrgsGetRequestOptions; - response: OctokitResponse; - }; + "GET /gitignore/templates/{name}": Operation<"/gitignore/templates/{name}", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#list-self-hosted-runner-groups-for-an-organization + * @see https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-app-installation */ - "GET /orgs/:org/actions/runner-groups": { - parameters: ActionsListSelfHostedRunnerGroupsForOrgEndpoint; - request: ActionsListSelfHostedRunnerGroupsForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /installation/repositories": Operation<"/installation/repositories", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#get-a-self-hosted-runner-group-for-an-organization + * @see https://docs.github.com/rest/reference/issues#list-issues-assigned-to-the-authenticated-user */ - "GET /orgs/:org/actions/runner-groups/:runner_group_id": { - parameters: ActionsGetSelfHostedRunnerGroupForOrgEndpoint; - request: ActionsGetSelfHostedRunnerGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /issues": Operation<"/issues", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#list-repository-access-to-a-self-hosted-runner-group-in-an-organization + * @see https://docs.github.com/rest/reference/licenses#get-all-commonly-used-licenses */ - "GET /orgs/:org/actions/runner-groups/:runner_group_id/repositories": { - parameters: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgEndpoint; - request: ActionsListRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /licenses": Operation<"/licenses", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#list-self-hosted-runners-in-a-group-for-an-organization + * @see https://docs.github.com/rest/reference/licenses#get-a-license */ - "GET /orgs/:org/actions/runner-groups/:runner_group_id/runners": { - parameters: ActionsListSelfHostedRunnersInGroupForOrgEndpoint; - request: ActionsListSelfHostedRunnersInGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /licenses/{license}": Operation<"/licenses/{license}", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization + * @see https://docs.github.com/rest/reference/apps#get-a-subscription-plan-for-an-account */ - "GET /orgs/:org/actions/runners": { - parameters: ActionsListSelfHostedRunnersForOrgEndpoint; - request: ActionsListSelfHostedRunnersForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /marketplace_listing/accounts/{account_id}": Operation<"/marketplace_listing/accounts/{account_id}", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#get-a-self-hosted-runner-for-an-organization + * @see https://docs.github.com/rest/reference/apps#list-plans */ - "GET /orgs/:org/actions/runners/:runner_id": { - parameters: ActionsGetSelfHostedRunnerForOrgEndpoint; - request: ActionsGetSelfHostedRunnerForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /marketplace_listing/plans": Operation<"/marketplace_listing/plans", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-runner-applications-for-an-organization + * @see https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan */ - "GET /orgs/:org/actions/runners/downloads": { - parameters: ActionsListRunnerApplicationsForOrgEndpoint; - request: ActionsListRunnerApplicationsForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /marketplace_listing/plans/{plan_id}/accounts": Operation<"/marketplace_listing/plans/{plan_id}/accounts", "get">; /** - * @see https://developer.github.com/v3/actions/secrets/#list-organization-secrets + * @see https://docs.github.com/rest/reference/apps#get-a-subscription-plan-for-an-account-stubbed */ - "GET /orgs/:org/actions/secrets": { - parameters: ActionsListOrgSecretsEndpoint; - request: ActionsListOrgSecretsRequestOptions; - response: OctokitResponse; - }; + "GET /marketplace_listing/stubbed/accounts/{account_id}": Operation<"/marketplace_listing/stubbed/accounts/{account_id}", "get">; /** - * @see https://developer.github.com/v3/actions/secrets/#get-an-organization-secret + * @see https://docs.github.com/rest/reference/apps#list-plans-stubbed */ - "GET /orgs/:org/actions/secrets/:secret_name": { - parameters: ActionsGetOrgSecretEndpoint; - request: ActionsGetOrgSecretRequestOptions; - response: OctokitResponse; - }; + "GET /marketplace_listing/stubbed/plans": Operation<"/marketplace_listing/stubbed/plans", "get">; /** - * @see https://developer.github.com/v3/actions/secrets/#list-selected-repositories-for-an-organization-secret + * @see https://docs.github.com/rest/reference/apps#list-accounts-for-a-plan-stubbed */ - "GET /orgs/:org/actions/secrets/:secret_name/repositories": { - parameters: ActionsListSelectedReposForOrgSecretEndpoint; - request: ActionsListSelectedReposForOrgSecretRequestOptions; - response: OctokitResponse; - }; + "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts": Operation<"/marketplace_listing/stubbed/plans/{plan_id}/accounts", "get">; /** - * @see https://developer.github.com/v3/actions/secrets/#get-an-organization-public-key + * @see https://docs.github.com/rest/reference/meta#get-github-meta-information */ - "GET /orgs/:org/actions/secrets/public-key": { - parameters: ActionsGetOrgPublicKeyEndpoint; - request: ActionsGetOrgPublicKeyRequestOptions; - response: OctokitResponse; - }; + "GET /meta": Operation<"/meta", "get">; /** - * @see https://developer.github.com/v3/orgs/blocking/#list-users-blocked-by-an-organization + * @see https://docs.github.com/rest/reference/activity#list-public-events-for-a-network-of-repositories */ - "GET /orgs/:org/blocks": { - parameters: OrgsListBlockedUsersEndpoint; - request: OrgsListBlockedUsersRequestOptions; - response: OctokitResponse; - }; + "GET /networks/{owner}/{repo}/events": Operation<"/networks/{owner}/{repo}/events", "get">; /** - * @see https://developer.github.com/v3/orgs/blocking/#check-if-a-user-is-blocked-by-an-organization + * @see https://docs.github.com/rest/reference/activity#list-notifications-for-the-authenticated-user */ - "GET /orgs/:org/blocks/:username": { - parameters: OrgsCheckBlockedUserEndpoint; - request: OrgsCheckBlockedUserRequestOptions; - response: OctokitResponse; - }; + "GET /notifications": Operation<"/notifications", "get">; /** - * @see https://developer.github.com/v3/orgs/#list-saml-sso-authorizations-for-an-organization + * @see https://docs.github.com/rest/reference/activity#get-a-thread */ - "GET /orgs/:org/credential-authorizations": { - parameters: OrgsListSamlSsoAuthorizationsEndpoint; - request: OrgsListSamlSsoAuthorizationsRequestOptions; - response: OctokitResponse; - }; + "GET /notifications/threads/{thread_id}": Operation<"/notifications/threads/{thread_id}", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-public-organization-events + * @see https://docs.github.com/rest/reference/activity#get-a-thread-subscription-for-the-authenticated-user */ - "GET /orgs/:org/events": { - parameters: ActivityListPublicOrgEventsEndpoint; - request: ActivityListPublicOrgEventsRequestOptions; - response: OctokitResponse; - }; + "GET /notifications/threads/{thread_id}/subscription": Operation<"/notifications/threads/{thread_id}/subscription", "get">; /** - * @see https://developer.github.com/v3/orgs/hooks/#list-organization-webhooks + * @see https://docs.github.com/rest/reference/meta#get-octocat */ - "GET /orgs/:org/hooks": { - parameters: OrgsListWebhooksEndpoint; - request: OrgsListWebhooksRequestOptions; - response: OctokitResponse; - }; + "GET /octocat": Operation<"/octocat", "get">; /** - * @see https://developer.github.com/v3/orgs/hooks/#get-an-organization-webhook + * @see https://docs.github.com/rest/reference/orgs#list-organizations */ - "GET /orgs/:org/hooks/:hook_id": { - parameters: OrgsGetWebhookEndpoint; - request: OrgsGetWebhookRequestOptions; - response: OctokitResponse; - }; + "GET /organizations": Operation<"/organizations", "get">; /** - * @see https://developer.github.com/v3/apps/#get-an-organization-installation-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/orgs#get-an-organization */ - "GET /orgs/:org/installation": { - parameters: AppsGetOrgInstallationEndpoint; - request: AppsGetOrgInstallationRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}": Operation<"/orgs/{org}", "get">; /** - * @see https://developer.github.com/v3/orgs/#list-app-installations-for-an-organization + * @see https://docs.github.com/rest/reference/actions#get-github-actions-permissions-for-an-organization */ - "GET /orgs/:org/installations": { - parameters: OrgsListAppInstallationsEndpoint; - request: OrgsListAppInstallationsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/permissions": Operation<"/orgs/{org}/actions/permissions", "get">; /** - * @see https://developer.github.com/v3/interactions/orgs/#get-interaction-restrictions-for-an-organization + * @see https://docs.github.com/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization */ - "GET /orgs/:org/interaction-limits": { - parameters: InteractionsGetRestrictionsForOrgEndpoint; - request: InteractionsGetRestrictionsForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/permissions/repositories": Operation<"/orgs/{org}/actions/permissions/repositories", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations + * @see https://docs.github.com/rest/reference/actions#get-allowed-actions-for-an-organization */ - "GET /orgs/:org/invitations": { - parameters: OrgsListPendingInvitationsEndpoint; - request: OrgsListPendingInvitationsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/permissions/selected-actions": Operation<"/orgs/{org}/actions/permissions/selected-actions", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#list-organization-invitation-teams + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization */ - "GET /orgs/:org/invitations/:invitation_id/teams": { - parameters: OrgsListInvitationTeamsEndpoint; - request: OrgsListInvitationTeamsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runner-groups": Operation<"/orgs/{org}/actions/runner-groups", "get">; /** - * @see https://developer.github.com/v3/issues/#list-organization-issues-assigned-to-the-authenticated-user + * @see https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-group-for-an-organization */ - "GET /orgs/:org/issues": { - parameters: IssuesListForOrgEndpoint; - request: IssuesListForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#list-organization-members + * @see https://docs.github.com/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization */ - "GET /orgs/:org/members": { - parameters: OrgsListMembersEndpoint; - request: OrgsListMembersRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#check-organization-membership-for-a-user + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization */ - "GET /orgs/:org/members/:username": { - parameters: OrgsCheckMembershipForUserEndpoint; - request: OrgsCheckMembershipForUserRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#get-organization-membership-for-a-user + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-an-organization */ - "GET /orgs/:org/memberships/:username": { - parameters: OrgsGetMembershipForUserEndpoint; - request: OrgsGetMembershipForUserRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runners": Operation<"/orgs/{org}/actions/runners", "get">; /** - * @see https://developer.github.com/v3/migrations/orgs/#list-organization-migrations + * @see https://docs.github.com/rest/reference/actions#list-runner-applications-for-an-organization */ - "GET /orgs/:org/migrations": { - parameters: MigrationsListForOrgEndpoint; - request: MigrationsListForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runners/downloads": Operation<"/orgs/{org}/actions/runners/downloads", "get">; /** - * @see https://developer.github.com/v3/migrations/orgs/#get-an-organization-migration-status + * @see https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-for-an-organization */ - "GET /orgs/:org/migrations/:migration_id": { - parameters: MigrationsGetStatusForOrgEndpoint; - request: MigrationsGetStatusForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/runners/{runner_id}": Operation<"/orgs/{org}/actions/runners/{runner_id}", "get">; /** - * @see https://developer.github.com/v3/migrations/orgs/#download-an-organization-migration-archive + * @see https://docs.github.com/rest/reference/actions#list-organization-secrets */ - "GET /orgs/:org/migrations/:migration_id/archive": { - parameters: MigrationsDownloadArchiveForOrgEndpoint; - request: MigrationsDownloadArchiveForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/secrets": Operation<"/orgs/{org}/actions/secrets", "get">; /** - * @see https://developer.github.com/v3/migrations/orgs/#list-repositories-in-an-organization-migration + * @see https://docs.github.com/rest/reference/actions#get-an-organization-public-key */ - "GET /orgs/:org/migrations/:migration_id/repositories": { - parameters: MigrationsListReposForOrgEndpoint; - request: MigrationsListReposForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/secrets/public-key": Operation<"/orgs/{org}/actions/secrets/public-key", "get">; /** - * @see https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators-for-an-organization + * @see https://docs.github.com/rest/reference/actions#get-an-organization-secret */ - "GET /orgs/:org/outside_collaborators": { - parameters: OrgsListOutsideCollaboratorsEndpoint; - request: OrgsListOutsideCollaboratorsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/secrets/{secret_name}": Operation<"/orgs/{org}/actions/secrets/{secret_name}", "get">; /** - * @see https://developer.github.com/v3/projects/#list-organization-projects + * @see https://docs.github.com/rest/reference/actions#list-selected-repositories-for-an-organization-secret */ - "GET /orgs/:org/projects": { - parameters: ProjectsListForOrgEndpoint; - request: ProjectsListForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/actions/secrets/{secret_name}/repositories": Operation<"/orgs/{org}/actions/secrets/{secret_name}/repositories", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#list-public-organization-members + * @see https://docs.github.com/rest/reference/orgs#get-audit-log */ - "GET /orgs/:org/public_members": { - parameters: OrgsListPublicMembersEndpoint; - request: OrgsListPublicMembersRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/audit-log": Operation<"/orgs/{org}/audit-log", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#check-public-organization-membership-for-a-user + * @see https://docs.github.com/rest/reference/orgs#list-users-blocked-by-an-organization */ - "GET /orgs/:org/public_members/:username": { - parameters: OrgsCheckPublicMembershipForUserEndpoint; - request: OrgsCheckPublicMembershipForUserRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/blocks": Operation<"/orgs/{org}/blocks", "get">; /** - * @see https://developer.github.com/v3/repos/#list-organization-repositories + * @see https://docs.github.com/rest/reference/orgs#check-if-a-user-is-blocked-by-an-organization */ - "GET /orgs/:org/repos": { - parameters: ReposListForOrgEndpoint; - request: ReposListForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "get">; /** - * @see https://developer.github.com/v3/billing/#get-github-actions-billing-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-saml-sso-authorizations-for-an-organization */ - "GET /orgs/:org/settings/billing/actions": { - parameters: BillingGetGithubActionsBillingOrgEndpoint; - request: BillingGetGithubActionsBillingOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/credential-authorizations": Operation<"/orgs/{org}/credential-authorizations", "get">; /** - * @see https://developer.github.com/v3/billing/#get-github-packages-billing-for-an-organization + * @see https://docs.github.com/rest/reference/activity#list-public-organization-events */ - "GET /orgs/:org/settings/billing/packages": { - parameters: BillingGetGithubPackagesBillingOrgEndpoint; - request: BillingGetGithubPackagesBillingOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/events": Operation<"/orgs/{org}/events", "get">; /** - * @see https://developer.github.com/v3/billing/#get-shared-storage-billing-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-failed-organization-invitations */ - "GET /orgs/:org/settings/billing/shared-storage": { - parameters: BillingGetSharedStorageBillingOrgEndpoint; - request: BillingGetSharedStorageBillingOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/failed_invitations": Operation<"/orgs/{org}/failed_invitations", "get">; /** - * @see https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-an-organization + * @see https://docs.github.com/rest/reference/orgs#list-organization-webhooks */ - "GET /orgs/:org/team-sync/groups": { - parameters: TeamsListIdPGroupsForOrgEndpoint; - request: TeamsListIdPGroupsForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/hooks": Operation<"/orgs/{org}/hooks", "get">; /** - * @see https://developer.github.com/v3/teams/#list-teams + * @see https://docs.github.com/rest/reference/orgs#get-an-organization-webhook */ - "GET /orgs/:org/teams": { - parameters: TeamsListEndpoint; - request: TeamsListRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/hooks/{hook_id}": Operation<"/orgs/{org}/hooks/{hook_id}", "get">; /** - * @see https://developer.github.com/v3/teams/#get-a-team-by-name + * @see https://docs.github.com/rest/reference/orgs#get-a-webhook-configuration-for-an-organization */ - "GET /orgs/:org/teams/:team_slug": { - parameters: TeamsGetByNameEndpoint; - request: TeamsGetByNameRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/hooks/{hook_id}/config": Operation<"/orgs/{org}/hooks/{hook_id}/config", "get">; /** - * @see https://developer.github.com/v3/teams/discussions/#list-discussions + * @see https://docs.github.com/rest/reference/orgs#list-deliveries-for-an-organization-webhook */ - "GET /orgs/:org/teams/:team_slug/discussions": { - parameters: TeamsListDiscussionsInOrgEndpoint; - request: TeamsListDiscussionsInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/hooks/{hook_id}/deliveries": Operation<"/orgs/{org}/hooks/{hook_id}/deliveries", "get">; /** - * @see https://developer.github.com/v3/teams/discussions/#get-a-discussion + * @see https://docs.github.com/rest/reference/orgs#get-a-webhook-delivery-for-an-organization-webhook */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number": { - parameters: TeamsGetDiscussionInOrgEndpoint; - request: TeamsGetDiscussionInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}": Operation<"/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}", "get">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#list-discussion-comments + * @see https://docs.github.com/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments": { - parameters: TeamsListDiscussionCommentsInOrgEndpoint; - request: TeamsListDiscussionCommentsInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/installation": Operation<"/orgs/{org}/installation", "get">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#get-a-discussion-comment + * @see https://docs.github.com/rest/reference/orgs#list-app-installations-for-an-organization */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number": { - parameters: TeamsGetDiscussionCommentInOrgEndpoint; - request: TeamsGetDiscussionCommentInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/installations": Operation<"/orgs/{org}/installations", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment + * @see https://docs.github.com/rest/reference/interactions#get-interaction-restrictions-for-an-organization */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions": { - parameters: ReactionsListForTeamDiscussionCommentInOrgEndpoint; - request: ReactionsListForTeamDiscussionCommentInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/interaction-limits": Operation<"/orgs/{org}/interaction-limits", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion + * @see https://docs.github.com/rest/reference/orgs#list-pending-organization-invitations */ - "GET /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions": { - parameters: ReactionsListForTeamDiscussionInOrgEndpoint; - request: ReactionsListForTeamDiscussionInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/invitations": Operation<"/orgs/{org}/invitations", "get">; /** - * @see https://developer.github.com/v3/teams/members/#list-pending-team-invitations + * @see https://docs.github.com/rest/reference/orgs#list-organization-invitation-teams */ - "GET /orgs/:org/teams/:team_slug/invitations": { - parameters: TeamsListPendingInvitationsInOrgEndpoint; - request: TeamsListPendingInvitationsInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/invitations/{invitation_id}/teams": Operation<"/orgs/{org}/invitations/{invitation_id}/teams", "get">; /** - * @see https://developer.github.com/v3/teams/members/#list-team-members + * @see https://docs.github.com/rest/reference/issues#list-organization-issues-assigned-to-the-authenticated-user */ - "GET /orgs/:org/teams/:team_slug/members": { - parameters: TeamsListMembersInOrgEndpoint; - request: TeamsListMembersInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/issues": Operation<"/orgs/{org}/issues", "get">; /** - * @see https://developer.github.com/v3/teams/members/#get-team-membership-for-a-user + * @see https://docs.github.com/rest/reference/orgs#list-organization-members */ - "GET /orgs/:org/teams/:team_slug/memberships/:username": { - parameters: TeamsGetMembershipForUserInOrgEndpoint; - request: TeamsGetMembershipForUserInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/members": Operation<"/orgs/{org}/members", "get">; /** - * @see https://developer.github.com/v3/teams/#list-team-projects + * @see https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user */ - "GET /orgs/:org/teams/:team_slug/projects": { - parameters: TeamsListProjectsInOrgEndpoint; - request: TeamsListProjectsInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/members/{username}": Operation<"/orgs/{org}/members/{username}", "get">; /** - * @see https://developer.github.com/v3/teams/#check-team-permissions-for-a-project + * @see https://docs.github.com/rest/reference/orgs#get-organization-membership-for-a-user */ - "GET /orgs/:org/teams/:team_slug/projects/:project_id": { - parameters: TeamsCheckPermissionsForProjectInOrgEndpoint; - request: TeamsCheckPermissionsForProjectInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/memberships/{username}": Operation<"/orgs/{org}/memberships/{username}", "get">; /** - * @see https://developer.github.com/v3/teams/#list-team-repositories + * @see https://docs.github.com/rest/reference/migrations#list-organization-migrations */ - "GET /orgs/:org/teams/:team_slug/repos": { - parameters: TeamsListReposInOrgEndpoint; - request: TeamsListReposInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/migrations": Operation<"/orgs/{org}/migrations", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/teams/#check-team-permissions-for-a-repository + * @see https://docs.github.com/rest/reference/migrations#get-an-organization-migration-status */ - "GET /orgs/:org/teams/:team_slug/repos/:owner/:repo": { - parameters: TeamsCheckPermissionsForRepoInOrgEndpoint; - request: TeamsCheckPermissionsForRepoInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/migrations/{migration_id}": Operation<"/orgs/{org}/migrations/{migration_id}", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-a-team + * @see https://docs.github.com/rest/reference/migrations#download-an-organization-migration-archive */ - "GET /orgs/:org/teams/:team_slug/team-sync/group-mappings": { - parameters: TeamsListIdPGroupsInOrgEndpoint; - request: TeamsListIdPGroupsInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/migrations/{migration_id}/archive": Operation<"/orgs/{org}/migrations/{migration_id}/archive", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/teams/#list-child-teams + * @see https://docs.github.com/rest/reference/migrations#list-repositories-in-an-organization-migration */ - "GET /orgs/:org/teams/:team_slug/teams": { - parameters: TeamsListChildInOrgEndpoint; - request: TeamsListChildInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/migrations/{migration_id}/repositories": Operation<"/orgs/{org}/migrations/{migration_id}/repositories", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/projects/#get-a-project + * @see https://docs.github.com/rest/reference/orgs#list-outside-collaborators-for-an-organization */ - "GET /projects/:project_id": { - parameters: ProjectsGetEndpoint; - request: ProjectsGetRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/outside_collaborators": Operation<"/orgs/{org}/outside_collaborators", "get">; /** - * @see https://developer.github.com/v3/projects/collaborators/#list-project-collaborators + * @see https://docs.github.com/rest/reference/packages#get-a-package-for-an-organization */ - "GET /projects/:project_id/collaborators": { - parameters: ProjectsListCollaboratorsEndpoint; - request: ProjectsListCollaboratorsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/packages/{package_type}/{package_name}": Operation<"/orgs/{org}/packages/{package_type}/{package_name}", "get">; /** - * @see https://developer.github.com/v3/projects/collaborators/#get-project-permission-for-a-user + * @see https://docs.github.com/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-an-organization */ - "GET /projects/:project_id/collaborators/:username/permission": { - parameters: ProjectsGetPermissionForUserEndpoint; - request: ProjectsGetPermissionForUserRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions": Operation<"/orgs/{org}/packages/{package_type}/{package_name}/versions", "get">; /** - * @see https://developer.github.com/v3/projects/columns/#list-project-columns + * @see https://docs.github.com/rest/reference/packages#get-a-package-version-for-an-organization */ - "GET /projects/:project_id/columns": { - parameters: ProjectsListColumnsEndpoint; - request: ProjectsListColumnsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}": Operation<"/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", "get">; /** - * @see https://developer.github.com/v3/projects/columns/#get-a-project-column + * @see https://docs.github.com/rest/reference/projects#list-organization-projects */ - "GET /projects/columns/:column_id": { - parameters: ProjectsGetColumnEndpoint; - request: ProjectsGetColumnRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/projects": Operation<"/orgs/{org}/projects", "get", "inertia">; /** - * @see https://developer.github.com/v3/projects/cards/#list-project-cards + * @see https://docs.github.com/rest/reference/orgs#list-public-organization-members */ - "GET /projects/columns/:column_id/cards": { - parameters: ProjectsListCardsEndpoint; - request: ProjectsListCardsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/public_members": Operation<"/orgs/{org}/public_members", "get">; /** - * @see https://developer.github.com/v3/projects/cards/#get-a-project-card + * @see https://docs.github.com/rest/reference/orgs#check-public-organization-membership-for-a-user */ - "GET /projects/columns/cards/:card_id": { - parameters: ProjectsGetCardEndpoint; - request: ProjectsGetCardRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/public_members/{username}": Operation<"/orgs/{org}/public_members/{username}", "get">; /** - * @see https://developer.github.com/v3/rate_limit/#get-rate-limit-status-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#list-organization-repositories */ - "GET /rate_limit": { - parameters: RateLimitGetEndpoint; - request: RateLimitGetRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/repos": Operation<"/orgs/{org}/repos", "get">; /** - * @see https://developer.github.com/v3/repos/#get-a-repository + * @see https://docs.github.com/rest/reference/billing#get-github-actions-billing-for-an-organization */ - "GET /repos/:owner/:repo": { - parameters: ReposGetEndpoint; - request: ReposGetRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/settings/billing/actions": Operation<"/orgs/{org}/settings/billing/actions", "get">; /** - * @see https://developer.github.com/v3/repos/contents/#download-a-repository-archive + * @see https://docs.github.com/rest/reference/billing#get-github-packages-billing-for-an-organization */ - "GET /repos/:owner/:repo/:archive_format/:ref": { - parameters: ReposDownloadArchiveEndpoint; - request: ReposDownloadArchiveRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/settings/billing/packages": Operation<"/orgs/{org}/settings/billing/packages", "get">; /** - * @see https://developer.github.com/v3/actions/artifacts/#list-artifacts-for-a-repository + * @see https://docs.github.com/rest/reference/billing#get-shared-storage-billing-for-an-organization */ - "GET /repos/:owner/:repo/actions/artifacts": { - parameters: ActionsListArtifactsForRepoEndpoint; - request: ActionsListArtifactsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/settings/billing/shared-storage": Operation<"/orgs/{org}/settings/billing/shared-storage", "get">; /** - * @see https://developer.github.com/v3/actions/artifacts/#get-an-artifact + * @see https://docs.github.com/rest/reference/teams#list-idp-groups-for-an-organization */ - "GET /repos/:owner/:repo/actions/artifacts/:artifact_id": { - parameters: ActionsGetArtifactEndpoint; - request: ActionsGetArtifactRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/team-sync/groups": Operation<"/orgs/{org}/team-sync/groups", "get">; /** - * @see https://developer.github.com/v3/actions/artifacts/#download-an-artifact + * @see https://docs.github.com/rest/reference/teams#list-teams */ - "GET /repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format": { - parameters: ActionsDownloadArtifactEndpoint; - request: ActionsDownloadArtifactRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams": Operation<"/orgs/{org}/teams", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-jobs/#get-a-job-for-a-workflow-run + * @see https://docs.github.com/rest/reference/teams#get-a-team-by-name */ - "GET /repos/:owner/:repo/actions/jobs/:job_id": { - parameters: ActionsGetJobForWorkflowRunEndpoint; - request: ActionsGetJobForWorkflowRunRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}": Operation<"/orgs/{org}/teams/{team_slug}", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-jobs/#download-job-logs-for-a-workflow-run + * @see https://docs.github.com/rest/reference/teams#list-discussions */ - "GET /repos/:owner/:repo/actions/jobs/:job_id/logs": { - parameters: ActionsDownloadJobLogsForWorkflowRunEndpoint; - request: ActionsDownloadJobLogsForWorkflowRunRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/discussions": Operation<"/orgs/{org}/teams/{team_slug}/discussions", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository + * @see https://docs.github.com/rest/reference/teams#get-a-discussion */ - "GET /repos/:owner/:repo/actions/runners": { - parameters: ActionsListSelfHostedRunnersForRepoEndpoint; - request: ActionsListSelfHostedRunnersForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#get-a-self-hosted-runner-for-a-repository + * @see https://docs.github.com/rest/reference/teams#list-discussion-comments */ - "GET /repos/:owner/:repo/actions/runners/:runner_id": { - parameters: ActionsGetSelfHostedRunnerForRepoEndpoint; - request: ActionsGetSelfHostedRunnerForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#list-runner-applications-for-a-repository + * @see https://docs.github.com/rest/reference/teams#get-a-discussion-comment */ - "GET /repos/:owner/:repo/actions/runners/downloads": { - parameters: ActionsListRunnerApplicationsForRepoEndpoint; - request: ActionsListRunnerApplicationsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs-for-a-repository + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion-comment */ - "GET /repos/:owner/:repo/actions/runs": { - parameters: ActionsListWorkflowRunsForRepoEndpoint; - request: ActionsListWorkflowRunsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#get-a-workflow-run + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-team-discussion */ - "GET /repos/:owner/:repo/actions/runs/:run_id": { - parameters: ActionsGetWorkflowRunEndpoint; - request: ActionsGetWorkflowRunRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts + * @see https://docs.github.com/rest/reference/teams#list-pending-team-invitations */ - "GET /repos/:owner/:repo/actions/runs/:run_id/artifacts": { - parameters: ActionsListWorkflowRunArtifactsEndpoint; - request: ActionsListWorkflowRunArtifactsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/invitations": Operation<"/orgs/{org}/teams/{team_slug}/invitations", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-jobs/#list-jobs-for-a-workflow-run + * @see https://docs.github.com/rest/reference/teams#list-team-members */ - "GET /repos/:owner/:repo/actions/runs/:run_id/jobs": { - parameters: ActionsListJobsForWorkflowRunEndpoint; - request: ActionsListJobsForWorkflowRunRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/members": Operation<"/orgs/{org}/teams/{team_slug}/members", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#download-workflow-run-logs + * @see https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user */ - "GET /repos/:owner/:repo/actions/runs/:run_id/logs": { - parameters: ActionsDownloadWorkflowRunLogsEndpoint; - request: ActionsDownloadWorkflowRunLogsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/memberships/{username}": Operation<"/orgs/{org}/teams/{team_slug}/memberships/{username}", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#get-workflow-run-usage + * @see https://docs.github.com/rest/reference/teams#list-team-projects */ - "GET /repos/:owner/:repo/actions/runs/:run_id/timing": { - parameters: ActionsGetWorkflowRunUsageEndpoint; - request: ActionsGetWorkflowRunUsageRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/projects": Operation<"/orgs/{org}/teams/{team_slug}/projects", "get", "inertia">; /** - * @see https://developer.github.com/v3/actions/secrets/#list-repository-secrets + * @see https://docs.github.com/rest/reference/teams#check-team-permissions-for-a-project */ - "GET /repos/:owner/:repo/actions/secrets": { - parameters: ActionsListRepoSecretsEndpoint; - request: ActionsListRepoSecretsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/projects/{project_id}": Operation<"/orgs/{org}/teams/{team_slug}/projects/{project_id}", "get", "inertia">; /** - * @see https://developer.github.com/v3/actions/secrets/#get-a-repository-secret + * @see https://docs.github.com/rest/reference/teams#list-team-repositories */ - "GET /repos/:owner/:repo/actions/secrets/:secret_name": { - parameters: ActionsGetRepoSecretEndpoint; - request: ActionsGetRepoSecretRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/repos": Operation<"/orgs/{org}/teams/{team_slug}/repos", "get">; /** - * @see https://developer.github.com/v3/actions/secrets/#get-a-repository-public-key + * @see https://docs.github.com/rest/reference/teams/#check-team-permissions-for-a-repository */ - "GET /repos/:owner/:repo/actions/secrets/public-key": { - parameters: ActionsGetRepoPublicKeyEndpoint; - request: ActionsGetRepoPublicKeyRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}": Operation<"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}", "get">; /** - * @see https://developer.github.com/v3/actions/workflows/#list-repository-workflows + * @see https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team */ - "GET /repos/:owner/:repo/actions/workflows": { - parameters: ActionsListRepoWorkflowsEndpoint; - request: ActionsListRepoWorkflowsRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings": Operation<"/orgs/{org}/teams/{team_slug}/team-sync/group-mappings", "get">; /** - * @see https://developer.github.com/v3/actions/workflows/#get-a-workflow + * @see https://docs.github.com/rest/reference/teams#list-child-teams */ - "GET /repos/:owner/:repo/actions/workflows/:workflow_id": { - parameters: ActionsGetWorkflowEndpoint; - request: ActionsGetWorkflowRequestOptions; - response: OctokitResponse; - }; + "GET /orgs/{org}/teams/{team_slug}/teams": Operation<"/orgs/{org}/teams/{team_slug}/teams", "get">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs + * @see https://docs.github.com/rest/reference/projects#get-a-project-card */ - "GET /repos/:owner/:repo/actions/workflows/:workflow_id/runs": { - parameters: ActionsListWorkflowRunsEndpoint; - request: ActionsListWorkflowRunsRequestOptions; - response: OctokitResponse; - }; + "GET /projects/columns/cards/{card_id}": Operation<"/projects/columns/cards/{card_id}", "get", "inertia">; /** - * @see https://developer.github.com/v3/actions/workflows/#get-workflow-usage + * @see https://docs.github.com/rest/reference/projects#get-a-project-column */ - "GET /repos/:owner/:repo/actions/workflows/:workflow_id/timing": { - parameters: ActionsGetWorkflowUsageEndpoint; - request: ActionsGetWorkflowUsageRequestOptions; - response: OctokitResponse; - }; + "GET /projects/columns/{column_id}": Operation<"/projects/columns/{column_id}", "get", "inertia">; /** - * @see https://developer.github.com/v3/issues/assignees/#list-assignees + * @see https://docs.github.com/rest/reference/projects#list-project-cards */ - "GET /repos/:owner/:repo/assignees": { - parameters: IssuesListAssigneesEndpoint; - request: IssuesListAssigneesRequestOptions; - response: OctokitResponse; - }; + "GET /projects/columns/{column_id}/cards": Operation<"/projects/columns/{column_id}/cards", "get", "inertia">; /** - * @see https://developer.github.com/v3/issues/assignees/#check-if-a-user-can-be-assigned + * @see https://docs.github.com/rest/reference/projects#get-a-project */ - "GET /repos/:owner/:repo/assignees/:assignee": { - parameters: IssuesCheckUserCanBeAssignedEndpoint; - request: IssuesCheckUserCanBeAssignedRequestOptions; - response: OctokitResponse; - }; + "GET /projects/{project_id}": Operation<"/projects/{project_id}", "get", "inertia">; /** - * @see https://developer.github.com/v3/repos/branches/#list-branches + * @see https://docs.github.com/rest/reference/projects#list-project-collaborators */ - "GET /repos/:owner/:repo/branches": { - parameters: ReposListBranchesEndpoint; - request: ReposListBranchesRequestOptions; - response: OctokitResponse; - }; + "GET /projects/{project_id}/collaborators": Operation<"/projects/{project_id}/collaborators", "get", "inertia">; /** - * @see https://developer.github.com/v3/repos/branches/#get-a-branch + * @see https://docs.github.com/rest/reference/projects#get-project-permission-for-a-user */ - "GET /repos/:owner/:repo/branches/:branch": { - parameters: ReposGetBranchEndpoint; - request: ReposGetBranchRequestOptions; - response: OctokitResponse; - }; + "GET /projects/{project_id}/collaborators/{username}/permission": Operation<"/projects/{project_id}/collaborators/{username}/permission", "get", "inertia">; /** - * @see https://developer.github.com/v3/repos/branches/#get-branch-protection + * @see https://docs.github.com/rest/reference/projects#list-project-columns */ - "GET /repos/:owner/:repo/branches/:branch/protection": { - parameters: ReposGetBranchProtectionEndpoint; - request: ReposGetBranchProtectionRequestOptions; - response: OctokitResponse; - }; + "GET /projects/{project_id}/columns": Operation<"/projects/{project_id}/columns", "get", "inertia">; /** - * @see https://developer.github.com/v3/repos/branches/#get-admin-branch-protection + * @see https://docs.github.com/rest/reference/rate-limit#get-rate-limit-status-for-the-authenticated-user */ - "GET /repos/:owner/:repo/branches/:branch/protection/enforce_admins": { - parameters: ReposGetAdminBranchProtectionEndpoint; - request: ReposGetAdminBranchProtectionRequestOptions; - response: OctokitResponse; - }; + "GET /rate_limit": Operation<"/rate_limit", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#get-pull-request-review-protection + * @see https://docs.github.com/rest/reference/repos#get-a-repository */ - "GET /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews": { - parameters: ReposGetPullRequestReviewProtectionEndpoint; - request: ReposGetPullRequestReviewProtectionRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}": Operation<"/repos/{owner}/{repo}", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#get-commit-signature-protection + * @see https://docs.github.com/rest/reference/actions#list-artifacts-for-a-repository */ - "GET /repos/:owner/:repo/branches/:branch/protection/required_signatures": { - parameters: ReposGetCommitSignatureProtectionEndpoint; - request: ReposGetCommitSignatureProtectionRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/artifacts": Operation<"/repos/{owner}/{repo}/actions/artifacts", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#get-status-checks-protection + * @see https://docs.github.com/rest/reference/actions#get-an-artifact */ - "GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks": { - parameters: ReposGetStatusChecksProtectionEndpoint; - request: ReposGetStatusChecksProtectionRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}": Operation<"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#get-all-status-check-contexts + * @see https://docs.github.com/rest/reference/actions#download-an-artifact */ - "GET /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts": { - parameters: ReposGetAllStatusCheckContextsEndpoint; - request: ReposGetAllStatusCheckContextsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}": Operation<"/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#get-access-restrictions + * @see https://docs.github.com/rest/reference/actions#get-a-job-for-a-workflow-run */ - "GET /repos/:owner/:repo/branches/:branch/protection/restrictions": { - parameters: ReposGetAccessRestrictionsEndpoint; - request: ReposGetAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/jobs/{job_id}": Operation<"/repos/{owner}/{repo}/actions/jobs/{job_id}", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#list-apps-with-access-to-the-protected-branch + * @see https://docs.github.com/rest/reference/actions#download-job-logs-for-a-workflow-run */ - "GET /repos/:owner/:repo/branches/:branch/protection/restrictions/apps": { - parameters: ReposGetAppsWithAccessToProtectedBranchEndpoint; - request: ReposGetAppsWithAccessToProtectedBranchRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs": Operation<"/repos/{owner}/{repo}/actions/jobs/{job_id}/logs", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#list-teams-with-access-to-the-protected-branch + * @see https://docs.github.com/rest/reference/actions#get-github-actions-permissions-for-a-repository */ - "GET /repos/:owner/:repo/branches/:branch/protection/restrictions/teams": { - parameters: ReposGetTeamsWithAccessToProtectedBranchEndpoint; - request: ReposGetTeamsWithAccessToProtectedBranchRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/permissions": Operation<"/repos/{owner}/{repo}/actions/permissions", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#list-users-with-access-to-the-protected-branch + * @see https://docs.github.com/rest/reference/actions#get-allowed-actions-for-a-repository */ - "GET /repos/:owner/:repo/branches/:branch/protection/restrictions/users": { - parameters: ReposGetUsersWithAccessToProtectedBranchEndpoint; - request: ReposGetUsersWithAccessToProtectedBranchRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/permissions/selected-actions": Operation<"/repos/{owner}/{repo}/actions/permissions/selected-actions", "get">; /** - * @see https://developer.github.com/v3/checks/runs/#get-a-check-run + * @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-a-repository */ - "GET /repos/:owner/:repo/check-runs/:check_run_id": { - parameters: ChecksGetEndpoint; - request: ChecksGetRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runners": Operation<"/repos/{owner}/{repo}/actions/runners", "get">; /** - * @see https://developer.github.com/v3/checks/runs/#list-check-run-annotations + * @see https://docs.github.com/rest/reference/actions#list-runner-applications-for-a-repository */ - "GET /repos/:owner/:repo/check-runs/:check_run_id/annotations": { - parameters: ChecksListAnnotationsEndpoint; - request: ChecksListAnnotationsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runners/downloads": Operation<"/repos/{owner}/{repo}/actions/runners/downloads", "get">; /** - * @see https://developer.github.com/v3/checks/suites/#get-a-check-suite + * @see https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-for-a-repository */ - "GET /repos/:owner/:repo/check-suites/:check_suite_id": { - parameters: ChecksGetSuiteEndpoint; - request: ChecksGetSuiteRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runners/{runner_id}": Operation<"/repos/{owner}/{repo}/actions/runners/{runner_id}", "get">; /** - * @see https://developer.github.com/v3/checks/runs/#list-check-runs-in-a-check-suite + * @see https://docs.github.com/rest/reference/actions#list-workflow-runs-for-a-repository */ - "GET /repos/:owner/:repo/check-suites/:check_suite_id/check-runs": { - parameters: ChecksListForSuiteEndpoint; - request: ChecksListForSuiteRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs": Operation<"/repos/{owner}/{repo}/actions/runs", "get">; /** - * @see https://developer.github.com/v3/code-scanning/#list-code-scanning-alerts-for-a-repository + * @see https://docs.github.com/rest/reference/actions#get-a-workflow-run */ - "GET /repos/:owner/:repo/code-scanning/alerts": { - parameters: CodeScanningListAlertsForRepoEndpoint; - request: CodeScanningListAlertsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}", "get">; /** - * @see https://developer.github.com/v3/code-scanning/#get-a-code-scanning-alert - * @deprecated "alert_id" is deprecated, use "alert_number" instead + * @see https://docs.github.com/rest/reference/actions#get-the-review-history-for-a-workflow-run */ - "GET /repos/:owner/:repo/code-scanning/alerts/:alert_id": { - parameters: CodeScanningGetAlertDeprecatedAlertIdEndpoint; - request: CodeScanningGetAlertRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/approvals", "get">; /** - * @see https://developer.github.com/v3/code-scanning/#get-a-code-scanning-alert + * @see https://docs.github.com/rest/reference/actions#list-workflow-run-artifacts */ - "GET /repos/:owner/:repo/code-scanning/alerts/:alert_number": { - parameters: CodeScanningGetAlertEndpoint; - request: CodeScanningGetAlertRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "get">; /** - * @see https://developer.github.com/v3/code-scanning/#list-recent-analyses + * @see https://docs.github.com/rest/reference/actions#list-jobs-for-a-workflow-run */ - "GET /repos/:owner/:repo/code-scanning/analyses": { - parameters: CodeScanningListRecentAnalysesEndpoint; - request: CodeScanningListRecentAnalysesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "get">; /** - * @see https://developer.github.com/v3/repos/collaborators/#list-repository-collaborators + * @see https://docs.github.com/rest/reference/actions#download-workflow-run-logs */ - "GET /repos/:owner/:repo/collaborators": { - parameters: ReposListCollaboratorsEndpoint; - request: ReposListCollaboratorsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/logs", "get">; /** - * @see https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-repository-collaborator + * @see https://docs.github.com/rest/reference/actions#get-pending-deployments-for-a-workflow-run */ - "GET /repos/:owner/:repo/collaborators/:username": { - parameters: ReposCheckCollaboratorEndpoint; - request: ReposCheckCollaboratorRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", "get">; /** - * @see https://developer.github.com/v3/repos/collaborators/#get-repository-permissions-for-a-user + * @see https://docs.github.com/rest/reference/actions#get-workflow-run-usage */ - "GET /repos/:owner/:repo/collaborators/:username/permission": { - parameters: ReposGetCollaboratorPermissionLevelEndpoint; - request: ReposGetCollaboratorPermissionLevelRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/timing", "get">; /** - * @see https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository + * @see https://docs.github.com/rest/reference/actions#list-repository-secrets */ - "GET /repos/:owner/:repo/comments": { - parameters: ReposListCommitCommentsForRepoEndpoint; - request: ReposListCommitCommentsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/secrets": Operation<"/repos/{owner}/{repo}/actions/secrets", "get">; /** - * @see https://developer.github.com/v3/repos/comments/#get-a-commit-comment + * @see https://docs.github.com/rest/reference/actions#get-a-repository-public-key */ - "GET /repos/:owner/:repo/comments/:comment_id": { - parameters: ReposGetCommitCommentEndpoint; - request: ReposGetCommitCommentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/secrets/public-key": Operation<"/repos/{owner}/{repo}/actions/secrets/public-key", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + * @see https://docs.github.com/rest/reference/actions#get-a-repository-secret */ - "GET /repos/:owner/:repo/comments/:comment_id/reactions": { - parameters: ReactionsListForCommitCommentEndpoint; - request: ReactionsListForCommitCommentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/secrets/{secret_name}": Operation<"/repos/{owner}/{repo}/actions/secrets/{secret_name}", "get">; /** - * @see https://developer.github.com/v3/repos/commits/#list-commits + * @see https://docs.github.com/rest/reference/actions#list-repository-workflows */ - "GET /repos/:owner/:repo/commits": { - parameters: ReposListCommitsEndpoint; - request: ReposListCommitsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/workflows": Operation<"/repos/{owner}/{repo}/actions/workflows", "get">; /** - * @see https://developer.github.com/v3/repos/commits/#list-branches-for-head-commit + * @see https://docs.github.com/rest/reference/actions#get-a-workflow */ - "GET /repos/:owner/:repo/commits/:commit_sha/branches-where-head": { - parameters: ReposListBranchesForHeadCommitEndpoint; - request: ReposListBranchesForHeadCommitRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}", "get">; /** - * @see https://developer.github.com/v3/repos/comments/#list-commit-comments + * @see https://docs.github.com/rest/reference/actions#list-workflow-runs */ - "GET /repos/:owner/:repo/commits/:commit_sha/comments": { - parameters: ReposListCommentsForCommitEndpoint; - request: ReposListCommentsForCommitRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "get">; /** - * @see https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-a-commit + * @see https://docs.github.com/rest/reference/actions#get-workflow-usage */ - "GET /repos/:owner/:repo/commits/:commit_sha/pulls": { - parameters: ReposListPullRequestsAssociatedWithCommitEndpoint; - request: ReposListPullRequestsAssociatedWithCommitRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing", "get">; /** - * @see https://developer.github.com/v3/repos/commits/#get-a-commit + * @see https://docs.github.com/rest/reference/issues#list-assignees */ - "GET /repos/:owner/:repo/commits/:ref": { - parameters: ReposGetCommitEndpoint; - request: ReposGetCommitRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/assignees": Operation<"/repos/{owner}/{repo}/assignees", "get">; /** - * @see https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-git-reference + * @see https://docs.github.com/rest/reference/issues#check-if-a-user-can-be-assigned */ - "GET /repos/:owner/:repo/commits/:ref/check-runs": { - parameters: ChecksListForRefEndpoint; - request: ChecksListForRefRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/assignees/{assignee}": Operation<"/repos/{owner}/{repo}/assignees/{assignee}", "get">; /** - * @see https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-git-reference + * @see https://docs.github.com/v3/repos#list-autolinks */ - "GET /repos/:owner/:repo/commits/:ref/check-suites": { - parameters: ChecksListSuitesForRefEndpoint; - request: ChecksListSuitesForRefRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/autolinks": Operation<"/repos/{owner}/{repo}/autolinks", "get">; /** - * @see https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-reference + * @see https://docs.github.com/v3/repos#get-autolink */ - "GET /repos/:owner/:repo/commits/:ref/status": { - parameters: ReposGetCombinedStatusForRefEndpoint; - request: ReposGetCombinedStatusForRefRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/autolinks/{autolink_id}": Operation<"/repos/{owner}/{repo}/autolinks/{autolink_id}", "get">; /** - * @see https://developer.github.com/v3/repos/statuses/#list-commit-statuses-for-a-reference + * @see https://docs.github.com/rest/reference/repos#list-branches */ - "GET /repos/:owner/:repo/commits/:ref/statuses": { - parameters: ReposListCommitStatusesForRefEndpoint; - request: ReposListCommitStatusesForRefRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches": Operation<"/repos/{owner}/{repo}/branches", "get">; /** - * @see https://developer.github.com/v3/codes_of_conduct/#get-the-code-of-conduct-for-a-repository + * @see https://docs.github.com/rest/reference/repos#get-a-branch */ - "GET /repos/:owner/:repo/community/code_of_conduct": { - parameters: CodesOfConductGetForRepoEndpoint; - request: CodesOfConductGetForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}": Operation<"/repos/{owner}/{repo}/branches/{branch}", "get">; /** - * @see https://developer.github.com/v3/repos/community/#get-community-profile-metrics + * @see https://docs.github.com/rest/reference/repos#get-branch-protection */ - "GET /repos/:owner/:repo/community/profile": { - parameters: ReposGetCommunityProfileMetricsEndpoint; - request: ReposGetCommunityProfileMetricsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection", "get">; /** - * @see https://developer.github.com/v3/repos/commits/#compare-two-commits + * @see https://docs.github.com/rest/reference/repos#get-admin-branch-protection */ - "GET /repos/:owner/:repo/compare/:base...:head": { - parameters: ReposCompareCommitsEndpoint; - request: ReposCompareCommitsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", "get">; /** - * @see https://developer.github.com/v3/repos/contents/#get-repository-content + * @see https://docs.github.com/rest/reference/repos#get-pull-request-review-protection */ - "GET /repos/:owner/:repo/contents/:path": { - parameters: ReposGetContentEndpoint; - request: ReposGetContentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", "get">; /** - * @see https://developer.github.com/v3/repos/#list-repository-contributors + * @see https://docs.github.com/rest/reference/repos#get-commit-signature-protection */ - "GET /repos/:owner/:repo/contributors": { - parameters: ReposListContributorsEndpoint; - request: ReposListContributorsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", "get", "zzzax">; /** - * @see https://developer.github.com/v3/repos/deployments/#list-deployments + * @see https://docs.github.com/rest/reference/repos#get-status-checks-protection */ - "GET /repos/:owner/:repo/deployments": { - parameters: ReposListDeploymentsEndpoint; - request: ReposListDeploymentsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", "get">; /** - * @see https://developer.github.com/v3/repos/deployments/#get-a-deployment + * @see https://docs.github.com/rest/reference/repos#get-all-status-check-contexts */ - "GET /repos/:owner/:repo/deployments/:deployment_id": { - parameters: ReposGetDeploymentEndpoint; - request: ReposGetDeploymentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", "get">; /** - * @see https://developer.github.com/v3/repos/deployments/#list-deployment-statuses + * @see https://docs.github.com/rest/reference/repos#get-access-restrictions */ - "GET /repos/:owner/:repo/deployments/:deployment_id/statuses": { - parameters: ReposListDeploymentStatusesEndpoint; - request: ReposListDeploymentStatusesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions", "get">; /** - * @see https://developer.github.com/v3/repos/deployments/#get-a-deployment-status + * @see https://docs.github.com/rest/reference/repos#list-apps-with-access-to-the-protected-branch */ - "GET /repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id": { - parameters: ReposGetDeploymentStatusEndpoint; - request: ReposGetDeploymentStatusRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-repository-events + * @see https://docs.github.com/rest/reference/repos#list-teams-with-access-to-the-protected-branch */ - "GET /repos/:owner/:repo/events": { - parameters: ActivityListRepoEventsEndpoint; - request: ActivityListRepoEventsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", "get">; /** - * @see https://developer.github.com/v3/repos/forks/#list-forks + * @see https://docs.github.com/rest/reference/repos#list-users-with-access-to-the-protected-branch */ - "GET /repos/:owner/:repo/forks": { - parameters: ReposListForksEndpoint; - request: ReposListForksRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", "get">; /** - * @see https://developer.github.com/v3/git/blobs/#get-a-blob + * @see https://docs.github.com/rest/reference/checks#get-a-check-run */ - "GET /repos/:owner/:repo/git/blobs/:file_sha": { - parameters: GitGetBlobEndpoint; - request: GitGetBlobRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}": Operation<"/repos/{owner}/{repo}/check-runs/{check_run_id}", "get">; /** - * @see https://developer.github.com/v3/git/commits/#get-a-commit + * @see https://docs.github.com/rest/reference/checks#list-check-run-annotations */ - "GET /repos/:owner/:repo/git/commits/:commit_sha": { - parameters: GitGetCommitEndpoint; - request: GitGetCommitRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations": Operation<"/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "get">; /** - * @see https://developer.github.com/v3/git/refs/#list-matching-references + * @see https://docs.github.com/rest/reference/checks#get-a-check-suite */ - "GET /repos/:owner/:repo/git/matching-refs/:ref": { - parameters: GitListMatchingRefsEndpoint; - request: GitListMatchingRefsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}": Operation<"/repos/{owner}/{repo}/check-suites/{check_suite_id}", "get">; /** - * @see https://developer.github.com/v3/git/refs/#get-a-reference + * @see https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite */ - "GET /repos/:owner/:repo/git/ref/:ref": { - parameters: GitGetRefEndpoint; - request: GitGetRefRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs": Operation<"/repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "get">; /** - * @see https://developer.github.com/v3/git/tags/#get-a-tag + * @see https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository */ - "GET /repos/:owner/:repo/git/tags/:tag_sha": { - parameters: GitGetTagEndpoint; - request: GitGetTagRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/alerts": Operation<"/repos/{owner}/{repo}/code-scanning/alerts", "get">; /** - * @see https://developer.github.com/v3/git/trees/#get-a-tree + * @see https://docs.github.com/rest/reference/code-scanning#get-a-code-scanning-alert + * @deprecated "alert_id" is now "alert_number" */ - "GET /repos/:owner/:repo/git/trees/:tree_sha": { - parameters: GitGetTreeEndpoint; - request: GitGetTreeRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_id}": Operation<"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", "get">; /** - * @see https://developer.github.com/v3/repos/hooks/#list-repository-webhooks + * @see https://docs.github.com/rest/reference/code-scanning#get-a-code-scanning-alert */ - "GET /repos/:owner/:repo/hooks": { - parameters: ReposListWebhooksEndpoint; - request: ReposListWebhooksRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", "get">; /** - * @see https://developer.github.com/v3/repos/hooks/#get-a-repository-webhook + * @see https://docs.github.com/rest/reference/code-scanning#list-instances-of-a-code-scanning-alert */ - "GET /repos/:owner/:repo/hooks/:hook_id": { - parameters: ReposGetWebhookEndpoint; - request: ReposGetWebhookRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances": Operation<"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "get">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#get-an-import-status + * @see https://docs.github.com/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository */ - "GET /repos/:owner/:repo/import": { - parameters: MigrationsGetImportStatusEndpoint; - request: MigrationsGetImportStatusRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/analyses": Operation<"/repos/{owner}/{repo}/code-scanning/analyses", "get">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#get-commit-authors + * @see https://docs.github.com/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository */ - "GET /repos/:owner/:repo/import/authors": { - parameters: MigrationsGetCommitAuthorsEndpoint; - request: MigrationsGetCommitAuthorsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}": Operation<"/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", "get">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#get-large-files + * @see https://docs.github.com/rest/reference/code-scanning#list-recent-code-scanning-analyses-for-a-repository */ - "GET /repos/:owner/:repo/import/large_files": { - parameters: MigrationsGetLargeFilesEndpoint; - request: MigrationsGetLargeFilesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}": Operation<"/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}", "get">; /** - * @see https://developer.github.com/v3/apps/#get-a-repository-installation-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/repos#list-repository-collaborators */ - "GET /repos/:owner/:repo/installation": { - parameters: AppsGetRepoInstallationEndpoint; - request: AppsGetRepoInstallationRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/collaborators": Operation<"/repos/{owner}/{repo}/collaborators", "get">; /** - * @see https://developer.github.com/v3/interactions/repos/#get-interaction-restrictions-for-a-repository + * @see https://docs.github.com/rest/reference/repos#check-if-a-user-is-a-repository-collaborator */ - "GET /repos/:owner/:repo/interaction-limits": { - parameters: InteractionsGetRestrictionsForRepoEndpoint; - request: InteractionsGetRestrictionsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/collaborators/{username}": Operation<"/repos/{owner}/{repo}/collaborators/{username}", "get">; /** - * @see https://developer.github.com/v3/repos/invitations/#list-repository-invitations + * @see https://docs.github.com/rest/reference/repos#get-repository-permissions-for-a-user */ - "GET /repos/:owner/:repo/invitations": { - parameters: ReposListInvitationsEndpoint; - request: ReposListInvitationsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/collaborators/{username}/permission": Operation<"/repos/{owner}/{repo}/collaborators/{username}/permission", "get">; /** - * @see https://developer.github.com/v3/issues/#list-repository-issues + * @see https://docs.github.com/rest/reference/repos#list-commit-comments-for-a-repository */ - "GET /repos/:owner/:repo/issues": { - parameters: IssuesListForRepoEndpoint; - request: IssuesListForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/comments": Operation<"/repos/{owner}/{repo}/comments", "get">; /** - * @see https://developer.github.com/v3/issues/#get-an-issue + * @see https://docs.github.com/rest/reference/repos#get-a-commit-comment */ - "GET /repos/:owner/:repo/issues/:issue_number": { - parameters: IssuesGetEndpoint; - request: IssuesGetRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/comments/{comment_id}", "get">; /** - * @see https://developer.github.com/v3/issues/comments/#list-issue-comments + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-commit-comment */ - "GET /repos/:owner/:repo/issues/:issue_number/comments": { - parameters: IssuesListCommentsEndpoint; - request: IssuesListCommentsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions": Operation<"/repos/{owner}/{repo}/comments/{comment_id}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/issues/events/#list-issue-events + * @see https://docs.github.com/rest/reference/repos#list-commits */ - "GET /repos/:owner/:repo/issues/:issue_number/events": { - parameters: IssuesListEventsEndpoint; - request: IssuesListEventsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits": Operation<"/repos/{owner}/{repo}/commits", "get">; /** - * @see https://developer.github.com/v3/issues/labels/#list-labels-for-an-issue + * @see https://docs.github.com/rest/reference/repos#list-branches-for-head-commit */ - "GET /repos/:owner/:repo/issues/:issue_number/labels": { - parameters: IssuesListLabelsOnIssueEndpoint; - request: IssuesListLabelsOnIssueRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head": Operation<"/repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", "get", "groot">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-an-issue + * @see https://docs.github.com/rest/reference/repos#list-commit-comments */ - "GET /repos/:owner/:repo/issues/:issue_number/reactions": { - parameters: ReactionsListForIssueEndpoint; - request: ReactionsListForIssueRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments": Operation<"/repos/{owner}/{repo}/commits/{commit_sha}/comments", "get">; /** - * @see https://developer.github.com/v3/issues/timeline/#list-timeline-events-for-an-issue + * @see https://docs.github.com/rest/reference/repos#list-pull-requests-associated-with-a-commit */ - "GET /repos/:owner/:repo/issues/:issue_number/timeline": { - parameters: IssuesListEventsForTimelineEndpoint; - request: IssuesListEventsForTimelineRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls": Operation<"/repos/{owner}/{repo}/commits/{commit_sha}/pulls", "get", "groot">; /** - * @see https://developer.github.com/v3/issues/comments/#list-issue-comments-for-a-repository + * @see https://docs.github.com/rest/reference/repos#get-a-commit */ - "GET /repos/:owner/:repo/issues/comments": { - parameters: IssuesListCommentsForRepoEndpoint; - request: IssuesListCommentsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{ref}": Operation<"/repos/{owner}/{repo}/commits/{ref}", "get">; /** - * @see https://developer.github.com/v3/issues/comments/#get-an-issue-comment + * @see https://docs.github.com/rest/reference/checks#list-check-runs-for-a-git-reference */ - "GET /repos/:owner/:repo/issues/comments/:comment_id": { - parameters: IssuesGetCommentEndpoint; - request: IssuesGetCommentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs": Operation<"/repos/{owner}/{repo}/commits/{ref}/check-runs", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment + * @see https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference */ - "GET /repos/:owner/:repo/issues/comments/:comment_id/reactions": { - parameters: ReactionsListForIssueCommentEndpoint; - request: ReactionsListForIssueCommentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{ref}/check-suites": Operation<"/repos/{owner}/{repo}/commits/{ref}/check-suites", "get">; /** - * @see https://developer.github.com/v3/issues/events/#list-issue-events-for-a-repository + * @see https://docs.github.com/rest/reference/repos#get-the-combined-status-for-a-specific-reference */ - "GET /repos/:owner/:repo/issues/events": { - parameters: IssuesListEventsForRepoEndpoint; - request: IssuesListEventsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{ref}/status": Operation<"/repos/{owner}/{repo}/commits/{ref}/status", "get">; /** - * @see https://developer.github.com/v3/issues/events/#get-an-issue-event + * @see https://docs.github.com/rest/reference/repos#list-commit-statuses-for-a-reference */ - "GET /repos/:owner/:repo/issues/events/:event_id": { - parameters: IssuesGetEventEndpoint; - request: IssuesGetEventRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/commits/{ref}/statuses": Operation<"/repos/{owner}/{repo}/commits/{ref}/statuses", "get">; /** - * @see https://developer.github.com/v3/repos/keys/#list-deploy-keys + * @see https://docs.github.com/rest/reference/codes-of-conduct#get-the-code-of-conduct-for-a-repository */ - "GET /repos/:owner/:repo/keys": { - parameters: ReposListDeployKeysEndpoint; - request: ReposListDeployKeysRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/community/code_of_conduct": Operation<"/repos/{owner}/{repo}/community/code_of_conduct", "get", "scarlet-witch">; /** - * @see https://developer.github.com/v3/repos/keys/#get-a-deploy-key + * @see https://docs.github.com/rest/reference/repos#get-community-profile-metrics */ - "GET /repos/:owner/:repo/keys/:key_id": { - parameters: ReposGetDeployKeyEndpoint; - request: ReposGetDeployKeyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/community/profile": Operation<"/repos/{owner}/{repo}/community/profile", "get">; /** - * @see https://developer.github.com/v3/issues/labels/#list-labels-for-a-repository + * @see https://docs.github.com/rest/reference/repos#compare-two-commits */ - "GET /repos/:owner/:repo/labels": { - parameters: IssuesListLabelsForRepoEndpoint; - request: IssuesListLabelsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/compare/{basehead}": Operation<"/repos/{owner}/{repo}/compare/{basehead}", "get">; /** - * @see https://developer.github.com/v3/issues/labels/#get-a-label + * @see https://docs.github.com/rest/reference/repos#compare-two-commits */ - "GET /repos/:owner/:repo/labels/:name": { - parameters: IssuesGetLabelEndpoint; - request: IssuesGetLabelRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/compare/{base}...{head}": Operation<"/repos/{owner}/{repo}/compare/{base}...{head}", "get">; /** - * @see https://developer.github.com/v3/repos/#list-repository-languages + * @see https://docs.github.com/rest/reference/repos#get-repository-content */ - "GET /repos/:owner/:repo/languages": { - parameters: ReposListLanguagesEndpoint; - request: ReposListLanguagesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/contents/{path}": Operation<"/repos/{owner}/{repo}/contents/{path}", "get">; /** - * @see https://developer.github.com/v3/licenses/#get-the-license-for-a-repository + * @see https://docs.github.com/rest/reference/repos#list-repository-contributors */ - "GET /repos/:owner/:repo/license": { - parameters: LicensesGetForRepoEndpoint; - request: LicensesGetForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/contributors": Operation<"/repos/{owner}/{repo}/contributors", "get">; /** - * @see https://developer.github.com/v3/issues/milestones/#list-milestones + * @see https://docs.github.com/rest/reference/repos#list-deployments */ - "GET /repos/:owner/:repo/milestones": { - parameters: IssuesListMilestonesEndpoint; - request: IssuesListMilestonesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/deployments": Operation<"/repos/{owner}/{repo}/deployments", "get">; /** - * @see https://developer.github.com/v3/issues/milestones/#get-a-milestone + * @see https://docs.github.com/rest/reference/repos#get-a-deployment */ - "GET /repos/:owner/:repo/milestones/:milestone_number": { - parameters: IssuesGetMilestoneEndpoint; - request: IssuesGetMilestoneRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/deployments/{deployment_id}": Operation<"/repos/{owner}/{repo}/deployments/{deployment_id}", "get">; /** - * @see https://developer.github.com/v3/issues/labels/#list-labels-for-issues-in-a-milestone + * @see https://docs.github.com/rest/reference/repos#list-deployment-statuses */ - "GET /repos/:owner/:repo/milestones/:milestone_number/labels": { - parameters: IssuesListLabelsForMilestoneEndpoint; - request: IssuesListLabelsForMilestoneRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses": Operation<"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "get">; /** - * @see https://developer.github.com/v3/activity/notifications/#list-repository-notifications-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-a-deployment-status */ - "GET /repos/:owner/:repo/notifications": { - parameters: ActivityListRepoNotificationsForAuthenticatedUserEndpoint; - request: ActivityListRepoNotificationsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}": Operation<"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}", "get">; /** - * @see https://developer.github.com/v3/repos/pages/#get-a-github-pages-site + * @see https://docs.github.com/rest/reference/repos#get-all-environments */ - "GET /repos/:owner/:repo/pages": { - parameters: ReposGetPagesEndpoint; - request: ReposGetPagesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/environments": Operation<"/repos/{owner}/{repo}/environments", "get">; /** - * @see https://developer.github.com/v3/repos/pages/#list-github-pages-builds + * @see https://docs.github.com/rest/reference/repos#get-an-environment */ - "GET /repos/:owner/:repo/pages/builds": { - parameters: ReposListPagesBuildsEndpoint; - request: ReposListPagesBuildsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/environments/{environment_name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}", "get">; /** - * @see https://developer.github.com/v3/repos/pages/#get-github-pages-build + * @see https://docs.github.com/rest/reference/activity#list-repository-events */ - "GET /repos/:owner/:repo/pages/builds/:build_id": { - parameters: ReposGetPagesBuildEndpoint; - request: ReposGetPagesBuildRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/events": Operation<"/repos/{owner}/{repo}/events", "get">; /** - * @see https://developer.github.com/v3/repos/pages/#get-latest-pages-build + * @see https://docs.github.com/rest/reference/repos#list-forks */ - "GET /repos/:owner/:repo/pages/builds/latest": { - parameters: ReposGetLatestPagesBuildEndpoint; - request: ReposGetLatestPagesBuildRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/forks": Operation<"/repos/{owner}/{repo}/forks", "get">; /** - * @see https://developer.github.com/v3/projects/#list-repository-projects + * @see https://docs.github.com/rest/reference/git#get-a-blob */ - "GET /repos/:owner/:repo/projects": { - parameters: ProjectsListForRepoEndpoint; - request: ProjectsListForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/git/blobs/{file_sha}": Operation<"/repos/{owner}/{repo}/git/blobs/{file_sha}", "get">; /** - * @see https://developer.github.com/v3/pulls/#list-pull-requests + * @see https://docs.github.com/rest/reference/git#get-a-commit */ - "GET /repos/:owner/:repo/pulls": { - parameters: PullsListEndpoint; - request: PullsListRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/git/commits/{commit_sha}": Operation<"/repos/{owner}/{repo}/git/commits/{commit_sha}", "get">; /** - * @see https://developer.github.com/v3/pulls/#get-a-pull-request + * @see https://docs.github.com/rest/reference/git#list-matching-references */ - "GET /repos/:owner/:repo/pulls/:pull_number": { - parameters: PullsGetEndpoint; - request: PullsGetRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/git/matching-refs/{ref}": Operation<"/repos/{owner}/{repo}/git/matching-refs/{ref}", "get">; /** - * @see https://developer.github.com/v3/pulls/comments/#list-review-comments-on-a-pull-request + * @see https://docs.github.com/rest/reference/git#get-a-reference */ - "GET /repos/:owner/:repo/pulls/:pull_number/comments": { - parameters: PullsListReviewCommentsEndpoint; - request: PullsListReviewCommentsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/git/ref/{ref}": Operation<"/repos/{owner}/{repo}/git/ref/{ref}", "get">; /** - * @see https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request + * @see https://docs.github.com/rest/reference/git#get-a-tag */ - "GET /repos/:owner/:repo/pulls/:pull_number/commits": { - parameters: PullsListCommitsEndpoint; - request: PullsListCommitsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/git/tags/{tag_sha}": Operation<"/repos/{owner}/{repo}/git/tags/{tag_sha}", "get">; /** - * @see https://developer.github.com/v3/pulls/#list-pull-requests-files + * @see https://docs.github.com/rest/reference/git#get-a-tree */ - "GET /repos/:owner/:repo/pulls/:pull_number/files": { - parameters: PullsListFilesEndpoint; - request: PullsListFilesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/git/trees/{tree_sha}": Operation<"/repos/{owner}/{repo}/git/trees/{tree_sha}", "get">; /** - * @see https://developer.github.com/v3/pulls/#check-if-a-pull-request-has-been-merged + * @see https://docs.github.com/rest/reference/repos#list-repository-webhooks */ - "GET /repos/:owner/:repo/pulls/:pull_number/merge": { - parameters: PullsCheckIfMergedEndpoint; - request: PullsCheckIfMergedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/hooks": Operation<"/repos/{owner}/{repo}/hooks", "get">; /** - * @see https://developer.github.com/v3/pulls/review_requests/#list-requested-reviewers-for-a-pull-request + * @see https://docs.github.com/rest/reference/repos#get-a-repository-webhook */ - "GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers": { - parameters: PullsListRequestedReviewersEndpoint; - request: PullsListRequestedReviewersRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/hooks/{hook_id}": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}", "get">; /** - * @see https://developer.github.com/v3/pulls/reviews/#list-reviews-for-a-pull-request + * @see https://docs.github.com/rest/reference/repos#get-a-webhook-configuration-for-a-repository */ - "GET /repos/:owner/:repo/pulls/:pull_number/reviews": { - parameters: PullsListReviewsEndpoint; - request: PullsListReviewsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/hooks/{hook_id}/config": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/config", "get">; /** - * @see https://developer.github.com/v3/pulls/reviews/#get-a-review-for-a-pull-request + * @see https://docs.github.com/rest/reference/repos#list-deliveries-for-a-repository-webhook */ - "GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id": { - parameters: PullsGetReviewEndpoint; - request: PullsGetReviewRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "get">; /** - * @see https://developer.github.com/v3/pulls/reviews/#list-comments-for-a-pull-request-review + * @see https://docs.github.com/rest/reference/repos#get-a-delivery-for-a-repository-webhook */ - "GET /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments": { - parameters: PullsListCommentsForReviewEndpoint; - request: PullsListCommentsForReviewRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}", "get">; /** - * @see https://developer.github.com/v3/pulls/comments/#list-review-comments-in-a-repository + * @see https://docs.github.com/rest/reference/migrations#get-an-import-status */ - "GET /repos/:owner/:repo/pulls/comments": { - parameters: PullsListReviewCommentsForRepoEndpoint; - request: PullsListReviewCommentsForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "get">; /** - * @see https://developer.github.com/v3/pulls/comments/#get-a-review-comment-for-a-pull-request + * @see https://docs.github.com/rest/reference/migrations#get-commit-authors */ - "GET /repos/:owner/:repo/pulls/comments/:comment_id": { - parameters: PullsGetReviewCommentEndpoint; - request: PullsGetReviewCommentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/import/authors": Operation<"/repos/{owner}/{repo}/import/authors", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment + * @see https://docs.github.com/rest/reference/migrations#get-large-files */ - "GET /repos/:owner/:repo/pulls/comments/:comment_id/reactions": { - parameters: ReactionsListForPullRequestReviewCommentEndpoint; - request: ReactionsListForPullRequestReviewCommentRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/import/large_files": Operation<"/repos/{owner}/{repo}/import/large_files", "get">; /** - * @see https://developer.github.com/v3/repos/contents/#get-a-repository-readme + * @see https://docs.github.com/rest/reference/apps#get-a-repository-installation-for-the-authenticated-app */ - "GET /repos/:owner/:repo/readme": { - parameters: ReposGetReadmeEndpoint; - request: ReposGetReadmeRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/installation": Operation<"/repos/{owner}/{repo}/installation", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#list-releases + * @see https://docs.github.com/rest/reference/interactions#get-interaction-restrictions-for-a-repository */ - "GET /repos/:owner/:repo/releases": { - parameters: ReposListReleasesEndpoint; - request: ReposListReleasesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/interaction-limits": Operation<"/repos/{owner}/{repo}/interaction-limits", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#get-a-release + * @see https://docs.github.com/rest/reference/repos#list-repository-invitations */ - "GET /repos/:owner/:repo/releases/:release_id": { - parameters: ReposGetReleaseEndpoint; - request: ReposGetReleaseRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/invitations": Operation<"/repos/{owner}/{repo}/invitations", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#list-release-assets + * @see https://docs.github.com/rest/reference/issues#list-repository-issues */ - "GET /repos/:owner/:repo/releases/:release_id/assets": { - parameters: ReposListReleaseAssetsEndpoint; - request: ReposListReleaseAssetsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues": Operation<"/repos/{owner}/{repo}/issues", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#get-a-release-asset + * @see https://docs.github.com/rest/reference/issues#list-issue-comments-for-a-repository */ - "GET /repos/:owner/:repo/releases/assets/:asset_id": { - parameters: ReposGetReleaseAssetEndpoint; - request: ReposGetReleaseAssetRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/comments": Operation<"/repos/{owner}/{repo}/issues/comments", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#get-the-latest-release + * @see https://docs.github.com/rest/reference/issues#get-an-issue-comment */ - "GET /repos/:owner/:repo/releases/latest": { - parameters: ReposGetLatestReleaseEndpoint; - request: ReposGetLatestReleaseRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/issues/comments/{comment_id}", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-an-issue-comment */ - "GET /repos/:owner/:repo/releases/tags/:tag": { - parameters: ReposGetReleaseByTagEndpoint; - request: ReposGetReleaseByTagRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions": Operation<"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/activity/starring/#list-stargazers + * @see https://docs.github.com/rest/reference/issues#list-issue-events-for-a-repository */ - "GET /repos/:owner/:repo/stargazers": { - parameters: ActivityListStargazersForRepoEndpoint; - request: ActivityListStargazersForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/events": Operation<"/repos/{owner}/{repo}/issues/events", "get">; /** - * @see https://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-activity + * @see https://docs.github.com/rest/reference/issues#get-an-issue-event */ - "GET /repos/:owner/:repo/stats/code_frequency": { - parameters: ReposGetCodeFrequencyStatsEndpoint; - request: ReposGetCodeFrequencyStatsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/events/{event_id}": Operation<"/repos/{owner}/{repo}/issues/events/{event_id}", "get">; /** - * @see https://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity + * @see https://docs.github.com/rest/reference/issues#get-an-issue */ - "GET /repos/:owner/:repo/stats/commit_activity": { - parameters: ReposGetCommitActivityStatsEndpoint; - request: ReposGetCommitActivityStatsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/{issue_number}": Operation<"/repos/{owner}/{repo}/issues/{issue_number}", "get">; /** - * @see https://developer.github.com/v3/repos/statistics/#get-all-contributor-commit-activity + * @see https://docs.github.com/rest/reference/issues#list-issue-comments */ - "GET /repos/:owner/:repo/stats/contributors": { - parameters: ReposGetContributorsStatsEndpoint; - request: ReposGetContributorsStatsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/{issue_number}/comments": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/comments", "get">; /** - * @see https://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-count + * @see https://docs.github.com/rest/reference/issues#list-issue-events */ - "GET /repos/:owner/:repo/stats/participation": { - parameters: ReposGetParticipationStatsEndpoint; - request: ReposGetParticipationStatsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/{issue_number}/events": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/events", "get">; /** - * @see https://developer.github.com/v3/repos/statistics/#get-the-hourly-commit-count-for-each-day + * @see https://docs.github.com/rest/reference/issues#list-labels-for-an-issue */ - "GET /repos/:owner/:repo/stats/punch_card": { - parameters: ReposGetPunchCardStatsEndpoint; - request: ReposGetPunchCardStatsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/{issue_number}/labels": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/labels", "get">; /** - * @see https://developer.github.com/v3/activity/watching/#list-watchers + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-an-issue */ - "GET /repos/:owner/:repo/subscribers": { - parameters: ActivityListWatchersForRepoEndpoint; - request: ActivityListWatchersForRepoRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/activity/watching/#get-a-repository-subscription + * @see https://docs.github.com/rest/reference/issues#list-timeline-events-for-an-issue */ - "GET /repos/:owner/:repo/subscription": { - parameters: ActivityGetRepoSubscriptionEndpoint; - request: ActivityGetRepoSubscriptionRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/timeline", "get", "mockingbird">; /** - * @see https://developer.github.com/v3/repos/#list-repository-tags + * @see https://docs.github.com/rest/reference/repos#list-deploy-keys */ - "GET /repos/:owner/:repo/tags": { - parameters: ReposListTagsEndpoint; - request: ReposListTagsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/keys": Operation<"/repos/{owner}/{repo}/keys", "get">; /** - * @see https://developer.github.com/v3/repos/#list-repository-teams + * @see https://docs.github.com/rest/reference/repos#get-a-deploy-key */ - "GET /repos/:owner/:repo/teams": { - parameters: ReposListTeamsEndpoint; - request: ReposListTeamsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/keys/{key_id}": Operation<"/repos/{owner}/{repo}/keys/{key_id}", "get">; /** - * @see https://developer.github.com/v3/repos/#get-all-repository-topics + * @see https://docs.github.com/rest/reference/issues#list-labels-for-a-repository */ - "GET /repos/:owner/:repo/topics": { - parameters: ReposGetAllTopicsEndpoint; - request: ReposGetAllTopicsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/labels": Operation<"/repos/{owner}/{repo}/labels", "get">; /** - * @see https://developer.github.com/v3/repos/traffic/#get-repository-clones + * @see https://docs.github.com/rest/reference/issues#get-a-label */ - "GET /repos/:owner/:repo/traffic/clones": { - parameters: ReposGetClonesEndpoint; - request: ReposGetClonesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/labels/{name}": Operation<"/repos/{owner}/{repo}/labels/{name}", "get">; /** - * @see https://developer.github.com/v3/repos/traffic/#get-top-referral-paths + * @see https://docs.github.com/rest/reference/repos#list-repository-languages */ - "GET /repos/:owner/:repo/traffic/popular/paths": { - parameters: ReposGetTopPathsEndpoint; - request: ReposGetTopPathsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/languages": Operation<"/repos/{owner}/{repo}/languages", "get">; /** - * @see https://developer.github.com/v3/repos/traffic/#get-top-referral-sources + * @see https://docs.github.com/rest/reference/licenses/#get-the-license-for-a-repository */ - "GET /repos/:owner/:repo/traffic/popular/referrers": { - parameters: ReposGetTopReferrersEndpoint; - request: ReposGetTopReferrersRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/license": Operation<"/repos/{owner}/{repo}/license", "get">; /** - * @see https://developer.github.com/v3/repos/traffic/#get-page-views + * @see https://docs.github.com/rest/reference/issues#list-milestones */ - "GET /repos/:owner/:repo/traffic/views": { - parameters: ReposGetViewsEndpoint; - request: ReposGetViewsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/milestones": Operation<"/repos/{owner}/{repo}/milestones", "get">; /** - * @see https://developer.github.com/v3/repos/#check-if-vulnerability-alerts-are-enabled-for-a-repository + * @see https://docs.github.com/rest/reference/issues#get-a-milestone */ - "GET /repos/:owner/:repo/vulnerability-alerts": { - parameters: ReposCheckVulnerabilityAlertsEndpoint; - request: ReposCheckVulnerabilityAlertsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/milestones/{milestone_number}": Operation<"/repos/{owner}/{repo}/milestones/{milestone_number}", "get">; /** - * @see https://developer.github.com/v3/repos/#list-public-repositories + * @see https://docs.github.com/rest/reference/issues#list-labels-for-issues-in-a-milestone */ - "GET /repositories": { - parameters: ReposListPublicEndpoint; - request: ReposListPublicRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels": Operation<"/repos/{owner}/{repo}/milestones/{milestone_number}/labels", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#list-provisioned-scim groups-for-an-enterprise + * @see https://docs.github.com/rest/reference/activity#list-repository-notifications-for-the-authenticated-user */ - "GET /scim/v2/enterprises/:enterprise/Groups": { - parameters: EnterpriseAdminListProvisionedGroupsEnterpriseEndpoint; - request: EnterpriseAdminListProvisionedGroupsEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/notifications": Operation<"/repos/{owner}/{repo}/notifications", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#get-scim-provisioning-information-for-an-enterprise group + * @see https://docs.github.com/rest/reference/repos#get-a-github-pages-site */ - "GET /scim/v2/enterprises/:enterprise/Groups/:scim_group_id": { - parameters: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupEndpoint; - request: EnterpriseAdminGetProvisioningInformationForEnterpriseGroupRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pages": Operation<"/repos/{owner}/{repo}/pages", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#list-scim-provisioned-identities-for-an-enterprise + * @see https://docs.github.com/rest/reference/repos#list-github-pages-builds */ - "GET /scim/v2/enterprises/:enterprise/Users": { - parameters: EnterpriseAdminListProvisionedIdentitiesEnterpriseEndpoint; - request: EnterpriseAdminListProvisionedIdentitiesEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pages/builds": Operation<"/repos/{owner}/{repo}/pages/builds", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#get-scim-provisioning-information-for-an-enterprise-user + * @see https://docs.github.com/rest/reference/repos#get-latest-pages-build */ - "GET /scim/v2/enterprises/:enterprise/Users/:scim_user_id": { - parameters: EnterpriseAdminGetProvisioningInformationForEnterpriseUserEndpoint; - request: EnterpriseAdminGetProvisioningInformationForEnterpriseUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pages/builds/latest": Operation<"/repos/{owner}/{repo}/pages/builds/latest", "get">; /** - * @see https://developer.github.com/v3/scim/#list-scim-provisioned-identities + * @see https://docs.github.com/rest/reference/repos#get-github-pages-build */ - "GET /scim/v2/organizations/:org/Users": { - parameters: ScimListProvisionedIdentitiesEndpoint; - request: ScimListProvisionedIdentitiesRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pages/builds/{build_id}": Operation<"/repos/{owner}/{repo}/pages/builds/{build_id}", "get">; /** - * @see https://developer.github.com/v3/scim/#get-scim-provisioning-information-for-a-user + * @see https://docs.github.com/rest/reference/repos#get-a-dns-health-check-for-github-pages */ - "GET /scim/v2/organizations/:org/Users/:scim_user_id": { - parameters: ScimGetProvisioningInformationForUserEndpoint; - request: ScimGetProvisioningInformationForUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pages/health": Operation<"/repos/{owner}/{repo}/pages/health", "get">; /** - * @see https://developer.github.com/v3/search/#search-code + * @see https://docs.github.com/rest/reference/projects#list-repository-projects */ - "GET /search/code": { - parameters: SearchCodeEndpoint; - request: SearchCodeRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/projects": Operation<"/repos/{owner}/{repo}/projects", "get", "inertia">; /** - * @see https://developer.github.com/v3/search/#search-commits + * @see https://docs.github.com/rest/reference/pulls#list-pull-requests */ - "GET /search/commits": { - parameters: SearchCommitsEndpoint; - request: SearchCommitsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls": Operation<"/repos/{owner}/{repo}/pulls", "get">; /** - * @see https://developer.github.com/v3/search/#search-issues-and-pull-requests + * @see https://docs.github.com/rest/reference/pulls#list-review-comments-in-a-repository */ - "GET /search/issues": { - parameters: SearchIssuesAndPullRequestsEndpoint; - request: SearchIssuesAndPullRequestsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/comments": Operation<"/repos/{owner}/{repo}/pulls/comments", "get">; /** - * @see https://developer.github.com/v3/search/#search-labels + * @see https://docs.github.com/rest/reference/pulls#get-a-review-comment-for-a-pull-request */ - "GET /search/labels": { - parameters: SearchLabelsEndpoint; - request: SearchLabelsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/pulls/comments/{comment_id}", "get">; /** - * @see https://developer.github.com/v3/search/#search-repositories + * @see https://docs.github.com/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment */ - "GET /search/repositories": { - parameters: SearchReposEndpoint; - request: SearchReposRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions": Operation<"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/search/#search-topics + * @see https://docs.github.com/rest/reference/pulls#get-a-pull-request */ - "GET /search/topics": { - parameters: SearchTopicsEndpoint; - request: SearchTopicsRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}", "get">; /** - * @see https://developer.github.com/v3/search/#search-users + * @see https://docs.github.com/rest/reference/pulls#list-review-comments-on-a-pull-request */ - "GET /search/users": { - parameters: SearchUsersEndpoint; - request: SearchUsersRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/comments", "get">; /** - * @see https://developer.github.com/v3/teams/#get-a-team-legacy + * @see https://docs.github.com/rest/reference/pulls#list-commits-on-a-pull-request */ - "GET /teams/:team_id": { - parameters: TeamsGetLegacyEndpoint; - request: TeamsGetLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/commits", "get">; /** - * @see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy + * @see https://docs.github.com/rest/reference/pulls#list-pull-requests-files */ - "GET /teams/:team_id/discussions": { - parameters: TeamsListDiscussionsLegacyEndpoint; - request: TeamsListDiscussionsLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/files": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/files", "get">; /** - * @see https://developer.github.com/v3/teams/discussions/#get-a-discussion-legacy + * @see https://docs.github.com/rest/reference/pulls#check-if-a-pull-request-has-been-merged */ - "GET /teams/:team_id/discussions/:discussion_number": { - parameters: TeamsGetDiscussionLegacyEndpoint; - request: TeamsGetDiscussionLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/merge": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/merge", "get">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#list-discussion-comments-legacy + * @see https://docs.github.com/rest/reference/pulls#list-requested-reviewers-for-a-pull-request */ - "GET /teams/:team_id/discussions/:discussion_number/comments": { - parameters: TeamsListDiscussionCommentsLegacyEndpoint; - request: TeamsListDiscussionCommentsLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "get">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#get-a-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/pulls#list-reviews-for-a-pull-request */ - "GET /teams/:team_id/discussions/:discussion_number/comments/:comment_number": { - parameters: TeamsGetDiscussionCommentLegacyEndpoint; - request: TeamsGetDiscussionCommentLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/pulls#get-a-review-for-a-pull-request */ - "GET /teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions": { - parameters: ReactionsListForTeamDiscussionCommentLegacyEndpoint; - request: ReactionsListForTeamDiscussionCommentLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}", "get">; /** - * @see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy + * @see https://docs.github.com/rest/reference/pulls#list-comments-for-a-pull-request-review */ - "GET /teams/:team_id/discussions/:discussion_number/reactions": { - parameters: ReactionsListForTeamDiscussionLegacyEndpoint; - request: ReactionsListForTeamDiscussionLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "get">; /** - * @see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy + * @see https://docs.github.com/rest/reference/repos#get-a-repository-readme */ - "GET /teams/:team_id/invitations": { - parameters: TeamsListPendingInvitationsLegacyEndpoint; - request: TeamsListPendingInvitationsLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/readme": Operation<"/repos/{owner}/{repo}/readme", "get">; /** - * @see https://developer.github.com/v3/teams/members/#list-team-members-legacy + * @see https://docs.github.com/rest/reference/repos#get-a-repository-directory-readme */ - "GET /teams/:team_id/members": { - parameters: TeamsListMembersLegacyEndpoint; - request: TeamsListMembersLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/readme/{dir}": Operation<"/repos/{owner}/{repo}/readme/{dir}", "get">; /** - * @see https://developer.github.com/v3/teams/members/#get-team-member-legacy + * @see https://docs.github.com/rest/reference/repos#list-releases */ - "GET /teams/:team_id/members/:username": { - parameters: TeamsGetMemberLegacyEndpoint; - request: TeamsGetMemberLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/releases": Operation<"/repos/{owner}/{repo}/releases", "get">; /** - * @see https://developer.github.com/v3/teams/members/#get-team-membership-for-a-user-legacy + * @see https://docs.github.com/rest/reference/repos#get-a-release-asset */ - "GET /teams/:team_id/memberships/:username": { - parameters: TeamsGetMembershipForUserLegacyEndpoint; - request: TeamsGetMembershipForUserLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/releases/assets/{asset_id}": Operation<"/repos/{owner}/{repo}/releases/assets/{asset_id}", "get">; /** - * @see https://developer.github.com/v3/teams/#list-team-projects-legacy + * @see https://docs.github.com/rest/reference/repos#get-the-latest-release */ - "GET /teams/:team_id/projects": { - parameters: TeamsListProjectsLegacyEndpoint; - request: TeamsListProjectsLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/releases/latest": Operation<"/repos/{owner}/{repo}/releases/latest", "get">; /** - * @see https://developer.github.com/v3/teams/#check-team-permissions-for-a-project-legacy + * @see https://docs.github.com/rest/reference/repos#get-a-release-by-tag-name */ - "GET /teams/:team_id/projects/:project_id": { - parameters: TeamsCheckPermissionsForProjectLegacyEndpoint; - request: TeamsCheckPermissionsForProjectLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/releases/tags/{tag}": Operation<"/repos/{owner}/{repo}/releases/tags/{tag}", "get">; /** - * @see https://developer.github.com/v3/teams/#list-team-repositories-legacy + * @see https://docs.github.com/rest/reference/repos#get-a-release */ - "GET /teams/:team_id/repos": { - parameters: TeamsListReposLegacyEndpoint; - request: TeamsListReposLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/releases/{release_id}": Operation<"/repos/{owner}/{repo}/releases/{release_id}", "get">; /** - * @see https://developer.github.com/v3/teams/#check-team-permissions-for-a-repository-legacy + * @see https://docs.github.com/rest/reference/repos#list-release-assets */ - "GET /teams/:team_id/repos/:owner/:repo": { - parameters: TeamsCheckPermissionsForRepoLegacyEndpoint; - request: TeamsCheckPermissionsForRepoLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/releases/{release_id}/assets": Operation<"/repos/{owner}/{repo}/releases/{release_id}/assets", "get">; /** - * @see https://developer.github.com/v3/teams/team_sync/#list-idp-groups-for-a-team-legacy + * @see https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-a-repository */ - "GET /teams/:team_id/team-sync/group-mappings": { - parameters: TeamsListIdPGroupsForLegacyEndpoint; - request: TeamsListIdPGroupsForLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/secret-scanning/alerts": Operation<"/repos/{owner}/{repo}/secret-scanning/alerts", "get">; /** - * @see https://developer.github.com/v3/teams/#list-child-teams-legacy + * @see https://docs.github.com/rest/reference/secret-scanning#get-a-secret-scanning-alert */ - "GET /teams/:team_id/teams": { - parameters: TeamsListChildLegacyEndpoint; - request: TeamsListChildLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", "get">; /** - * @see https://developer.github.com/v3/users/#get-the-authenticated-user + * @see https://docs.github.com/rest/reference/activity#list-stargazers */ - "GET /user": { - parameters: UsersGetAuthenticatedEndpoint; - request: UsersGetAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/stargazers": Operation<"/repos/{owner}/{repo}/stargazers", "get">; /** - * @see https://developer.github.com/v3/users/blocking/#list-users-blocked-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-the-weekly-commit-activity */ - "GET /user/blocks": { - parameters: UsersListBlockedByAuthenticatedEndpoint; - request: UsersListBlockedByAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/stats/code_frequency": Operation<"/repos/{owner}/{repo}/stats/code_frequency", "get">; /** - * @see https://developer.github.com/v3/users/blocking/#check-if-a-user-is-blocked-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-the-last-year-of-commit-activity */ - "GET /user/blocks/:username": { - parameters: UsersCheckBlockedEndpoint; - request: UsersCheckBlockedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/stats/commit_activity": Operation<"/repos/{owner}/{repo}/stats/commit_activity", "get">; /** - * @see https://developer.github.com/v3/users/emails/#list-email-addresses-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-all-contributor-commit-activity */ - "GET /user/emails": { - parameters: UsersListEmailsForAuthenticatedEndpoint; - request: UsersListEmailsForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/stats/contributors": Operation<"/repos/{owner}/{repo}/stats/contributors", "get">; /** - * @see https://developer.github.com/v3/users/followers/#list-followers-of-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-the-weekly-commit-count */ - "GET /user/followers": { - parameters: UsersListFollowersForAuthenticatedUserEndpoint; - request: UsersListFollowersForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/stats/participation": Operation<"/repos/{owner}/{repo}/stats/participation", "get">; /** - * @see https://developer.github.com/v3/users/followers/#list-the-people-the-authenticated-user-follows + * @see https://docs.github.com/rest/reference/repos#get-the-hourly-commit-count-for-each-day */ - "GET /user/following": { - parameters: UsersListFollowedByAuthenticatedEndpoint; - request: UsersListFollowedByAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/stats/punch_card": Operation<"/repos/{owner}/{repo}/stats/punch_card", "get">; /** - * @see https://developer.github.com/v3/users/followers/#check-if-a-person-is-followed-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/activity#list-watchers */ - "GET /user/following/:username": { - parameters: UsersCheckPersonIsFollowedByAuthenticatedEndpoint; - request: UsersCheckPersonIsFollowedByAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/subscribers": Operation<"/repos/{owner}/{repo}/subscribers", "get">; /** - * @see https://developer.github.com/v3/users/gpg_keys/#list-gpg-keys-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/activity#get-a-repository-subscription */ - "GET /user/gpg_keys": { - parameters: UsersListGpgKeysForAuthenticatedEndpoint; - request: UsersListGpgKeysForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/subscription": Operation<"/repos/{owner}/{repo}/subscription", "get">; /** - * @see https://developer.github.com/v3/users/gpg_keys/#get-a-gpg-key-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#list-repository-tags */ - "GET /user/gpg_keys/:gpg_key_id": { - parameters: UsersGetGpgKeyForAuthenticatedEndpoint; - request: UsersGetGpgKeyForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/tags": Operation<"/repos/{owner}/{repo}/tags", "get">; /** - * @see https://developer.github.com/v3/apps/installations/#list-app-installations-accessible-to-the-user-access-token + * @see https://docs.github.com/rest/reference/repos#download-a-repository-archive */ - "GET /user/installations": { - parameters: AppsListInstallationsForAuthenticatedUserEndpoint; - request: AppsListInstallationsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/tarball/{ref}": Operation<"/repos/{owner}/{repo}/tarball/{ref}", "get">; /** - * @see https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-access-token + * @see https://docs.github.com/rest/reference/repos#list-repository-teams */ - "GET /user/installations/:installation_id/repositories": { - parameters: AppsListInstallationReposForAuthenticatedUserEndpoint; - request: AppsListInstallationReposForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/teams": Operation<"/repos/{owner}/{repo}/teams", "get">; /** - * @see https://developer.github.com/v3/issues/#list-user-account-issues-assigned-to-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-all-repository-topics */ - "GET /user/issues": { - parameters: IssuesListForAuthenticatedUserEndpoint; - request: IssuesListForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/topics": Operation<"/repos/{owner}/{repo}/topics", "get", "mercy">; /** - * @see https://developer.github.com/v3/users/keys/#list-public-ssh-keys-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-repository-clones */ - "GET /user/keys": { - parameters: UsersListPublicSshKeysForAuthenticatedEndpoint; - request: UsersListPublicSshKeysForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/traffic/clones": Operation<"/repos/{owner}/{repo}/traffic/clones", "get">; /** - * @see https://developer.github.com/v3/users/keys/#get-a-public-ssh-key-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-top-referral-paths */ - "GET /user/keys/:key_id": { - parameters: UsersGetPublicSshKeyForAuthenticatedEndpoint; - request: UsersGetPublicSshKeyForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/traffic/popular/paths": Operation<"/repos/{owner}/{repo}/traffic/popular/paths", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-subscriptions-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#get-top-referral-sources */ - "GET /user/marketplace_purchases": { - parameters: AppsListSubscriptionsForAuthenticatedUserEndpoint; - request: AppsListSubscriptionsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/traffic/popular/referrers": Operation<"/repos/{owner}/{repo}/traffic/popular/referrers", "get">; /** - * @see https://developer.github.com/v3/apps/marketplace/#list-subscriptions-for-the-authenticated-user-stubbed + * @see https://docs.github.com/rest/reference/repos#get-page-views */ - "GET /user/marketplace_purchases/stubbed": { - parameters: AppsListSubscriptionsForAuthenticatedUserStubbedEndpoint; - request: AppsListSubscriptionsForAuthenticatedUserStubbedRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/traffic/views": Operation<"/repos/{owner}/{repo}/traffic/views", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#list-organization-memberships-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository */ - "GET /user/memberships/orgs": { - parameters: OrgsListMembershipsForAuthenticatedUserEndpoint; - request: OrgsListMembershipsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/vulnerability-alerts": Operation<"/repos/{owner}/{repo}/vulnerability-alerts", "get", "dorian">; /** - * @see https://developer.github.com/v3/orgs/members/#get-an-organization-membership-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/repos#download-a-repository-archive */ - "GET /user/memberships/orgs/:org": { - parameters: OrgsGetMembershipForAuthenticatedUserEndpoint; - request: OrgsGetMembershipForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repos/{owner}/{repo}/zipball/{ref}": Operation<"/repos/{owner}/{repo}/zipball/{ref}", "get">; /** - * @see https://developer.github.com/v3/migrations/users/#list-user-migrations + * @see https://docs.github.com/rest/reference/repos#list-public-repositories */ - "GET /user/migrations": { - parameters: MigrationsListForAuthenticatedUserEndpoint; - request: MigrationsListForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repositories": Operation<"/repositories", "get">; /** - * @see https://developer.github.com/v3/migrations/users/#get-a-user-migration-status + * @see https://docs.github.com/rest/reference/actions#list-environment-secrets */ - "GET /user/migrations/:migration_id": { - parameters: MigrationsGetStatusForAuthenticatedUserEndpoint; - request: MigrationsGetStatusForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repositories/{repository_id}/environments/{environment_name}/secrets": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets", "get">; /** - * @see https://developer.github.com/v3/migrations/users/#download-a-user-migration-archive + * @see https://docs.github.com/rest/reference/actions#get-an-environment-public-key */ - "GET /user/migrations/:migration_id/archive": { - parameters: MigrationsGetArchiveForAuthenticatedUserEndpoint; - request: MigrationsGetArchiveForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/public-key", "get">; /** - * @see https://developer.github.com/v3/migrations/users/#list-repositories-for-a-user-migration + * @see https://docs.github.com/rest/reference/actions#get-an-environment-secret */ - "GET /user/migrations/:migration_id/repositories": { - parameters: MigrationsListReposForUserEndpoint; - request: MigrationsListReposForUserRequestOptions; - response: OctokitResponse; - }; + "GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", "get">; /** - * @see https://developer.github.com/v3/orgs/#list-organizations-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/enterprise-admin#list-provisioned-scim-groups-for-an-enterprise */ - "GET /user/orgs": { - parameters: OrgsListForAuthenticatedUserEndpoint; - request: OrgsListForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /scim/v2/enterprises/{enterprise}/Groups": Operation<"/scim/v2/enterprises/{enterprise}/Groups", "get">; /** - * @see https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/enterprise-admin#get-scim-provisioning-information-for-an-enterprise-group */ - "GET /user/public_emails": { - parameters: UsersListPublicEmailsForAuthenticatedEndpoint; - request: UsersListPublicEmailsForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}": Operation<"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}", "get">; /** - * @see https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/enterprise-admin#list-scim-provisioned-identities-for-an-enterprise */ - "GET /user/repos": { - parameters: ReposListForAuthenticatedUserEndpoint; - request: ReposListForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /scim/v2/enterprises/{enterprise}/Users": Operation<"/scim/v2/enterprises/{enterprise}/Users", "get">; /** - * @see https://developer.github.com/v3/repos/invitations/#list-repository-invitations-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/enterprise-admin#get-scim-provisioning-information-for-an-enterprise-user */ - "GET /user/repository_invitations": { - parameters: ReposListInvitationsForAuthenticatedUserEndpoint; - request: ReposListInvitationsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}": Operation<"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}", "get">; /** - * @see https://developer.github.com/v3/activity/starring/#list-repositories-starred-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/scim#list-scim-provisioned-identities */ - "GET /user/starred": { - parameters: ActivityListReposStarredByAuthenticatedUserEndpoint; - request: ActivityListReposStarredByAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /scim/v2/organizations/{org}/Users": Operation<"/scim/v2/organizations/{org}/Users", "get">; /** - * @see https://developer.github.com/v3/activity/starring/#check-if-a-repository-is-starred-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/scim#get-scim-provisioning-information-for-a-user */ - "GET /user/starred/:owner/:repo": { - parameters: ActivityCheckRepoIsStarredByAuthenticatedUserEndpoint; - request: ActivityCheckRepoIsStarredByAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /scim/v2/organizations/{org}/Users/{scim_user_id}": Operation<"/scim/v2/organizations/{org}/Users/{scim_user_id}", "get">; /** - * @see https://developer.github.com/v3/activity/watching/#list-repositories-watched-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/search#search-code */ - "GET /user/subscriptions": { - parameters: ActivityListWatchedReposForAuthenticatedUserEndpoint; - request: ActivityListWatchedReposForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /search/code": Operation<"/search/code", "get">; /** - * @see https://developer.github.com/v3/teams/#list-teams-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/search#search-commits */ - "GET /user/teams": { - parameters: TeamsListForAuthenticatedUserEndpoint; - request: TeamsListForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /search/commits": Operation<"/search/commits", "get", "cloak">; /** - * @see https://developer.github.com/v3/users/#list-users + * @see https://docs.github.com/rest/reference/search#search-issues-and-pull-requests */ - "GET /users": { - parameters: UsersListEndpoint; - request: UsersListRequestOptions; - response: OctokitResponse; - }; + "GET /search/issues": Operation<"/search/issues", "get">; /** - * @see https://developer.github.com/v3/users/#get-a-user + * @see https://docs.github.com/rest/reference/search#search-labels */ - "GET /users/:username": { - parameters: UsersGetByUsernameEndpoint; - request: UsersGetByUsernameRequestOptions; - response: OctokitResponse; - }; + "GET /search/labels": Operation<"/search/labels", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-events-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/search#search-repositories */ - "GET /users/:username/events": { - parameters: ActivityListEventsForAuthenticatedUserEndpoint; - request: ActivityListEventsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /search/repositories": Operation<"/search/repositories", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-organization-events-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/search#search-topics */ - "GET /users/:username/events/orgs/:org": { - parameters: ActivityListOrgEventsForAuthenticatedUserEndpoint; - request: ActivityListOrgEventsForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /search/topics": Operation<"/search/topics", "get", "mercy">; /** - * @see https://developer.github.com/v3/activity/events/#list-public-events-for-a-user + * @see https://docs.github.com/rest/reference/search#search-users */ - "GET /users/:username/events/public": { - parameters: ActivityListPublicEventsForUserEndpoint; - request: ActivityListPublicEventsForUserRequestOptions; - response: OctokitResponse; - }; + "GET /search/users": Operation<"/search/users", "get">; /** - * @see https://developer.github.com/v3/users/followers/#list-followers-of-a-user + * @see https://docs.github.com/rest/reference/teams/#get-a-team-legacy */ - "GET /users/:username/followers": { - parameters: UsersListFollowersForUserEndpoint; - request: UsersListFollowersForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}": Operation<"/teams/{team_id}", "get">; /** - * @see https://developer.github.com/v3/users/followers/#list-the-people-a-user-follows + * @see https://docs.github.com/rest/reference/teams#list-discussions-legacy */ - "GET /users/:username/following": { - parameters: UsersListFollowingForUserEndpoint; - request: UsersListFollowingForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/discussions": Operation<"/teams/{team_id}/discussions", "get">; /** - * @see https://developer.github.com/v3/users/followers/#check-if-a-user-follows-another-user + * @see https://docs.github.com/rest/reference/teams#get-a-discussion-legacy */ - "GET /users/:username/following/:target_user": { - parameters: UsersCheckFollowingForUserEndpoint; - request: UsersCheckFollowingForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/discussions/{discussion_number}": Operation<"/teams/{team_id}/discussions/{discussion_number}", "get">; /** - * @see https://developer.github.com/v3/gists/#list-gists-for-a-user + * @see https://docs.github.com/rest/reference/teams#list-discussion-comments-legacy */ - "GET /users/:username/gists": { - parameters: GistsListForUserEndpoint; - request: GistsListForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/discussions/{discussion_number}/comments": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments", "get">; /** - * @see https://developer.github.com/v3/users/gpg_keys/#list-gpg-keys-for-a-user + * @see https://docs.github.com/rest/reference/teams#get-a-discussion-comment-legacy */ - "GET /users/:username/gpg_keys": { - parameters: UsersListGpgKeysForUserEndpoint; - request: UsersListGpgKeysForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}", "get">; /** - * @see https://developer.github.com/v3/users/#get-contextual-information-for-a-user + * @see https://docs.github.com/rest/reference/reactions/#list-reactions-for-a-team-discussion-comment-legacy */ - "GET /users/:username/hovercard": { - parameters: UsersGetContextForUserEndpoint; - request: UsersGetContextForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/apps/#get-a-user-installation-for-the-authenticated-app + * @see https://docs.github.com/rest/reference/reactions/#list-reactions-for-a-team-discussion-legacy */ - "GET /users/:username/installation": { - parameters: AppsGetUserInstallationEndpoint; - request: AppsGetUserInstallationRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/discussions/{discussion_number}/reactions": Operation<"/teams/{team_id}/discussions/{discussion_number}/reactions", "get", "squirrel-girl">; /** - * @see https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user + * @see https://docs.github.com/rest/reference/teams#list-pending-team-invitations-legacy */ - "GET /users/:username/keys": { - parameters: UsersListPublicKeysForUserEndpoint; - request: UsersListPublicKeysForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/invitations": Operation<"/teams/{team_id}/invitations", "get">; /** - * @see https://developer.github.com/v3/orgs/#list-organizations-for-a-user + * @see https://docs.github.com/rest/reference/teams#list-team-members-legacy */ - "GET /users/:username/orgs": { - parameters: OrgsListForUserEndpoint; - request: OrgsListForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/members": Operation<"/teams/{team_id}/members", "get">; /** - * @see https://developer.github.com/v3/projects/#list-user-projects + * @see https://docs.github.com/rest/reference/teams#get-team-member-legacy */ - "GET /users/:username/projects": { - parameters: ProjectsListForUserEndpoint; - request: ProjectsListForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/members/{username}": Operation<"/teams/{team_id}/members/{username}", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-events-received-by-the-authenticated-user + * @see https://docs.github.com/rest/reference/teams#get-team-membership-for-a-user-legacy */ - "GET /users/:username/received_events": { - parameters: ActivityListReceivedEventsForUserEndpoint; - request: ActivityListReceivedEventsForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/memberships/{username}": Operation<"/teams/{team_id}/memberships/{username}", "get">; /** - * @see https://developer.github.com/v3/activity/events/#list-public-events-received-by-a-user + * @see https://docs.github.com/rest/reference/teams/#list-team-projects-legacy */ - "GET /users/:username/received_events/public": { - parameters: ActivityListReceivedPublicEventsForUserEndpoint; - request: ActivityListReceivedPublicEventsForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/projects": Operation<"/teams/{team_id}/projects", "get", "inertia">; /** - * @see https://developer.github.com/v3/repos/#list-repositories-for-a-user + * @see https://docs.github.com/rest/reference/teams/#check-team-permissions-for-a-project-legacy */ - "GET /users/:username/repos": { - parameters: ReposListForUserEndpoint; - request: ReposListForUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/projects/{project_id}": Operation<"/teams/{team_id}/projects/{project_id}", "get", "inertia">; /** - * @see https://developer.github.com/v3/billing/#get-github-actions-billing-for-a-user + * @see https://docs.github.com/rest/reference/teams/#list-team-repositories-legacy */ - "GET /users/:username/settings/billing/actions": { - parameters: BillingGetGithubActionsBillingUserEndpoint; - request: BillingGetGithubActionsBillingUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/repos": Operation<"/teams/{team_id}/repos", "get">; /** - * @see https://developer.github.com/v3/billing/#get-github-packages-billing-for-a-user + * @see https://docs.github.com/rest/reference/teams/#check-team-permissions-for-a-repository-legacy */ - "GET /users/:username/settings/billing/packages": { - parameters: BillingGetGithubPackagesBillingUserEndpoint; - request: BillingGetGithubPackagesBillingUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/repos/{owner}/{repo}": Operation<"/teams/{team_id}/repos/{owner}/{repo}", "get">; /** - * @see https://developer.github.com/v3/billing/#get-shared-storage-billing-for-a-user + * @see https://docs.github.com/rest/reference/teams#list-idp-groups-for-a-team-legacy */ - "GET /users/:username/settings/billing/shared-storage": { - parameters: BillingGetSharedStorageBillingUserEndpoint; - request: BillingGetSharedStorageBillingUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/team-sync/group-mappings": Operation<"/teams/{team_id}/team-sync/group-mappings", "get">; /** - * @see https://developer.github.com/v3/activity/starring/#list-repositories-starred-by-a-user + * @see https://docs.github.com/rest/reference/teams/#list-child-teams-legacy */ - "GET /users/:username/starred": { - parameters: ActivityListReposStarredByUserEndpoint; - request: ActivityListReposStarredByUserRequestOptions; - response: OctokitResponse; - }; + "GET /teams/{team_id}/teams": Operation<"/teams/{team_id}/teams", "get">; /** - * @see https://developer.github.com/v3/activity/watching/#list-repositories-watched-by-a-user + * @see https://docs.github.com/rest/reference/users#get-the-authenticated-user */ - "GET /users/:username/subscriptions": { - parameters: ActivityListReposWatchedByUserEndpoint; - request: ActivityListReposWatchedByUserRequestOptions; - response: OctokitResponse; - }; + "GET /user": Operation<"/user", "get">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#reset-a-token + * @see https://docs.github.com/rest/reference/users#list-users-blocked-by-the-authenticated-user */ - "PATCH /applications/:client_id/token": { - parameters: AppsResetTokenEndpoint; - request: AppsResetTokenRequestOptions; - response: OctokitResponse; - }; + "GET /user/blocks": Operation<"/user/blocks", "get">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization + * @see https://docs.github.com/rest/reference/users#check-if-a-user-is-blocked-by-the-authenticated-user */ - "PATCH /authorizations/:authorization_id": { - parameters: OauthAuthorizationsUpdateAuthorizationEndpoint; - request: OauthAuthorizationsUpdateAuthorizationRequestOptions; - response: OctokitResponse; - }; + "GET /user/blocks/{username}": Operation<"/user/blocks/{username}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#update-a-self-hosted-runner-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/users#list-email-addresses-for-the-authenticated-user */ - "PATCH /enterprises/:enterprise/actions/runner-groups/:runner_group_id": { - parameters: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseEndpoint; - request: EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /user/emails": Operation<"/user/emails", "get">; /** - * @see https://developer.github.com/v3/gists/#update-a-gist + * @see https://docs.github.com/rest/reference/users#list-followers-of-the-authenticated-user */ - "PATCH /gists/:gist_id": { - parameters: GistsUpdateEndpoint; - request: GistsUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /user/followers": Operation<"/user/followers", "get">; /** - * @see https://developer.github.com/v3/gists/comments/#update-a-gist-comment + * @see https://docs.github.com/rest/reference/users#list-the-people-the-authenticated-user-follows */ - "PATCH /gists/:gist_id/comments/:comment_id": { - parameters: GistsUpdateCommentEndpoint; - request: GistsUpdateCommentRequestOptions; - response: OctokitResponse; - }; + "GET /user/following": Operation<"/user/following", "get">; /** - * @see https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read + * @see https://docs.github.com/rest/reference/users#check-if-a-person-is-followed-by-the-authenticated-user */ - "PATCH /notifications/threads/:thread_id": { - parameters: ActivityMarkThreadAsReadEndpoint; - request: ActivityMarkThreadAsReadRequestOptions; - response: OctokitResponse; - }; + "GET /user/following/{username}": Operation<"/user/following/{username}", "get">; /** - * @see https://developer.github.com/v3/orgs/#update-an-organization + * @see https://docs.github.com/rest/reference/users#list-gpg-keys-for-the-authenticated-user */ - "PATCH /orgs/:org": { - parameters: OrgsUpdateEndpoint; - request: OrgsUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /user/gpg_keys": Operation<"/user/gpg_keys", "get">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#update-a-self-hosted-runner-group-for-an-organization + * @see https://docs.github.com/rest/reference/users#get-a-gpg-key-for-the-authenticated-user */ - "PATCH /orgs/:org/actions/runner-groups/:runner_group_id": { - parameters: ActionsUpdateSelfHostedRunnerGroupForOrgEndpoint; - request: ActionsUpdateSelfHostedRunnerGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "GET /user/gpg_keys/{gpg_key_id}": Operation<"/user/gpg_keys/{gpg_key_id}", "get">; /** - * @see https://developer.github.com/v3/orgs/hooks/#update-an-organization-webhook + * @see https://docs.github.com/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token */ - "PATCH /orgs/:org/hooks/:hook_id": { - parameters: OrgsUpdateWebhookEndpoint; - request: OrgsUpdateWebhookRequestOptions; - response: OctokitResponse; - }; + "GET /user/installations": Operation<"/user/installations", "get">; /** - * @see https://developer.github.com/v3/teams/#update-a-team + * @see https://docs.github.com/rest/reference/apps#list-repositories-accessible-to-the-user-access-token */ - "PATCH /orgs/:org/teams/:team_slug": { - parameters: TeamsUpdateInOrgEndpoint; - request: TeamsUpdateInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /user/installations/{installation_id}/repositories": Operation<"/user/installations/{installation_id}/repositories", "get">; /** - * @see https://developer.github.com/v3/teams/discussions/#update-a-discussion + * @see https://docs.github.com/rest/reference/interactions#get-interaction-restrictions-for-your-public-repositories */ - "PATCH /orgs/:org/teams/:team_slug/discussions/:discussion_number": { - parameters: TeamsUpdateDiscussionInOrgEndpoint; - request: TeamsUpdateDiscussionInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /user/interaction-limits": Operation<"/user/interaction-limits", "get">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#update-a-discussion-comment + * @see https://docs.github.com/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user */ - "PATCH /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number": { - parameters: TeamsUpdateDiscussionCommentInOrgEndpoint; - request: TeamsUpdateDiscussionCommentInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /user/issues": Operation<"/user/issues", "get">; /** - * @see https://developer.github.com/v3/teams/team_sync/#create-or-update-idp-group-connections + * @see https://docs.github.com/rest/reference/users#list-public-ssh-keys-for-the-authenticated-user */ - "PATCH /orgs/:org/teams/:team_slug/team-sync/group-mappings": { - parameters: TeamsCreateOrUpdateIdPGroupConnectionsInOrgEndpoint; - request: TeamsCreateOrUpdateIdPGroupConnectionsInOrgRequestOptions; - response: OctokitResponse; - }; + "GET /user/keys": Operation<"/user/keys", "get">; /** - * @see https://developer.github.com/v3/projects/#update-a-project + * @see https://docs.github.com/rest/reference/users#get-a-public-ssh-key-for-the-authenticated-user */ - "PATCH /projects/:project_id": { - parameters: ProjectsUpdateEndpoint; - request: ProjectsUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /user/keys/{key_id}": Operation<"/user/keys/{key_id}", "get">; /** - * @see https://developer.github.com/v3/projects/columns/#update-a-project-column + * @see https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user */ - "PATCH /projects/columns/:column_id": { - parameters: ProjectsUpdateColumnEndpoint; - request: ProjectsUpdateColumnRequestOptions; - response: OctokitResponse; - }; + "GET /user/marketplace_purchases": Operation<"/user/marketplace_purchases", "get">; /** - * @see https://developer.github.com/v3/projects/cards/#update-a-project-card + * @see https://docs.github.com/rest/reference/apps#list-subscriptions-for-the-authenticated-user-stubbed */ - "PATCH /projects/columns/cards/:card_id": { - parameters: ProjectsUpdateCardEndpoint; - request: ProjectsUpdateCardRequestOptions; - response: OctokitResponse; - }; + "GET /user/marketplace_purchases/stubbed": Operation<"/user/marketplace_purchases/stubbed", "get">; /** - * @see https://developer.github.com/v3/repos/#update-a-repository + * @see https://docs.github.com/rest/reference/orgs#list-organization-memberships-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo": { - parameters: ReposUpdateEndpoint; - request: ReposUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /user/memberships/orgs": Operation<"/user/memberships/orgs", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#update-pull-request-review-protection + * @see https://docs.github.com/rest/reference/orgs#get-an-organization-membership-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews": { - parameters: ReposUpdatePullRequestReviewProtectionEndpoint; - request: ReposUpdatePullRequestReviewProtectionRequestOptions; - response: OctokitResponse; - }; + "GET /user/memberships/orgs/{org}": Operation<"/user/memberships/orgs/{org}", "get">; /** - * @see https://developer.github.com/v3/repos/branches/#update-status-check-potection + * @see https://docs.github.com/rest/reference/migrations#list-user-migrations */ - "PATCH /repos/:owner/:repo/branches/:branch/protection/required_status_checks": { - parameters: ReposUpdateStatusCheckPotectionEndpoint; - request: ReposUpdateStatusCheckPotectionRequestOptions; - response: OctokitResponse; - }; + "GET /user/migrations": Operation<"/user/migrations", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/checks/runs/#update-a-check-run + * @see https://docs.github.com/rest/reference/migrations#get-a-user-migration-status */ - "PATCH /repos/:owner/:repo/check-runs/:check_run_id": { - parameters: ChecksUpdateEndpoint; - request: ChecksUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /user/migrations/{migration_id}": Operation<"/user/migrations/{migration_id}", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/checks/suites/#update-repository-preferences-for-check-suites + * @see https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive */ - "PATCH /repos/:owner/:repo/check-suites/preferences": { - parameters: ChecksSetSuitesPreferencesEndpoint; - request: ChecksSetSuitesPreferencesRequestOptions; - response: OctokitResponse; - }; + "GET /user/migrations/{migration_id}/archive": Operation<"/user/migrations/{migration_id}/archive", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/code-scanning/#upload-a-code-scanning-alert + * @see https://docs.github.com/rest/reference/migrations#list-repositories-for-a-user-migration */ - "PATCH /repos/:owner/:repo/code-scanning/alerts/:alert_number": { - parameters: CodeScanningUpdateAlertEndpoint; - request: CodeScanningUpdateAlertRequestOptions; - response: OctokitResponse; - }; + "GET /user/migrations/{migration_id}/repositories": Operation<"/user/migrations/{migration_id}/repositories", "get", "wyandotte">; /** - * @see https://developer.github.com/v3/repos/comments/#update-a-commit-comment + * @see https://docs.github.com/rest/reference/orgs#list-organizations-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/comments/:comment_id": { - parameters: ReposUpdateCommitCommentEndpoint; - request: ReposUpdateCommitCommentRequestOptions; - response: OctokitResponse; - }; + "GET /user/orgs": Operation<"/user/orgs", "get">; /** - * @see https://developer.github.com/v3/git/refs/#update-a-reference + * @see https://docs.github.com/rest/reference/packages#get-a-package-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/git/refs/:ref": { - parameters: GitUpdateRefEndpoint; - request: GitUpdateRefRequestOptions; - response: OctokitResponse; - }; + "GET /user/packages/{package_type}/{package_name}": Operation<"/user/packages/{package_type}/{package_name}", "get">; /** - * @see https://developer.github.com/v3/repos/hooks/#update-a-repository-webhook + * @see https://docs.github.com/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user */ - "PATCH /repos/:owner/:repo/hooks/:hook_id": { - parameters: ReposUpdateWebhookEndpoint; - request: ReposUpdateWebhookRequestOptions; - response: OctokitResponse; - }; + "GET /user/packages/{package_type}/{package_name}/versions": Operation<"/user/packages/{package_type}/{package_name}/versions", "get">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#update-an-import + * @see https://docs.github.com/rest/reference/packages#get-a-package-version-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/import": { - parameters: MigrationsUpdateImportEndpoint; - request: MigrationsUpdateImportRequestOptions; - response: OctokitResponse; - }; + "GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}": Operation<"/user/packages/{package_type}/{package_name}/versions/{package_version_id}", "get">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#map-a-commit-author + * @see https://docs.github.com/rest/reference/users#list-public-email-addresses-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/import/authors/:author_id": { - parameters: MigrationsMapCommitAuthorEndpoint; - request: MigrationsMapCommitAuthorRequestOptions; - response: OctokitResponse; - }; + "GET /user/public_emails": Operation<"/user/public_emails", "get">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#update-git-lfs-preference + * @see https://docs.github.com/rest/reference/repos#list-repositories-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/import/lfs": { - parameters: MigrationsSetLfsPreferenceEndpoint; - request: MigrationsSetLfsPreferenceRequestOptions; - response: OctokitResponse; - }; + "GET /user/repos": Operation<"/user/repos", "get">; /** - * @see https://developer.github.com/v3/repos/invitations/#update-a-repository-invitation + * @see https://docs.github.com/rest/reference/repos#list-repository-invitations-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/invitations/:invitation_id": { - parameters: ReposUpdateInvitationEndpoint; - request: ReposUpdateInvitationRequestOptions; - response: OctokitResponse; - }; + "GET /user/repository_invitations": Operation<"/user/repository_invitations", "get">; /** - * @see https://developer.github.com/v3/issues/#update-an-issue + * @see https://docs.github.com/rest/reference/activity#list-repositories-starred-by-the-authenticated-user */ - "PATCH /repos/:owner/:repo/issues/:issue_number": { - parameters: IssuesUpdateEndpoint; - request: IssuesUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /user/starred": Operation<"/user/starred", "get">; /** - * @see https://developer.github.com/v3/issues/comments/#update-an-issue-comment + * @see https://docs.github.com/rest/reference/activity#check-if-a-repository-is-starred-by-the-authenticated-user */ - "PATCH /repos/:owner/:repo/issues/comments/:comment_id": { - parameters: IssuesUpdateCommentEndpoint; - request: IssuesUpdateCommentRequestOptions; - response: OctokitResponse; - }; + "GET /user/starred/{owner}/{repo}": Operation<"/user/starred/{owner}/{repo}", "get">; /** - * @see https://developer.github.com/v3/issues/labels/#update-a-label + * @see https://docs.github.com/rest/reference/activity#list-repositories-watched-by-the-authenticated-user */ - "PATCH /repos/:owner/:repo/labels/:name": { - parameters: IssuesUpdateLabelEndpoint; - request: IssuesUpdateLabelRequestOptions; - response: OctokitResponse; - }; + "GET /user/subscriptions": Operation<"/user/subscriptions", "get">; /** - * @see https://developer.github.com/v3/issues/milestones/#update-a-milestone + * @see https://docs.github.com/rest/reference/teams#list-teams-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/milestones/:milestone_number": { - parameters: IssuesUpdateMilestoneEndpoint; - request: IssuesUpdateMilestoneRequestOptions; - response: OctokitResponse; - }; + "GET /user/teams": Operation<"/user/teams", "get">; /** - * @see https://developer.github.com/v3/pulls/#update-a-pull-request + * @see https://docs.github.com/rest/reference/users#list-users */ - "PATCH /repos/:owner/:repo/pulls/:pull_number": { - parameters: PullsUpdateEndpoint; - request: PullsUpdateRequestOptions; - response: OctokitResponse; - }; + "GET /users": Operation<"/users", "get">; /** - * @see https://developer.github.com/v3/pulls/comments/#update-a-review-comment-for-a-pull-request + * @see https://docs.github.com/rest/reference/users#get-a-user */ - "PATCH /repos/:owner/:repo/pulls/comments/:comment_id": { - parameters: PullsUpdateReviewCommentEndpoint; - request: PullsUpdateReviewCommentRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}": Operation<"/users/{username}", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#update-a-release + * @see https://docs.github.com/rest/reference/activity#list-events-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/releases/:release_id": { - parameters: ReposUpdateReleaseEndpoint; - request: ReposUpdateReleaseRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/events": Operation<"/users/{username}/events", "get">; /** - * @see https://developer.github.com/v3/repos/releases/#update-a-release-asset + * @see https://docs.github.com/rest/reference/activity#list-organization-events-for-the-authenticated-user */ - "PATCH /repos/:owner/:repo/releases/assets/:asset_id": { - parameters: ReposUpdateReleaseAssetEndpoint; - request: ReposUpdateReleaseAssetRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/events/orgs/{org}": Operation<"/users/{username}/events/orgs/{org}", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#update-an-attribute-for-a-scim-enterprise-group + * @see https://docs.github.com/rest/reference/activity#list-public-events-for-a-user */ - "PATCH /scim/v2/enterprises/:enterprise/Groups/:scim_group_id": { - parameters: EnterpriseAdminUpdateAttributeForEnterpriseGroupEndpoint; - request: EnterpriseAdminUpdateAttributeForEnterpriseGroupRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/events/public": Operation<"/users/{username}/events/public", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#update-an-attribute-for-a-scim-enterprise-user + * @see https://docs.github.com/rest/reference/users#list-followers-of-a-user */ - "PATCH /scim/v2/enterprises/:enterprise/Users/:scim_user_id": { - parameters: EnterpriseAdminUpdateAttributeForEnterpriseUserEndpoint; - request: EnterpriseAdminUpdateAttributeForEnterpriseUserRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/followers": Operation<"/users/{username}/followers", "get">; /** - * @see https://developer.github.com/v3/scim/#update-an-attribute-for-a-scim-user + * @see https://docs.github.com/rest/reference/users#list-the-people-a-user-follows */ - "PATCH /scim/v2/organizations/:org/Users/:scim_user_id": { - parameters: ScimUpdateAttributeForUserEndpoint; - request: ScimUpdateAttributeForUserRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/following": Operation<"/users/{username}/following", "get">; /** - * @see https://developer.github.com/v3/teams/#update-a-team-legacy + * @see https://docs.github.com/rest/reference/users#check-if-a-user-follows-another-user */ - "PATCH /teams/:team_id": { - parameters: TeamsUpdateLegacyEndpoint; - request: TeamsUpdateLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/following/{target_user}": Operation<"/users/{username}/following/{target_user}", "get">; /** - * @see https://developer.github.com/v3/teams/discussions/#update-a-discussion-legacy + * @see https://docs.github.com/rest/reference/gists#list-gists-for-a-user */ - "PATCH /teams/:team_id/discussions/:discussion_number": { - parameters: TeamsUpdateDiscussionLegacyEndpoint; - request: TeamsUpdateDiscussionLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/gists": Operation<"/users/{username}/gists", "get">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#update-a-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/users#list-gpg-keys-for-a-user */ - "PATCH /teams/:team_id/discussions/:discussion_number/comments/:comment_number": { - parameters: TeamsUpdateDiscussionCommentLegacyEndpoint; - request: TeamsUpdateDiscussionCommentLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/gpg_keys": Operation<"/users/{username}/gpg_keys", "get">; /** - * @see https://developer.github.com/v3/teams/team_sync/#create-or-update-idp-group-connections-legacy + * @see https://docs.github.com/rest/reference/users#get-contextual-information-for-a-user */ - "PATCH /teams/:team_id/team-sync/group-mappings": { - parameters: TeamsCreateOrUpdateIdPGroupConnectionsLegacyEndpoint; - request: TeamsCreateOrUpdateIdPGroupConnectionsLegacyRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/hovercard": Operation<"/users/{username}/hovercard", "get">; /** - * @see https://developer.github.com/v3/users/#update-the-authenticated-user + * @see https://docs.github.com/rest/reference/apps#get-a-user-installation-for-the-authenticated-app */ - "PATCH /user": { - parameters: UsersUpdateAuthenticatedEndpoint; - request: UsersUpdateAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/installation": Operation<"/users/{username}/installation", "get">; /** - * @see https://developer.github.com/v3/users/emails/#set-primary-email-visibility-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/users#list-public-keys-for-a-user */ - "PATCH /user/email/visibility": { - parameters: UsersSetPrimaryEmailVisibilityForAuthenticatedEndpoint; - request: UsersSetPrimaryEmailVisibilityForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/keys": Operation<"/users/{username}/keys", "get">; /** - * @see https://developer.github.com/v3/orgs/members/#update-an-organization-membership-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/orgs#list-organizations-for-a-user */ - "PATCH /user/memberships/orgs/:org": { - parameters: OrgsUpdateMembershipForAuthenticatedUserEndpoint; - request: OrgsUpdateMembershipForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/orgs": Operation<"/users/{username}/orgs", "get">; /** - * @see https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation + * @see https://docs.github.com/rest/reference/packages#get-a-package-for-a-user */ - "PATCH /user/repository_invitations/:invitation_id": { - parameters: ReposAcceptInvitationEndpoint; - request: ReposAcceptInvitationRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/packages/{package_type}/{package_name}": Operation<"/users/{username}/packages/{package_type}/{package_name}", "get">; /** - * @see https://developer.github.com/v3/apps/#create-a-github-app-from-a-manifest + * @see https://docs.github.com/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-a-user */ - "POST /app-manifests/:code/conversions": { - parameters: AppsCreateFromManifestEndpoint; - request: AppsCreateFromManifestRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/packages/{package_type}/{package_name}/versions": Operation<"/users/{username}/packages/{package_type}/{package_name}/versions", "get">; /** - * @see https://developer.github.com/v3/apps/#create-an-installation-access-token-for-an-app + * @see https://docs.github.com/rest/reference/packages#get-a-package-version-for-a-user */ - "POST /app/installations/:installation_id/access_tokens": { - parameters: AppsCreateInstallationAccessTokenEndpoint; - request: AppsCreateInstallationAccessTokenRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}": Operation<"/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}", "get">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#check-a-token + * @see https://docs.github.com/rest/reference/projects#list-user-projects */ - "POST /applications/:client_id/token": { - parameters: AppsCheckTokenEndpoint; - request: AppsCheckTokenRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/projects": Operation<"/users/{username}/projects", "get", "inertia">; /** - * @see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization + * @see https://docs.github.com/rest/reference/activity#list-events-received-by-the-authenticated-user */ - "POST /applications/:client_id/tokens/:access_token": { - parameters: AppsResetAuthorizationEndpoint; - request: AppsResetAuthorizationRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/received_events": Operation<"/users/{username}/received_events", "get">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization + * @see https://docs.github.com/rest/reference/activity#list-public-events-received-by-a-user */ - "POST /authorizations": { - parameters: OauthAuthorizationsCreateAuthorizationEndpoint; - request: OauthAuthorizationsCreateAuthorizationRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/received_events/public": Operation<"/users/{username}/received_events/public", "get">; /** - * @see https://developer.github.com/v3/apps/installations/#create-a-content-attachment + * @see https://docs.github.com/rest/reference/repos#list-repositories-for-a-user */ - "POST /content_references/:content_reference_id/attachments": { - parameters: AppsCreateContentAttachmentEndpoint; - request: AppsCreateContentAttachmentRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/repos": Operation<"/users/{username}/repos", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#create-self-hosted-runner-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/billing#get-github-actions-billing-for-a-user */ - "POST /enterprises/:enterprise/actions/runner-groups": { - parameters: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseEndpoint; - request: EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/settings/billing/actions": Operation<"/users/{username}/settings/billing/actions", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#create-a-registration-token-for-an-enterprise + * @see https://docs.github.com/rest/reference/billing#get-github-packages-billing-for-a-user */ - "POST /enterprises/:enterprise/actions/runners/registration-token": { - parameters: EnterpriseAdminCreateRegistrationTokenForEnterpriseEndpoint; - request: EnterpriseAdminCreateRegistrationTokenForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/settings/billing/packages": Operation<"/users/{username}/settings/billing/packages", "get">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#create-a-remove-token-for-an-enterprise + * @see https://docs.github.com/rest/reference/billing#get-shared-storage-billing-for-a-user */ - "POST /enterprises/:enterprise/actions/runners/remove-token": { - parameters: EnterpriseAdminCreateRemoveTokenForEnterpriseEndpoint; - request: EnterpriseAdminCreateRemoveTokenForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/settings/billing/shared-storage": Operation<"/users/{username}/settings/billing/shared-storage", "get">; /** - * @see https://developer.github.com/v3/gists/#create-a-gist + * @see https://docs.github.com/rest/reference/activity#list-repositories-starred-by-a-user */ - "POST /gists": { - parameters: GistsCreateEndpoint; - request: GistsCreateRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/starred": Operation<"/users/{username}/starred", "get">; /** - * @see https://developer.github.com/v3/gists/comments/#create-a-gist-comment + * @see https://docs.github.com/rest/reference/activity#list-repositories-watched-by-a-user */ - "POST /gists/:gist_id/comments": { - parameters: GistsCreateCommentEndpoint; - request: GistsCreateCommentRequestOptions; - response: OctokitResponse; - }; + "GET /users/{username}/subscriptions": Operation<"/users/{username}/subscriptions", "get">; /** - * @see https://developer.github.com/v3/gists/#fork-a-gist + * @see */ - "POST /gists/:gist_id/forks": { - parameters: GistsForkEndpoint; - request: GistsForkRequestOptions; - response: OctokitResponse; - }; + "GET /zen": Operation<"/zen", "get">; /** - * @see https://developer.github.com/v3/markdown/#render-a-markdown-document + * @see https://docs.github.com/rest/reference/apps#update-a-webhook-configuration-for-an-app */ - "POST /markdown": { - parameters: MarkdownRenderEndpoint; - request: MarkdownRenderRequestOptions; - response: OctokitResponse; - }; + "PATCH /app/hook/config": Operation<"/app/hook/config", "patch">; /** - * @see https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode + * @see https://docs.github.com/rest/reference/apps#reset-a-token */ - "POST /markdown/raw": { - parameters: MarkdownRenderRawEndpoint; - request: MarkdownRenderRawRequestOptions; - response: OctokitResponse; - }; + "PATCH /applications/{client_id}/token": Operation<"/applications/{client_id}/token", "patch">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#create-a-self-hosted-runner-group-for-an-organization + * @see https://docs.github.com/rest/reference/oauth-authorizations#update-an-existing-authorization */ - "POST /orgs/:org/actions/runner-groups": { - parameters: ActionsCreateSelfHostedRunnerGroupForOrgEndpoint; - request: ActionsCreateSelfHostedRunnerGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /authorizations/{authorization_id}": Operation<"/authorizations/{authorization_id}", "patch">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#create-a-registration-token-for-an-organization + * @see https://docs.github.com/rest/reference/enterprise-admin#update-a-self-hosted-runner-group-for-an-enterprise */ - "POST /orgs/:org/actions/runners/registration-token": { - parameters: ActionsCreateRegistrationTokenForOrgEndpoint; - request: ActionsCreateRegistrationTokenForOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}", "patch">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#create-a-remove-token-for-an-organization + * @see https://docs.github.com/rest/reference/gists/#update-a-gist */ - "POST /orgs/:org/actions/runners/remove-token": { - parameters: ActionsCreateRemoveTokenForOrgEndpoint; - request: ActionsCreateRemoveTokenForOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /gists/{gist_id}": Operation<"/gists/{gist_id}", "patch">; /** - * @see https://developer.github.com/v3/orgs/hooks/#create-an-organization-webhook + * @see https://docs.github.com/rest/reference/gists#update-a-gist-comment */ - "POST /orgs/:org/hooks": { - parameters: OrgsCreateWebhookEndpoint; - request: OrgsCreateWebhookRequestOptions; - response: OctokitResponse; - }; + "PATCH /gists/{gist_id}/comments/{comment_id}": Operation<"/gists/{gist_id}/comments/{comment_id}", "patch">; /** - * @see https://developer.github.com/v3/orgs/hooks/#ping-an-organization-webhook + * @see https://docs.github.com/rest/reference/activity#mark-a-thread-as-read */ - "POST /orgs/:org/hooks/:hook_id/pings": { - parameters: OrgsPingWebhookEndpoint; - request: OrgsPingWebhookRequestOptions; - response: OctokitResponse; - }; + "PATCH /notifications/threads/{thread_id}": Operation<"/notifications/threads/{thread_id}", "patch">; /** - * @see https://developer.github.com/v3/orgs/members/#create-an-organization-invitation + * @see https://docs.github.com/rest/reference/orgs/#update-an-organization */ - "POST /orgs/:org/invitations": { - parameters: OrgsCreateInvitationEndpoint; - request: OrgsCreateInvitationRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}": Operation<"/orgs/{org}", "patch">; /** - * @see https://developer.github.com/v3/migrations/orgs/#start-an-organization-migration + * @see https://docs.github.com/rest/reference/actions#update-a-self-hosted-runner-group-for-an-organization */ - "POST /orgs/:org/migrations": { - parameters: MigrationsStartForOrgEndpoint; - request: MigrationsStartForOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}", "patch">; /** - * @see https://developer.github.com/v3/projects/#create-an-organization-project + * @see https://docs.github.com/rest/reference/orgs#update-an-organization-webhook */ - "POST /orgs/:org/projects": { - parameters: ProjectsCreateForOrgEndpoint; - request: ProjectsCreateForOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/hooks/{hook_id}": Operation<"/orgs/{org}/hooks/{hook_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/#create-an-organization-repository + * @see https://docs.github.com/rest/reference/orgs#update-a-webhook-configuration-for-an-organization */ - "POST /orgs/:org/repos": { - parameters: ReposCreateInOrgEndpoint; - request: ReposCreateInOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/hooks/{hook_id}/config": Operation<"/orgs/{org}/hooks/{hook_id}/config", "patch">; /** - * @see https://developer.github.com/v3/teams/#create-a-team + * @see https://docs.github.com/rest/reference/teams#update-a-team */ - "POST /orgs/:org/teams": { - parameters: TeamsCreateEndpoint; - request: TeamsCreateRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/teams/{team_slug}": Operation<"/orgs/{org}/teams/{team_slug}", "patch">; /** - * @see https://developer.github.com/v3/teams/discussions/#create-a-discussion + * @see https://docs.github.com/rest/reference/teams#update-a-discussion */ - "POST /orgs/:org/teams/:team_slug/discussions": { - parameters: TeamsCreateDiscussionInOrgEndpoint; - request: TeamsCreateDiscussionInOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}", "patch">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#create-a-discussion-comment + * @see https://docs.github.com/rest/reference/teams#update-a-discussion-comment */ - "POST /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments": { - parameters: TeamsCreateDiscussionCommentInOrgEndpoint; - request: TeamsCreateDiscussionCommentInOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}", "patch">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment + * @see https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections */ - "POST /orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions": { - parameters: ReactionsCreateForTeamDiscussionCommentInOrgEndpoint; - request: ReactionsCreateForTeamDiscussionCommentInOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings": Operation<"/orgs/{org}/teams/{team_slug}/team-sync/group-mappings", "patch">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion + * @see https://docs.github.com/rest/reference/projects#update-a-project-card */ - "POST /orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions": { - parameters: ReactionsCreateForTeamDiscussionInOrgEndpoint; - request: ReactionsCreateForTeamDiscussionInOrgRequestOptions; - response: OctokitResponse; - }; + "PATCH /projects/columns/cards/{card_id}": Operation<"/projects/columns/cards/{card_id}", "patch", "inertia">; /** - * @see https://developer.github.com/v3/projects/columns/#create-a-project-column + * @see https://docs.github.com/rest/reference/projects#update-a-project-column */ - "POST /projects/:project_id/columns": { - parameters: ProjectsCreateColumnEndpoint; - request: ProjectsCreateColumnRequestOptions; - response: OctokitResponse; - }; + "PATCH /projects/columns/{column_id}": Operation<"/projects/columns/{column_id}", "patch", "inertia">; /** - * @see https://developer.github.com/v3/projects/cards/#create-a-project-card + * @see https://docs.github.com/rest/reference/projects#update-a-project */ - "POST /projects/columns/:column_id/cards": { - parameters: ProjectsCreateCardEndpoint; - request: ProjectsCreateCardRequestOptions; - response: OctokitResponse; - }; + "PATCH /projects/{project_id}": Operation<"/projects/{project_id}", "patch", "inertia">; /** - * @see https://developer.github.com/v3/projects/columns/#move-a-project-column + * @see https://docs.github.com/rest/reference/repos/#update-a-repository */ - "POST /projects/columns/:column_id/moves": { - parameters: ProjectsMoveColumnEndpoint; - request: ProjectsMoveColumnRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}": Operation<"/repos/{owner}/{repo}", "patch">; /** - * @see https://developer.github.com/v3/projects/cards/#move-a-project-card + * @see https://docs.github.com/rest/reference/repos#update-pull-request-review-protection */ - "POST /projects/columns/cards/:card_id/moves": { - parameters: ProjectsMoveCardEndpoint; - request: ProjectsMoveCardRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews", "patch">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#create-a-registration-token-for-a-repository + * @see https://docs.github.com/rest/reference/repos#update-status-check-potection */ - "POST /repos/:owner/:repo/actions/runners/registration-token": { - parameters: ActionsCreateRegistrationTokenForRepoEndpoint; - request: ActionsCreateRegistrationTokenForRepoRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", "patch">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runners/#create-a-remove-token-for-a-repository + * @see https://docs.github.com/rest/reference/checks#update-a-check-run */ - "POST /repos/:owner/:repo/actions/runners/remove-token": { - parameters: ActionsCreateRemoveTokenForRepoEndpoint; - request: ActionsCreateRemoveTokenForRepoRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}": Operation<"/repos/{owner}/{repo}/check-runs/{check_run_id}", "patch">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#cancel-a-workflow-run + * @see https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites */ - "POST /repos/:owner/:repo/actions/runs/:run_id/cancel": { - parameters: ActionsCancelWorkflowRunEndpoint; - request: ActionsCancelWorkflowRunRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/check-suites/preferences": Operation<"/repos/{owner}/{repo}/check-suites/preferences", "patch">; /** - * @see https://developer.github.com/v3/actions/workflow-runs/#re-run-a-workflow + * @see https://docs.github.com/rest/reference/code-scanning#update-a-code-scanning-alert */ - "POST /repos/:owner/:repo/actions/runs/:run_id/rerun": { - parameters: ActionsReRunWorkflowEndpoint; - request: ActionsReRunWorkflowRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", "patch">; /** - * @see https://developer.github.com/v3/actions/workflows/#create-a-workflow-dispatch-event + * @see https://docs.github.com/rest/reference/repos#update-a-commit-comment */ - "POST /repos/:owner/:repo/actions/workflows/:workflow_id/dispatches": { - parameters: ActionsCreateWorkflowDispatchEndpoint; - request: ActionsCreateWorkflowDispatchRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/comments/{comment_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/branches/#set-admin-branch-protection + * @see https://docs.github.com/rest/reference/git#update-a-reference */ - "POST /repos/:owner/:repo/branches/:branch/protection/enforce_admins": { - parameters: ReposSetAdminBranchProtectionEndpoint; - request: ReposSetAdminBranchProtectionRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/git/refs/{ref}": Operation<"/repos/{owner}/{repo}/git/refs/{ref}", "patch">; /** - * @see https://developer.github.com/v3/repos/branches/#create-commit-signature-protection + * @see https://docs.github.com/rest/reference/repos#update-a-repository-webhook */ - "POST /repos/:owner/:repo/branches/:branch/protection/required_signatures": { - parameters: ReposCreateCommitSignatureProtectionEndpoint; - request: ReposCreateCommitSignatureProtectionRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/hooks/{hook_id}": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/branches/#add-status-check-contexts + * @see https://docs.github.com/rest/reference/repos#update-a-webhook-configuration-for-a-repository */ - "POST /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts": { - parameters: ReposAddStatusCheckContextsEndpoint; - request: ReposAddStatusCheckContextsRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/config", "patch">; /** - * @see https://developer.github.com/v3/repos/branches/#add-app-access-restrictions + * @see https://docs.github.com/rest/reference/migrations#update-an-import */ - "POST /repos/:owner/:repo/branches/:branch/protection/restrictions/apps": { - parameters: ReposAddAppAccessRestrictionsEndpoint; - request: ReposAddAppAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "patch">; /** - * @see https://developer.github.com/v3/repos/branches/#add-team-access-restrictions + * @see https://docs.github.com/rest/reference/migrations#map-a-commit-author */ - "POST /repos/:owner/:repo/branches/:branch/protection/restrictions/teams": { - parameters: ReposAddTeamAccessRestrictionsEndpoint; - request: ReposAddTeamAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/import/authors/{author_id}": Operation<"/repos/{owner}/{repo}/import/authors/{author_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/branches/#add-user-access-restrictions + * @see https://docs.github.com/rest/reference/migrations#update-git-lfs-preference */ - "POST /repos/:owner/:repo/branches/:branch/protection/restrictions/users": { - parameters: ReposAddUserAccessRestrictionsEndpoint; - request: ReposAddUserAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/import/lfs": Operation<"/repos/{owner}/{repo}/import/lfs", "patch">; /** - * @see https://developer.github.com/v3/checks/runs/#create-a-check-run + * @see https://docs.github.com/rest/reference/repos#update-a-repository-invitation */ - "POST /repos/:owner/:repo/check-runs": { - parameters: ChecksCreateEndpoint; - request: ChecksCreateRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}": Operation<"/repos/{owner}/{repo}/invitations/{invitation_id}", "patch">; /** - * @see https://developer.github.com/v3/checks/suites/#create-a-check-suite + * @see https://docs.github.com/rest/reference/issues#update-an-issue-comment */ - "POST /repos/:owner/:repo/check-suites": { - parameters: ChecksCreateSuiteEndpoint; - request: ChecksCreateSuiteRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/issues/comments/{comment_id}", "patch">; /** - * @see https://developer.github.com/v3/checks/suites/#rerequest-a-check-suite + * @see https://docs.github.com/rest/reference/issues/#update-an-issue */ - "POST /repos/:owner/:repo/check-suites/:check_suite_id/rerequest": { - parameters: ChecksRerequestSuiteEndpoint; - request: ChecksRerequestSuiteRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/issues/{issue_number}": Operation<"/repos/{owner}/{repo}/issues/{issue_number}", "patch">; /** - * @see https://developer.github.com/v3/code-scanning/#upload-a-sarif-analysis + * @see https://docs.github.com/rest/reference/issues#update-a-label */ - "POST /repos/:owner/:repo/code-scanning/sarifs": { - parameters: CodeScanningUploadSarifEndpoint; - request: CodeScanningUploadSarifRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/labels/{name}": Operation<"/repos/{owner}/{repo}/labels/{name}", "patch">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment + * @see https://docs.github.com/rest/reference/issues#update-a-milestone */ - "POST /repos/:owner/:repo/comments/:comment_id/reactions": { - parameters: ReactionsCreateForCommitCommentEndpoint; - request: ReactionsCreateForCommitCommentRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/milestones/{milestone_number}": Operation<"/repos/{owner}/{repo}/milestones/{milestone_number}", "patch">; /** - * @see https://developer.github.com/v3/repos/comments/#create-a-commit-comment + * @see https://docs.github.com/rest/reference/pulls#update-a-review-comment-for-a-pull-request */ - "POST /repos/:owner/:repo/commits/:commit_sha/comments": { - parameters: ReposCreateCommitCommentEndpoint; - request: ReposCreateCommitCommentRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}": Operation<"/repos/{owner}/{repo}/pulls/comments/{comment_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/deployments/#create-a-deployment + * @see https://docs.github.com/rest/reference/pulls/#update-a-pull-request */ - "POST /repos/:owner/:repo/deployments": { - parameters: ReposCreateDeploymentEndpoint; - request: ReposCreateDeploymentRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/pulls/{pull_number}": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}", "patch">; /** - * @see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status + * @see https://docs.github.com/rest/reference/repos#update-a-release-asset */ - "POST /repos/:owner/:repo/deployments/:deployment_id/statuses": { - parameters: ReposCreateDeploymentStatusEndpoint; - request: ReposCreateDeploymentStatusRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}": Operation<"/repos/{owner}/{repo}/releases/assets/{asset_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event + * @see https://docs.github.com/rest/reference/repos#update-a-release */ - "POST /repos/:owner/:repo/dispatches": { - parameters: ReposCreateDispatchEventEndpoint; - request: ReposCreateDispatchEventRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/releases/{release_id}": Operation<"/repos/{owner}/{repo}/releases/{release_id}", "patch">; /** - * @see https://developer.github.com/v3/repos/forks/#create-a-fork + * @see https://docs.github.com/rest/reference/secret-scanning#update-a-secret-scanning-alert */ - "POST /repos/:owner/:repo/forks": { - parameters: ReposCreateForkEndpoint; - request: ReposCreateForkRequestOptions; - response: OctokitResponse; - }; + "PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", "patch">; /** - * @see https://developer.github.com/v3/git/blobs/#create-a-blob + * @see https://docs.github.com/rest/reference/enterprise-admin#update-an-attribute-for-a-scim-enterprise-group */ - "POST /repos/:owner/:repo/git/blobs": { - parameters: GitCreateBlobEndpoint; - request: GitCreateBlobRequestOptions; - response: OctokitResponse; - }; + "PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}": Operation<"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}", "patch">; /** - * @see https://developer.github.com/v3/git/commits/#create-a-commit + * @see https://docs.github.com/rest/reference/enterprise-admin#update-an-attribute-for-a-scim-enterprise-user */ - "POST /repos/:owner/:repo/git/commits": { - parameters: GitCreateCommitEndpoint; - request: GitCreateCommitRequestOptions; - response: OctokitResponse; - }; + "PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}": Operation<"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}", "patch">; /** - * @see https://developer.github.com/v3/git/refs/#create-a-reference + * @see https://docs.github.com/rest/reference/scim#update-an-attribute-for-a-scim-user */ - "POST /repos/:owner/:repo/git/refs": { - parameters: GitCreateRefEndpoint; - request: GitCreateRefRequestOptions; - response: OctokitResponse; - }; + "PATCH /scim/v2/organizations/{org}/Users/{scim_user_id}": Operation<"/scim/v2/organizations/{org}/Users/{scim_user_id}", "patch">; /** - * @see https://developer.github.com/v3/git/tags/#create-a-tag-object + * @see https://docs.github.com/rest/reference/teams/#update-a-team-legacy */ - "POST /repos/:owner/:repo/git/tags": { - parameters: GitCreateTagEndpoint; - request: GitCreateTagRequestOptions; - response: OctokitResponse; - }; + "PATCH /teams/{team_id}": Operation<"/teams/{team_id}", "patch">; /** - * @see https://developer.github.com/v3/git/trees/#create-a-tree + * @see https://docs.github.com/rest/reference/teams#update-a-discussion-legacy */ - "POST /repos/:owner/:repo/git/trees": { - parameters: GitCreateTreeEndpoint; - request: GitCreateTreeRequestOptions; - response: OctokitResponse; - }; + "PATCH /teams/{team_id}/discussions/{discussion_number}": Operation<"/teams/{team_id}/discussions/{discussion_number}", "patch">; /** - * @see https://developer.github.com/v3/repos/hooks/#create-a-repository-webhook + * @see https://docs.github.com/rest/reference/teams#update-a-discussion-comment-legacy */ - "POST /repos/:owner/:repo/hooks": { - parameters: ReposCreateWebhookEndpoint; - request: ReposCreateWebhookRequestOptions; - response: OctokitResponse; - }; + "PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}", "patch">; /** - * @see https://developer.github.com/v3/repos/hooks/#ping-a-repository-webhook + * @see https://docs.github.com/rest/reference/teams#create-or-update-idp-group-connections-legacy */ - "POST /repos/:owner/:repo/hooks/:hook_id/pings": { - parameters: ReposPingWebhookEndpoint; - request: ReposPingWebhookRequestOptions; - response: OctokitResponse; - }; + "PATCH /teams/{team_id}/team-sync/group-mappings": Operation<"/teams/{team_id}/team-sync/group-mappings", "patch">; /** - * @see https://developer.github.com/v3/repos/hooks/#test-the-push-repository-webhook + * @see https://docs.github.com/rest/reference/users/#update-the-authenticated-user */ - "POST /repos/:owner/:repo/hooks/:hook_id/tests": { - parameters: ReposTestPushWebhookEndpoint; - request: ReposTestPushWebhookRequestOptions; - response: OctokitResponse; - }; + "PATCH /user": Operation<"/user", "patch">; /** - * @see https://developer.github.com/v3/issues/#create-an-issue + * @see https://docs.github.com/rest/reference/users#set-primary-email-visibility-for-the-authenticated-user */ - "POST /repos/:owner/:repo/issues": { - parameters: IssuesCreateEndpoint; - request: IssuesCreateRequestOptions; - response: OctokitResponse; - }; + "PATCH /user/email/visibility": Operation<"/user/email/visibility", "patch">; /** - * @see https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue + * @see https://docs.github.com/rest/reference/orgs#update-an-organization-membership-for-the-authenticated-user */ - "POST /repos/:owner/:repo/issues/:issue_number/assignees": { - parameters: IssuesAddAssigneesEndpoint; - request: IssuesAddAssigneesRequestOptions; - response: OctokitResponse; - }; + "PATCH /user/memberships/orgs/{org}": Operation<"/user/memberships/orgs/{org}", "patch">; /** - * @see https://developer.github.com/v3/issues/comments/#create-an-issue-comment + * @see https://docs.github.com/rest/reference/repos#accept-a-repository-invitation */ - "POST /repos/:owner/:repo/issues/:issue_number/comments": { - parameters: IssuesCreateCommentEndpoint; - request: IssuesCreateCommentRequestOptions; - response: OctokitResponse; - }; + "PATCH /user/repository_invitations/{invitation_id}": Operation<"/user/repository_invitations/{invitation_id}", "patch">; /** - * @see https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue + * @see https://docs.github.com/rest/reference/apps#create-a-github-app-from-a-manifest */ - "POST /repos/:owner/:repo/issues/:issue_number/labels": { - parameters: IssuesAddLabelsEndpoint; - request: IssuesAddLabelsRequestOptions; - response: OctokitResponse; - }; + "POST /app-manifests/{code}/conversions": Operation<"/app-manifests/{code}/conversions", "post">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-an-issue + * @see https://docs.github.com/rest/reference/apps#redeliver-a-delivery-for-an-app-webhook */ - "POST /repos/:owner/:repo/issues/:issue_number/reactions": { - parameters: ReactionsCreateForIssueEndpoint; - request: ReactionsCreateForIssueRequestOptions; - response: OctokitResponse; - }; + "POST /app/hook/deliveries/{delivery_id}/attempts": Operation<"/app/hook/deliveries/{delivery_id}/attempts", "post">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment + * @see https://docs.github.com/rest/reference/apps/#create-an-installation-access-token-for-an-app */ - "POST /repos/:owner/:repo/issues/comments/:comment_id/reactions": { - parameters: ReactionsCreateForIssueCommentEndpoint; - request: ReactionsCreateForIssueCommentRequestOptions; - response: OctokitResponse; - }; + "POST /app/installations/{installation_id}/access_tokens": Operation<"/app/installations/{installation_id}/access_tokens", "post">; /** - * @see https://developer.github.com/v3/repos/keys/#create-a-deploy-key + * @see https://docs.github.com/rest/reference/apps#check-a-token */ - "POST /repos/:owner/:repo/keys": { - parameters: ReposCreateDeployKeyEndpoint; - request: ReposCreateDeployKeyRequestOptions; - response: OctokitResponse; - }; + "POST /applications/{client_id}/token": Operation<"/applications/{client_id}/token", "post">; /** - * @see https://developer.github.com/v3/issues/labels/#create-a-label + * @see https://docs.github.com/rest/reference/apps#create-a-scoped-access-token */ - "POST /repos/:owner/:repo/labels": { - parameters: IssuesCreateLabelEndpoint; - request: IssuesCreateLabelRequestOptions; - response: OctokitResponse; - }; + "POST /applications/{client_id}/token/scoped": Operation<"/applications/{client_id}/token/scoped", "post">; /** - * @see https://developer.github.com/v3/repos/merging/#merge-a-branch + * @see https://docs.github.com/rest/reference/apps#reset-an-authorization */ - "POST /repos/:owner/:repo/merges": { - parameters: ReposMergeEndpoint; - request: ReposMergeRequestOptions; - response: OctokitResponse; - }; + "POST /applications/{client_id}/tokens/{access_token}": Operation<"/applications/{client_id}/tokens/{access_token}", "post">; /** - * @see https://developer.github.com/v3/issues/milestones/#create-a-milestone + * @see https://docs.github.com/rest/reference/oauth-authorizations#create-a-new-authorization */ - "POST /repos/:owner/:repo/milestones": { - parameters: IssuesCreateMilestoneEndpoint; - request: IssuesCreateMilestoneRequestOptions; - response: OctokitResponse; - }; + "POST /authorizations": Operation<"/authorizations", "post">; /** - * @see https://developer.github.com/v3/repos/pages/#create-a-github-pages-site + * @see https://docs.github.com/rest/reference/apps#create-a-content-attachment */ - "POST /repos/:owner/:repo/pages": { - parameters: ReposCreatePagesSiteEndpoint; - request: ReposCreatePagesSiteRequestOptions; - response: OctokitResponse; - }; + "POST /content_references/{content_reference_id}/attachments": Operation<"/content_references/{content_reference_id}/attachments", "post", "corsair">; /** - * @see https://developer.github.com/v3/repos/pages/#request-a-github-pages-build + * @see https://docs.github.com/rest/reference/enterprise-admin#create-self-hosted-runner-group-for-an-enterprise */ - "POST /repos/:owner/:repo/pages/builds": { - parameters: ReposRequestPagesBuildEndpoint; - request: ReposRequestPagesBuildRequestOptions; - response: OctokitResponse; - }; + "POST /enterprises/{enterprise}/actions/runner-groups": Operation<"/enterprises/{enterprise}/actions/runner-groups", "post">; /** - * @see https://developer.github.com/v3/projects/#create-a-repository-project + * @see https://docs.github.com/rest/reference/enterprise-admin#create-a-registration-token-for-an-enterprise */ - "POST /repos/:owner/:repo/projects": { - parameters: ProjectsCreateForRepoEndpoint; - request: ProjectsCreateForRepoRequestOptions; - response: OctokitResponse; - }; + "POST /enterprises/{enterprise}/actions/runners/registration-token": Operation<"/enterprises/{enterprise}/actions/runners/registration-token", "post">; /** - * @see https://developer.github.com/v3/pulls/#create-a-pull-request + * @see https://docs.github.com/rest/reference/enterprise-admin#create-a-remove-token-for-an-enterprise */ - "POST /repos/:owner/:repo/pulls": { - parameters: PullsCreateEndpoint; - request: PullsCreateRequestOptions; - response: OctokitResponse; - }; + "POST /enterprises/{enterprise}/actions/runners/remove-token": Operation<"/enterprises/{enterprise}/actions/runners/remove-token", "post">; /** - * @see https://developer.github.com/v3/pulls/comments/#create-a-review-comment-for-a-pull-request + * @see https://docs.github.com/rest/reference/gists#create-a-gist */ - "POST /repos/:owner/:repo/pulls/:pull_number/comments": { - parameters: PullsCreateReviewCommentEndpoint; - request: PullsCreateReviewCommentRequestOptions; - response: OctokitResponse; - }; + "POST /gists": Operation<"/gists", "post">; /** - * @see https://developer.github.com/v3/pulls/comments/#create-a-reply-for-a-review-comment + * @see https://docs.github.com/rest/reference/gists#create-a-gist-comment */ - "POST /repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies": { - parameters: PullsCreateReplyForReviewCommentEndpoint; - request: PullsCreateReplyForReviewCommentRequestOptions; - response: OctokitResponse; - }; + "POST /gists/{gist_id}/comments": Operation<"/gists/{gist_id}/comments", "post">; /** - * @see https://developer.github.com/v3/pulls/review_requests/#request-reviewers-for-a-pull-request + * @see https://docs.github.com/rest/reference/gists#fork-a-gist */ - "POST /repos/:owner/:repo/pulls/:pull_number/requested_reviewers": { - parameters: PullsRequestReviewersEndpoint; - request: PullsRequestReviewersRequestOptions; - response: OctokitResponse; - }; + "POST /gists/{gist_id}/forks": Operation<"/gists/{gist_id}/forks", "post">; /** - * @see https://developer.github.com/v3/pulls/reviews/#create-a-review-for-a-pull-request + * @see https://docs.github.com/rest/reference/markdown#render-a-markdown-document */ - "POST /repos/:owner/:repo/pulls/:pull_number/reviews": { - parameters: PullsCreateReviewEndpoint; - request: PullsCreateReviewRequestOptions; - response: OctokitResponse; - }; + "POST /markdown": Operation<"/markdown", "post">; /** - * @see https://developer.github.com/v3/pulls/reviews/#submit-a-review-for-a-pull-request + * @see https://docs.github.com/rest/reference/markdown#render-a-markdown-document-in-raw-mode */ - "POST /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events": { - parameters: PullsSubmitReviewEndpoint; - request: PullsSubmitReviewRequestOptions; - response: OctokitResponse; - }; + "POST /markdown/raw": Operation<"/markdown/raw", "post">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment + * @see https://docs.github.com/rest/reference/actions#create-a-self-hosted-runner-group-for-an-organization */ - "POST /repos/:owner/:repo/pulls/comments/:comment_id/reactions": { - parameters: ReactionsCreateForPullRequestReviewCommentEndpoint; - request: ReactionsCreateForPullRequestReviewCommentRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/actions/runner-groups": Operation<"/orgs/{org}/actions/runner-groups", "post">; /** - * @see https://developer.github.com/v3/repos/releases/#create-a-release + * @see https://docs.github.com/rest/reference/actions#create-a-registration-token-for-an-organization */ - "POST /repos/:owner/:repo/releases": { - parameters: ReposCreateReleaseEndpoint; - request: ReposCreateReleaseRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/actions/runners/registration-token": Operation<"/orgs/{org}/actions/runners/registration-token", "post">; /** - * @see https://developer.github.com/v3/repos/releases/#upload-a-release-asset + * @see https://docs.github.com/rest/reference/actions#create-a-remove-token-for-an-organization */ - "POST /repos/:owner/:repo/releases/:release_id/assets{?name,label}": { - parameters: ReposUploadReleaseAssetEndpoint; - request: ReposUploadReleaseAssetRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/actions/runners/remove-token": Operation<"/orgs/{org}/actions/runners/remove-token", "post">; /** - * @see https://developer.github.com/v3/repos/statuses/#create-a-commit-status + * @see https://docs.github.com/rest/reference/orgs#create-an-organization-webhook */ - "POST /repos/:owner/:repo/statuses/:sha": { - parameters: ReposCreateCommitStatusEndpoint; - request: ReposCreateCommitStatusRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/hooks": Operation<"/orgs/{org}/hooks", "post">; /** - * @see https://developer.github.com/v3/repos/#transfer-a-repository + * @see https://docs.github.com/rest/reference/orgs#redeliver-a-delivery-for-an-organization-webhook */ - "POST /repos/:owner/:repo/transfer": { - parameters: ReposTransferEndpoint; - request: ReposTransferRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts": Operation<"/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", "post">; /** - * @see https://developer.github.com/v3/repos/#create-a-repository-using-a-template + * @see https://docs.github.com/rest/reference/orgs#ping-an-organization-webhook */ - "POST /repos/:template_owner/:template_repo/generate": { - parameters: ReposCreateUsingTemplateEndpoint; - request: ReposCreateUsingTemplateRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/hooks/{hook_id}/pings": Operation<"/orgs/{org}/hooks/{hook_id}/pings", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#provision-a-scim-enterprise-group-and-invite-users + * @see https://docs.github.com/rest/reference/orgs#create-an-organization-invitation */ - "POST /scim/v2/enterprises/:enterprise/Groups": { - parameters: EnterpriseAdminProvisionAndInviteEnterpriseGroupEndpoint; - request: EnterpriseAdminProvisionAndInviteEnterpriseGroupRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/invitations": Operation<"/orgs/{org}/invitations", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#provision-and-invite-a-scim-enterprise-user + * @see https://docs.github.com/rest/reference/migrations#start-an-organization-migration */ - "POST /scim/v2/enterprises/:enterprise/Users": { - parameters: EnterpriseAdminProvisionAndInviteEnterpriseUserEndpoint; - request: EnterpriseAdminProvisionAndInviteEnterpriseUserRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/migrations": Operation<"/orgs/{org}/migrations", "post">; /** - * @see https://developer.github.com/v3/scim/#provision-and-invite-a-scim-user + * @see https://docs.github.com/rest/reference/packages#restore-a-package-for-an-organization */ - "POST /scim/v2/organizations/:org/Users": { - parameters: ScimProvisionAndInviteUserEndpoint; - request: ScimProvisionAndInviteUserRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}": Operation<"/orgs/{org}/packages/{package_type}/{package_name}/restore", "post">; /** - * @see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy + * @see https://docs.github.com/rest/reference/packages#restore-a-package-version-for-an-organization */ - "POST /teams/:team_id/discussions": { - parameters: TeamsCreateDiscussionLegacyEndpoint; - request: TeamsCreateDiscussionLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore": Operation<"/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", "post">; /** - * @see https://developer.github.com/v3/teams/discussion_comments/#create-a-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/projects#create-an-organization-project */ - "POST /teams/:team_id/discussions/:discussion_number/comments": { - parameters: TeamsCreateDiscussionCommentLegacyEndpoint; - request: TeamsCreateDiscussionCommentLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/projects": Operation<"/orgs/{org}/projects", "post", "inertia">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy + * @see https://docs.github.com/rest/reference/repos#create-an-organization-repository */ - "POST /teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions": { - parameters: ReactionsCreateForTeamDiscussionCommentLegacyEndpoint; - request: ReactionsCreateForTeamDiscussionCommentLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/repos": Operation<"/orgs/{org}/repos", "post">; /** - * @see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy + * @see https://docs.github.com/rest/reference/teams#create-a-team */ - "POST /teams/:team_id/discussions/:discussion_number/reactions": { - parameters: ReactionsCreateForTeamDiscussionLegacyEndpoint; - request: ReactionsCreateForTeamDiscussionLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/teams": Operation<"/orgs/{org}/teams", "post">; /** - * @see https://developer.github.com/v3/users/emails/#add-an-email-address-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/teams#create-a-discussion */ - "POST /user/emails": { - parameters: UsersAddEmailForAuthenticatedEndpoint; - request: UsersAddEmailForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/teams/{team_slug}/discussions": Operation<"/orgs/{org}/teams/{team_slug}/discussions", "post">; /** - * @see https://developer.github.com/v3/users/gpg_keys/#create-a-gpg-key-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/teams#create-a-discussion-comment */ - "POST /user/gpg_keys": { - parameters: UsersCreateGpgKeyForAuthenticatedEndpoint; - request: UsersCreateGpgKeyForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "post">; /** - * @see https://developer.github.com/v3/users/keys/#create-a-public-ssh-key-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion-comment */ - "POST /user/keys": { - parameters: UsersCreatePublicSshKeyForAuthenticatedEndpoint; - request: UsersCreatePublicSshKeyForAuthenticatedRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "post", "squirrel-girl">; /** - * @see https://developer.github.com/v3/migrations/users/#start-a-user-migration + * @see https://docs.github.com/rest/reference/reactions#create-reaction-for-a-team-discussion */ - "POST /user/migrations": { - parameters: MigrationsStartForAuthenticatedUserEndpoint; - request: MigrationsStartForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions": Operation<"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "post", "squirrel-girl">; /** - * @see https://developer.github.com/v3/projects/#create-a-user-project + * @see https://docs.github.com/rest/reference/projects#move-a-project-card */ - "POST /user/projects": { - parameters: ProjectsCreateForAuthenticatedUserEndpoint; - request: ProjectsCreateForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "POST /projects/columns/cards/{card_id}/moves": Operation<"/projects/columns/cards/{card_id}/moves", "post", "inertia">; /** - * @see https://developer.github.com/v3/repos/#create-a-repository-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/projects#create-a-project-card */ - "POST /user/repos": { - parameters: ReposCreateForAuthenticatedUserEndpoint; - request: ReposCreateForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "POST /projects/columns/{column_id}/cards": Operation<"/projects/columns/{column_id}/cards", "post", "inertia">; /** - * @see https://developer.github.com/v3/apps/#suspend-an-app-installation + * @see https://docs.github.com/rest/reference/projects#move-a-project-column */ - "PUT /app/installations/:installation_id/suspended": { - parameters: AppsSuspendInstallationEndpoint; - request: AppsSuspendInstallationRequestOptions; - response: OctokitResponse; - }; + "POST /projects/columns/{column_id}/moves": Operation<"/projects/columns/{column_id}/moves", "post", "inertia">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app + * @see https://docs.github.com/rest/reference/projects#create-a-project-column */ - "PUT /authorizations/clients/:client_id": { - parameters: OauthAuthorizationsGetOrCreateAuthorizationForAppEndpoint; - request: OauthAuthorizationsGetOrCreateAuthorizationForAppRequestOptions; - response: OctokitResponse; - }; + "POST /projects/{project_id}/columns": Operation<"/projects/{project_id}/columns", "post", "inertia">; /** - * @see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint + * @see https://docs.github.com/rest/reference/actions#create-a-registration-token-for-a-repository */ - "PUT /authorizations/clients/:client_id/:fingerprint": { - parameters: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintEndpoint; - request: OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/runners/registration-token": Operation<"/repos/{owner}/{repo}/actions/runners/registration-token", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#set-organization-access-to-a-self-hosted-runner-group-in-an-enterprise + * @see https://docs.github.com/rest/reference/actions#create-a-remove-token-for-a-repository */ - "PUT /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations": { - parameters: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint; - request: EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/runners/remove-token": Operation<"/repos/{owner}/{repo}/actions/runners/remove-token", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise + * @see https://docs.github.com/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request */ - "PUT /enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations/:org_id": { - parameters: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint; - request: EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/approve", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#set-self-hosted-runners-in-a-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/actions#cancel-a-workflow-run */ - "PUT /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners": { - parameters: EnterpriseAdminSetSelfHostedInGroupForEnterpriseEndpoint; - request: EnterpriseAdminSetSelfHostedInGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/cancel", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/actions/#add-a-self-hosted-runner-to-a-group-for-an-enterprise + * @see https://docs.github.com/rest/reference/actions#review-pending-deployments-for-a-workflow-run */ - "PUT /enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners/:runner_id": { - parameters: EnterpriseAdminAddSelfHostedRunnerToRunnerGroupForEnterpriseEndpoint; - request: EnterpriseAdminAddSelfHostedRunnerToRunnerGroupForEnterpriseRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", "post">; /** - * @see https://developer.github.com/v3/gists/#star-a-gist + * @see https://docs.github.com/rest/reference/actions#re-run-a-workflow */ - "PUT /gists/:gist_id/star": { - parameters: GistsStarEndpoint; - request: GistsStarRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun", "post">; /** - * @see https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read + * @see https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event */ - "PUT /notifications": { - parameters: ActivityMarkNotificationsAsReadEndpoint; - request: ActivityMarkNotificationsAsReadRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches", "post">; /** - * @see https://developer.github.com/v3/activity/notifications/#set-a-thread-subscription + * @see https://docs.github.com/v3/repos#create-an-autolink */ - "PUT /notifications/threads/:thread_id/subscription": { - parameters: ActivitySetThreadSubscriptionEndpoint; - request: ActivitySetThreadSubscriptionRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/autolinks": Operation<"/repos/{owner}/{repo}/autolinks", "post">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#set-repository-access-to-a-self-hosted-runner-group-in-an-organization + * @see https://docs.github.com/rest/reference/repos#set-admin-branch-protection */ - "PUT /orgs/:org/actions/runner-groups/:runner_group_id/repositories": { - parameters: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgEndpoint; - request: ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins", "post">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#add-repository-acess-to-a-self-hosted-runner-group-in-an-organization + * @see https://docs.github.com/rest/reference/repos#create-commit-signature-protection */ - "PUT /orgs/:org/actions/runner-groups/:runner_group_id/repositories/:repository_id": { - parameters: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgEndpoint; - request: ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_signatures", "post", "zzzax">; /** - * @see https://developer.github.com/v3/actions/sef-hosted-runner-groups/#set-self-hosted-runners-in-a-group-for-an-organization + * @see https://docs.github.com/rest/reference/repos#add-status-check-contexts */ - "PUT /orgs/:org/actions/runner-groups/:runner_group_id/runners": { - parameters: ActionsSetSelfHostedRunnersInGroupForOrgEndpoint; - request: ActionsSetSelfHostedRunnersInGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", "post">; /** - * @see https://developer.github.com/v3/actions/self-hosted-runner-groups/#add-a-self-hosted-runner-to-a-group-for-an-organization + * @see https://docs.github.com/rest/reference/repos#add-app-access-restrictions */ - "PUT /orgs/:org/actions/runner-groups/:runner_group_id/runners/:runner_id": { - parameters: ActionsAddSelfHostedRunnerToGroupForOrgEndpoint; - request: ActionsAddSelfHostedRunnerToGroupForOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", "post">; /** - * @see https://developer.github.com/v3/actions/secrets/#create-or-update-an-organization-secret + * @see https://docs.github.com/rest/reference/repos#add-team-access-restrictions */ - "PUT /orgs/:org/actions/secrets/:secret_name": { - parameters: ActionsCreateOrUpdateOrgSecretEndpoint; - request: ActionsCreateOrUpdateOrgSecretRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", "post">; /** - * @see https://developer.github.com/v3/actions/secrets/#set-selected-repositories-for-an-organization-secret + * @see https://docs.github.com/rest/reference/repos#add-user-access-restrictions */ - "PUT /orgs/:org/actions/secrets/:secret_name/repositories": { - parameters: ActionsSetSelectedReposForOrgSecretEndpoint; - request: ActionsSetSelectedReposForOrgSecretRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", "post">; /** - * @see https://developer.github.com/v3/actions/secrets/#add-selected-repository-to-an-organization-secret + * @see https://docs.github.com/rest/reference/repos#rename-a-branch */ - "PUT /orgs/:org/actions/secrets/:secret_name/repositories/:repository_id": { - parameters: ActionsAddSelectedRepoToOrgSecretEndpoint; - request: ActionsAddSelectedRepoToOrgSecretRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/branches/{branch}/rename": Operation<"/repos/{owner}/{repo}/branches/{branch}/rename", "post">; /** - * @see https://developer.github.com/v3/orgs/blocking/#block-a-user-from-an-organization + * @see https://docs.github.com/rest/reference/checks#create-a-check-run */ - "PUT /orgs/:org/blocks/:username": { - parameters: OrgsBlockUserEndpoint; - request: OrgsBlockUserRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/check-runs": Operation<"/repos/{owner}/{repo}/check-runs", "post">; /** - * @see https://developer.github.com/v3/interactions/orgs/#set-interaction-restrictions-for-an-organization + * @see https://docs.github.com/rest/reference/checks#create-a-check-suite */ - "PUT /orgs/:org/interaction-limits": { - parameters: InteractionsSetRestrictionsForOrgEndpoint; - request: InteractionsSetRestrictionsForOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/check-suites": Operation<"/repos/{owner}/{repo}/check-suites", "post">; /** - * @see https://developer.github.com/v3/orgs/members/#set-organization-membership-for-a-user + * @see https://docs.github.com/rest/reference/checks#rerequest-a-check-suite */ - "PUT /orgs/:org/memberships/:username": { - parameters: OrgsSetMembershipForUserEndpoint; - request: OrgsSetMembershipForUserRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest": Operation<"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", "post">; /** - * @see https://developer.github.com/v3/orgs/outside_collaborators/#convert-an-organization-member-to-outside-collaborator + * @see https://docs.github.com/rest/reference/code-scanning#upload-a-sarif-file */ - "PUT /orgs/:org/outside_collaborators/:username": { - parameters: OrgsConvertMemberToOutsideCollaboratorEndpoint; - request: OrgsConvertMemberToOutsideCollaboratorRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/code-scanning/sarifs": Operation<"/repos/{owner}/{repo}/code-scanning/sarifs", "post">; /** - * @see https://developer.github.com/v3/orgs/members/#set-public-organization-membership-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/reactions#create-reaction-for-a-commit-comment */ - "PUT /orgs/:org/public_members/:username": { - parameters: OrgsSetPublicMembershipForAuthenticatedUserEndpoint; - request: OrgsSetPublicMembershipForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/comments/{comment_id}/reactions": Operation<"/repos/{owner}/{repo}/comments/{comment_id}/reactions", "post", "squirrel-girl">; /** - * @see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-for-a-user + * @see https://docs.github.com/rest/reference/repos#create-a-commit-comment */ - "PUT /orgs/:org/teams/:team_slug/memberships/:username": { - parameters: TeamsAddOrUpdateMembershipForUserInOrgEndpoint; - request: TeamsAddOrUpdateMembershipForUserInOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/commits/{commit_sha}/comments": Operation<"/repos/{owner}/{repo}/commits/{commit_sha}/comments", "post">; /** - * @see https://developer.github.com/v3/teams/#add-or-update-team-project-permissions + * @see https://docs.github.com/rest/reference/apps#create-a-content-attachment */ - "PUT /orgs/:org/teams/:team_slug/projects/:project_id": { - parameters: TeamsAddOrUpdateProjectPermissionsInOrgEndpoint; - request: TeamsAddOrUpdateProjectPermissionsInOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments": Operation<"/repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", "post", "corsair">; /** - * @see https://developer.github.com/v3/teams/#add-or-update-team-repository-permissions + * @see https://docs.github.com/rest/reference/repos#create-a-deployment */ - "PUT /orgs/:org/teams/:team_slug/repos/:owner/:repo": { - parameters: TeamsAddOrUpdateRepoPermissionsInOrgEndpoint; - request: TeamsAddOrUpdateRepoPermissionsInOrgRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/deployments": Operation<"/repos/{owner}/{repo}/deployments", "post">; /** - * @see https://developer.github.com/v3/projects/collaborators/#add-project-collaborator + * @see https://docs.github.com/rest/reference/repos#create-a-deployment-status */ - "PUT /projects/:project_id/collaborators/:username": { - parameters: ProjectsAddCollaboratorEndpoint; - request: ProjectsAddCollaboratorRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses": Operation<"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "post">; /** - * @see https://developer.github.com/v3/actions/secrets/#create-or-update-a-repository-secret + * @see https://docs.github.com/rest/reference/repos#create-a-repository-dispatch-event */ - "PUT /repos/:owner/:repo/actions/secrets/:secret_name": { - parameters: ActionsCreateOrUpdateRepoSecretEndpoint; - request: ActionsCreateOrUpdateRepoSecretRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/dispatches": Operation<"/repos/{owner}/{repo}/dispatches", "post">; /** - * @see https://developer.github.com/v3/repos/#enable-automated-security-fixes + * @see https://docs.github.com/rest/reference/repos#create-a-fork */ - "PUT /repos/:owner/:repo/automated-security-fixes": { - parameters: ReposEnableAutomatedSecurityFixesEndpoint; - request: ReposEnableAutomatedSecurityFixesRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/forks": Operation<"/repos/{owner}/{repo}/forks", "post">; /** - * @see https://developer.github.com/v3/repos/branches/#update-branch-protection + * @see https://docs.github.com/rest/reference/git#create-a-blob */ - "PUT /repos/:owner/:repo/branches/:branch/protection": { - parameters: ReposUpdateBranchProtectionEndpoint; - request: ReposUpdateBranchProtectionRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/git/blobs": Operation<"/repos/{owner}/{repo}/git/blobs", "post">; /** - * @see https://developer.github.com/v3/repos/branches/#set-status-check-contexts + * @see https://docs.github.com/rest/reference/git#create-a-commit */ - "PUT /repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts": { - parameters: ReposSetStatusCheckContextsEndpoint; - request: ReposSetStatusCheckContextsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/git/commits": Operation<"/repos/{owner}/{repo}/git/commits", "post">; /** - * @see https://developer.github.com/v3/repos/branches/#set-app-access-restrictions + * @see https://docs.github.com/rest/reference/git#create-a-reference */ - "PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/apps": { - parameters: ReposSetAppAccessRestrictionsEndpoint; - request: ReposSetAppAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/git/refs": Operation<"/repos/{owner}/{repo}/git/refs", "post">; /** - * @see https://developer.github.com/v3/repos/branches/#set-team-access-restrictions + * @see https://docs.github.com/rest/reference/git#create-a-tag-object */ - "PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/teams": { - parameters: ReposSetTeamAccessRestrictionsEndpoint; - request: ReposSetTeamAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/git/tags": Operation<"/repos/{owner}/{repo}/git/tags", "post">; /** - * @see https://developer.github.com/v3/repos/branches/#set-user-access-restrictions + * @see https://docs.github.com/rest/reference/git#create-a-tree */ - "PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/users": { - parameters: ReposSetUserAccessRestrictionsEndpoint; - request: ReposSetUserAccessRestrictionsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/git/trees": Operation<"/repos/{owner}/{repo}/git/trees", "post">; /** - * @see https://developer.github.com/v3/repos/collaborators/#add-a-repository-collaborator + * @see https://docs.github.com/rest/reference/repos#create-a-repository-webhook */ - "PUT /repos/:owner/:repo/collaborators/:username": { - parameters: ReposAddCollaboratorEndpoint; - request: ReposAddCollaboratorRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/hooks": Operation<"/repos/{owner}/{repo}/hooks", "post">; /** - * @see https://developer.github.com/v3/repos/contents/#create-or-update-file-contents + * @see https://docs.github.com/rest/reference/repos#redeliver-a-delivery-for-a-repository-webhook */ - "PUT /repos/:owner/:repo/contents/:path": { - parameters: ReposCreateOrUpdateFileContentsEndpoint; - request: ReposCreateOrUpdateFileContentsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", "post">; /** - * @see https://developer.github.com/v3/migrations/source_imports/#start-an-import + * @see https://docs.github.com/rest/reference/repos#ping-a-repository-webhook */ - "PUT /repos/:owner/:repo/import": { - parameters: MigrationsStartImportEndpoint; - request: MigrationsStartImportRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/hooks/{hook_id}/pings": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/pings", "post">; /** - * @see https://developer.github.com/v3/interactions/repos/#set-interaction-restrictions-for-a-repository + * @see https://docs.github.com/rest/reference/repos#test-the-push-repository-webhook */ - "PUT /repos/:owner/:repo/interaction-limits": { - parameters: InteractionsSetRestrictionsForRepoEndpoint; - request: InteractionsSetRestrictionsForRepoRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/hooks/{hook_id}/tests": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/tests", "post">; /** - * @see https://developer.github.com/v3/issues/labels/#set-labels-for-an-issue + * @see https://docs.github.com/rest/reference/issues#create-an-issue */ - "PUT /repos/:owner/:repo/issues/:issue_number/labels": { - parameters: IssuesSetLabelsEndpoint; - request: IssuesSetLabelsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/issues": Operation<"/repos/{owner}/{repo}/issues", "post">; /** - * @see https://developer.github.com/v3/issues/#lock-an-issue + * @see https://docs.github.com/rest/reference/reactions#create-reaction-for-an-issue-comment */ - "PUT /repos/:owner/:repo/issues/:issue_number/lock": { - parameters: IssuesLockEndpoint; - request: IssuesLockRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions": Operation<"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "post", "squirrel-girl">; /** - * @see https://developer.github.com/v3/activity/notifications/#mark-repository-notifications-as-read + * @see https://docs.github.com/rest/reference/issues#add-assignees-to-an-issue */ - "PUT /repos/:owner/:repo/notifications": { - parameters: ActivityMarkRepoNotificationsAsReadEndpoint; - request: ActivityMarkRepoNotificationsAsReadRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/assignees", "post">; /** - * @see https://developer.github.com/v3/repos/pages/#update-information-about-a-github-pages-site + * @see https://docs.github.com/rest/reference/issues#create-an-issue-comment */ - "PUT /repos/:owner/:repo/pages": { - parameters: ReposUpdateInformationAboutPagesSiteEndpoint; - request: ReposUpdateInformationAboutPagesSiteRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/issues/{issue_number}/comments": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/comments", "post">; /** - * @see https://developer.github.com/v3/pulls/#merge-a-pull-request + * @see https://docs.github.com/rest/reference/issues#add-labels-to-an-issue */ - "PUT /repos/:owner/:repo/pulls/:pull_number/merge": { - parameters: PullsMergeEndpoint; - request: PullsMergeRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/issues/{issue_number}/labels": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/labels", "post">; /** - * @see https://developer.github.com/v3/pulls/reviews/#update-a-review-for-a-pull-request + * @see https://docs.github.com/rest/reference/reactions#create-reaction-for-an-issue */ - "PUT /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id": { - parameters: PullsUpdateReviewEndpoint; - request: PullsUpdateReviewRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/issues/{issue_number}/reactions": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/reactions", "post", "squirrel-girl">; /** - * @see https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request + * @see https://docs.github.com/rest/reference/repos#create-a-deploy-key */ - "PUT /repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals": { - parameters: PullsDismissReviewEndpoint; - request: PullsDismissReviewRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/keys": Operation<"/repos/{owner}/{repo}/keys", "post">; /** - * @see https://developer.github.com/v3/pulls/#update-a-pull-request-branch + * @see https://docs.github.com/rest/reference/issues#create-a-label */ - "PUT /repos/:owner/:repo/pulls/:pull_number/update-branch": { - parameters: PullsUpdateBranchEndpoint; - request: PullsUpdateBranchRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/labels": Operation<"/repos/{owner}/{repo}/labels", "post">; /** - * @see https://developer.github.com/v3/activity/watching/#set-a-repository-subscription + * @see https://docs.github.com/rest/reference/repos#merge-a-branch */ - "PUT /repos/:owner/:repo/subscription": { - parameters: ActivitySetRepoSubscriptionEndpoint; - request: ActivitySetRepoSubscriptionRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/merges": Operation<"/repos/{owner}/{repo}/merges", "post">; /** - * @see https://developer.github.com/v3/repos/#replace-all-repository-topics + * @see https://docs.github.com/rest/reference/issues#create-a-milestone */ - "PUT /repos/:owner/:repo/topics": { - parameters: ReposReplaceAllTopicsEndpoint; - request: ReposReplaceAllTopicsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/milestones": Operation<"/repos/{owner}/{repo}/milestones", "post">; /** - * @see https://developer.github.com/v3/repos/#enable-vulnerability-alerts + * @see https://docs.github.com/rest/reference/repos#create-a-github-pages-site */ - "PUT /repos/:owner/:repo/vulnerability-alerts": { - parameters: ReposEnableVulnerabilityAlertsEndpoint; - request: ReposEnableVulnerabilityAlertsRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pages": Operation<"/repos/{owner}/{repo}/pages", "post", "switcheroo">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#set-scim-information-for-a-provisioned-enterprise-group + * @see https://docs.github.com/rest/reference/repos#request-a-github-pages-build */ - "PUT /scim/v2/enterprises/:enterprise/Groups/:scim_group_id": { - parameters: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupEndpoint; - request: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pages/builds": Operation<"/repos/{owner}/{repo}/pages/builds", "post">; /** - * @see https://developer.github.com/v3/enterprise-admin/scim/#set-scim-information-for-a-provisioned-enterprise-user + * @see https://docs.github.com/rest/reference/projects#create-a-repository-project */ - "PUT /scim/v2/enterprises/:enterprise/Users/:scim_user_id": { - parameters: EnterpriseAdminSetInformationForProvisionedEnterpriseUserEndpoint; - request: EnterpriseAdminSetInformationForProvisionedEnterpriseUserRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/projects": Operation<"/repos/{owner}/{repo}/projects", "post", "inertia">; /** - * @see https://developer.github.com/v3/scim/#set-scim-information-for-a-provisioned-user + * @see https://docs.github.com/rest/reference/pulls#create-a-pull-request */ - "PUT /scim/v2/organizations/:org/Users/:scim_user_id": { - parameters: ScimSetInformationForProvisionedUserEndpoint; - request: ScimSetInformationForProvisionedUserRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls": Operation<"/repos/{owner}/{repo}/pulls", "post">; /** - * @see https://developer.github.com/v3/teams/members/#add-team-member-legacy + * @see https://docs.github.com/rest/reference/reactions#create-reaction-for-a-pull-request-review-comment */ - "PUT /teams/:team_id/members/:username": { - parameters: TeamsAddMemberLegacyEndpoint; - request: TeamsAddMemberLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions": Operation<"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "post", "squirrel-girl">; /** - * @see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-for-a-user-legacy + * @see https://docs.github.com/rest/reference/pulls#create-a-review-comment-for-a-pull-request */ - "PUT /teams/:team_id/memberships/:username": { - parameters: TeamsAddOrUpdateMembershipForUserLegacyEndpoint; - request: TeamsAddOrUpdateMembershipForUserLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/comments", "post">; /** - * @see https://developer.github.com/v3/teams/#add-or-update-team-project-permissions-legacy + * @see https://docs.github.com/rest/reference/pulls#create-a-reply-for-a-review-comment */ - "PUT /teams/:team_id/projects/:project_id": { - parameters: TeamsAddOrUpdateProjectPermissionsLegacyEndpoint; - request: TeamsAddOrUpdateProjectPermissionsLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies", "post">; /** - * @see https://developer.github.com/v3/teams/#add-or-update-team-repository-permissions-legacy + * @see https://docs.github.com/rest/reference/pulls#request-reviewers-for-a-pull-request */ - "PUT /teams/:team_id/repos/:owner/:repo": { - parameters: TeamsAddOrUpdateRepoPermissionsLegacyEndpoint; - request: TeamsAddOrUpdateRepoPermissionsLegacyRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "post">; /** - * @see https://developer.github.com/v3/users/blocking/#block-a-user + * @see https://docs.github.com/rest/reference/pulls#create-a-review-for-a-pull-request */ - "PUT /user/blocks/:username": { - parameters: UsersBlockEndpoint; - request: UsersBlockRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews", "post">; /** - * @see https://developer.github.com/v3/users/followers/#follow-a-user + * @see https://docs.github.com/rest/reference/pulls#submit-a-review-for-a-pull-request */ - "PUT /user/following/:username": { - parameters: UsersFollowEndpoint; - request: UsersFollowRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events", "post">; /** - * @see https://developer.github.com/v3/apps/installations/#add-a-repository-to-an-app-installation + * @see https://docs.github.com/rest/reference/repos#create-a-release */ - "PUT /user/installations/:installation_id/repositories/:repository_id": { - parameters: AppsAddRepoToInstallationEndpoint; - request: AppsAddRepoToInstallationRequestOptions; - response: OctokitResponse; - }; + "POST /repos/{owner}/{repo}/releases": Operation<"/repos/{owner}/{repo}/releases", "post">; /** - * @see https://developer.github.com/v3/activity/starring/#star-a-repository-for-the-authenticated-user + * @see https://docs.github.com/rest/reference/reactions/#create-reaction-for-a-release */ - "PUT /user/starred/:owner/:repo": { - parameters: ActivityStarRepoForAuthenticatedUserEndpoint; - request: ActivityStarRepoForAuthenticatedUserRequestOptions; - response: OctokitResponse; - }; -} -declare type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgEndpoint = { - org: string; + "POST /repos/{owner}/{repo}/releases/{release_id}/reactions": Operation<"/repos/{owner}/{repo}/releases/{release_id}/reactions", "post", "squirrel-girl">; /** - * Unique identifier of the self-hosted runner group. + * @see https://docs.github.com/rest/reference/repos#create-a-commit-status */ - runner_group_id: number; - repository_id: number; -}; -declare type ActionsAddRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/repositories/:repository_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsAddSelectedRepoToOrgSecretEndpoint = { - org: string; - secret_name: string; - repository_id: number; -}; -declare type ActionsAddSelectedRepoToOrgSecretRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/secrets/:secret_name/repositories/:repository_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsAddSelfHostedRunnerToGroupForOrgEndpoint = { - org: string; + "POST /repos/{owner}/{repo}/statuses/{sha}": Operation<"/repos/{owner}/{repo}/statuses/{sha}", "post">; /** - * Unique identifier of the self-hosted runner group. + * @see https://docs.github.com/rest/reference/repos#transfer-a-repository */ - runner_group_id: number; + "POST /repos/{owner}/{repo}/transfer": Operation<"/repos/{owner}/{repo}/transfer", "post">; /** - * Unique identifier of the self-hosted runner. + * @see https://docs.github.com/rest/reference/repos#create-a-repository-using-a-template */ - runner_id: number; -}; -declare type ActionsAddSelfHostedRunnerToGroupForOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsCancelWorkflowRunEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsCancelWorkflowRunRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsCreateOrUpdateOrgSecretEndpoint = { - org: string; - secret_name: string; + "POST /repos/{template_owner}/{template_repo}/generate": Operation<"/repos/{template_owner}/{template_repo}/generate", "post", "baptiste">; /** - * Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://developer.github.com/v3/actions/secrets/#get-an-organization-public-key) endpoint. + * @see https://docs.github.com/rest/reference/enterprise-admin#provision-a-scim-enterprise-group-and-invite-users */ - encrypted_value?: string; + "POST /scim/v2/enterprises/{enterprise}/Groups": Operation<"/scim/v2/enterprises/{enterprise}/Groups", "post">; /** - * ID of the key you used to encrypt the secret. + * @see https://docs.github.com/rest/reference/enterprise-admin#provision-and-invite-a-scim-enterprise-user */ - key_id?: string; + "POST /scim/v2/enterprises/{enterprise}/Users": Operation<"/scim/v2/enterprises/{enterprise}/Users", "post">; /** - * Configures the access that repositories have to the organization secret. Can be one of: - * \- `all` - All repositories in an organization can access the secret. - * \- `private` - Private repositories in an organization can access the secret. - * \- `selected` - Only specific repositories can access the secret. + * @see https://docs.github.com/rest/reference/scim#provision-and-invite-a-scim-user */ - visibility?: "all" | "private" | "selected"; + "POST /scim/v2/organizations/{org}/Users": Operation<"/scim/v2/organizations/{org}/Users", "post">; /** - * An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://developer.github.com/v3/actions/secrets/#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://developer.github.com/v3/actions/secrets/#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://developer.github.com/v3/actions/secrets/#remove-selected-repository-from-an-organization-secret) endpoints. + * @see https://docs.github.com/rest/reference/teams#create-a-discussion-legacy */ - selected_repository_ids?: number[]; -}; -declare type ActionsCreateOrUpdateOrgSecretRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/secrets/:secret_name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsCreateOrUpdateRepoSecretEndpoint = { - owner: string; - repo: string; - secret_name: string; + "POST /teams/{team_id}/discussions": Operation<"/teams/{team_id}/discussions", "post">; /** - * Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://developer.github.com/v3/actions/secrets/#get-a-repository-public-key) endpoint. + * @see https://docs.github.com/rest/reference/teams#create-a-discussion-comment-legacy */ - encrypted_value?: string; + "POST /teams/{team_id}/discussions/{discussion_number}/comments": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments", "post">; /** - * ID of the key you used to encrypt the secret. + * @see https://docs.github.com/rest/reference/reactions/#create-reaction-for-a-team-discussion-comment-legacy */ - key_id?: string; -}; -declare type ActionsCreateOrUpdateRepoSecretRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/actions/secrets/:secret_name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsCreateRegistrationTokenForOrgEndpoint = { - org: string; -}; -declare type ActionsCreateRegistrationTokenForOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/actions/runners/registration-token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsCreateRegistrationTokenForOrgResponseData { - token: string; - expires_at: string; -} -declare type ActionsCreateRegistrationTokenForRepoEndpoint = { - owner: string; - repo: string; -}; -declare type ActionsCreateRegistrationTokenForRepoRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/actions/runners/registration-token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsCreateRegistrationTokenForRepoResponseData { - token: string; - expires_at: string; -} -declare type ActionsCreateRemoveTokenForOrgEndpoint = { - org: string; -}; -declare type ActionsCreateRemoveTokenForOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/actions/runners/remove-token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsCreateRemoveTokenForOrgResponseData { - token: string; - expires_at: string; -} -declare type ActionsCreateRemoveTokenForRepoEndpoint = { - owner: string; - repo: string; -}; -declare type ActionsCreateRemoveTokenForRepoRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/actions/runners/remove-token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsCreateRemoveTokenForRepoResponseData { - token: string; - expires_at: string; -} -declare type ActionsCreateSelfHostedRunnerGroupForOrgEndpoint = { - org: string; + "POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions": Operation<"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "post", "squirrel-girl">; /** - * Name of the runner group. + * @see https://docs.github.com/rest/reference/reactions/#create-reaction-for-a-team-discussion-legacy */ - name: string; + "POST /teams/{team_id}/discussions/{discussion_number}/reactions": Operation<"/teams/{team_id}/discussions/{discussion_number}/reactions", "post", "squirrel-girl">; /** - * Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. Can be one of: `all`, `selected`, or `private`. + * @see https://docs.github.com/rest/reference/users#add-an-email-address-for-the-authenticated-user */ - visibility?: "selected" | "all" | "private"; + "POST /user/emails": Operation<"/user/emails", "post">; /** - * List of repository IDs that can access the runner group. + * @see https://docs.github.com/rest/reference/users#create-a-gpg-key-for-the-authenticated-user */ - selected_repository_ids?: number[]; + "POST /user/gpg_keys": Operation<"/user/gpg_keys", "post">; /** - * List of runner IDs to add to the runner group. + * @see https://docs.github.com/rest/reference/users#create-a-public-ssh-key-for-the-authenticated-user */ - runners?: number[]; -}; -declare type ActionsCreateSelfHostedRunnerGroupForOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/actions/runner-groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsCreateSelfHostedRunnerGroupForOrgResponseData { - id: number; - name: string; - visibility: string; - default: boolean; - selected_repositories_url: string; - runners_url: string; - inherited: boolean; -} -declare type ActionsCreateWorkflowDispatchEndpoint = { - owner: string; - repo: string; - workflow_id: number; + "POST /user/keys": Operation<"/user/keys", "post">; /** - * The reference of the workflow run. The reference can be a branch, tag, or a commit SHA. + * @see https://docs.github.com/rest/reference/migrations#start-a-user-migration */ - ref: string; + "POST /user/migrations": Operation<"/user/migrations", "post">; /** - * Input keys and values configured in the workflow file. The maximum number of properties is 10. + * @see https://docs.github.com/rest/reference/packages#restore-a-package-for-the-authenticated-user */ - inputs?: ActionsCreateWorkflowDispatchParamsInputs; -}; -declare type ActionsCreateWorkflowDispatchRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/actions/workflows/:workflow_id/dispatches"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteArtifactEndpoint = { - owner: string; - repo: string; - artifact_id: number; -}; -declare type ActionsDeleteArtifactRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteOrgSecretEndpoint = { - org: string; - secret_name: string; -}; -declare type ActionsDeleteOrgSecretRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/actions/secrets/:secret_name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteRepoSecretEndpoint = { - owner: string; - repo: string; - secret_name: string; -}; -declare type ActionsDeleteRepoSecretRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/actions/secrets/:secret_name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteSelfHostedRunnerFromOrgEndpoint = { - org: string; + "POST /user/packages/{package_type}/{package_name}/restore{?token}": Operation<"/user/packages/{package_type}/{package_name}/restore", "post">; /** - * Unique identifier of the self-hosted runner. + * @see https://docs.github.com/rest/reference/packages#restore-a-package-version-for-the-authenticated-user */ - runner_id: number; -}; -declare type ActionsDeleteSelfHostedRunnerFromOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/actions/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteSelfHostedRunnerFromRepoEndpoint = { - owner: string; - repo: string; + "POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore": Operation<"/user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", "post">; /** - * Unique identifier of the self-hosted runner. + * @see https://docs.github.com/rest/reference/projects#create-a-user-project */ - runner_id: number; -}; -declare type ActionsDeleteSelfHostedRunnerFromRepoRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/actions/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteSelfHostedRunnerGroupFromOrgEndpoint = { - org: string; + "POST /user/projects": Operation<"/user/projects", "post", "inertia">; /** - * Unique identifier of the self-hosted runner group. + * @see https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user */ - runner_group_id: number; -}; -declare type ActionsDeleteSelfHostedRunnerGroupFromOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteWorkflowRunEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsDeleteWorkflowRunRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/actions/runs/:run_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDeleteWorkflowRunLogsEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsDeleteWorkflowRunLogsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/actions/runs/:run_id/logs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDownloadArtifactEndpoint = { - owner: string; - repo: string; - artifact_id: number; - archive_format: string; -}; -declare type ActionsDownloadArtifactRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDownloadJobLogsForWorkflowRunEndpoint = { - owner: string; - repo: string; - job_id: number; -}; -declare type ActionsDownloadJobLogsForWorkflowRunRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsDownloadWorkflowRunLogsEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsDownloadWorkflowRunLogsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runs/:run_id/logs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsGetArtifactEndpoint = { - owner: string; - repo: string; - artifact_id: number; -}; -declare type ActionsGetArtifactRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetArtifactResponseData { - id: number; - node_id: string; - name: string; - size_in_bytes: number; - url: string; - archive_download_url: string; - expired: boolean; - created_at: string; - expires_at: string; -} -declare type ActionsGetJobForWorkflowRunEndpoint = { - owner: string; - repo: string; - job_id: number; -}; -declare type ActionsGetJobForWorkflowRunRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/jobs/:job_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetJobForWorkflowRunResponseData { - id: number; - run_id: number; - run_url: string; - node_id: string; - head_sha: string; - url: string; - html_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - name: string; - steps: { - name: string; - status: string; - conclusion: string; - number: number; - started_at: string; - completed_at: string; - }[]; - check_run_url: string; -} -declare type ActionsGetOrgPublicKeyEndpoint = { - org: string; -}; -declare type ActionsGetOrgPublicKeyRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/secrets/public-key"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetOrgPublicKeyResponseData { - key_id: string; - key: string; -} -declare type ActionsGetOrgSecretEndpoint = { - org: string; - secret_name: string; -}; -declare type ActionsGetOrgSecretRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/secrets/:secret_name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetOrgSecretResponseData { - name: string; - created_at: string; - updated_at: string; - visibility: string; - selected_repositories_url: string; -} -declare type ActionsGetRepoPublicKeyEndpoint = { - owner: string; - repo: string; -}; -declare type ActionsGetRepoPublicKeyRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/secrets/public-key"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetRepoPublicKeyResponseData { - key_id: string; - key: string; -} -declare type ActionsGetRepoSecretEndpoint = { - owner: string; - repo: string; - secret_name: string; -}; -declare type ActionsGetRepoSecretRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/secrets/:secret_name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetRepoSecretResponseData { - name: string; - created_at: string; - updated_at: string; -} -declare type ActionsGetSelfHostedRunnerForOrgEndpoint = { - org: string; + "POST /user/repos": Operation<"/user/repos", "post">; /** - * Unique identifier of the self-hosted runner. + * @see https://docs.github.com/rest/reference/repos#upload-a-release-asset */ - runner_id: number; -}; -declare type ActionsGetSelfHostedRunnerForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetSelfHostedRunnerForOrgResponseData { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; -} -declare type ActionsGetSelfHostedRunnerForRepoEndpoint = { - owner: string; - repo: string; + "POST {origin}/repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}": Operation<"/repos/{owner}/{repo}/releases/{release_id}/assets", "post">; /** - * Unique identifier of the self-hosted runner. + * @see https://docs.github.com/rest/reference/apps#suspend-an-app-installation */ - runner_id: number; -}; -declare type ActionsGetSelfHostedRunnerForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetSelfHostedRunnerForRepoResponseData { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; -} -declare type ActionsGetSelfHostedRunnerGroupForOrgEndpoint = { - org: string; + "PUT /app/installations/{installation_id}/suspended": Operation<"/app/installations/{installation_id}/suspended", "put">; /** - * Unique identifier of the self-hosted runner group. + * @see https://docs.github.com/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app */ - runner_group_id: number; -}; -declare type ActionsGetSelfHostedRunnerGroupForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetSelfHostedRunnerGroupForOrgResponseData { - id: number; - name: string; - visibility: string; - default: boolean; - selected_repositories_url: string; - runners_url: string; - inherited: boolean; -} -declare type ActionsGetWorkflowEndpoint = { - owner: string; - repo: string; - workflow_id: number; -}; -declare type ActionsGetWorkflowRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/workflows/:workflow_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetWorkflowResponseData { - id: number; - node_id: string; - name: string; - path: string; - state: string; - created_at: string; - updated_at: string; - url: string; - html_url: string; - badge_url: string; -} -declare type ActionsGetWorkflowRunEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsGetWorkflowRunRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runs/:run_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetWorkflowRunResponseData { - id: number; - node_id: string; - head_branch: string; - head_sha: string; - run_number: number; - event: string; - status: string; - conclusion: string; - workflow_id: number; - url: string; - html_url: string; - pull_requests: unknown[]; - created_at: string; - updated_at: string; - jobs_url: string; - logs_url: string; - check_suite_url: string; - artifacts_url: string; - cancel_url: string; - rerun_url: string; - workflow_url: string; - head_commit: { - id: string; - tree_id: string; - message: string; - timestamp: string; - author: { - name: string; - email: string; - }; - committer: { - name: string; - email: string; - }; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - head_repository: { - id: number; - node_id: string; - name: string; - full_name: string; - private: boolean; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - html_url: string; - description: string; - fork: boolean; - url: string; - forks_url: string; - keys_url: string; - collaborators_url: string; - teams_url: string; - hooks_url: string; - issue_events_url: string; - events_url: string; - assignees_url: string; - branches_url: string; - tags_url: string; - blobs_url: string; - git_tags_url: string; - git_refs_url: string; - trees_url: string; - statuses_url: string; - languages_url: string; - stargazers_url: string; - contributors_url: string; - subscribers_url: string; - subscription_url: string; - commits_url: string; - git_commits_url: string; - comments_url: string; - issue_comment_url: string; - contents_url: string; - compare_url: string; - merges_url: string; - archive_url: string; - downloads_url: string; - issues_url: string; - pulls_url: string; - milestones_url: string; - notifications_url: string; - labels_url: string; - releases_url: string; - deployments_url: string; - }; -} -declare type ActionsGetWorkflowRunUsageEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsGetWorkflowRunUsageRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runs/:run_id/timing"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetWorkflowRunUsageResponseData { - billable: { - UBUNTU: { - total_ms: number; - jobs: number; - }; - MACOS: { - total_ms: number; - jobs: number; - }; - WINDOWS: { - total_ms: number; - jobs: number; - }; - }; - run_duration_ms: number; -} -declare type ActionsGetWorkflowUsageEndpoint = { - owner: string; - repo: string; - workflow_id: number; -}; -declare type ActionsGetWorkflowUsageRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/workflows/:workflow_id/timing"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsGetWorkflowUsageResponseData { - billable: { - UBUNTU: { - total_ms: number; - }; - MACOS: { - total_ms: number; - }; - WINDOWS: { - total_ms: number; - }; - }; -} -declare type ActionsListArtifactsForRepoEndpoint = { - owner: string; - repo: string; + "PUT /authorizations/clients/{client_id}": Operation<"/authorizations/clients/{client_id}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint */ - per_page?: number; + "PUT /authorizations/clients/{client_id}/{fingerprint}": Operation<"/authorizations/clients/{client_id}/{fingerprint}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/enterprise-admin#set-github-actions-permissions-for-an-enterprise */ - page?: number; -}; -declare type ActionsListArtifactsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/artifacts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListArtifactsForRepoResponseData { - total_count: number; - artifacts: { - id: number; - node_id: string; - name: string; - size_in_bytes: number; - url: string; - archive_download_url: string; - expired: boolean; - created_at: string; - expires_at: string; - }[]; -} -declare type ActionsListJobsForWorkflowRunEndpoint = { - owner: string; - repo: string; - run_id: number; - /** - * Filters jobs by their `completed_at` timestamp. Can be one of: - * \* `latest`: Returns jobs from the most recent execution of the workflow run. - * \* `all`: Returns all jobs for a workflow run, including from old executions of the workflow run. - */ - filter?: "latest" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListJobsForWorkflowRunRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListJobsForWorkflowRunResponseData { - total_count: number; - jobs: { - id: number; - run_id: number; - run_url: string; - node_id: string; - head_sha: string; - url: string; - html_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - name: string; - steps: { - name: string; - status: string; - conclusion: string; - number: number; - started_at: string; - completed_at: string; - }[]; - check_run_url: string; - }[]; -} -declare type ActionsListOrgSecretsEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListOrgSecretsRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/secrets"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListOrgSecretsResponseData { - total_count: number; - secrets: { - name: string; - created_at: string; - updated_at: string; - visibility: string; - selected_repositories_url: string; - }[]; -} -declare type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; -}; -declare type ActionsListRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListRepoAccessToSelfHostedRunnerGroupInOrgResponseData { - total_count: number; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; -} -declare type ActionsListRepoSecretsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListRepoSecretsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/secrets"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListRepoSecretsResponseData { - total_count: number; - secrets: { - name: string; - created_at: string; - updated_at: string; - }[]; -} -declare type ActionsListRepoWorkflowsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListRepoWorkflowsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/workflows"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListRepoWorkflowsResponseData { - total_count: number; - workflows: { - id: number; - node_id: string; - name: string; - path: string; - state: string; - created_at: string; - updated_at: string; - url: string; - html_url: string; - badge_url: string; - }[]; -} -declare type ActionsListRunnerApplicationsForOrgEndpoint = { - org: string; -}; -declare type ActionsListRunnerApplicationsForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runners/downloads"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActionsListRunnerApplicationsForOrgResponseData = { - os: string; - architecture: string; - download_url: string; - filename: string; -}[]; -declare type ActionsListRunnerApplicationsForRepoEndpoint = { - owner: string; - repo: string; -}; -declare type ActionsListRunnerApplicationsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runners/downloads"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActionsListRunnerApplicationsForRepoResponseData = { - os: string; - architecture: string; - download_url: string; - filename: string; -}[]; -declare type ActionsListSelectedReposForOrgSecretEndpoint = { - org: string; - secret_name: string; -}; -declare type ActionsListSelectedReposForOrgSecretRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/secrets/:secret_name/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListSelectedReposForOrgSecretResponseData { - total_count: number; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }[]; -} -declare type ActionsListSelfHostedRunnerGroupsForOrgEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListSelfHostedRunnerGroupsForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runner-groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListSelfHostedRunnerGroupsForOrgResponseData { - total_count: number; - runner_groups: { - id: number; - name: string; - visibility: string; - default: boolean; - selected_repositories_url: string; - runners_url: string; - inherited: boolean; - }[]; -} -declare type ActionsListSelfHostedRunnersForOrgEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListSelfHostedRunnersForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListSelfHostedRunnersForOrgResponseData { - total_count: number; - runners: { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; - }[]; -} -declare type ActionsListSelfHostedRunnersForRepoEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListSelfHostedRunnersForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListSelfHostedRunnersForRepoResponseData { - total_count: number; - runners: { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; - }[]; -} -declare type ActionsListSelfHostedRunnersInGroupForOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListSelfHostedRunnersInGroupForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListSelfHostedRunnersInGroupForOrgResponseData { - total_count: number; - runners: { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; - }[]; -} -declare type ActionsListWorkflowRunArtifactsEndpoint = { - owner: string; - repo: string; - run_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListWorkflowRunArtifactsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListWorkflowRunArtifactsResponseData { - total_count: number; - artifacts: { - id: number; - node_id: string; - name: string; - size_in_bytes: number; - url: string; - archive_download_url: string; - expired: boolean; - created_at: string; - expires_at: string; - }[]; -} -declare type ActionsListWorkflowRunsEndpoint = { - owner: string; - repo: string; - workflow_id: number; - /** - * Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. - */ - actor?: string; - /** - * Returns workflow runs associated with a branch. Use the name of the branch of the `push`. - */ - branch?: string; - /** - * Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." - */ - event?: string; - /** - * Returns workflow runs associated with the check run `status` or `conclusion` you specify. For example, a conclusion can be `success` or a status can be `completed`. For more information, see the `status` and `conclusion` options available in "[Create a check run](https://developer.github.com/v3/checks/runs/#create-a-check-run)." - */ - status?: "completed" | "status" | "conclusion"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListWorkflowRunsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListWorkflowRunsResponseData { - total_count: number; - workflow_runs: { - id: number; - node_id: string; - head_branch: string; - head_sha: string; - run_number: number; - event: string; - status: string; - conclusion: string; - workflow_id: number; - url: string; - html_url: string; - pull_requests: unknown[]; - created_at: string; - updated_at: string; - jobs_url: string; - logs_url: string; - check_suite_url: string; - artifacts_url: string; - cancel_url: string; - rerun_url: string; - workflow_url: string; - head_commit: { - id: string; - tree_id: string; - message: string; - timestamp: string; - author: { - name: string; - email: string; - }; - committer: { - name: string; - email: string; - }; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - head_repository: { - id: number; - node_id: string; - name: string; - full_name: string; - private: boolean; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - html_url: string; - description: string; - fork: boolean; - url: string; - forks_url: string; - keys_url: string; - collaborators_url: string; - teams_url: string; - hooks_url: string; - issue_events_url: string; - events_url: string; - assignees_url: string; - branches_url: string; - tags_url: string; - blobs_url: string; - git_tags_url: string; - git_refs_url: string; - trees_url: string; - statuses_url: string; - languages_url: string; - stargazers_url: string; - contributors_url: string; - subscribers_url: string; - subscription_url: string; - commits_url: string; - git_commits_url: string; - comments_url: string; - issue_comment_url: string; - contents_url: string; - compare_url: string; - merges_url: string; - archive_url: string; - downloads_url: string; - issues_url: string; - pulls_url: string; - milestones_url: string; - notifications_url: string; - labels_url: string; - releases_url: string; - deployments_url: string; - }; - }[]; -} -declare type ActionsListWorkflowRunsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. - */ - actor?: string; - /** - * Returns workflow runs associated with a branch. Use the name of the branch of the `push`. - */ - branch?: string; - /** - * Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." - */ - event?: string; - /** - * Returns workflow runs associated with the check run `status` or `conclusion` you specify. For example, a conclusion can be `success` or a status can be `completed`. For more information, see the `status` and `conclusion` options available in "[Create a check run](https://developer.github.com/v3/checks/runs/#create-a-check-run)." - */ - status?: "completed" | "status" | "conclusion"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActionsListWorkflowRunsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/actions/runs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsListWorkflowRunsForRepoResponseData { - total_count: number; - workflow_runs: { - id: number; - node_id: string; - head_branch: string; - head_sha: string; - run_number: number; - event: string; - status: string; - conclusion: string; - workflow_id: number; - url: string; - html_url: string; - pull_requests: unknown[]; - created_at: string; - updated_at: string; - jobs_url: string; - logs_url: string; - check_suite_url: string; - artifacts_url: string; - cancel_url: string; - rerun_url: string; - workflow_url: string; - head_commit: { - id: string; - tree_id: string; - message: string; - timestamp: string; - author: { - name: string; - email: string; - }; - committer: { - name: string; - email: string; - }; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - head_repository: { - id: number; - node_id: string; - name: string; - full_name: string; - private: boolean; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - html_url: string; - description: string; - fork: boolean; - url: string; - forks_url: string; - keys_url: string; - collaborators_url: string; - teams_url: string; - hooks_url: string; - issue_events_url: string; - events_url: string; - assignees_url: string; - branches_url: string; - tags_url: string; - blobs_url: string; - git_tags_url: string; - git_refs_url: string; - trees_url: string; - statuses_url: string; - languages_url: string; - stargazers_url: string; - contributors_url: string; - subscribers_url: string; - subscription_url: string; - commits_url: string; - git_commits_url: string; - comments_url: string; - issue_comment_url: string; - contents_url: string; - compare_url: string; - merges_url: string; - archive_url: string; - downloads_url: string; - issues_url: string; - pulls_url: string; - milestones_url: string; - notifications_url: string; - labels_url: string; - releases_url: string; - deployments_url: string; - }; - }[]; -} -declare type ActionsReRunWorkflowEndpoint = { - owner: string; - repo: string; - run_id: number; -}; -declare type ActionsReRunWorkflowRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - repository_id: number; -}; -declare type ActionsRemoveRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/repositories/:repository_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsRemoveSelectedRepoFromOrgSecretEndpoint = { - org: string; - secret_name: string; - repository_id: number; -}; -declare type ActionsRemoveSelectedRepoFromOrgSecretRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/actions/secrets/:secret_name/repositories/:repository_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsRemoveSelfHostedRunnerFromGroupForOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Unique identifier of the self-hosted runner. - */ - runner_id: number; -}; -declare type ActionsRemoveSelfHostedRunnerFromGroupForOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * List of repository IDs that can access the runner group. - */ - selected_repository_ids: number[]; -}; -declare type ActionsSetRepoAccessToSelfHostedRunnerGroupInOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsSetSelectedReposForOrgSecretEndpoint = { - org: string; - secret_name: string; - /** - * An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://developer.github.com/v3/actions/secrets/#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://developer.github.com/v3/actions/secrets/#remove-selected-repository-from-an-organization-secret) endpoints. - */ - selected_repository_ids?: number[]; -}; -declare type ActionsSetSelectedReposForOrgSecretRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/secrets/:secret_name/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsSetSelfHostedRunnersInGroupForOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * List of runner IDs to add to the runner group. - */ - runners: number[]; -}; -declare type ActionsSetSelfHostedRunnersInGroupForOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActionsUpdateSelfHostedRunnerGroupForOrgEndpoint = { - org: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Name of the runner group. - */ - name?: string; - /** - * Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. Can be one of: `all`, `selected`, or `private`. - */ - visibility?: "selected" | "all" | "private"; -}; -declare type ActionsUpdateSelfHostedRunnerGroupForOrgRequestOptions = { - method: "PATCH"; - url: "/orgs/:org/actions/runner-groups/:runner_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActionsUpdateSelfHostedRunnerGroupForOrgResponseData { - id: number; - name: string; - visibility: string; - default: boolean; - selected_repositories_url: string; - runners_url: string; - inherited: boolean; -} -declare type ActivityCheckRepoIsStarredByAuthenticatedUserEndpoint = { - owner: string; - repo: string; -}; -declare type ActivityCheckRepoIsStarredByAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/starred/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityDeleteRepoSubscriptionEndpoint = { - owner: string; - repo: string; -}; -declare type ActivityDeleteRepoSubscriptionRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/subscription"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityDeleteThreadSubscriptionEndpoint = { - thread_id: number; -}; -declare type ActivityDeleteThreadSubscriptionRequestOptions = { - method: "DELETE"; - url: "/notifications/threads/:thread_id/subscription"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityGetFeedsEndpoint = {}; -declare type ActivityGetFeedsRequestOptions = { - method: "GET"; - url: "/feeds"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActivityGetFeedsResponseData { - timeline_url: string; - user_url: string; - current_user_public_url: string; - current_user_url: string; - current_user_actor_url: string; - current_user_organization_url: string; - current_user_organization_urls: string[]; - security_advisories_url: string; - _links: { - timeline: { - href: string; - type: string; - }; - user: { - href: string; - type: string; - }; - current_user_public: { - href: string; - type: string; - }; - current_user: { - href: string; - type: string; - }; - current_user_actor: { - href: string; - type: string; - }; - current_user_organization: { - href: string; - type: string; - }; - current_user_organizations: { - href: string; - type: string; - }[]; - security_advisories: { - href: string; - type: string; - }; - }; -} -declare type ActivityGetRepoSubscriptionEndpoint = { - owner: string; - repo: string; -}; -declare type ActivityGetRepoSubscriptionRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/subscription"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActivityGetRepoSubscriptionResponseData { - subscribed: boolean; - ignored: boolean; - reason: string; - created_at: string; - url: string; - repository_url: string; -} -declare type ActivityGetThreadEndpoint = { - thread_id: number; -}; -declare type ActivityGetThreadRequestOptions = { - method: "GET"; - url: "/notifications/threads/:thread_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActivityGetThreadResponseData { - id: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - subject: { - title: string; - url: string; - latest_comment_url: string; - type: string; - }; - reason: string; - unread: boolean; - updated_at: string; - last_read_at: string; - url: string; -} -declare type ActivityGetThreadSubscriptionForAuthenticatedUserEndpoint = { - thread_id: number; -}; -declare type ActivityGetThreadSubscriptionForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/notifications/threads/:thread_id/subscription"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActivityGetThreadSubscriptionForAuthenticatedUserResponseData { - subscribed: boolean; - ignored: boolean; - reason: string; - created_at: string; - url: string; - thread_url: string; -} -declare type ActivityListEventsForAuthenticatedUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListEventsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/users/:username/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListNotificationsForAuthenticatedUserEndpoint = { - /** - * If `true`, show notifications marked as read. - */ - all?: boolean; - /** - * If `true`, only shows notifications in which the user is directly participating or mentioned. - */ - participating?: boolean; - /** - * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - before?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListNotificationsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/notifications"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListNotificationsForAuthenticatedUserResponseData = { - id: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - subject: { - title: string; - url: string; - latest_comment_url: string; - type: string; - }; - reason: string; - unread: boolean; - updated_at: string; - last_read_at: string; - url: string; -}[]; -declare type ActivityListOrgEventsForAuthenticatedUserEndpoint = { - username: string; - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListOrgEventsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/users/:username/events/orgs/:org"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListPublicEventsEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListPublicEventsRequestOptions = { - method: "GET"; - url: "/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListPublicEventsForRepoNetworkEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListPublicEventsForRepoNetworkRequestOptions = { - method: "GET"; - url: "/networks/:owner/:repo/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListPublicEventsForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListPublicEventsForUserRequestOptions = { - method: "GET"; - url: "/users/:username/events/public"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListPublicOrgEventsEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListPublicOrgEventsRequestOptions = { - method: "GET"; - url: "/orgs/:org/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListReceivedEventsForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListReceivedEventsForUserRequestOptions = { - method: "GET"; - url: "/users/:username/received_events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListReceivedPublicEventsForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListReceivedPublicEventsForUserRequestOptions = { - method: "GET"; - url: "/users/:username/received_events/public"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListRepoEventsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListRepoEventsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityListRepoNotificationsForAuthenticatedUserEndpoint = { - owner: string; - repo: string; - /** - * If `true`, show notifications marked as read. - */ - all?: boolean; - /** - * If `true`, only shows notifications in which the user is directly participating or mentioned. - */ - participating?: boolean; - /** - * Only show notifications updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - before?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListRepoNotificationsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/notifications"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListRepoNotificationsForAuthenticatedUserResponseData = { - id: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - subject: { - title: string; - url: string; - latest_comment_url: string; - type: string; - }; - reason: string; - unread: boolean; - updated_at: string; - last_read_at: string; - url: string; -}[]; -declare type ActivityListReposStarredByAuthenticatedUserEndpoint = { - /** - * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). - */ - sort?: "created" | "updated"; - /** - * One of `asc` (ascending) or `desc` (descending). - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListReposStarredByAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/starred"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListReposStarredByAuthenticatedUserResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -}[]; -export declare type ActivityListReposStarredByAuthenticatedUserResponse200Data = { - starred_at: string; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -}[]; -declare type ActivityListReposStarredByUserEndpoint = { - username: string; - /** - * One of `created` (when the repository was starred) or `updated` (when it was last pushed to). - */ - sort?: "created" | "updated"; - /** - * One of `asc` (ascending) or `desc` (descending). - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListReposStarredByUserRequestOptions = { - method: "GET"; - url: "/users/:username/starred"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListReposStarredByUserResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -}[]; -export declare type ActivityListReposStarredByUserResponse200Data = { - starred_at: string; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -}[]; -declare type ActivityListReposWatchedByUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListReposWatchedByUserRequestOptions = { - method: "GET"; - url: "/users/:username/subscriptions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListReposWatchedByUserResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type ActivityListStargazersForRepoEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListStargazersForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/stargazers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListStargazersForRepoResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -export declare type ActivityListStargazersForRepoResponse200Data = { - starred_at: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -}[]; -declare type ActivityListWatchedReposForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListWatchedReposForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/subscriptions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListWatchedReposForAuthenticatedUserResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type ActivityListWatchersForRepoEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ActivityListWatchersForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/subscribers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ActivityListWatchersForRepoResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type ActivityMarkNotificationsAsReadEndpoint = { - /** - * Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. - */ - last_read_at?: string; -}; -declare type ActivityMarkNotificationsAsReadRequestOptions = { - method: "PUT"; - url: "/notifications"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityMarkRepoNotificationsAsReadEndpoint = { - owner: string; - repo: string; - /** - * Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. - */ - last_read_at?: string; -}; -declare type ActivityMarkRepoNotificationsAsReadRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/notifications"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityMarkThreadAsReadEndpoint = { - thread_id: number; -}; -declare type ActivityMarkThreadAsReadRequestOptions = { - method: "PATCH"; - url: "/notifications/threads/:thread_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivitySetRepoSubscriptionEndpoint = { - owner: string; - repo: string; - /** - * Determines if notifications should be received from this repository. - */ - subscribed?: boolean; - /** - * Determines if all notifications should be blocked from this repository. - */ - ignored?: boolean; -}; -declare type ActivitySetRepoSubscriptionRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/subscription"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActivitySetRepoSubscriptionResponseData { - subscribed: boolean; - ignored: boolean; - reason: string; - created_at: string; - url: string; - repository_url: string; -} -declare type ActivitySetThreadSubscriptionEndpoint = { - thread_id: number; - /** - * Unsubscribes and subscribes you to a conversation. Set `ignored` to `true` to block all notifications from this thread. - */ - ignored?: boolean; -}; -declare type ActivitySetThreadSubscriptionRequestOptions = { - method: "PUT"; - url: "/notifications/threads/:thread_id/subscription"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ActivitySetThreadSubscriptionResponseData { - subscribed: boolean; - ignored: boolean; - reason: string; - created_at: string; - url: string; - thread_url: string; -} -declare type ActivityStarRepoForAuthenticatedUserEndpoint = { - owner: string; - repo: string; -}; -declare type ActivityStarRepoForAuthenticatedUserRequestOptions = { - method: "PUT"; - url: "/user/starred/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ActivityUnstarRepoForAuthenticatedUserEndpoint = { - owner: string; - repo: string; -}; -declare type ActivityUnstarRepoForAuthenticatedUserRequestOptions = { - method: "DELETE"; - url: "/user/starred/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsAddRepoToInstallationEndpoint = { - installation_id: number; - repository_id: number; -}; -declare type AppsAddRepoToInstallationRequestOptions = { - method: "PUT"; - url: "/user/installations/:installation_id/repositories/:repository_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsCheckAuthorizationEndpoint = { - client_id: string; - access_token: string; -}; -declare type AppsCheckAuthorizationRequestOptions = { - method: "GET"; - url: "/applications/:client_id/tokens/:access_token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsCheckAuthorizationResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type AppsCheckTokenEndpoint = { - client_id: string; - /** - * The OAuth access token used to authenticate to the GitHub API. - */ - access_token?: string; -}; -declare type AppsCheckTokenRequestOptions = { - method: "POST"; - url: "/applications/:client_id/token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsCheckTokenResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type AppsCreateContentAttachmentEndpoint = { - content_reference_id: number; - /** - * The title of the content attachment displayed in the body or comment of an issue or pull request. - */ - title: string; - /** - * The body text of the content attachment displayed in the body or comment of an issue or pull request. This parameter supports markdown. - */ - body: string; -} & RequiredPreview<"corsair">; -declare type AppsCreateContentAttachmentRequestOptions = { - method: "POST"; - url: "/content_references/:content_reference_id/attachments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsCreateContentAttachmentResponseData { - id: number; - title: string; - body: string; -} -declare type AppsCreateFromManifestEndpoint = { - code: string; -}; -declare type AppsCreateFromManifestRequestOptions = { - method: "POST"; - url: "/app-manifests/:code/conversions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsCreateFromManifestResponseData { - id: number; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - client_id: string; - client_secret: string; - webhook_secret: string; - pem: string; -} -declare type AppsCreateInstallationAccessTokenEndpoint = { - installation_id: number; - /** - * The `id`s of the repositories that the installation token can access. Providing repository `id`s restricts the access of an installation token to specific repositories. You can use the "[List repositories accessible to the app installation](https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-app-installation)" endpoint to get the `id` of all repositories that an installation can access. For example, you can select specific repositories when creating an installation token to restrict the number of repositories that can be cloned using the token. - */ - repository_ids?: number[]; - /** - * 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](https://developer.github.com/apps/building-github-apps/creating-github-apps-using-url-parameters/#github-app-permissions)." - */ - permissions?: AppsCreateInstallationAccessTokenParamsPermissions; -}; -declare type AppsCreateInstallationAccessTokenRequestOptions = { - method: "POST"; - url: "/app/installations/:installation_id/access_tokens"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsCreateInstallationAccessTokenResponseData { - token: string; - expires_at: string; - permissions: { - issues: string; - contents: string; - }; - repository_selection: "all" | "selected"; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; -} -declare type AppsDeleteAuthorizationEndpoint = { - client_id: string; - /** - * The OAuth access token used to authenticate to the GitHub API. - */ - access_token?: string; -}; -declare type AppsDeleteAuthorizationRequestOptions = { - method: "DELETE"; - url: "/applications/:client_id/grant"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsDeleteInstallationEndpoint = { - installation_id: number; -}; -declare type AppsDeleteInstallationRequestOptions = { - method: "DELETE"; - url: "/app/installations/:installation_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsDeleteTokenEndpoint = { - client_id: string; - /** - * The OAuth access token used to authenticate to the GitHub API. - */ - access_token?: string; -}; -declare type AppsDeleteTokenRequestOptions = { - method: "DELETE"; - url: "/applications/:client_id/token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsGetAuthenticatedEndpoint = {}; -declare type AppsGetAuthenticatedRequestOptions = { - method: "GET"; - url: "/app"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetAuthenticatedResponseData { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - installations_count: number; -} -declare type AppsGetBySlugEndpoint = { - app_slug: string; -}; -declare type AppsGetBySlugRequestOptions = { - method: "GET"; - url: "/apps/:app_slug"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetBySlugResponseData { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; -} -declare type AppsGetInstallationEndpoint = { - installation_id: number; -}; -declare type AppsGetInstallationRequestOptions = { - method: "GET"; - url: "/app/installations/:installation_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetInstallationResponseData { - id: number; - account: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - checks: string; - metadata: string; - contents: string; - }; - events: string[]; - single_file_name: string; - repository_selection: "all" | "selected"; -} -declare type AppsGetOrgInstallationEndpoint = { - org: string; -}; -declare type AppsGetOrgInstallationRequestOptions = { - method: "GET"; - url: "/orgs/:org/installation"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetOrgInstallationResponseData { - id: number; - account: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repository_selection: "all" | "selected"; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - checks: string; - metadata: string; - contents: string; - }; - events: string[]; - created_at: string; - updated_at: string; - single_file_name: string; -} -declare type AppsGetRepoInstallationEndpoint = { - owner: string; - repo: string; -}; -declare type AppsGetRepoInstallationRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/installation"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetRepoInstallationResponseData { - id: number; - account: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repository_selection: "all" | "selected"; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - checks: string; - metadata: string; - contents: string; - }; - events: string[]; - created_at: string; - updated_at: string; - single_file_name: string; -} -declare type AppsGetSubscriptionPlanForAccountEndpoint = { - account_id: number; -}; -declare type AppsGetSubscriptionPlanForAccountRequestOptions = { - method: "GET"; - url: "/marketplace_listing/accounts/:account_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetSubscriptionPlanForAccountResponseData { - url: string; - type: string; - id: number; - login: string; - email: string; - organization_billing_email: string; - marketplace_pending_change: { - effective_date: string; - unit_count: number; - id: number; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - state: string; - unit_name: string; - bullets: string[]; - }; - }; - marketplace_purchase: { - billing_cycle: string; - next_billing_date: string; - unit_count: number; - on_free_trial: boolean; - free_trial_ends_on: string; - updated_at: string; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; - }; - }; -} -declare type AppsGetSubscriptionPlanForAccountStubbedEndpoint = { - account_id: number; -}; -declare type AppsGetSubscriptionPlanForAccountStubbedRequestOptions = { - method: "GET"; - url: "/marketplace_listing/stubbed/accounts/:account_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetSubscriptionPlanForAccountStubbedResponseData { - url: string; - type: string; - id: number; - login: string; - email: string; - organization_billing_email: string; - marketplace_pending_change: { - effective_date: string; - unit_count: number; - id: number; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - state: string; - unit_name: string; - bullets: string[]; - }; - }; - marketplace_purchase: { - billing_cycle: string; - next_billing_date: string; - unit_count: number; - on_free_trial: boolean; - free_trial_ends_on: string; - updated_at: string; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; - }; - }; -} -declare type AppsGetUserInstallationEndpoint = { - username: string; -}; -declare type AppsGetUserInstallationRequestOptions = { - method: "GET"; - url: "/users/:username/installation"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsGetUserInstallationResponseData { - id: number; - account: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repository_selection: "all" | "selected"; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - checks: string; - metadata: string; - contents: string; - }; - events: string[]; - created_at: string; - updated_at: string; - single_file_name: string; -} -declare type AppsListAccountsForPlanEndpoint = { - plan_id: number; - /** - * Sorts the GitHub accounts by the date they were created or last updated. Can be one of `created` or `updated`. - */ - sort?: "created" | "updated"; - /** - * To return the oldest accounts first, set to `asc`. Can be one of `asc` or `desc`. Ignored without the `sort` parameter. - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListAccountsForPlanRequestOptions = { - method: "GET"; - url: "/marketplace_listing/plans/:plan_id/accounts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListAccountsForPlanResponseData = { - url: string; - type: string; - id: number; - login: string; - email: string; - organization_billing_email: string; - marketplace_pending_change: { - effective_date: string; - unit_count: number; - id: number; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - state: string; - unit_name: string; - bullets: string[]; - }; - }; - marketplace_purchase: { - billing_cycle: string; - next_billing_date: string; - unit_count: number; - on_free_trial: boolean; - free_trial_ends_on: string; - updated_at: string; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; - }; - }; -}[]; -declare type AppsListAccountsForPlanStubbedEndpoint = { - plan_id: number; - /** - * Sorts the GitHub accounts by the date they were created or last updated. Can be one of `created` or `updated`. - */ - sort?: "created" | "updated"; - /** - * To return the oldest accounts first, set to `asc`. Can be one of `asc` or `desc`. Ignored without the `sort` parameter. - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListAccountsForPlanStubbedRequestOptions = { - method: "GET"; - url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListAccountsForPlanStubbedResponseData = { - url: string; - type: string; - id: number; - login: string; - email: string; - organization_billing_email: string; - marketplace_pending_change: { - effective_date: string; - unit_count: number; - id: number; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - state: string; - unit_name: string; - bullets: string[]; - }; - }; - marketplace_purchase: { - billing_cycle: string; - next_billing_date: string; - unit_count: number; - on_free_trial: boolean; - free_trial_ends_on: string; - updated_at: string; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; - }; - }; -}[]; -declare type AppsListInstallationReposForAuthenticatedUserEndpoint = { - installation_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListInstallationReposForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/installations/:installation_id/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsListInstallationReposForAuthenticatedUserResponseData { - total_count: number; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; -} -declare type AppsListInstallationsEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListInstallationsRequestOptions = { - method: "GET"; - url: "/app/installations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListInstallationsResponseData = { - id: number; - account: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - checks: string; - metadata: string; - contents: string; - }; - events: string[]; - single_file_name: string; - repository_selection: "all" | "selected"; -}[]; -declare type AppsListInstallationsForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListInstallationsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/installations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsListInstallationsForAuthenticatedUserResponseData { - total_count: number; - installations: { - id: number; - account: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - gravatar_id: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - checks: string; - metadata: string; - contents: string; - }; - events: string[]; - single_file_name: string; - }[]; -} -declare type AppsListPlansEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListPlansRequestOptions = { - method: "GET"; - url: "/marketplace_listing/plans"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListPlansResponseData = { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; -}[]; -declare type AppsListPlansStubbedEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListPlansStubbedRequestOptions = { - method: "GET"; - url: "/marketplace_listing/stubbed/plans"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListPlansStubbedResponseData = { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; -}[]; -declare type AppsListReposAccessibleToInstallationEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListReposAccessibleToInstallationRequestOptions = { - method: "GET"; - url: "/installation/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsListReposAccessibleToInstallationResponseData { - total_count: number; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; -} -declare type AppsListSubscriptionsForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListSubscriptionsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/marketplace_purchases"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListSubscriptionsForAuthenticatedUserResponseData = { - billing_cycle: string; - next_billing_date: string; - unit_count: number; - on_free_trial: boolean; - free_trial_ends_on: string; - updated_at: string; - account: { - login: string; - id: number; - url: string; - email: string; - organization_billing_email: string; - type: string; - }; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; - }; -}[]; -declare type AppsListSubscriptionsForAuthenticatedUserStubbedEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type AppsListSubscriptionsForAuthenticatedUserStubbedRequestOptions = { - method: "GET"; - url: "/user/marketplace_purchases/stubbed"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type AppsListSubscriptionsForAuthenticatedUserStubbedResponseData = { - billing_cycle: string; - next_billing_date: string; - unit_count: number; - on_free_trial: boolean; - free_trial_ends_on: string; - updated_at: string; - account: { - login: string; - id: number; - url: string; - email: string; - organization_billing_email: string; - type: string; - }; - plan: { - url: string; - accounts_url: string; - id: number; - number: number; - name: string; - description: string; - monthly_price_in_cents: number; - yearly_price_in_cents: number; - price_model: string; - has_free_trial: boolean; - unit_name: string; - state: string; - bullets: string[]; - }; -}[]; -declare type AppsRemoveRepoFromInstallationEndpoint = { - installation_id: number; - repository_id: number; -}; -declare type AppsRemoveRepoFromInstallationRequestOptions = { - method: "DELETE"; - url: "/user/installations/:installation_id/repositories/:repository_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsResetAuthorizationEndpoint = { - client_id: string; - access_token: string; -}; -declare type AppsResetAuthorizationRequestOptions = { - method: "POST"; - url: "/applications/:client_id/tokens/:access_token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsResetAuthorizationResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type AppsResetTokenEndpoint = { - client_id: string; - /** - * The OAuth access token used to authenticate to the GitHub API. - */ - access_token?: string; -}; -declare type AppsResetTokenRequestOptions = { - method: "PATCH"; - url: "/applications/:client_id/token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface AppsResetTokenResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type AppsRevokeAuthorizationForApplicationEndpoint = { - client_id: string; - access_token: string; -}; -declare type AppsRevokeAuthorizationForApplicationRequestOptions = { - method: "DELETE"; - url: "/applications/:client_id/tokens/:access_token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsRevokeGrantForApplicationEndpoint = { - client_id: string; - access_token: string; -}; -declare type AppsRevokeGrantForApplicationRequestOptions = { - method: "DELETE"; - url: "/applications/:client_id/grants/:access_token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsRevokeInstallationAccessTokenEndpoint = {}; -declare type AppsRevokeInstallationAccessTokenRequestOptions = { - method: "DELETE"; - url: "/installation/token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsSuspendInstallationEndpoint = { - installation_id: number; -}; -declare type AppsSuspendInstallationRequestOptions = { - method: "PUT"; - url: "/app/installations/:installation_id/suspended"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type AppsUnsuspendInstallationEndpoint = { - installation_id: number; -}; -declare type AppsUnsuspendInstallationRequestOptions = { - method: "DELETE"; - url: "/app/installations/:installation_id/suspended"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type BillingGetGithubActionsBillingOrgEndpoint = { - org: string; -}; -declare type BillingGetGithubActionsBillingOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/settings/billing/actions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface BillingGetGithubActionsBillingOrgResponseData { - /** - * The sum of the free and paid GitHub Actions minutes used. - */ - total_minutes_used: number; - /** - * The total paid GitHub Actions minutes used. - */ - total_paid_minutes_used: number; - /** - * The amount of free GitHub Actions minutes available. - */ - included_minutes: number; - minutes_used_breakdown: { - /** - * Total minutes used on Ubuntu runner machines. - */ - UBUNTU: number; - /** - * Total minutes used on macOS runner machines. - */ - MACOS: number; - /** - * Total minutes used on Windows runner machines. - */ - WINDOWS: number; - }; -} -declare type BillingGetGithubActionsBillingUserEndpoint = { - username: string; -}; -declare type BillingGetGithubActionsBillingUserRequestOptions = { - method: "GET"; - url: "/users/:username/settings/billing/actions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface BillingGetGithubActionsBillingUserResponseData { - /** - * The sum of the free and paid GitHub Actions minutes used. - */ - total_minutes_used: number; - /** - * The total paid GitHub Actions minutes used. - */ - total_paid_minutes_used: number; - /** - * The amount of free GitHub Actions minutes available. - */ - included_minutes: number; - minutes_used_breakdown: { - /** - * Total minutes used on Ubuntu runner machines. - */ - UBUNTU: number; - /** - * Total minutes used on macOS runner machines. - */ - MACOS: number; - /** - * Total minutes used on Windows runner machines. - */ - WINDOWS: number; - }; -} -declare type BillingGetGithubPackagesBillingOrgEndpoint = { - org: string; -}; -declare type BillingGetGithubPackagesBillingOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/settings/billing/packages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface BillingGetGithubPackagesBillingOrgResponseData { - /** - * Sum of the free and paid storage space (GB) for GitHuub Packages. - */ - total_gigabytes_bandwidth_used: number; - /** - * Total paid storage space (GB) for GitHuub Packages. - */ - total_paid_gigabytes_bandwidth_used: number; - /** - * Free storage space (GB) for GitHub Packages. - */ - included_gigabytes_bandwidth: number; -} -declare type BillingGetGithubPackagesBillingUserEndpoint = { - username: string; -}; -declare type BillingGetGithubPackagesBillingUserRequestOptions = { - method: "GET"; - url: "/users/:username/settings/billing/packages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface BillingGetGithubPackagesBillingUserResponseData { - /** - * Sum of the free and paid storage space (GB) for GitHuub Packages. - */ - total_gigabytes_bandwidth_used: number; - /** - * Total paid storage space (GB) for GitHuub Packages. - */ - total_paid_gigabytes_bandwidth_used: number; - /** - * Free storage space (GB) for GitHub Packages. - */ - included_gigabytes_bandwidth: number; -} -declare type BillingGetSharedStorageBillingOrgEndpoint = { - org: string; -}; -declare type BillingGetSharedStorageBillingOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/settings/billing/shared-storage"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface BillingGetSharedStorageBillingOrgResponseData { - /** - * Numbers of days left in billing cycle. - */ - days_left_in_billing_cycle: number; - /** - * Estimated storage space (GB) used in billing cycle. - */ - estimated_paid_storage_for_month: number; - /** - * Estimated sum of free and paid storage space (GB) used in billing cycle. - */ - estimated_storage_for_month: number; -} -declare type BillingGetSharedStorageBillingUserEndpoint = { - username: string; -}; -declare type BillingGetSharedStorageBillingUserRequestOptions = { - method: "GET"; - url: "/users/:username/settings/billing/shared-storage"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface BillingGetSharedStorageBillingUserResponseData { - /** - * Numbers of days left in billing cycle. - */ - days_left_in_billing_cycle: number; - /** - * Estimated storage space (GB) used in billing cycle. - */ - estimated_paid_storage_for_month: number; - /** - * Estimated sum of free and paid storage space (GB) used in billing cycle. - */ - estimated_storage_for_month: number; -} -declare type ChecksCreateEndpoint = { - owner: string; - repo: string; - /** - * The name of the check. For example, "code-coverage". - */ - name: string; - /** - * The SHA of the commit. - */ - head_sha: string; - /** - * The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used. - */ - details_url?: string; - /** - * A reference for the run on the integrator's system. - */ - external_id?: string; - /** - * The current status. Can be one of `queued`, `in_progress`, or `completed`. - */ - status?: "queued" | "in_progress" | "completed"; - /** - * The time that the check run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - started_at?: string; - /** - * **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `success`, `failure`, `neutral`, `cancelled`, `skipped`, `timed_out`, or `action_required`. When the conclusion is `action_required`, additional details should be provided on the site specified by `details_url`. - * **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. Only GitHub can change a check run conclusion to `stale`. - */ - conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required"; - /** - * The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - completed_at?: string; - /** - * Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://developer.github.com/v3/checks/runs/#output-object) description. - */ - output?: ChecksCreateParamsOutput; - /** - * Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the [`check_run.requested_action` webhook](https://developer.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://developer.github.com/v3/checks/runs/#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://developer.github.com/v3/checks/runs/#check-runs-and-requested-actions)." To learn more about check runs and requested actions, see "[Check runs and requested actions](https://developer.github.com/v3/checks/runs/#check-runs-and-requested-actions)." - */ - actions?: ChecksCreateParamsActions[]; -} & RequiredPreview<"antiope">; -declare type ChecksCreateRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/check-runs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksCreateResponseData { - id: number; - head_sha: string; - node_id: string; - external_id: string; - url: string; - html_url: string; - details_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - output: { - title: string; - summary: string; - annotations_url: string; - annotations_count: number; - text: string; - }; - name: string; - check_suite: { - id: number; - }; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - base: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - }[]; -} -declare type ChecksCreateSuiteEndpoint = { - owner: string; - repo: string; - /** - * The sha of the head commit. - */ - head_sha: string; -} & RequiredPreview<"antiope">; -declare type ChecksCreateSuiteRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/check-suites"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksCreateSuiteResponseData { - id: number; - node_id: string; - head_branch: string; - head_sha: string; - status: string; - conclusion: string; - url: string; - before: string; - after: string; - pull_requests: unknown[]; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -} -declare type ChecksGetEndpoint = { - owner: string; - repo: string; - check_run_id: number; -} & RequiredPreview<"antiope">; -declare type ChecksGetRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/check-runs/:check_run_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksGetResponseData { - id: number; - head_sha: string; - node_id: string; - external_id: string; - url: string; - html_url: string; - details_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - output: { - title: string; - summary: string; - text: string; - annotations_count: number; - annotations_url: string; - }; - name: string; - check_suite: { - id: number; - }; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - base: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - }[]; -} -declare type ChecksGetSuiteEndpoint = { - owner: string; - repo: string; - check_suite_id: number; -} & RequiredPreview<"antiope">; -declare type ChecksGetSuiteRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/check-suites/:check_suite_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksGetSuiteResponseData { - id: number; - node_id: string; - head_branch: string; - head_sha: string; - status: string; - conclusion: string; - url: string; - before: string; - after: string; - pull_requests: unknown[]; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -} -declare type ChecksListAnnotationsEndpoint = { - owner: string; - repo: string; - check_run_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"antiope">; -declare type ChecksListAnnotationsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ChecksListAnnotationsResponseData = { - path: string; - start_line: number; - end_line: number; - start_column: number; - end_column: number; - annotation_level: string; - title: string; - message: string; - raw_details: string; -}[]; -declare type ChecksListForRefEndpoint = { - owner: string; - repo: string; - ref: string; - /** - * Returns check runs with the specified `name`. - */ - check_name?: string; - /** - * Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. - */ - status?: "queued" | "in_progress" | "completed"; - /** - * Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`. - */ - filter?: "latest" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"antiope">; -declare type ChecksListForRefRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:ref/check-runs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksListForRefResponseData { - total_count: number; - check_runs: { - id: number; - head_sha: string; - node_id: string; - external_id: string; - url: string; - html_url: string; - details_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - output: { - title: string; - summary: string; - text: string; - annotations_count: number; - annotations_url: string; - }; - name: string; - check_suite: { - id: number; - }; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - base: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - }[]; - }[]; -} -declare type ChecksListForSuiteEndpoint = { - owner: string; - repo: string; - check_suite_id: number; - /** - * Returns check runs with the specified `name`. - */ - check_name?: string; - /** - * Returns check runs with the specified `status`. Can be one of `queued`, `in_progress`, or `completed`. - */ - status?: "queued" | "in_progress" | "completed"; - /** - * Filters check runs by their `completed_at` timestamp. Can be one of `latest` (returning the most recent check runs) or `all`. - */ - filter?: "latest" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"antiope">; -declare type ChecksListForSuiteRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksListForSuiteResponseData { - total_count: number; - check_runs: { - id: number; - head_sha: string; - node_id: string; - external_id: string; - url: string; - html_url: string; - details_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - output: { - title: string; - summary: string; - text: string; - annotations_count: number; - annotations_url: string; - }; - name: string; - check_suite: { - id: number; - }; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - base: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - }[]; - }[]; -} -declare type ChecksListSuitesForRefEndpoint = { - owner: string; - repo: string; - ref: string; - /** - * Filters check suites by GitHub App `id`. - */ - app_id?: number; - /** - * Filters checks suites by the name of the [check run](https://developer.github.com/v3/checks/runs/). - */ - check_name?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"antiope">; -declare type ChecksListSuitesForRefRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:ref/check-suites"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksListSuitesForRefResponseData { - total_count: number; - check_suites: { - id: number; - node_id: string; - head_branch: string; - head_sha: string; - status: string; - conclusion: string; - url: string; - before: string; - after: string; - pull_requests: unknown[]; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }[]; -} -declare type ChecksRerequestSuiteEndpoint = { - owner: string; - repo: string; - check_suite_id: number; -} & RequiredPreview<"antiope">; -declare type ChecksRerequestSuiteRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ChecksSetSuitesPreferencesEndpoint = { - owner: string; - repo: string; - /** - * Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. See the [`auto_trigger_checks` object](https://developer.github.com/v3/checks/suites/#auto_trigger_checks-object) description for details. - */ - auto_trigger_checks?: ChecksSetSuitesPreferencesParamsAutoTriggerChecks[]; -} & RequiredPreview<"antiope">; -declare type ChecksSetSuitesPreferencesRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/check-suites/preferences"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksSetSuitesPreferencesResponseData { - preferences: { - auto_trigger_checks: { - app_id: number; - setting: boolean; - }[]; - }; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -} -declare type ChecksUpdateEndpoint = { - owner: string; - repo: string; - check_run_id: number; - /** - * The name of the check. For example, "code-coverage". - */ - name?: string; - /** - * The URL of the integrator's site that has the full details of the check. - */ - details_url?: string; - /** - * A reference for the run on the integrator's system. - */ - external_id?: string; - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - started_at?: string; - /** - * The current status. Can be one of `queued`, `in_progress`, or `completed`. - */ - status?: "queued" | "in_progress" | "completed"; - /** - * **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check. Can be one of `success`, `failure`, `neutral`, `cancelled`, `skipped`, `timed_out`, or `action_required`. - * **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. Only GitHub can change a check run conclusion to `stale`. - */ - conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required"; - /** - * The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - completed_at?: string; - /** - * Check runs can accept a variety of data in the `output` object, including a `title` and `summary` and can optionally provide descriptive details about the run. See the [`output` object](https://developer.github.com/v3/checks/runs/#output-object-1) description. - */ - output?: ChecksUpdateParamsOutput; - /** - * Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. See the [`actions` object](https://developer.github.com/v3/checks/runs/#actions-object) description. To learn more about check runs and requested actions, see "[Check runs and requested actions](https://developer.github.com/v3/checks/runs/#check-runs-and-requested-actions)." - */ - actions?: ChecksUpdateParamsActions[]; -} & RequiredPreview<"antiope">; -declare type ChecksUpdateRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/check-runs/:check_run_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ChecksUpdateResponseData { - id: number; - head_sha: string; - node_id: string; - external_id: string; - url: string; - html_url: string; - details_url: string; - status: string; - conclusion: string; - started_at: string; - completed_at: string; - output: { - title: string; - summary: string; - text: string; - annotations_count: number; - annotations_url: string; - }; - name: string; - check_suite: { - id: number; - }; - app: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }; - pull_requests: { - url: string; - id: number; - number: number; - head: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - base: { - ref: string; - sha: string; - repo: { - id: number; - url: string; - name: string; - }; - }; - }[]; -} -declare type CodeScanningGetAlertEndpoint = { - owner: string; - repo: string; - /** - * The code scanning alert number. - */ - alert_number?: number; -}; -declare type CodeScanningGetAlertRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/code-scanning/alerts/:alert_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface CodeScanningGetAlertResponseData { - /** - * The code scanning alert number. - */ - number: number; - /** - * The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - created_at: string; - /** - * The REST API URL of the alert resource. - */ - url: string; - /** - * The GitHub URL of the alert resource. - */ - html_url: string; - instances: unknown[]; - /** - * State of a code scanning alert. - */ - state: "open" | "dismissed" | "fixed"; - dismissed_by: { - login?: string; - id?: number; - node_id?: string; - avatar_url?: string; - gravatar_id?: string; - url?: string; - html_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - starred_url?: string; - subscriptions_url?: string; - organizations_url?: string; - repos_url?: string; - events_url?: string; - received_events_url?: string; - type?: string; - site_admin?: boolean; - [k: string]: unknown; - } | null; - /** - * The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - dismissed_at: string; - /** - * **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. - */ - dismissed_reason: ("false positive" | "won't fix" | "used in tests") | null; - rule: { - /** - * A unique identifier for the rule used to detect the alert. - */ - id: string; - /** - * The severity of the alert. - */ - severity: "none" | "note" | "warning" | "error"; - /** - * A short description of the rule used to detect the alert. - */ - description: string; - }; - tool: { - /** - * The name of the tool used to generate the code scanning analysis alert. - */ - name: string; - /** - * The version of the tool used to detect the alert. - */ - version: string; - }; -} -declare type CodeScanningGetAlertDeprecatedAlertIdEndpoint = { - owner: string; - repo: string; - /** - * The code scanning alert number. - * @deprecated "alert_id" is deprecated. Use "alert_number" instead - */ - alert_id?: number; -}; -declare type CodeScanningListAlertsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Set to `open`, `fixed`, or `dismissed` to list code scanning alerts in a specific state. - */ - state?: "open" | "dismissed" | "fixed"; - /** - * Set a full Git reference to list alerts for a specific branch. The `ref` must be formatted as `refs/heads/`. - */ - ref?: string; -}; -declare type CodeScanningListAlertsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/code-scanning/alerts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type CodeScanningListAlertsForRepoResponseData = { - /** - * The code scanning alert number. - */ - number: number; - /** - * The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - created_at: string; - /** - * The REST API URL of the alert resource. - */ - url: string; - /** - * The GitHub URL of the alert resource. - */ - html_url: string; - /** - * State of a code scanning alert. - */ - state: "open" | "dismissed" | "fixed"; - dismissed_by: { - login?: string; - id?: number; - node_id?: string; - avatar_url?: string; - gravatar_id?: string; - url?: string; - html_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - starred_url?: string; - subscriptions_url?: string; - organizations_url?: string; - repos_url?: string; - events_url?: string; - received_events_url?: string; - type?: string; - site_admin?: boolean; - [k: string]: unknown; - } | null; - /** - * The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - dismissed_at: string; - /** - * **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. - */ - dismissed_reason: ("false positive" | "won't fix" | "used in tests") | null; - rule: { - /** - * A unique identifier for the rule used to detect the alert. - */ - id: string; - /** - * The severity of the alert. - */ - severity: "none" | "note" | "warning" | "error"; - /** - * A short description of the rule used to detect the alert. - */ - description: string; - }; - tool: { - /** - * The name of the tool used to generate the code scanning analysis alert. - */ - name: string; - /** - * The version of the tool used to detect the alert. - */ - version: string; - }; -}[]; -declare type CodeScanningListRecentAnalysesEndpoint = { - owner: string; - repo: string; - /** - * Set a full Git reference to list alerts for a specific branch. The `ref` must be formatted as `refs/heads/`. - */ - ref?: string; - /** - * Set a single code scanning tool name to filter alerts by tool. - */ - tool_name?: string; -}; -declare type CodeScanningListRecentAnalysesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/code-scanning/analyses"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type CodeScanningListRecentAnalysesResponseData = { - /** - * The commit SHA of the code scanning analysis file. - */ - commit_sha: string; - /** - * The full Git reference of the code scanning analysis file, formatted as `refs/heads/`. - */ - ref: string; - /** - * Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. - */ - analysis_key: string; - /** - * The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - created_at: string; - /** - * The name of the tool used to generate the code scanning analysis alert. - */ - tool_name: string; - error: string; - /** - * Identifies the variable values associated with the environment in which this analysis was performed. - */ - environment: string; -}[]; -declare type CodeScanningUpdateAlertEndpoint = { - owner: string; - repo: string; - /** - * The code scanning alert number. - */ - alert_number?: number; - /** - * Sets the state of the code scanning alert. Can be one of `open` or `dismissed`. You must provide `dismissed_reason` when you set the state to `dismissed`. - */ - state: "open" | "dismissed"; - /** - * **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. - */ - dismissed_reason?: string | null; -}; -declare type CodeScanningUpdateAlertRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/code-scanning/alerts/:alert_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface CodeScanningUpdateAlertResponseData { - /** - * The code scanning alert number. - */ - number: number; - /** - * The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - created_at: string; - /** - * The REST API URL of the alert resource. - */ - url: string; - /** - * The GitHub URL of the alert resource. - */ - html_url: string; - instances: unknown[]; - /** - * State of a code scanning alert. - */ - state: "open" | "dismissed" | "fixed"; - dismissed_by: { - login?: string; - id?: number; - node_id?: string; - avatar_url?: string; - gravatar_id?: string; - url?: string; - html_url?: string; - followers_url?: string; - following_url?: string; - gists_url?: string; - starred_url?: string; - subscriptions_url?: string; - organizations_url?: string; - repos_url?: string; - events_url?: string; - received_events_url?: string; - type?: string; - site_admin?: boolean; - [k: string]: unknown; - } | null; - /** - * The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - dismissed_at: string; - /** - * **Required when the state is dismissed.** The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`. - */ - dismissed_reason: ("false positive" | "won't fix" | "used in tests") | null; - rule: { - /** - * A unique identifier for the rule used to detect the alert. - */ - id: string; - /** - * The severity of the alert. - */ - severity: "none" | "note" | "warning" | "error"; - /** - * A short description of the rule used to detect the alert. - */ - description: string; - }; - tool: { - /** - * The name of the tool used to generate the code scanning analysis alert. - */ - name: string; - /** - * The version of the tool used to detect the alert. - */ - version: string; - }; -} -declare type CodeScanningUploadSarifEndpoint = { - owner: string; - repo: string; - /** - * The commit SHA of the code scanning analysis file. - */ - commit_sha: string; - /** - * The full Git reference of the code scanning analysis file, formatted as `refs/heads/`. - */ - ref: string; - /** - * A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. - */ - sarif: string; - /** - * The base directory used in the analysis, as it appears in the SARIF file. - * This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. - */ - checkout_uri?: string; - /** - * The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - started_at?: string; - /** - * The name of the tool used to generate the code scanning analysis alert. - */ - tool_name: string; -}; -declare type CodeScanningUploadSarifRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/code-scanning/sarifs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type CodesOfConductGetAllCodesOfConductEndpoint = {} & RequiredPreview<"scarlet-witch">; -declare type CodesOfConductGetAllCodesOfConductRequestOptions = { - method: "GET"; - url: "/codes_of_conduct"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type CodesOfConductGetAllCodesOfConductResponseData = { - key: string; - name: string; - url: string; -}[]; -declare type CodesOfConductGetConductCodeEndpoint = { - key: string; -} & RequiredPreview<"scarlet-witch">; -declare type CodesOfConductGetConductCodeRequestOptions = { - method: "GET"; - url: "/codes_of_conduct/:key"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface CodesOfConductGetConductCodeResponseData { - key: string; - name: string; - url: string; - body: string; -} -declare type CodesOfConductGetForRepoEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"scarlet-witch">; -declare type CodesOfConductGetForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/community/code_of_conduct"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface CodesOfConductGetForRepoResponseData { - key: string; - name: string; - url: string; - body: string; -} -declare type EmojisGetEndpoint = {}; -declare type EmojisGetRequestOptions = { - method: "GET"; - url: "/emojis"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Unique identifier of an organization. - */ - org_id: number; -}; -declare type EnterpriseAdminAddOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions = { - method: "PUT"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations/:org_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminAddSelfHostedRunnerToRunnerGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Unique identifier of the self-hosted runner. - */ - runner_id: number; -}; -declare type EnterpriseAdminAddSelfHostedRunnerToRunnerGroupForEnterpriseRequestOptions = { - method: "PUT"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminCreateRegistrationTokenForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; -}; -declare type EnterpriseAdminCreateRegistrationTokenForEnterpriseRequestOptions = { - method: "POST"; - url: "/enterprises/:enterprise/actions/runners/registration-token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminCreateRegistrationTokenForEnterpriseResponseData { - token: string; - expires_at: string; -} -declare type EnterpriseAdminCreateRemoveTokenForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; -}; -declare type EnterpriseAdminCreateRemoveTokenForEnterpriseRequestOptions = { - method: "POST"; - url: "/enterprises/:enterprise/actions/runners/remove-token"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminCreateRemoveTokenForEnterpriseResponseData { - token: string; - expires_at: string; -} -declare type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Name of the runner group. - */ - name: string; - /** - * Visibility of a runner group. You can select all organizations or select individual organization. Can be one of: `all` or `selected` - */ - visibility?: "selected" | "all"; - /** - * List of organization IDs that can access the runner group. - */ - selected_organization_ids?: number[]; - /** - * List of runner IDs to add to the runner group. - */ - runners?: number[]; -}; -declare type EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseRequestOptions = { - method: "POST"; - url: "/enterprises/:enterprise/actions/runner-groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminCreateSelfHostedRunnerGroupForEnterpriseResponseData { - id: number; - name: string; - visibility: string; - default: boolean; - selected_organizations_url: string; - runners_url: string; -} -declare type EnterpriseAdminDeleteScimGroupFromEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_group_id: string; -}; -declare type EnterpriseAdminDeleteScimGroupFromEnterpriseRequestOptions = { - method: "DELETE"; - url: "/scim/v2/enterprises/:enterprise/Groups/:scim_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner. - */ - runner_id: number; -}; -declare type EnterpriseAdminDeleteSelfHostedRunnerFromEnterpriseRequestOptions = { - method: "DELETE"; - url: "/enterprises/:enterprise/actions/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; -}; -declare type EnterpriseAdminDeleteSelfHostedRunnerGroupFromEnterpriseRequestOptions = { - method: "DELETE"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminDeleteUserFromEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; -}; -declare type EnterpriseAdminDeleteUserFromEnterpriseRequestOptions = { - method: "DELETE"; - url: "/scim/v2/enterprises/:enterprise/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminGetGithubActionsBillingGheEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; -}; -declare type EnterpriseAdminGetGithubActionsBillingGheRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/settings/billing/actions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetGithubActionsBillingGheResponseData { - /** - * The sum of the free and paid GitHub Actions minutes used. - */ - total_minutes_used: number; - /** - * The total paid GitHub Actions minutes used. - */ - total_paid_minutes_used: number; - /** - * The amount of free GitHub Actions minutes available. - */ - included_minutes: number; - minutes_used_breakdown: { - /** - * Total minutes used on Ubuntu runner machines. - */ - UBUNTU: number; - /** - * Total minutes used on macOS runner machines. - */ - MACOS: number; - /** - * Total minutes used on Windows runner machines. - */ - WINDOWS: number; - }; -} -declare type EnterpriseAdminGetGithubActionsBillingGheDeprecatedEnterpriseIdEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - * @deprecated "enterprise_id" is deprecated. Use "enterprise" instead - */ - enterprise_id?: string; -}; -declare type EnterpriseAdminGetGithubPackagesBillingGheEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; -}; -declare type EnterpriseAdminGetGithubPackagesBillingGheRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/settings/billing/packages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetGithubPackagesBillingGheResponseData { - /** - * Sum of the free and paid storage space (GB) for GitHuub Packages. - */ - total_gigabytes_bandwidth_used: number; - /** - * Total paid storage space (GB) for GitHuub Packages. - */ - total_paid_gigabytes_bandwidth_used: number; - /** - * Free storage space (GB) for GitHub Packages. - */ - included_gigabytes_bandwidth: number; -} -declare type EnterpriseAdminGetGithubPackagesBillingGheDeprecatedEnterpriseIdEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - * @deprecated "enterprise_id" is deprecated. Use "enterprise" instead - */ - enterprise_id?: string; -}; -declare type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_group_id: string; -}; -declare type EnterpriseAdminGetProvisioningInformationForEnterpriseGroupRequestOptions = { - method: "GET"; - url: "/scim/v2/enterprises/:enterprise/Groups/:scim_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetProvisioningInformationForEnterpriseGroupResponseData { - schemas: string[]; - id: string; - externalId: string; - displayName: string; - members: { - value: string; - $ref: string; - display: string; - }[]; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminGetProvisioningInformationForEnterpriseUserEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; -}; -declare type EnterpriseAdminGetProvisioningInformationForEnterpriseUserRequestOptions = { - method: "GET"; - url: "/scim/v2/enterprises/:enterprise/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetProvisioningInformationForEnterpriseUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - groups: { - value: string; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminGetSelfHostedRunnerForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner. - */ - runner_id: number; -}; -declare type EnterpriseAdminGetSelfHostedRunnerForEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetSelfHostedRunnerForEnterpriseResponseData { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; -} -declare type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; -}; -declare type EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetSelfHostedRunnerGroupForEnterpriseResponseData { - id: number; - name: string; - visibility: string; - default: boolean; - selected_organizations_url: string; - runners_url: string; -} -declare type EnterpriseAdminGetSharedStorageBillingGheEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; -}; -declare type EnterpriseAdminGetSharedStorageBillingGheRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/settings/billing/shared-storage"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminGetSharedStorageBillingGheResponseData { - /** - * Numbers of days left in billing cycle. - */ - days_left_in_billing_cycle: number; - /** - * Estimated storage space (GB) used in billing cycle. - */ - estimated_paid_storage_for_month: number; - /** - * Estimated sum of free and paid storage space (GB) used in billing cycle. - */ - estimated_storage_for_month: number; -} -declare type EnterpriseAdminGetSharedStorageBillingGheDeprecatedEnterpriseIdEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - * @deprecated "enterprise_id" is deprecated. Use "enterprise" instead - */ - enterprise_id?: string; -}; -declare type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminListOrgAccessToSelfHostedRunnerGroupInEnterpriseResponseData { - total_count: number; - organizations: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }[]; -} -declare type EnterpriseAdminListProvisionedGroupsEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Used for pagination: the index of the first result to return. - */ - startIndex?: number; - /** - * Used for pagination: the number of results to return. - */ - count?: number; -}; -declare type EnterpriseAdminListProvisionedGroupsEnterpriseRequestOptions = { - method: "GET"; - url: "/scim/v2/enterprises/:enterprise/Groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminListProvisionedGroupsEnterpriseResponseData { - schemas: string[]; - totalResults: number; - itemsPerPage: number; - startIndex: number; - Resources: { - schemas: string[]; - id: string; - externalId: string; - displayName: string; - members: { - value: string; - $ref: string; - display: string; - }[]; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; - }[]; -} -declare type EnterpriseAdminListProvisionedIdentitiesEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Used for pagination: the index of the first result to return. - */ - startIndex?: number; - /** - * Used for pagination: the number of results to return. - */ - count?: number; -}; -declare type EnterpriseAdminListProvisionedIdentitiesEnterpriseRequestOptions = { - method: "GET"; - url: "/scim/v2/enterprises/:enterprise/Users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminListProvisionedIdentitiesEnterpriseResponseData { - schemas: string[]; - totalResults: number; - itemsPerPage: number; - startIndex: number; - Resources: { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - primary: boolean; - type: string; - }[]; - groups: { - value: string; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; - }[]; -} -declare type EnterpriseAdminListRunnerApplicationsForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; -}; -declare type EnterpriseAdminListRunnerApplicationsForEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runners/downloads"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type EnterpriseAdminListRunnerApplicationsForEnterpriseResponseData = { - os: string; - architecture: string; - download_url: string; - filename: string; -}[]; -declare type EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runner-groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminListSelfHostedRunnerGroupsForEnterpriseResponseData { - total_count: number; - runner_groups: { - id: number; - name: string; - visibility: string; - default: boolean; - selected_organizations_url: string; - runners_url: string; - }[]; -} -declare type EnterpriseAdminListSelfHostedRunnersForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type EnterpriseAdminListSelfHostedRunnersForEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminListSelfHostedRunnersForEnterpriseResponseData { - total_count: number; - runners: { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; - }[]; -} -declare type EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseRequestOptions = { - method: "GET"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminListSelfHostedRunnersInGroupForEnterpriseResponseData { - total_count: number; - runners: { - id: number; - name: string; - os: string; - status: string; - busy: boolean; - labels: { - /** - * Unique identifier of the label. - */ - id: number; - /** - * Name of the label. - */ - name: string; - /** - * The type of label. Read-only labels are applied automatically when the runner is configured. - */ - type: "read-only" | "custom"; - }[]; - }[]; -} -declare type EnterpriseAdminProvisionAndInviteEnterpriseGroupEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * The name of the SCIM group. This must match the GitHub organization that the group maps to. - */ - displayName: string; - members?: EnterpriseAdminProvisionAndInviteEnterpriseGroupParamsMembers[]; -}; -declare type EnterpriseAdminProvisionAndInviteEnterpriseGroupRequestOptions = { - method: "POST"; - url: "/scim/v2/enterprises/:enterprise/Groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminProvisionAndInviteEnterpriseGroupResponseData { - schemas: string[]; - id: string; - externalId: string; - displayName: string; - members: { - value: string; - $ref: string; - display: string; - }[]; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminProvisionAndInviteEnterpriseUserEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * The username for the user. - */ - userName: string; - name: EnterpriseAdminProvisionAndInviteEnterpriseUserParamsName; - /** - * List of user emails. - */ - emails: EnterpriseAdminProvisionAndInviteEnterpriseUserParamsEmails[]; - /** - * List of SCIM group IDs the user is a member of. - */ - groups?: EnterpriseAdminProvisionAndInviteEnterpriseUserParamsGroups[]; -}; -declare type EnterpriseAdminProvisionAndInviteEnterpriseUserRequestOptions = { - method: "POST"; - url: "/scim/v2/enterprises/:enterprise/Users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminProvisionAndInviteEnterpriseUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - groups: { - value: string; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Unique identifier of an organization. - */ - org_id: number; -}; -declare type EnterpriseAdminRemoveOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions = { - method: "DELETE"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations/:org_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Unique identifier of the self-hosted runner. - */ - runner_id: number; -}; -declare type EnterpriseAdminRemoveSelfHostedRunnerFromGroupForEnterpriseRequestOptions = { - method: "DELETE"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners/:runner_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_group_id: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * The name of the SCIM group. This must match the GitHub organization that the group maps to. - */ - displayName: string; - members?: EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParamsMembers[]; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupRequestOptions = { - method: "PUT"; - url: "/scim/v2/enterprises/:enterprise/Groups/:scim_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminSetInformationForProvisionedEnterpriseGroupResponseData { - schemas: string[]; - id: string; - externalId: string; - displayName: string; - members: { - value: string; - $ref: string; - display: string; - }[]; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseUserEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * The username for the user. - */ - userName: string; - name: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParamsName; - /** - * List of user emails. - */ - emails: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParamsEmails[]; - /** - * List of SCIM group IDs the user is a member of. - */ - groups?: EnterpriseAdminSetInformationForProvisionedEnterpriseUserParamsGroups[]; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseUserRequestOptions = { - method: "PUT"; - url: "/scim/v2/enterprises/:enterprise/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminSetInformationForProvisionedEnterpriseUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - groups: { - value: string; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * List of organization IDs that can access the runner group. - */ - selected_organization_ids: number[]; -}; -declare type EnterpriseAdminSetOrgAccessToSelfHostedRunnerGroupInEnterpriseRequestOptions = { - method: "PUT"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/organizations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminSetSelfHostedInGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * List of runner IDs to add to the runner group. - */ - runners: number[]; -}; -declare type EnterpriseAdminSetSelfHostedInGroupForEnterpriseRequestOptions = { - method: "PUT"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id/runners"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type EnterpriseAdminUpdateAttributeForEnterpriseGroupEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_group_id: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). - */ - Operations: EnterpriseAdminUpdateAttributeForEnterpriseGroupParamsOperations[]; -}; -declare type EnterpriseAdminUpdateAttributeForEnterpriseGroupRequestOptions = { - method: "PATCH"; - url: "/scim/v2/enterprises/:enterprise/Groups/:scim_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminUpdateAttributeForEnterpriseGroupResponseData { - schemas: string[]; - id: string; - externalId: string; - displayName: string; - members: { - value: string; - $ref: string; - display: string; - }[]; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminUpdateAttributeForEnterpriseUserEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). - */ - Operations: EnterpriseAdminUpdateAttributeForEnterpriseUserParamsOperations[]; -}; -declare type EnterpriseAdminUpdateAttributeForEnterpriseUserRequestOptions = { - method: "PATCH"; - url: "/scim/v2/enterprises/:enterprise/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminUpdateAttributeForEnterpriseUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - groups: { - value: string; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseEndpoint = { - /** - * The slug version of the enterprise name. You can also substitute this value with the enterprise id. - */ - enterprise: string; - /** - * Unique identifier of the self-hosted runner group. - */ - runner_group_id: number; - /** - * Name of the runner group. - */ - name?: string; - /** - * Visibility of a runner group. You can select all organizations or select individual organizations. Can be one of: `all` or `selected` - */ - visibility?: "selected" | "all"; -}; -declare type EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseRequestOptions = { - method: "PATCH"; - url: "/enterprises/:enterprise/actions/runner-groups/:runner_group_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface EnterpriseAdminUpdateSelfHostedRunnerGroupForEnterpriseResponseData { - id: number; - name: string; - visibility: string; - default: boolean; - selected_organizations_url: string; - runners_url: string; -} -declare type GistsCheckIsStarredEndpoint = { - gist_id: string; -}; -declare type GistsCheckIsStarredRequestOptions = { - method: "GET"; - url: "/gists/:gist_id/star"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type GistsCreateEndpoint = { - /** - * The filenames and content of each file in the gist. The keys in the `files` object represent the filename and have the type `string`. - */ - files: GistsCreateParamsFiles; - /** - * A descriptive name for this gist. - */ - description?: string; - /** - * When `true`, the gist will be public and available for anyone to see. - */ - public?: boolean; -}; -declare type GistsCreateRequestOptions = { - method: "POST"; - url: "/gists"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsCreateResponseData { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - truncated?: boolean; - content?: string; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; - forks: { - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - url: string; - id: string; - created_at: string; - updated_at: string; - }[]; - history: { - url: string; - version: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - change_status: { - deletions: number; - additions: number; - total: number; - }; - committed_at: string; - }[]; -} -declare type GistsCreateCommentEndpoint = { - gist_id: string; - /** - * The comment text. - */ - body: string; -}; -declare type GistsCreateCommentRequestOptions = { - method: "POST"; - url: "/gists/:gist_id/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsCreateCommentResponseData { - id: number; - node_id: string; - url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type GistsDeleteEndpoint = { - gist_id: string; -}; -declare type GistsDeleteRequestOptions = { - method: "DELETE"; - url: "/gists/:gist_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type GistsDeleteCommentEndpoint = { - gist_id: string; - comment_id: number; -}; -declare type GistsDeleteCommentRequestOptions = { - method: "DELETE"; - url: "/gists/:gist_id/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type GistsForkEndpoint = { - gist_id: string; -}; -declare type GistsForkRequestOptions = { - method: "POST"; - url: "/gists/:gist_id/forks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsForkResponseData { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; -} -declare type GistsGetEndpoint = { - gist_id: string; -}; -declare type GistsGetRequestOptions = { - method: "GET"; - url: "/gists/:gist_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsGetResponseData { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - truncated?: boolean; - content?: string; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; - forks: { - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - url: string; - id: string; - created_at: string; - updated_at: string; - }[]; - history: { - url: string; - version: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - change_status: { - deletions: number; - additions: number; - total: number; - }; - committed_at: string; - }[]; -} -declare type GistsGetCommentEndpoint = { - gist_id: string; - comment_id: number; -}; -declare type GistsGetCommentRequestOptions = { - method: "GET"; - url: "/gists/:gist_id/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsGetCommentResponseData { - id: number; - node_id: string; - url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type GistsGetRevisionEndpoint = { - gist_id: string; - sha: string; -}; -declare type GistsGetRevisionRequestOptions = { - method: "GET"; - url: "/gists/:gist_id/:sha"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsGetRevisionResponseData { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - truncated?: boolean; - content?: string; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; - forks: { - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - url: string; - id: string; - created_at: string; - updated_at: string; - }[]; - history: { - url: string; - version: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - change_status: { - deletions: number; - additions: number; - total: number; - }; - committed_at: string; - }[]; -} -declare type GistsListEndpoint = { - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Only gists updated at or after this time are returned. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListRequestOptions = { - method: "GET"; - url: "/gists"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListResponseData = { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; -}[]; -declare type GistsListCommentsEndpoint = { - gist_id: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListCommentsRequestOptions = { - method: "GET"; - url: "/gists/:gist_id/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListCommentsResponseData = { - id: number; - node_id: string; - url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type GistsListCommitsEndpoint = { - gist_id: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListCommitsRequestOptions = { - method: "GET"; - url: "/gists/:gist_id/commits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListCommitsResponseData = { - url: string; - version: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - change_status: { - deletions: number; - additions: number; - total: number; - }; - committed_at: string; -}[]; -declare type GistsListForUserEndpoint = { - username: string; - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Only gists updated at or after this time are returned. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListForUserRequestOptions = { - method: "GET"; - url: "/users/:username/gists"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListForUserResponseData = { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; -}[]; -declare type GistsListForksEndpoint = { - gist_id: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListForksRequestOptions = { - method: "GET"; - url: "/gists/:gist_id/forks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListForksResponseData = { - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - url: string; - id: string; - created_at: string; - updated_at: string; -}[]; -declare type GistsListPublicEndpoint = { - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Only gists updated at or after this time are returned. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListPublicRequestOptions = { - method: "GET"; - url: "/gists/public"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListPublicResponseData = { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; -}[]; -declare type GistsListStarredEndpoint = { - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Only gists updated at or after this time are returned. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GistsListStarredRequestOptions = { - method: "GET"; - url: "/gists/starred"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GistsListStarredResponseData = { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; -}[]; -declare type GistsStarEndpoint = { - gist_id: string; -}; -declare type GistsStarRequestOptions = { - method: "PUT"; - url: "/gists/:gist_id/star"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type GistsUnstarEndpoint = { - gist_id: string; -}; -declare type GistsUnstarRequestOptions = { - method: "DELETE"; - url: "/gists/:gist_id/star"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type GistsUpdateEndpoint = { - gist_id: string; - /** - * A descriptive name for this gist. - */ - description?: string; - /** - * The filenames and content that make up this gist. - */ - files?: GistsUpdateParamsFiles; -}; -declare type GistsUpdateRequestOptions = { - method: "PATCH"; - url: "/gists/:gist_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsUpdateResponseData { - url: string; - forks_url: string; - commits_url: string; - id: string; - node_id: string; - git_pull_url: string; - git_push_url: string; - html_url: string; - files: { - [k: string]: { - filename?: string; - type?: string; - language?: string; - raw_url?: string; - size?: number; - truncated?: boolean; - content?: string; - [k: string]: unknown; - }; - }; - public: boolean; - created_at: string; - updated_at: string; - description: string; - comments: number; - user: string; - comments_url: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - truncated: boolean; - forks: { - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - url: string; - id: string; - created_at: string; - updated_at: string; - }[]; - history: { - url: string; - version: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - change_status: { - deletions: number; - additions: number; - total: number; - }; - committed_at: string; - }[]; -} -declare type GistsUpdateCommentEndpoint = { - gist_id: string; - comment_id: number; - /** - * The comment text. - */ - body: string; -}; -declare type GistsUpdateCommentRequestOptions = { - method: "PATCH"; - url: "/gists/:gist_id/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GistsUpdateCommentResponseData { - id: number; - node_id: string; - url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type GitCreateBlobEndpoint = { - owner: string; - repo: string; - /** - * The new blob's content. - */ - content: string; - /** - * The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. - */ - encoding?: string; -}; -declare type GitCreateBlobRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/git/blobs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitCreateBlobResponseData { - url: string; - sha: string; -} -declare type GitCreateCommitEndpoint = { - owner: string; - repo: string; - /** - * The commit message - */ - message: string; - /** - * The SHA of the tree object this commit points to - */ - tree: string; - /** - * The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. - */ - parents: string[]; - /** - * Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. - */ - author?: GitCreateCommitParamsAuthor; - /** - * Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. - */ - committer?: GitCreateCommitParamsCommitter; - /** - * The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. - */ - signature?: string; -}; -declare type GitCreateCommitRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/git/commits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitCreateCommitResponseData { - sha: string; - node_id: string; - url: string; - author: { - date: string; - name: string; - email: string; - }; - committer: { - date: string; - name: string; - email: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - parents: { - url: string; - sha: string; - }[]; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; -} -declare type GitCreateRefEndpoint = { - owner: string; - repo: string; - /** - * The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. - */ - ref: string; - /** - * The SHA1 value for this reference. - */ - sha: string; -}; -declare type GitCreateRefRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/git/refs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitCreateRefResponseData { - ref: string; - node_id: string; - url: string; - object: { - type: string; - sha: string; - url: string; - }; -} -declare type GitCreateTagEndpoint = { - owner: string; - repo: string; - /** - * The tag's name. This is typically a version (e.g., "v0.0.1"). - */ - tag: string; - /** - * The tag message. - */ - message: string; - /** - * The SHA of the git object this is tagging. - */ - object: string; - /** - * The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`. - */ - type: "commit" | "tree" | "blob"; - /** - * An object with information about the individual creating the tag. - */ - tagger?: GitCreateTagParamsTagger; -}; -declare type GitCreateTagRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/git/tags"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitCreateTagResponseData { - node_id: string; - tag: string; - sha: string; - url: string; - message: string; - tagger: { - name: string; - email: string; - date: string; - }; - object: { - type: string; - sha: string; - url: string; - }; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; -} -declare type GitCreateTreeEndpoint = { - owner: string; - repo: string; - /** - * Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. - */ - tree: GitCreateTreeParamsTree[]; - /** - * The SHA1 of the tree you want to update with new data. If you don't set this, the commit will be created on top of everything; however, it will only contain your change, the rest of your files will show up as deleted. - */ - base_tree?: string; -}; -declare type GitCreateTreeRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/git/trees"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitCreateTreeResponseData { - sha: string; - url: string; - tree: { - path: string; - mode: string; - type: string; - size: number; - sha: string; - url: string; - }[]; -} -declare type GitDeleteRefEndpoint = { - owner: string; - repo: string; - ref: string; -}; -declare type GitDeleteRefRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/git/refs/:ref"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type GitGetBlobEndpoint = { - owner: string; - repo: string; - file_sha: string; -}; -declare type GitGetBlobRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/git/blobs/:file_sha"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitGetBlobResponseData { - content: string; - encoding: string; - url: string; - sha: string; - size: number; -} -declare type GitGetCommitEndpoint = { - owner: string; - repo: string; - commit_sha: string; -}; -declare type GitGetCommitRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/git/commits/:commit_sha"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitGetCommitResponseData { - sha: string; - node_id: string; - url: string; - author: { - date: string; - name: string; - email: string; - }; - committer: { - date: string; - name: string; - email: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - parents: { - url: string; - sha: string; - }[]; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; -} -declare type GitGetRefEndpoint = { - owner: string; - repo: string; - ref: string; -}; -declare type GitGetRefRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/git/ref/:ref"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitGetRefResponseData { - ref: string; - node_id: string; - url: string; - object: { - type: string; - sha: string; - url: string; - }; -} -declare type GitGetTagEndpoint = { - owner: string; - repo: string; - tag_sha: string; -}; -declare type GitGetTagRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/git/tags/:tag_sha"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitGetTagResponseData { - node_id: string; - tag: string; - sha: string; - url: string; - message: string; - tagger: { - name: string; - email: string; - date: string; - }; - object: { - type: string; - sha: string; - url: string; - }; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; -} -declare type GitGetTreeEndpoint = { - owner: string; - repo: string; - tree_sha: string; - /** - * Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `"true"`, and `"false"`. Omit this parameter to prevent recursively returning objects or subtrees. - */ - recursive?: string; -}; -declare type GitGetTreeRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/git/trees/:tree_sha"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitGetTreeResponseData { - sha: string; - url: string; - tree: { - path: string; - mode: string; - type: string; - size: number; - sha: string; - url: string; - }[]; - truncated: boolean; -} -declare type GitListMatchingRefsEndpoint = { - owner: string; - repo: string; - ref: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type GitListMatchingRefsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/git/matching-refs/:ref"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GitListMatchingRefsResponseData = { - ref: string; - node_id: string; - url: string; - object: { - type: string; - sha: string; - url: string; - }; -}[]; -declare type GitUpdateRefEndpoint = { - owner: string; - repo: string; - ref: string; - /** - * The SHA1 value to set this reference to - */ - sha: string; - /** - * Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. - */ - force?: boolean; -}; -declare type GitUpdateRefRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/git/refs/:ref"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitUpdateRefResponseData { - ref: string; - node_id: string; - url: string; - object: { - type: string; - sha: string; - url: string; - }; -} -declare type GitignoreGetAllTemplatesEndpoint = {}; -declare type GitignoreGetAllTemplatesRequestOptions = { - method: "GET"; - url: "/gitignore/templates"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type GitignoreGetAllTemplatesResponseData = string[]; -declare type GitignoreGetTemplateEndpoint = { - name: string; -}; -declare type GitignoreGetTemplateRequestOptions = { - method: "GET"; - url: "/gitignore/templates/:name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface GitignoreGetTemplateResponseData { - name: string; - source: string; -} -declare type InteractionsGetRestrictionsForOrgEndpoint = { - org: string; -} & RequiredPreview<"sombra">; -declare type InteractionsGetRestrictionsForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/interaction-limits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface InteractionsGetRestrictionsForOrgResponseData { - limit: string; - origin: string; - expires_at: string; -} -declare type InteractionsGetRestrictionsForRepoEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"sombra">; -declare type InteractionsGetRestrictionsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/interaction-limits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface InteractionsGetRestrictionsForRepoResponseData { - limit: string; - origin: string; - expires_at: string; -} -declare type InteractionsRemoveRestrictionsForOrgEndpoint = { - org: string; -} & RequiredPreview<"sombra">; -declare type InteractionsRemoveRestrictionsForOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/interaction-limits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type InteractionsRemoveRestrictionsForRepoEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"sombra">; -declare type InteractionsRemoveRestrictionsForRepoRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/interaction-limits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type InteractionsSetRestrictionsForOrgEndpoint = { - org: string; - /** - * Specifies the group of GitHub users who can comment, open issues, or create pull requests in public repositories for the given organization. Must be one of: `existing_users`, `contributors_only`, or `collaborators_only`. - */ - limit: "existing_users" | "contributors_only" | "collaborators_only"; -} & RequiredPreview<"sombra">; -declare type InteractionsSetRestrictionsForOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/interaction-limits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface InteractionsSetRestrictionsForOrgResponseData { - limit: string; - origin: string; - expires_at: string; -} -declare type InteractionsSetRestrictionsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Specifies the group of GitHub users who can comment, open issues, or create pull requests for the given repository. Must be one of: `existing_users`, `contributors_only`, or `collaborators_only`. - */ - limit: "existing_users" | "contributors_only" | "collaborators_only"; -} & RequiredPreview<"sombra">; -declare type InteractionsSetRestrictionsForRepoRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/interaction-limits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface InteractionsSetRestrictionsForRepoResponseData { - limit: string; - origin: string; - expires_at: string; -} -declare type IssuesAddAssigneesEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ - */ - assignees?: string[]; -}; -declare type IssuesAddAssigneesRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/issues/:issue_number/assignees"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesAddAssigneesResponseData { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; -} -declare type IssuesAddLabelsEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * The name of the label to add to the issue. Must contain at least one label. **Note:** Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. - */ - labels: string[]; -}; -declare type IssuesAddLabelsRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/issues/:issue_number/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesAddLabelsResponseData = { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -}[]; -declare type IssuesCheckUserCanBeAssignedEndpoint = { - owner: string; - repo: string; - assignee: string; -}; -declare type IssuesCheckUserCanBeAssignedRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/assignees/:assignee"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesCreateEndpoint = { - owner: string; - repo: string; - /** - * The title of the issue. - */ - title: string; - /** - * The contents of the issue. - */ - body?: string; - /** - * Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ - */ - assignee?: string; - /** - * The `number` of the milestone to associate this issue with. _NOTE: Only users with push access can set the milestone for new issues. The milestone is silently dropped otherwise._ - */ - milestone?: number; - /** - * Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ - */ - labels?: string[]; - /** - * Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ - */ - assignees?: string[]; -}; -declare type IssuesCreateRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/issues"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesCreateResponseData { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - closed_by: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type IssuesCreateCommentEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * The contents of the comment. - */ - body: string; -}; -declare type IssuesCreateCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/issues/:issue_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesCreateCommentResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type IssuesCreateLabelEndpoint = { - owner: string; - repo: string; - /** - * The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). - */ - name: string; - /** - * The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. - */ - color: string; - /** - * A short description of the label. - */ - description?: string; -}; -declare type IssuesCreateLabelRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesCreateLabelResponseData { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -} -declare type IssuesCreateMilestoneEndpoint = { - owner: string; - repo: string; - /** - * The title of the milestone. - */ - title: string; - /** - * The state of the milestone. Either `open` or `closed`. - */ - state?: "open" | "closed"; - /** - * A description of the milestone. - */ - description?: string; - /** - * The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - due_on?: string; -}; -declare type IssuesCreateMilestoneRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/milestones"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesCreateMilestoneResponseData { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; -} -declare type IssuesDeleteCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; -}; -declare type IssuesDeleteCommentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesDeleteLabelEndpoint = { - owner: string; - repo: string; - name: string; -}; -declare type IssuesDeleteLabelRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/labels/:name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesDeleteMilestoneEndpoint = { - owner: string; - repo: string; - milestone_number: number; -}; -declare type IssuesDeleteMilestoneRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/milestones/:milestone_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesGetEndpoint = { - owner: string; - repo: string; - issue_number: number; -}; -declare type IssuesGetRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/:issue_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesGetResponseData { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - closed_by: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type IssuesGetCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; -}; -declare type IssuesGetCommentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesGetCommentResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type IssuesGetEventEndpoint = { - owner: string; - repo: string; - event_id: number; -}; -declare type IssuesGetEventRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/events/:event_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesGetEventResponseData { - id: number; - node_id: string; - url: string; - actor: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - event: string; - commit_id: string; - commit_url: string; - created_at: string; - issue: { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - }; -} -declare type IssuesGetLabelEndpoint = { - owner: string; - repo: string; - name: string; -}; -declare type IssuesGetLabelRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/labels/:name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesGetLabelResponseData { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -} -declare type IssuesGetMilestoneEndpoint = { - owner: string; - repo: string; - milestone_number: number; -}; -declare type IssuesGetMilestoneRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/milestones/:milestone_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesGetMilestoneResponseData { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; -} -declare type IssuesListEndpoint = { - /** - * Indicates which sorts of issues to return. Can be one of: - * \* `assigned`: Issues assigned to you - * \* `created`: Issues created by you - * \* `mentioned`: Issues mentioning you - * \* `subscribed`: Issues you're subscribed to updates for - * \* `all`: All issues the authenticated user can see, regardless of participation or creation - */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** - * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * A list of comma separated label names. Example: `bug,ui,@high` - */ - labels?: string; - /** - * What to sort results by. Can be either `created`, `updated`, `comments`. - */ - sort?: "created" | "updated" | "comments"; - /** - * The direction of the sort. Can be either `asc` or `desc`. - */ - direction?: "asc" | "desc"; - /** - * Only issues updated at or after this time are returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListRequestOptions = { - method: "GET"; - url: "/issues"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListResponseData = { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -}[]; -declare type IssuesListAssigneesEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListAssigneesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/assignees"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListAssigneesResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type IssuesListCommentsEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Only comments updated at or after this time are returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListCommentsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/:issue_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListCommentsResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type IssuesListCommentsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Either `created` or `updated`. - */ - sort?: "created" | "updated"; - /** - * Either `asc` or `desc`. Ignored without the `sort` parameter. - */ - direction?: "asc" | "desc"; - /** - * Only comments updated at or after this time are returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListCommentsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListCommentsForRepoResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type IssuesListEventsEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListEventsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/:issue_number/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListEventsResponseData = { - id: number; - node_id: string; - url: string; - actor: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - event: string; - commit_id: string; - commit_url: string; - created_at: string; -}[]; -declare type IssuesListEventsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListEventsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListEventsForRepoResponseData = { - id: number; - node_id: string; - url: string; - actor: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - event: string; - commit_id: string; - commit_url: string; - created_at: string; - issue: { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - }; -}[]; -declare type IssuesListEventsForTimelineEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"mockingbird">; -declare type IssuesListEventsForTimelineRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/:issue_number/timeline"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListEventsForTimelineResponseData = { - id: number; - node_id: string; - url: string; - actor: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - event: string; - commit_id: string; - commit_url: string; - created_at: string; -}[]; -declare type IssuesListForAuthenticatedUserEndpoint = { - /** - * Indicates which sorts of issues to return. Can be one of: - * \* `assigned`: Issues assigned to you - * \* `created`: Issues created by you - * \* `mentioned`: Issues mentioning you - * \* `subscribed`: Issues you're subscribed to updates for - * \* `all`: All issues the authenticated user can see, regardless of participation or creation - */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** - * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * A list of comma separated label names. Example: `bug,ui,@high` - */ - labels?: string; - /** - * What to sort results by. Can be either `created`, `updated`, `comments`. - */ - sort?: "created" | "updated" | "comments"; - /** - * The direction of the sort. Can be either `asc` or `desc`. - */ - direction?: "asc" | "desc"; - /** - * Only issues updated at or after this time are returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/issues"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListForAuthenticatedUserResponseData = { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -}[]; -declare type IssuesListForOrgEndpoint = { - org: string; - /** - * Indicates which sorts of issues to return. Can be one of: - * \* `assigned`: Issues assigned to you - * \* `created`: Issues created by you - * \* `mentioned`: Issues mentioning you - * \* `subscribed`: Issues you're subscribed to updates for - * \* `all`: All issues the authenticated user can see, regardless of participation or creation - */ - filter?: "assigned" | "created" | "mentioned" | "subscribed" | "all"; - /** - * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * A list of comma separated label names. Example: `bug,ui,@high` - */ - labels?: string; - /** - * What to sort results by. Can be either `created`, `updated`, `comments`. - */ - sort?: "created" | "updated" | "comments"; - /** - * The direction of the sort. Can be either `asc` or `desc`. - */ - direction?: "asc" | "desc"; - /** - * Only issues updated at or after this time are returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/issues"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListForOrgResponseData = { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -}[]; -declare type IssuesListForRepoEndpoint = { - owner: string; - repo: string; - /** - * If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. - */ - milestone?: string; - /** - * Indicates the state of the issues to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. - */ - assignee?: string; - /** - * The user that created the issue. - */ - creator?: string; - /** - * A user that's mentioned in the issue. - */ - mentioned?: string; - /** - * A list of comma separated label names. Example: `bug,ui,@high` - */ - labels?: string; - /** - * What to sort results by. Can be either `created`, `updated`, `comments`. - */ - sort?: "created" | "updated" | "comments"; - /** - * The direction of the sort. Can be either `asc` or `desc`. - */ - direction?: "asc" | "desc"; - /** - * Only issues updated at or after this time are returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListForRepoResponseData = { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; -}[]; -declare type IssuesListLabelsForMilestoneEndpoint = { - owner: string; - repo: string; - milestone_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListLabelsForMilestoneRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/milestones/:milestone_number/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListLabelsForMilestoneResponseData = { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -}[]; -declare type IssuesListLabelsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListLabelsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListLabelsForRepoResponseData = { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -}[]; -declare type IssuesListLabelsOnIssueEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListLabelsOnIssueRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/:issue_number/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListLabelsOnIssueResponseData = { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -}[]; -declare type IssuesListMilestonesEndpoint = { - owner: string; - repo: string; - /** - * The state of the milestone. Either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * What to sort results by. Either `due_on` or `completeness`. - */ - sort?: "due_on" | "completeness"; - /** - * The direction of the sort. Either `asc` or `desc`. - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type IssuesListMilestonesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/milestones"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesListMilestonesResponseData = { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; -}[]; -declare type IssuesLockEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: - * \* `off-topic` - * \* `too heated` - * \* `resolved` - * \* `spam` - */ - lock_reason?: "off-topic" | "too heated" | "resolved" | "spam"; -}; -declare type IssuesLockRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/issues/:issue_number/lock"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesRemoveAllLabelsEndpoint = { - owner: string; - repo: string; - issue_number: number; -}; -declare type IssuesRemoveAllLabelsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/:issue_number/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesRemoveAssigneesEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ - */ - assignees?: string[]; -}; -declare type IssuesRemoveAssigneesRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/:issue_number/assignees"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesRemoveAssigneesResponseData { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; -} -declare type IssuesRemoveLabelEndpoint = { - owner: string; - repo: string; - issue_number: number; - name: string; -}; -declare type IssuesRemoveLabelRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesRemoveLabelResponseData = { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -}[]; -declare type IssuesSetLabelsEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * The names of the labels to add to the issue. You can pass an empty array to remove all labels. **Note:** Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. - */ - labels?: string[]; -}; -declare type IssuesSetLabelsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/issues/:issue_number/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type IssuesSetLabelsResponseData = { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -}[]; -declare type IssuesUnlockEndpoint = { - owner: string; - repo: string; - issue_number: number; -}; -declare type IssuesUnlockRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/:issue_number/lock"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type IssuesUpdateEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * The title of the issue. - */ - title?: string; - /** - * The contents of the issue. - */ - body?: string; - /** - * Login for the user that this issue should be assigned to. **This field is deprecated.** - */ - assignee?: string; - /** - * State of the issue. Either `open` or `closed`. - */ - state?: "open" | "closed"; - /** - * The `number` of the milestone to associate this issue with or `null` to remove current. _NOTE: Only users with push access can set the milestone for issues. The milestone is silently dropped otherwise._ - */ - milestone?: number | null; - /** - * Labels to associate with this issue. Pass one or more Labels to _replace_ the set of Labels on this Issue. Send an empty array (`[]`) to clear all Labels from the Issue. _NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise._ - */ - labels?: string[]; - /** - * Logins for Users to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this Issue. Send an empty array (`[]`) to clear all assignees from the Issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ - */ - assignees?: string[]; -}; -declare type IssuesUpdateRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/issues/:issue_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesUpdateResponseData { - id: number; - node_id: string; - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - number: number; - state: string; - title: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - locked: boolean; - active_lock_reason: string; - comments: number; - pull_request: { - url: string; - html_url: string; - diff_url: string; - patch_url: string; - }; - closed_at: string; - created_at: string; - updated_at: string; - closed_by: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type IssuesUpdateCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * The contents of the comment. - */ - body: string; -}; -declare type IssuesUpdateCommentRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/issues/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesUpdateCommentResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - body: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type IssuesUpdateLabelEndpoint = { - owner: string; - repo: string; - name: string; - /** - * The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see [emoji-cheat-sheet.com](http://emoji-cheat-sheet.com/). - */ - new_name?: string; - /** - * The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. - */ - color?: string; - /** - * A short description of the label. - */ - description?: string; -}; -declare type IssuesUpdateLabelRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/labels/:name"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesUpdateLabelResponseData { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; -} -declare type IssuesUpdateMilestoneEndpoint = { - owner: string; - repo: string; - milestone_number: number; - /** - * The title of the milestone. - */ - title?: string; - /** - * The state of the milestone. Either `open` or `closed`. - */ - state?: "open" | "closed"; - /** - * A description of the milestone. - */ - description?: string; - /** - * The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - due_on?: string; -}; -declare type IssuesUpdateMilestoneRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/milestones/:milestone_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface IssuesUpdateMilestoneResponseData { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; -} -declare type LicensesGetEndpoint = { - license: string; -}; -declare type LicensesGetRequestOptions = { - method: "GET"; - url: "/licenses/:license"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface LicensesGetResponseData { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - html_url: string; - description: string; - implementation: string; - permissions: string[]; - conditions: string[]; - limitations: string[]; - body: string; - featured: boolean; -} -declare type LicensesGetAllCommonlyUsedEndpoint = {}; -declare type LicensesGetAllCommonlyUsedRequestOptions = { - method: "GET"; - url: "/licenses"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type LicensesGetAllCommonlyUsedResponseData = { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; -}[]; -declare type LicensesGetForRepoEndpoint = { - owner: string; - repo: string; -}; -declare type LicensesGetForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/license"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface LicensesGetForRepoResponseData { - name: string; - path: string; - sha: string; - size: number; - url: string; - html_url: string; - git_url: string; - download_url: string; - type: string; - content: string; - encoding: string; - _links: { - self: string; - git: string; - html: string; - }; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -} -declare type MarkdownRenderEndpoint = { - /** - * The Markdown text to render in HTML. Markdown content must be 400 KB or less. - */ - text: string; - /** - * The rendering mode. Can be either: - * \* `markdown` to render a document in plain Markdown, just like README.md files are rendered. - * \* `gfm` to render a document in [GitHub Flavored Markdown](https://github.github.com/gfm/), which creates links for user mentions as well as references to SHA-1 hashes, issues, and pull requests. - */ - mode?: "markdown" | "gfm"; - /** - * The repository context to use when creating references in `gfm` mode. Omit this parameter when using `markdown` mode. - */ - context?: string; -}; -declare type MarkdownRenderRequestOptions = { - method: "POST"; - url: "/markdown"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MarkdownRenderRawEndpoint = { - /** - * data parameter - */ - data: string; -} & { - headers: { - "content-type": "text/plain; charset=utf-8"; - }; -}; -declare type MarkdownRenderRawRequestOptions = { - method: "POST"; - url: "/markdown/raw"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MetaGetEndpoint = {}; -declare type MetaGetRequestOptions = { - method: "GET"; - url: "/meta"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MetaGetResponseData { - verifiable_password_authentication: boolean; - ssh_key_fingerprints: { - MD5_RSA: string; - MD5_DSA: string; - SHA256_RSA: string; - SHA256_DSA: string; - }; - hooks: string[]; - web: string[]; - api: string[]; - git: string[]; - pages: string[]; - importer: string[]; -} -declare type MigrationsCancelImportEndpoint = { - owner: string; - repo: string; -}; -declare type MigrationsCancelImportRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/import"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsDeleteArchiveForAuthenticatedUserEndpoint = { - migration_id: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsDeleteArchiveForAuthenticatedUserRequestOptions = { - method: "DELETE"; - url: "/user/migrations/:migration_id/archive"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsDeleteArchiveForOrgEndpoint = { - org: string; - migration_id: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsDeleteArchiveForOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/migrations/:migration_id/archive"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsDownloadArchiveForOrgEndpoint = { - org: string; - migration_id: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsDownloadArchiveForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/migrations/:migration_id/archive"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsGetArchiveForAuthenticatedUserEndpoint = { - migration_id: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsGetArchiveForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/migrations/:migration_id/archive"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsGetCommitAuthorsEndpoint = { - owner: string; - repo: string; - /** - * Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the `raw` step. - */ - since?: string; -}; -declare type MigrationsGetCommitAuthorsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/import/authors"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type MigrationsGetCommitAuthorsResponseData = { - id: number; - remote_id: string; - remote_name: string; - email: string; - name: string; - url: string; - import_url: string; -}[]; -declare type MigrationsGetImportStatusEndpoint = { - owner: string; - repo: string; -}; -declare type MigrationsGetImportStatusRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/import"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsGetImportStatusResponseData { - vcs: string; - use_lfs: string; - vcs_url: string; - status: string; - status_text: string; - has_large_files: boolean; - large_files_size: number; - large_files_count: number; - authors_count: number; - url: string; - html_url: string; - authors_url: string; - repository_url: string; -} -declare type MigrationsGetLargeFilesEndpoint = { - owner: string; - repo: string; -}; -declare type MigrationsGetLargeFilesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/import/large_files"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type MigrationsGetLargeFilesResponseData = { - ref_name: string; - path: string; - oid: string; - size: number; -}[]; -declare type MigrationsGetStatusForAuthenticatedUserEndpoint = { - migration_id: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsGetStatusForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/migrations/:migration_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsGetStatusForAuthenticatedUserResponseData { - id: number; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - guid: string; - state: string; - lock_repositories: boolean; - exclude_attachments: boolean; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; - url: string; - created_at: string; - updated_at: string; -} -declare type MigrationsGetStatusForOrgEndpoint = { - org: string; - migration_id: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsGetStatusForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/migrations/:migration_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsGetStatusForOrgResponseData { - id: number; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - guid: string; - state: string; - lock_repositories: boolean; - exclude_attachments: boolean; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; - url: string; - created_at: string; - updated_at: string; -} -declare type MigrationsListForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsListForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/migrations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type MigrationsListForAuthenticatedUserResponseData = { - id: number; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - guid: string; - state: string; - lock_repositories: boolean; - exclude_attachments: boolean; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; - url: string; - created_at: string; - updated_at: string; -}[]; -declare type MigrationsListForOrgEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsListForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/migrations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type MigrationsListForOrgResponseData = { - id: number; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - guid: string; - state: string; - lock_repositories: boolean; - exclude_attachments: boolean; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; - url: string; - created_at: string; - updated_at: string; -}[]; -declare type MigrationsListReposForOrgEndpoint = { - org: string; - migration_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsListReposForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/migrations/:migration_id/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type MigrationsListReposForOrgResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type MigrationsListReposForUserEndpoint = { - migration_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"wyandotte">; -declare type MigrationsListReposForUserRequestOptions = { - method: "GET"; - url: "/user/migrations/:migration_id/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type MigrationsListReposForUserResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type MigrationsMapCommitAuthorEndpoint = { - owner: string; - repo: string; - author_id: number; - /** - * The new Git author email. - */ - email?: string; - /** - * The new Git author name. - */ - name?: string; -}; -declare type MigrationsMapCommitAuthorRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/import/authors/:author_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsMapCommitAuthorResponseData { - id: number; - remote_id: string; - remote_name: string; - email: string; - name: string; - url: string; - import_url: string; -} -declare type MigrationsSetLfsPreferenceEndpoint = { - owner: string; - repo: string; - /** - * Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import). - */ - use_lfs: "opt_in" | "opt_out"; -}; -declare type MigrationsSetLfsPreferenceRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/import/lfs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsSetLfsPreferenceResponseData { - vcs: string; - use_lfs: string; - vcs_url: string; - status: string; - status_text: string; - has_large_files: boolean; - large_files_size: number; - large_files_count: number; - authors_count: number; - url: string; - html_url: string; - authors_url: string; - repository_url: string; -} -declare type MigrationsStartForAuthenticatedUserEndpoint = { - /** - * An array of repositories to include in the migration. - */ - repositories: string[]; - /** - * Locks the `repositories` to prevent changes during the migration when set to `true`. - */ - lock_repositories?: boolean; - /** - * Does not include attachments uploaded to GitHub.com in the migration data when set to `true`. Excluding attachments will reduce the migration archive file size. - */ - exclude_attachments?: boolean; -}; -declare type MigrationsStartForAuthenticatedUserRequestOptions = { - method: "POST"; - url: "/user/migrations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsStartForAuthenticatedUserResponseData { - id: number; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - guid: string; - state: string; - lock_repositories: boolean; - exclude_attachments: boolean; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; - url: string; - created_at: string; - updated_at: string; -} -declare type MigrationsStartForOrgEndpoint = { - org: string; - /** - * A list of arrays indicating which repositories should be migrated. - */ - repositories: string[]; - /** - * Indicates whether repositories should be locked (to prevent manipulation) while migrating data. - */ - lock_repositories?: boolean; - /** - * Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). - */ - exclude_attachments?: boolean; -}; -declare type MigrationsStartForOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/migrations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsStartForOrgResponseData { - id: number; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - guid: string; - state: string; - lock_repositories: boolean; - exclude_attachments: boolean; - repositories: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }[]; - url: string; - created_at: string; - updated_at: string; -} -declare type MigrationsStartImportEndpoint = { - owner: string; - repo: string; - /** - * The URL of the originating repository. - */ - vcs_url: string; - /** - * The originating VCS type. Can be one of `subversion`, `git`, `mercurial`, or `tfvc`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response. - */ - vcs?: "subversion" | "git" | "mercurial" | "tfvc"; - /** - * If authentication is required, the username to provide to `vcs_url`. - */ - vcs_username?: string; - /** - * If authentication is required, the password to provide to `vcs_url`. - */ - vcs_password?: string; - /** - * For a tfvc import, the name of the project that is being imported. - */ - tfvc_project?: string; -}; -declare type MigrationsStartImportRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/import"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsStartImportResponseData { - vcs: string; - use_lfs: string; - vcs_url: string; - status: string; - status_text: string; - has_large_files: boolean; - large_files_size: number; - large_files_count: number; - authors_count: number; - percent: number; - commit_count: number; - url: string; - html_url: string; - authors_url: string; - repository_url: string; - tfvc_project: string; -} -declare type MigrationsUnlockRepoForAuthenticatedUserEndpoint = { - migration_id: number; - repo_name: string; -} & RequiredPreview<"wyandotte">; -declare type MigrationsUnlockRepoForAuthenticatedUserRequestOptions = { - method: "DELETE"; - url: "/user/migrations/:migration_id/repos/:repo_name/lock"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsUnlockRepoForOrgEndpoint = { - org: string; - migration_id: number; - repo_name: string; -} & RequiredPreview<"wyandotte">; -declare type MigrationsUnlockRepoForOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type MigrationsUpdateImportEndpoint = { - owner: string; - repo: string; - /** - * The username to provide to the originating repository. - */ - vcs_username?: string; - /** - * The password to provide to the originating repository. - */ - vcs_password?: string; -}; -declare type MigrationsUpdateImportRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/import"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface MigrationsUpdateImportResponseData { - vcs: string; - use_lfs: string; - vcs_url: string; - status: string; - status_text: string; - has_large_files: boolean; - large_files_size: number; - large_files_count: number; - authors_count: number; - percent: number; - commit_count: number; - url: string; - html_url: string; - authors_url: string; - repository_url: string; - tfvc_project: string; -} -declare type OauthAuthorizationsCreateAuthorizationEndpoint = { - /** - * A list of scopes that this authorization is in. - */ - scopes?: string[]; - /** - * A note to remind you what the OAuth token is for. Tokens not associated with a specific OAuth application (i.e. personal access tokens) must have a unique note. - */ - note: string; - /** - * A URL to remind you what app the OAuth token is for. - */ - note_url?: string; - /** - * The 20 character OAuth app client key for which to create the token. - */ - client_id?: string; - /** - * The 40 character OAuth app client secret for which to create the token. - */ - client_secret?: string; - /** - * A unique string to distinguish an authorization from others created for the same client ID and user. - */ - fingerprint?: string; -}; -declare type OauthAuthorizationsCreateAuthorizationRequestOptions = { - method: "POST"; - url: "/authorizations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OauthAuthorizationsCreateAuthorizationResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -declare type OauthAuthorizationsDeleteAuthorizationEndpoint = { - authorization_id: number; -}; -declare type OauthAuthorizationsDeleteAuthorizationRequestOptions = { - method: "DELETE"; - url: "/authorizations/:authorization_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OauthAuthorizationsDeleteGrantEndpoint = { - grant_id: number; -}; -declare type OauthAuthorizationsDeleteGrantRequestOptions = { - method: "DELETE"; - url: "/applications/grants/:grant_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OauthAuthorizationsGetAuthorizationEndpoint = { - authorization_id: number; -}; -declare type OauthAuthorizationsGetAuthorizationRequestOptions = { - method: "GET"; - url: "/authorizations/:authorization_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OauthAuthorizationsGetAuthorizationResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -declare type OauthAuthorizationsGetGrantEndpoint = { - grant_id: number; -}; -declare type OauthAuthorizationsGetGrantRequestOptions = { - method: "GET"; - url: "/applications/grants/:grant_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OauthAuthorizationsGetGrantResponseData { - id: number; - url: string; - app: { - url: string; - name: string; - client_id: string; - }; - created_at: string; - updated_at: string; - scopes: string[]; -} -declare type OauthAuthorizationsGetOrCreateAuthorizationForAppEndpoint = { - client_id: string; - /** - * The 40 character OAuth app client secret associated with the client ID specified in the URL. - */ - client_secret: string; - /** - * A list of scopes that this authorization is in. - */ - scopes?: string[]; - /** - * A note to remind you what the OAuth token is for. - */ - note?: string; - /** - * A URL to remind you what app the OAuth token is for. - */ - note_url?: string; - /** - * A unique string to distinguish an authorization from others created for the same client and user. If provided, this API is functionally equivalent to [Get-or-create an authorization for a specific app and fingerprint](https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint). - */ - fingerprint?: string; -}; -declare type OauthAuthorizationsGetOrCreateAuthorizationForAppRequestOptions = { - method: "PUT"; - url: "/authorizations/clients/:client_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppResponse201Data { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -declare type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintEndpoint = { - client_id: string; - fingerprint: string; - /** - * The 40 character OAuth app client secret associated with the client ID specified in the URL. - */ - client_secret: string; - /** - * A list of scopes that this authorization is in. - */ - scopes?: string[]; - /** - * A note to remind you what the OAuth token is for. - */ - note?: string; - /** - * A URL to remind you what app the OAuth token is for. - */ - note_url?: string; -}; -declare type OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintRequestOptions = { - method: "PUT"; - url: "/authorizations/clients/:client_id/:fingerprint"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -export interface OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintResponse201Data { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -declare type OauthAuthorizationsListAuthorizationsEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OauthAuthorizationsListAuthorizationsRequestOptions = { - method: "GET"; - url: "/authorizations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OauthAuthorizationsListAuthorizationsResponseData = { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -}[]; -declare type OauthAuthorizationsListGrantsEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OauthAuthorizationsListGrantsRequestOptions = { - method: "GET"; - url: "/applications/grants"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OauthAuthorizationsListGrantsResponseData = { - id: number; - url: string; - app: { - url: string; - name: string; - client_id: string; - }; - created_at: string; - updated_at: string; - scopes: string[]; -}[]; -declare type OauthAuthorizationsUpdateAuthorizationEndpoint = { - authorization_id: number; - /** - * Replaces the authorization scopes with these. - */ - scopes?: string[]; - /** - * A list of scopes to add to this authorization. - */ - add_scopes?: string[]; - /** - * A list of scopes to remove from this authorization. - */ - remove_scopes?: string[]; - /** - * A note to remind you what the OAuth token is for. Tokens not associated with a specific OAuth application (i.e. personal access tokens) must have a unique note. - */ - note?: string; - /** - * A URL to remind you what app the OAuth token is for. - */ - note_url?: string; - /** - * A unique string to distinguish an authorization from others created for the same client ID and user. - */ - fingerprint?: string; -}; -declare type OauthAuthorizationsUpdateAuthorizationRequestOptions = { - method: "PATCH"; - url: "/authorizations/:authorization_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OauthAuthorizationsUpdateAuthorizationResponseData { - id: number; - url: string; - scopes: string[]; - token: string; - token_last_eight: string; - hashed_token: string; - app: { - url: string; - name: string; - client_id: string; - }; - note: string; - note_url: string; - updated_at: string; - created_at: string; - fingerprint: string; -} -declare type OrgsBlockUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsBlockUserRequestOptions = { - method: "PUT"; - url: "/orgs/:org/blocks/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsCheckBlockedUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsCheckBlockedUserRequestOptions = { - method: "GET"; - url: "/orgs/:org/blocks/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsCheckMembershipForUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsCheckMembershipForUserRequestOptions = { - method: "GET"; - url: "/orgs/:org/members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsCheckPublicMembershipForUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsCheckPublicMembershipForUserRequestOptions = { - method: "GET"; - url: "/orgs/:org/public_members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsConvertMemberToOutsideCollaboratorEndpoint = { - org: string; - username: string; -}; -declare type OrgsConvertMemberToOutsideCollaboratorRequestOptions = { - method: "PUT"; - url: "/orgs/:org/outside_collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsConvertMemberToOutsideCollaboratorResponseData { - message: string; - documentation_url: string; -} -declare type OrgsCreateInvitationEndpoint = { - org: string; - /** - * **Required unless you provide `email`**. GitHub user ID for the person you are inviting. - */ - invitee_id?: number; - /** - * **Required unless you provide `invitee_id`**. Email address of the person you are inviting, which can be an existing GitHub user. - */ - email?: string; - /** - * Specify role for new member. Can be one of: - * \* `admin` - Organization owners with full administrative rights to the organization and complete access to all repositories and teams. - * \* `direct_member` - Non-owner organization members with ability to see other members and join teams by invitation. - * \* `billing_manager` - Non-owner organization members with ability to manage the billing settings of your organization. - */ - role?: "admin" | "direct_member" | "billing_manager"; - /** - * Specify IDs for the teams you want to invite new members to. - */ - team_ids?: number[]; -}; -declare type OrgsCreateInvitationRequestOptions = { - method: "POST"; - url: "/orgs/:org/invitations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsCreateInvitationResponseData { - id: number; - login: string; - email: string; - role: string; - created_at: string; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - team_count: number; - invitation_team_url: string; -} -declare type OrgsCreateWebhookEndpoint = { - org: string; - /** - * Must be passed as "web". - */ - name: string; - /** - * Key/value pairs to provide settings for this webhook. [These are defined below](https://developer.github.com/v3/orgs/hooks/#create-hook-config-params). - */ - config: OrgsCreateWebhookParamsConfig; - /** - * Determines what [events](https://developer.github.com/webhooks/event-payloads) the hook is triggered for. - */ - events?: string[]; - /** - * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - */ - active?: boolean; -}; -declare type OrgsCreateWebhookRequestOptions = { - method: "POST"; - url: "/orgs/:org/hooks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsCreateWebhookResponseData { - id: number; - url: string; - ping_url: string; - name: string; - events: string[]; - active: boolean; - config: { - url: string; - content_type: string; - }; - updated_at: string; - created_at: string; -} -declare type OrgsDeleteWebhookEndpoint = { - org: string; - hook_id: number; -}; -declare type OrgsDeleteWebhookRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/hooks/:hook_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsGetEndpoint = { - org: string; -}; -declare type OrgsGetRequestOptions = { - method: "GET"; - url: "/orgs/:org"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsGetResponseData { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - total_private_repos: number; - owned_private_repos: number; - private_gists: number; - disk_usage: number; - collaborators: number; - billing_email: string; - plan: { - name: string; - space: number; - private_repos: number; - seats: number; - filled_seats: number; - }; - default_repository_permission: string; - members_can_create_repositories: boolean; - two_factor_requirement_enabled: boolean; - members_allowed_repository_creation_type: string; - members_can_create_public_repositories: boolean; - members_can_create_private_repositories: boolean; - members_can_create_internal_repositories: boolean; -} -declare type OrgsGetMembershipForAuthenticatedUserEndpoint = { - org: string; -}; -declare type OrgsGetMembershipForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/memberships/orgs/:org"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsGetMembershipForAuthenticatedUserResponseData { - url: string; - state: string; - role: string; - organization_url: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type OrgsGetMembershipForUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsGetMembershipForUserRequestOptions = { - method: "GET"; - url: "/orgs/:org/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsGetMembershipForUserResponseData { - url: string; - state: string; - role: string; - organization_url: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type OrgsGetWebhookEndpoint = { - org: string; - hook_id: number; -}; -declare type OrgsGetWebhookRequestOptions = { - method: "GET"; - url: "/orgs/:org/hooks/:hook_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsGetWebhookResponseData { - id: number; - url: string; - ping_url: string; - name: string; - events: string[]; - active: boolean; - config: { - url: string; - content_type: string; - }; - updated_at: string; - created_at: string; -} -declare type OrgsListEndpoint = { - /** - * The integer ID of the last organization that you've seen. - */ - since?: number; -}; -declare type OrgsListRequestOptions = { - method: "GET"; - url: "/organizations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListResponseData = { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; -}[]; -declare type OrgsListAppInstallationsEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListAppInstallationsRequestOptions = { - method: "GET"; - url: "/orgs/:org/installations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsListAppInstallationsResponseData { - total_count: number; - installations: { - id: number; - account: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repository_selection: "all" | "selected"; - access_tokens_url: string; - repositories_url: string; - html_url: string; - app_id: number; - target_id: number; - target_type: string; - permissions: { - deployments: string; - metadata: string; - pull_requests: string; - statuses: string; - }; - events: string[]; - created_at: string; - updated_at: string; - single_file_name: string; - }[]; -} -declare type OrgsListBlockedUsersEndpoint = { - org: string; -}; -declare type OrgsListBlockedUsersRequestOptions = { - method: "GET"; - url: "/orgs/:org/blocks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListBlockedUsersResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type OrgsListForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/orgs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListForAuthenticatedUserResponseData = { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; -}[]; -declare type OrgsListForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListForUserRequestOptions = { - method: "GET"; - url: "/users/:username/orgs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListForUserResponseData = { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; -}[]; -declare type OrgsListInvitationTeamsEndpoint = { - org: string; - invitation_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListInvitationTeamsRequestOptions = { - method: "GET"; - url: "/orgs/:org/invitations/:invitation_id/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListInvitationTeamsResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type OrgsListMembersEndpoint = { - org: string; - /** - * Filter members returned in the list. Can be one of: - * \* `2fa_disabled` - Members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. Available for organization owners. - * \* `all` - All members the authenticated user can see. - */ - filter?: "2fa_disabled" | "all"; - /** - * Filter members returned by their role. Can be one of: - * \* `all` - All members of the organization, regardless of role. - * \* `admin` - Organization owners. - * \* `member` - Non-owner organization members. - */ - role?: "all" | "admin" | "member"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListMembersRequestOptions = { - method: "GET"; - url: "/orgs/:org/members"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListMembersResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type OrgsListMembershipsForAuthenticatedUserEndpoint = { - /** - * Indicates the state of the memberships to return. Can be either `active` or `pending`. If not specified, the API returns both active and pending memberships. - */ - state?: "active" | "pending"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListMembershipsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/memberships/orgs"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListMembershipsForAuthenticatedUserResponseData = { - url: string; - state: string; - role: string; - organization_url: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -}[]; -declare type OrgsListOutsideCollaboratorsEndpoint = { - org: string; - /** - * Filter the list of outside collaborators. Can be one of: - * \* `2fa_disabled`: Outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled. - * \* `all`: All outside collaborators. - */ - filter?: "2fa_disabled" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListOutsideCollaboratorsRequestOptions = { - method: "GET"; - url: "/orgs/:org/outside_collaborators"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListOutsideCollaboratorsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type OrgsListPendingInvitationsEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListPendingInvitationsRequestOptions = { - method: "GET"; - url: "/orgs/:org/invitations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListPendingInvitationsResponseData = { - id: number; - login: string; - email: string; - role: string; - created_at: string; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - team_count: number; - invitation_team_url: string; -}[]; -declare type OrgsListPublicMembersEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListPublicMembersRequestOptions = { - method: "GET"; - url: "/orgs/:org/public_members"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListPublicMembersResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type OrgsListSamlSsoAuthorizationsEndpoint = { - org: string; -}; -declare type OrgsListSamlSsoAuthorizationsRequestOptions = { - method: "GET"; - url: "/orgs/:org/credential-authorizations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListSamlSsoAuthorizationsResponseData = { - login: string; - credential_id: string; - credential_type: string; - token_last_eight: string; - credential_authorized_at: string; - scopes: string[]; -}[]; -declare type OrgsListWebhooksEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type OrgsListWebhooksRequestOptions = { - method: "GET"; - url: "/orgs/:org/hooks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type OrgsListWebhooksResponseData = { - id: number; - url: string; - ping_url: string; - name: string; - events: string[]; - active: boolean; - config: { - url: string; - content_type: string; - }; - updated_at: string; - created_at: string; -}[]; -declare type OrgsPingWebhookEndpoint = { - org: string; - hook_id: number; -}; -declare type OrgsPingWebhookRequestOptions = { - method: "POST"; - url: "/orgs/:org/hooks/:hook_id/pings"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsRemoveMemberEndpoint = { - org: string; - username: string; -}; -declare type OrgsRemoveMemberRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsRemoveMembershipForUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsRemoveMembershipForUserRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsRemoveOutsideCollaboratorEndpoint = { - org: string; - username: string; -}; -declare type OrgsRemoveOutsideCollaboratorRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/outside_collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsRemoveOutsideCollaboratorResponseData { - message: string; - documentation_url: string; -} -declare type OrgsRemovePublicMembershipForAuthenticatedUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsRemovePublicMembershipForAuthenticatedUserRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/public_members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsRemoveSamlSsoAuthorizationEndpoint = { - org: string; - credential_id: number; -}; -declare type OrgsRemoveSamlSsoAuthorizationRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/credential-authorizations/:credential_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsSetMembershipForUserEndpoint = { - org: string; - username: string; - /** - * The role to give the user in the organization. Can be one of: - * \* `admin` - The user will become an owner of the organization. - * \* `member` - The user will become a non-owner member of the organization. - */ - role?: "admin" | "member"; -}; -declare type OrgsSetMembershipForUserRequestOptions = { - method: "PUT"; - url: "/orgs/:org/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsSetMembershipForUserResponseData { - url: string; - state: string; - role: string; - organization_url: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type OrgsSetPublicMembershipForAuthenticatedUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsSetPublicMembershipForAuthenticatedUserRequestOptions = { - method: "PUT"; - url: "/orgs/:org/public_members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsUnblockUserEndpoint = { - org: string; - username: string; -}; -declare type OrgsUnblockUserRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/blocks/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type OrgsUpdateEndpoint = { - org: string; - /** - * Billing email address. This address is not publicized. - */ - billing_email?: string; - /** - * The company name. - */ - company?: string; - /** - * The publicly visible email address. - */ - email?: string; - /** - * The Twitter username of the company. - */ - twitter_username?: string; - /** - * The location. - */ - location?: string; - /** - * The shorthand name of the company. - */ - name?: string; - /** - * The description of the company. - */ - description?: string; - /** - * Toggles whether an organization can use organization projects. - */ - has_organization_projects?: boolean; - /** - * Toggles whether repositories that belong to the organization can use repository projects. - */ - has_repository_projects?: boolean; - /** - * Default permission level members have for organization repositories: - * \* `read` - can pull, but not push to or administer this repository. - * \* `write` - can pull and push, but not administer this repository. - * \* `admin` - can pull, push, and administer this repository. - * \* `none` - no permissions granted by default. - */ - default_repository_permission?: "read" | "write" | "admin" | "none"; - /** - * Toggles the ability of non-admin organization members to create repositories. Can be one of: - * \* `true` - all organization members can create repositories. - * \* `false` - only organization owners can create repositories. - * Default: `true` - * **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. - */ - members_can_create_repositories?: boolean; - /** - * Toggles whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. Can be one of: - * \* `true` - all organization members can create internal repositories. - * \* `false` - only organization owners can create internal repositories. - * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)". - */ - members_can_create_internal_repositories?: boolean; - /** - * Toggles whether organization members can create private repositories, which are visible to organization members with permission. Can be one of: - * \* `true` - all organization members can create private repositories. - * \* `false` - only organization owners can create private repositories. - * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)". - */ - members_can_create_private_repositories?: boolean; - /** - * Toggles whether organization members can create public repositories, which are visible to anyone. Can be one of: - * \* `true` - all organization members can create public repositories. - * \* `false` - only organization owners can create public repositories. - * Default: `true`. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)". - */ - members_can_create_public_repositories?: boolean; - /** - * Specifies which types of repositories non-admin organization members can create. Can be one of: - * \* `all` - all organization members can create public and private repositories. - * \* `private` - members can create private repositories. This option is only available to repositories that are part of an organization on GitHub Enterprise Cloud. - * \* `none` - only admin members can create repositories. - * **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See [this note](https://developer.github.com/v3/orgs/#members_can_create_repositories) for details. - */ - members_allowed_repository_creation_type?: "all" | "private" | "none"; -}; -declare type OrgsUpdateRequestOptions = { - method: "PATCH"; - url: "/orgs/:org"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsUpdateResponseData { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - total_private_repos: number; - owned_private_repos: number; - private_gists: number; - disk_usage: number; - collaborators: number; - billing_email: string; - plan: { - name: string; - space: number; - private_repos: number; - seats: number; - filled_seats: number; - }; - default_repository_permission: string; - members_can_create_repositories: boolean; - two_factor_requirement_enabled: boolean; - members_allowed_repository_creation_type: string; - members_can_create_public_repositories: boolean; - members_can_create_private_repositories: boolean; - members_can_create_internal_repositories: boolean; -} -declare type OrgsUpdateMembershipForAuthenticatedUserEndpoint = { - org: string; - /** - * The state that the membership should be in. Only `"active"` will be accepted. - */ - state: "active"; -}; -declare type OrgsUpdateMembershipForAuthenticatedUserRequestOptions = { - method: "PATCH"; - url: "/user/memberships/orgs/:org"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsUpdateMembershipForAuthenticatedUserResponseData { - url: string; - state: string; - role: string; - organization_url: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type OrgsUpdateWebhookEndpoint = { - org: string; - hook_id: number; - /** - * Key/value pairs to provide settings for this webhook. [These are defined below](https://developer.github.com/v3/orgs/hooks/#update-hook-config-params). - */ - config?: OrgsUpdateWebhookParamsConfig; - /** - * Determines what [events](https://developer.github.com/webhooks/event-payloads) the hook is triggered for. - */ - events?: string[]; - /** - * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - */ - active?: boolean; -}; -declare type OrgsUpdateWebhookRequestOptions = { - method: "PATCH"; - url: "/orgs/:org/hooks/:hook_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface OrgsUpdateWebhookResponseData { - id: number; - url: string; - ping_url: string; - name: string; - events: string[]; - active: boolean; - config: { - url: string; - content_type: string; - }; - updated_at: string; - created_at: string; -} -declare type ProjectsAddCollaboratorEndpoint = { - project_id: number; - username: string; - /** - * The permission to grant the collaborator. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." Can be one of: - * \* `read` - can read, but not write to or administer this project. - * \* `write` - can read and write, but not administer this project. - * \* `admin` - can read, write and administer this project. - */ - permission?: "read" | "write" | "admin"; -} & RequiredPreview<"inertia">; -declare type ProjectsAddCollaboratorRequestOptions = { - method: "PUT"; - url: "/projects/:project_id/collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsCreateCardEndpoint = { - column_id: number; - /** - * The card's note content. Only valid for cards without another type of content, so you must omit when specifying `content_id` and `content_type`. - */ - note?: string; - /** - * The issue or pull request id you want to associate with this card. You can use the [List repository issues](https://developer.github.com/v3/issues/#list-repository-issues) and [List pull requests](https://developer.github.com/v3/pulls/#list-pull-requests) endpoints to find this id. - * **Note:** Depending on whether you use the issue id or pull request id, you will need to specify `Issue` or `PullRequest` as the `content_type`. - */ - content_id?: number; - /** - * **Required if you provide `content_id`**. The type of content you want to associate with this card. Use `Issue` when `content_id` is an issue id and use `PullRequest` when `content_id` is a pull request id. - */ - content_type?: string; -} & RequiredPreview<"inertia">; -declare type ProjectsCreateCardRequestOptions = { - method: "POST"; - url: "/projects/columns/:column_id/cards"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsCreateCardResponseData { - url: string; - id: number; - node_id: string; - note: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - archived: boolean; - column_url: string; - content_url: string; - project_url: string; -} -declare type ProjectsCreateColumnEndpoint = { - project_id: number; - /** - * The name of the column. - */ - name: string; -} & RequiredPreview<"inertia">; -declare type ProjectsCreateColumnRequestOptions = { - method: "POST"; - url: "/projects/:project_id/columns"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsCreateColumnResponseData { - url: string; - project_url: string; - cards_url: string; - id: number; - node_id: string; - name: string; - created_at: string; - updated_at: string; -} -declare type ProjectsCreateForAuthenticatedUserEndpoint = { - /** - * The name of the project. - */ - name: string; - /** - * The description of the project. - */ - body?: string; -} & RequiredPreview<"inertia">; -declare type ProjectsCreateForAuthenticatedUserRequestOptions = { - method: "POST"; - url: "/user/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsCreateForAuthenticatedUserResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ProjectsCreateForOrgEndpoint = { - org: string; - /** - * The name of the project. - */ - name: string; - /** - * The description of the project. - */ - body?: string; -} & RequiredPreview<"inertia">; -declare type ProjectsCreateForOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsCreateForOrgResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ProjectsCreateForRepoEndpoint = { - owner: string; - repo: string; - /** - * The name of the project. - */ - name: string; - /** - * The description of the project. - */ - body?: string; -} & RequiredPreview<"inertia">; -declare type ProjectsCreateForRepoRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsCreateForRepoResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ProjectsDeleteEndpoint = { - project_id: number; -} & RequiredPreview<"inertia">; -declare type ProjectsDeleteRequestOptions = { - method: "DELETE"; - url: "/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsDeleteCardEndpoint = { - card_id: number; -} & RequiredPreview<"inertia">; -declare type ProjectsDeleteCardRequestOptions = { - method: "DELETE"; - url: "/projects/columns/cards/:card_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsDeleteColumnEndpoint = { - column_id: number; -} & RequiredPreview<"inertia">; -declare type ProjectsDeleteColumnRequestOptions = { - method: "DELETE"; - url: "/projects/columns/:column_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsGetEndpoint = { - project_id: number; -} & RequiredPreview<"inertia">; -declare type ProjectsGetRequestOptions = { - method: "GET"; - url: "/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsGetResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ProjectsGetCardEndpoint = { - card_id: number; -} & RequiredPreview<"inertia">; -declare type ProjectsGetCardRequestOptions = { - method: "GET"; - url: "/projects/columns/cards/:card_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsGetCardResponseData { - url: string; - id: number; - node_id: string; - note: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - archived: boolean; - column_url: string; - content_url: string; - project_url: string; -} -declare type ProjectsGetColumnEndpoint = { - column_id: number; -} & RequiredPreview<"inertia">; -declare type ProjectsGetColumnRequestOptions = { - method: "GET"; - url: "/projects/columns/:column_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsGetColumnResponseData { - url: string; - project_url: string; - cards_url: string; - id: number; - node_id: string; - name: string; - created_at: string; - updated_at: string; -} -declare type ProjectsGetPermissionForUserEndpoint = { - project_id: number; - username: string; -} & RequiredPreview<"inertia">; -declare type ProjectsGetPermissionForUserRequestOptions = { - method: "GET"; - url: "/projects/:project_id/collaborators/:username/permission"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsGetPermissionForUserResponseData { - permission: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type ProjectsListCardsEndpoint = { - column_id: number; - /** - * Filters the project cards that are returned by the card's state. Can be one of `all`,`archived`, or `not_archived`. - */ - archived_state?: "all" | "archived" | "not_archived"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsListCardsRequestOptions = { - method: "GET"; - url: "/projects/columns/:column_id/cards"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ProjectsListCardsResponseData = { - url: string; - id: number; - node_id: string; - note: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - archived: boolean; - column_url: string; - content_url: string; - project_url: string; -}[]; -declare type ProjectsListCollaboratorsEndpoint = { - project_id: number; - /** - * Filters the collaborators by their affiliation. Can be one of: - * \* `outside`: Outside collaborators of a project that are not a member of the project's organization. - * \* `direct`: Collaborators with permissions to a project, regardless of organization membership status. - * \* `all`: All collaborators the authenticated user can see. - */ - affiliation?: "outside" | "direct" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsListCollaboratorsRequestOptions = { - method: "GET"; - url: "/projects/:project_id/collaborators"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ProjectsListCollaboratorsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type ProjectsListColumnsEndpoint = { - project_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsListColumnsRequestOptions = { - method: "GET"; - url: "/projects/:project_id/columns"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ProjectsListColumnsResponseData = { - url: string; - project_url: string; - cards_url: string; - id: number; - node_id: string; - name: string; - created_at: string; - updated_at: string; -}[]; -declare type ProjectsListForOrgEndpoint = { - org: string; - /** - * Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsListForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ProjectsListForOrgResponseData = { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type ProjectsListForRepoEndpoint = { - owner: string; - repo: string; - /** - * Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsListForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ProjectsListForRepoResponseData = { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type ProjectsListForUserEndpoint = { - username: string; - /** - * Indicates the state of the projects to return. Can be either `open`, `closed`, or `all`. - */ - state?: "open" | "closed" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsListForUserRequestOptions = { - method: "GET"; - url: "/users/:username/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ProjectsListForUserResponseData = { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type ProjectsMoveCardEndpoint = { - card_id: number; - /** - * Can be one of `top`, `bottom`, or `after:`, where `` is the `id` value of a card in the same column, or in the new column specified by `column_id`. - */ - position: string; - /** - * The `id` value of a column in the same project. - */ - column_id?: number; -} & RequiredPreview<"inertia">; -declare type ProjectsMoveCardRequestOptions = { - method: "POST"; - url: "/projects/columns/cards/:card_id/moves"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsMoveColumnEndpoint = { - column_id: number; - /** - * Can be one of `first`, `last`, or `after:`, where `` is the `id` value of a column in the same project. - */ - position: string; -} & RequiredPreview<"inertia">; -declare type ProjectsMoveColumnRequestOptions = { - method: "POST"; - url: "/projects/columns/:column_id/moves"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsRemoveCollaboratorEndpoint = { - project_id: number; - username: string; -} & RequiredPreview<"inertia">; -declare type ProjectsRemoveCollaboratorRequestOptions = { - method: "DELETE"; - url: "/projects/:project_id/collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ProjectsUpdateEndpoint = { - project_id: number; - /** - * The name of the project. - */ - name?: string; - /** - * The description of the project. - */ - body?: string; - /** - * State of the project. Either `open` or `closed`. - */ - state?: "open" | "closed"; - /** - * The permission level that determines whether all members of the project's organization can see and/or make changes to the project. Setting `organization_permission` is only available for organization projects. If an organization member belongs to a team with a higher level of access or is a collaborator with a higher level of access, their permission level is not lowered by `organization_permission`. For information on changing access for a team or collaborator, see [Add or update team project permissions](https://developer.github.com/v3/teams/#add-or-update-team-project-permissions) or [Add project collaborator](https://developer.github.com/v3/projects/collaborators/#add-project-collaborator). - * - * **Note:** Updating a project's `organization_permission` requires `admin` access to the project. - * - * Can be one of: - * \* `read` - Organization members can read, but not write to or administer this project. - * \* `write` - Organization members can read and write, but not administer this project. - * \* `admin` - Organization members can read, write and administer this project. - * \* `none` - Organization members can only see this project if it is public. - */ - organization_permission?: string; - /** - * Sets the visibility of a project board. Setting `private` is only available for organization and user projects. **Note:** Updating a project's visibility requires `admin` access to the project. - * - * Can be one of: - * \* `false` - Anyone can see the project. - * \* `true` - Only the user can view a project board created on a user account. Organization members with the appropriate `organization_permission` can see project boards in an organization account. - */ - private?: boolean; -} & RequiredPreview<"inertia">; -declare type ProjectsUpdateRequestOptions = { - method: "PATCH"; - url: "/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsUpdateResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ProjectsUpdateCardEndpoint = { - card_id: number; - /** - * The card's note content. Only valid for cards without another type of content, so this cannot be specified if the card already has a `content_id` and `content_type`. - */ - note?: string; - /** - * Use `true` to archive a project card. Specify `false` if you need to restore a previously archived project card. - */ - archived?: boolean; -} & RequiredPreview<"inertia">; -declare type ProjectsUpdateCardRequestOptions = { - method: "PATCH"; - url: "/projects/columns/cards/:card_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsUpdateCardResponseData { - url: string; - id: number; - node_id: string; - note: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - archived: boolean; - column_url: string; - content_url: string; - project_url: string; -} -declare type ProjectsUpdateColumnEndpoint = { - column_id: number; - /** - * The new name of the column. - */ - name: string; -} & RequiredPreview<"inertia">; -declare type ProjectsUpdateColumnRequestOptions = { - method: "PATCH"; - url: "/projects/columns/:column_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ProjectsUpdateColumnResponseData { - url: string; - project_url: string; - cards_url: string; - id: number; - node_id: string; - name: string; - created_at: string; - updated_at: string; -} -declare type PullsCheckIfMergedEndpoint = { - owner: string; - repo: string; - pull_number: number; -}; -declare type PullsCheckIfMergedRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/merge"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type PullsCreateEndpoint = { - owner: string; - repo: string; - /** - * The title of the new pull request. - */ - title: string; - /** - * The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. - */ - head: string; - /** - * The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. - */ - base: string; - /** - * The contents of the pull request. - */ - body?: string; - /** - * Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. - */ - maintainer_can_modify?: boolean; - /** - * Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/en/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. - */ - draft?: boolean; -}; -declare type PullsCreateRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsCreateResponseData { - url: string; - id: number; - node_id: string; - html_url: string; - diff_url: string; - patch_url: string; - issue_url: string; - commits_url: string; - review_comments_url: string; - review_comment_url: string; - comments_url: string; - statuses_url: string; - number: number; - state: string; - locked: boolean; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - active_lock_reason: string; - created_at: string; - updated_at: string; - closed_at: string; - merged_at: string; - merge_commit_sha: string; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_reviewers: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - head: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - base: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - issue: { - href: string; - }; - comments: { - href: string; - }; - review_comments: { - href: string; - }; - review_comment: { - href: string; - }; - commits: { - href: string; - }; - statuses: { - href: string; - }; - }; - author_association: string; - draft: boolean; - merged: boolean; - mergeable: boolean; - rebaseable: boolean; - mergeable_state: string; - merged_by: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - comments: number; - review_comments: number; - maintainer_can_modify: boolean; - commits: number; - additions: number; - deletions: number; - changed_files: number; -} -declare type PullsCreateReplyForReviewCommentEndpoint = { - owner: string; - repo: string; - pull_number: number; - comment_id: number; - /** - * The text of the review comment. - */ - body: string; -}; -declare type PullsCreateReplyForReviewCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsCreateReplyForReviewCommentResponseData { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - start_line: number; - original_start_line: number; - start_side: string; - line: number; - original_line: number; - side: string; -} -declare type PullsCreateReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. - */ - commit_id?: string; - /** - * **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. - */ - body?: string; - /** - * The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://developer.github.com/v3/pulls/reviews/#submit-a-review-for-a-pull-request) when you are ready. - */ - event?: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; - /** - * Use the following table to specify the location, destination, and contents of the draft review comment. - */ - comments?: PullsCreateReviewParamsComments[]; -}; -declare type PullsCreateReviewRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsCreateReviewResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - submitted_at: string; - commit_id: string; -} -declare type PullsCreateReviewCommentEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * The text of the review comment. - */ - body: string; - /** - * The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. - */ - commit_id: string; - /** - * The relative path to the file that necessitates a comment. - */ - path: string; - /** - * **Required without `comfort-fade` preview**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. For help finding the position value, read the note above. - */ - position?: number; - /** - * **Required with `comfort-fade` preview**. In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://docs.github.com/en/articles/about-comparing-branches-in-pull-requests#diff-view-options)". - */ - side?: "LEFT" | "RIGHT"; - /** - * **Required with `comfort-fade` preview**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. - */ - line?: number; - /** - * **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)". - */ - start_line?: number; - /** - * **Required when using multi-line comments**. To create multi-line comments, you must use the `comfort-fade` preview header. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/en/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)". See `side` in this table for additional context. - */ - start_side?: "LEFT" | "RIGHT" | "side"; -}; -declare type PullsCreateReviewCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls/:pull_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsCreateReviewCommentResponseData { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - start_line: number; - original_start_line: number; - start_side: string; - line: number; - original_line: number; - side: string; -} -declare type PullsDeletePendingReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - review_id: number; -}; -declare type PullsDeletePendingReviewRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsDeletePendingReviewResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - commit_id: string; -} -declare type PullsDeleteReviewCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; -}; -declare type PullsDeleteReviewCommentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/pulls/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type PullsDismissReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - review_id: number; - /** - * The message for the pull request review dismissal - */ - message: string; -}; -declare type PullsDismissReviewRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsDismissReviewResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - submitted_at: string; - commit_id: string; -} -declare type PullsGetEndpoint = { - owner: string; - repo: string; - pull_number: number; -}; -declare type PullsGetRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsGetResponseData { - url: string; - id: number; - node_id: string; - html_url: string; - diff_url: string; - patch_url: string; - issue_url: string; - commits_url: string; - review_comments_url: string; - review_comment_url: string; - comments_url: string; - statuses_url: string; - number: number; - state: string; - locked: boolean; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - active_lock_reason: string; - created_at: string; - updated_at: string; - closed_at: string; - merged_at: string; - merge_commit_sha: string; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_reviewers: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - head: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - base: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - issue: { - href: string; - }; - comments: { - href: string; - }; - review_comments: { - href: string; - }; - review_comment: { - href: string; - }; - commits: { - href: string; - }; - statuses: { - href: string; - }; - }; - author_association: string; - draft: boolean; - merged: boolean; - mergeable: boolean; - rebaseable: boolean; - mergeable_state: string; - merged_by: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - comments: number; - review_comments: number; - maintainer_can_modify: boolean; - commits: number; - additions: number; - deletions: number; - changed_files: number; -} -declare type PullsGetReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - review_id: number; -}; -declare type PullsGetReviewRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsGetReviewResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - submitted_at: string; - commit_id: string; -} -declare type PullsGetReviewCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; -}; -declare type PullsGetReviewCommentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsGetReviewCommentResponseData { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - start_line: number; - original_start_line: number; - start_side: string; - line: number; - original_line: number; - side: string; -} -declare type PullsListEndpoint = { - owner: string; - repo: string; - /** - * Either `open`, `closed`, or `all` to filter by state. - */ - state?: "open" | "closed" | "all"; - /** - * Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`. - */ - head?: string; - /** - * Filter pulls by base branch name. Example: `gh-pages`. - */ - base?: string; - /** - * What to sort results by. Can be either `created`, `updated`, `popularity` (comment count) or `long-running` (age, filtering by pulls updated in the last month). - */ - sort?: "created" | "updated" | "popularity" | "long-running"; - /** - * The direction of the sort. Can be either `asc` or `desc`. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`. - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListResponseData = { - url: string; - id: number; - node_id: string; - html_url: string; - diff_url: string; - patch_url: string; - issue_url: string; - commits_url: string; - review_comments_url: string; - review_comment_url: string; - comments_url: string; - statuses_url: string; - number: number; - state: string; - locked: boolean; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - active_lock_reason: string; - created_at: string; - updated_at: string; - closed_at: string; - merged_at: string; - merge_commit_sha: string; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_reviewers: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - head: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - base: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - issue: { - href: string; - }; - comments: { - href: string; - }; - review_comments: { - href: string; - }; - review_comment: { - href: string; - }; - commits: { - href: string; - }; - statuses: { - href: string; - }; - }; - author_association: string; - draft: boolean; -}[]; -declare type PullsListCommentsForReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - review_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListCommentsForReviewRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListCommentsForReviewResponseData = { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; -}[]; -declare type PullsListCommitsEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListCommitsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/commits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListCommitsResponseData = { - url: string; - sha: string; - node_id: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - name: string; - email: string; - date: string; - }; - committer: { - name: string; - email: string; - date: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - sha: string; - }[]; -}[]; -declare type PullsListFilesEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListFilesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/files"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListFilesResponseData = { - sha: string; - filename: string; - status: string; - additions: number; - deletions: number; - changes: number; - blob_url: string; - raw_url: string; - contents_url: string; - patch: string; -}[]; -declare type PullsListRequestedReviewersEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListRequestedReviewersRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsListRequestedReviewersResponseData { - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; -} -declare type PullsListReviewCommentsEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * Can be either `created` or `updated` comments. - */ - sort?: "created" | "updated"; - /** - * Can be either `asc` or `desc`. Ignored without `sort` parameter. - */ - direction?: "asc" | "desc"; - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Only returns comments `updated` at or after this time. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListReviewCommentsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListReviewCommentsResponseData = { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - start_line: number; - original_start_line: number; - start_side: string; - line: number; - original_line: number; - side: string; -}[]; -declare type PullsListReviewCommentsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Can be either `created` or `updated` comments. - */ - sort?: "created" | "updated"; - /** - * Can be either `asc` or `desc`. Ignored without `sort` parameter. - */ - direction?: "asc" | "desc"; - /** - * This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Only returns comments `updated` at or after this time. - */ - since?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListReviewCommentsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListReviewCommentsForRepoResponseData = { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - start_line: number; - original_start_line: number; - start_side: string; - line: number; - original_line: number; - side: string; -}[]; -declare type PullsListReviewsEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type PullsListReviewsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type PullsListReviewsResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - submitted_at: string; - commit_id: string; -}[]; -declare type PullsMergeEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * Title for the automatic commit message. - */ - commit_title?: string; - /** - * Extra detail to append to automatic commit message. - */ - commit_message?: string; - /** - * SHA that pull request head must match to allow merge. - */ - sha?: string; - /** - * Merge method to use. Possible values are `merge`, `squash` or `rebase`. Default is `merge`. - */ - merge_method?: "merge" | "squash" | "rebase"; -}; -declare type PullsMergeRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/pulls/:pull_number/merge"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsMergeResponseData { - sha: string; - merged: boolean; - message: string; -} -export interface PullsMergeResponse405Data { - message: string; - documentation_url: string; -} -export interface PullsMergeResponse409Data { - message: string; - documentation_url: string; -} -declare type PullsRemoveRequestedReviewersEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * An array of user `login`s that will be removed. - */ - reviewers?: string[]; - /** - * An array of team `slug`s that will be removed. - */ - team_reviewers?: string[]; -}; -declare type PullsRemoveRequestedReviewersRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type PullsRequestReviewersEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * An array of user `login`s that will be requested. - */ - reviewers?: string[]; - /** - * An array of team `slug`s that will be requested. - */ - team_reviewers?: string[]; -}; -declare type PullsRequestReviewersRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsRequestReviewersResponseData { - url: string; - id: number; - node_id: string; - html_url: string; - diff_url: string; - patch_url: string; - issue_url: string; - commits_url: string; - review_comments_url: string; - review_comment_url: string; - comments_url: string; - statuses_url: string; - number: number; - state: string; - locked: boolean; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - active_lock_reason: string; - created_at: string; - updated_at: string; - closed_at: string; - merged_at: string; - merge_commit_sha: string; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_reviewers: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - head: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - base: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - issue: { - href: string; - }; - comments: { - href: string; - }; - review_comments: { - href: string; - }; - review_comment: { - href: string; - }; - commits: { - href: string; - }; - statuses: { - href: string; - }; - }; - author_association: string; - draft: boolean; -} -declare type PullsSubmitReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - review_id: number; - /** - * The body text of the pull request review - */ - body?: string; - /** - * The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action. - */ - event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT"; -}; -declare type PullsSubmitReviewRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsSubmitReviewResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - submitted_at: string; - commit_id: string; -} -declare type PullsUpdateEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * The title of the pull request. - */ - title?: string; - /** - * The contents of the pull request. - */ - body?: string; - /** - * State of this Pull Request. Either `open` or `closed`. - */ - state?: "open" | "closed"; - /** - * The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. - */ - base?: string; - /** - * Indicates whether [maintainers can modify](https://docs.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. - */ - maintainer_can_modify?: boolean; -}; -declare type PullsUpdateRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/pulls/:pull_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsUpdateResponseData { - url: string; - id: number; - node_id: string; - html_url: string; - diff_url: string; - patch_url: string; - issue_url: string; - commits_url: string; - review_comments_url: string; - review_comment_url: string; - comments_url: string; - statuses_url: string; - number: number; - state: string; - locked: boolean; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - active_lock_reason: string; - created_at: string; - updated_at: string; - closed_at: string; - merged_at: string; - merge_commit_sha: string; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_reviewers: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - head: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - base: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - issue: { - href: string; - }; - comments: { - href: string; - }; - review_comments: { - href: string; - }; - review_comment: { - href: string; - }; - commits: { - href: string; - }; - statuses: { - href: string; - }; - }; - author_association: string; - draft: boolean; - merged: boolean; - mergeable: boolean; - rebaseable: boolean; - mergeable_state: string; - merged_by: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - comments: number; - review_comments: number; - maintainer_can_modify: boolean; - commits: number; - additions: number; - deletions: number; - changed_files: number; -} -declare type PullsUpdateBranchEndpoint = { - owner: string; - repo: string; - pull_number: number; - /** - * The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://developer.github.com/v3/repos/commits/#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. - */ - expected_head_sha?: string; -} & RequiredPreview<"lydian">; -declare type PullsUpdateBranchRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsUpdateBranchResponseData { - message: string; - url: string; -} -declare type PullsUpdateReviewEndpoint = { - owner: string; - repo: string; - pull_number: number; - review_id: number; - /** - * The body text of the pull request review. - */ - body: string; -}; -declare type PullsUpdateReviewRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsUpdateReviewResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - state: string; - html_url: string; - pull_request_url: string; - _links: { - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - submitted_at: string; - commit_id: string; -} -declare type PullsUpdateReviewCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * The text of the reply to the review comment. - */ - body: string; -}; -declare type PullsUpdateReviewCommentRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/pulls/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface PullsUpdateReviewCommentResponseData { - url: string; - pull_request_review_id: number; - id: number; - node_id: string; - diff_hunk: string; - path: string; - position: number; - original_position: number; - commit_id: string; - original_commit_id: string; - in_reply_to_id: number; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - created_at: string; - updated_at: string; - html_url: string; - pull_request_url: string; - author_association: string; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - pull_request: { - href: string; - }; - }; - start_line: number; - original_start_line: number; - start_side: string; - line: number; - original_line: number; - side: string; -} -declare type RateLimitGetEndpoint = {}; -declare type RateLimitGetRequestOptions = { - method: "GET"; - url: "/rate_limit"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface RateLimitGetResponseData { - resources: { - core: { - limit: number; - remaining: number; - reset: number; - }; - search: { - limit: number; - remaining: number; - reset: number; - }; - graphql: { - limit: number; - remaining: number; - reset: number; - }; - integration_manifest: { - limit: number; - remaining: number; - reset: number; - }; - }; - rate: { - limit: number; - remaining: number; - reset: number; - }; -} -declare type ReactionsCreateForCommitCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the commit comment. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForCommitCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/comments/:comment_id/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForCommitCommentResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForIssueEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the issue. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForIssueRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/issues/:issue_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForIssueResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForIssueCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the issue comment. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForIssueCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForIssueCommentResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForPullRequestReviewCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the pull request review comment. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForPullRequestReviewCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForPullRequestReviewCommentResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForTeamDiscussionCommentInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - comment_number: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the team discussion comment. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForTeamDiscussionCommentInOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForTeamDiscussionCommentInOrgResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForTeamDiscussionCommentLegacyEndpoint = { - team_id: number; - discussion_number: number; - comment_number: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the team discussion comment. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForTeamDiscussionCommentLegacyRequestOptions = { - method: "POST"; - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForTeamDiscussionCommentLegacyResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForTeamDiscussionInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the team discussion. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForTeamDiscussionInOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForTeamDiscussionInOrgResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsCreateForTeamDiscussionLegacyEndpoint = { - team_id: number; - discussion_number: number; - /** - * The [reaction type](https://developer.github.com/v3/reactions/#reaction-types) to add to the team discussion. - */ - content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsCreateForTeamDiscussionLegacyRequestOptions = { - method: "POST"; - url: "/teams/:team_id/discussions/:discussion_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReactionsCreateForTeamDiscussionLegacyResponseData { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -} -declare type ReactionsDeleteForCommitCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteForCommitCommentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/comments/:comment_id/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsDeleteForIssueEndpoint = { - owner: string; - repo: string; - issue_number: number; - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteForIssueRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/:issue_number/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsDeleteForIssueCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteForIssueCommentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsDeleteForPullRequestCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteForPullRequestCommentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsDeleteForTeamDiscussionEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteForTeamDiscussionRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsDeleteForTeamDiscussionCommentEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - comment_number: number; - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteForTeamDiscussionCommentRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsDeleteLegacyEndpoint = { - reaction_id: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsDeleteLegacyRequestOptions = { - method: "DELETE"; - url: "/reactions/:reaction_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReactionsListForCommitCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to a commit comment. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForCommitCommentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/comments/:comment_id/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForCommitCommentResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForIssueEndpoint = { - owner: string; - repo: string; - issue_number: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to an issue. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForIssueRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/:issue_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForIssueResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForIssueCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to an issue comment. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForIssueCommentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForIssueCommentResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForPullRequestReviewCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to a pull request review comment. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForPullRequestReviewCommentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForPullRequestReviewCommentResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForTeamDiscussionCommentInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - comment_number: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to a team discussion comment. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForTeamDiscussionCommentInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForTeamDiscussionCommentInOrgResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForTeamDiscussionCommentLegacyEndpoint = { - team_id: number; - discussion_number: number; - comment_number: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to a team discussion comment. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForTeamDiscussionCommentLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForTeamDiscussionCommentLegacyResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForTeamDiscussionInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to a team discussion. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForTeamDiscussionInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForTeamDiscussionInOrgResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReactionsListForTeamDiscussionLegacyEndpoint = { - team_id: number; - discussion_number: number; - /** - * Returns a single [reaction type](https://developer.github.com/v3/reactions/#reaction-types). Omit this parameter to list all reactions to a team discussion. - */ - content?: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"squirrel-girl">; -declare type ReactionsListForTeamDiscussionLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/discussions/:discussion_number/reactions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReactionsListForTeamDiscussionLegacyResponseData = { - id: number; - node_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - content: string; - created_at: string; -}[]; -declare type ReposAcceptInvitationEndpoint = { - invitation_id: number; -}; -declare type ReposAcceptInvitationRequestOptions = { - method: "PATCH"; - url: "/user/repository_invitations/:invitation_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposAddAppAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * apps parameter - */ - apps: string[]; -}; -declare type ReposAddAppAccessRestrictionsRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposAddAppAccessRestrictionsResponseData = { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; -}[]; -declare type ReposAddCollaboratorEndpoint = { - owner: string; - repo: string; - username: string; - /** - * The permission to grant the collaborator. **Only valid on organization-owned repositories.** Can be one of: - * \* `pull` - can pull, but not push to or administer this repository. - * \* `push` - can pull and push, but not administer this repository. - * \* `admin` - can pull, push and administer this repository. - * \* `maintain` - Recommended for project managers who need to manage the repository without access to sensitive or destructive actions. - * \* `triage` - Recommended for contributors who need to proactively manage issues and pull requests without write access. - */ - permission?: "pull" | "push" | "admin" | "maintain" | "triage"; -}; -declare type ReposAddCollaboratorRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposAddCollaboratorResponseData { - id: number; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - invitee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - permissions: string; - created_at: string; - url: string; - html_url: string; -} -declare type ReposAddStatusCheckContextsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * contexts parameter - */ - contexts: string[]; -}; -declare type ReposAddStatusCheckContextsRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposAddStatusCheckContextsResponseData = string[]; -declare type ReposAddTeamAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * teams parameter - */ - teams: string[]; -}; -declare type ReposAddTeamAccessRestrictionsRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposAddTeamAccessRestrictionsResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type ReposAddUserAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * users parameter - */ - users: string[]; -}; -declare type ReposAddUserAccessRestrictionsRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposAddUserAccessRestrictionsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type ReposCheckCollaboratorEndpoint = { - owner: string; - repo: string; - username: string; -}; -declare type ReposCheckCollaboratorRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposCheckVulnerabilityAlertsEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"dorian">; -declare type ReposCheckVulnerabilityAlertsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/vulnerability-alerts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposCompareCommitsEndpoint = { - owner: string; - repo: string; - base: string; - head: string; -}; -declare type ReposCompareCommitsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/compare/:base...:head"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCompareCommitsResponseData { - url: string; - html_url: string; - permalink_url: string; - diff_url: string; - patch_url: string; - base_commit: { - url: string; - sha: string; - node_id: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - name: string; - email: string; - date: string; - }; - committer: { - name: string; - email: string; - date: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - sha: string; - }[]; - }; - merge_base_commit: { - url: string; - sha: string; - node_id: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - name: string; - email: string; - date: string; - }; - committer: { - name: string; - email: string; - date: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - sha: string; - }[]; - }; - status: string; - ahead_by: number; - behind_by: number; - total_commits: number; - commits: { - url: string; - sha: string; - node_id: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - name: string; - email: string; - date: string; - }; - committer: { - name: string; - email: string; - date: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - sha: string; - }[]; - }[]; - files: { - sha: string; - filename: string; - status: string; - additions: number; - deletions: number; - changes: number; - blob_url: string; - raw_url: string; - contents_url: string; - patch: string; - }[]; -} -declare type ReposCreateCommitCommentEndpoint = { - owner: string; - repo: string; - commit_sha: string; - /** - * The contents of the comment. - */ - body: string; - /** - * Relative path of the file to comment on. - */ - path?: string; - /** - * Line index in the diff to comment on. - */ - position?: number; - /** - * **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. - */ - line?: number | null; -}; -declare type ReposCreateCommitCommentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/commits/:commit_sha/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateCommitCommentResponseData { - html_url: string; - url: string; - id: number; - node_id: string; - body: string; - path: string; - position: number; - line: number; - commit_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ReposCreateCommitSignatureProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -} & RequiredPreview<"zzzax">; -declare type ReposCreateCommitSignatureProtectionRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateCommitSignatureProtectionResponseData { - url: string; - enabled: boolean; -} -declare type ReposCreateCommitStatusEndpoint = { - owner: string; - repo: string; - sha: string; - /** - * The state of the status. Can be one of `error`, `failure`, `pending`, or `success`. - */ - state: "error" | "failure" | "pending" | "success"; - /** - * The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. - * For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: - * `http://ci.example.com/user/repo/build/sha` - */ - target_url?: string; - /** - * A short description of the status. - */ - description?: string; - /** - * A string label to differentiate this status from the status of other systems. - */ - context?: string; -}; -declare type ReposCreateCommitStatusRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/statuses/:sha"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateCommitStatusResponseData { - url: string; - avatar_url: string; - id: number; - node_id: string; - state: string; - description: string; - target_url: string; - context: string; - created_at: string; - updated_at: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type ReposCreateDeployKeyEndpoint = { - owner: string; - repo: string; - /** - * A name for the key. - */ - title?: string; - /** - * The contents of the key. - */ - key: string; - /** - * If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. - * - * Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/)." - */ - read_only?: boolean; -}; -declare type ReposCreateDeployKeyRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateDeployKeyResponseData { - id: number; - key: string; - url: string; - title: string; - verified: boolean; - created_at: string; - read_only: boolean; -} -declare type ReposCreateDeploymentEndpoint = { - owner: string; - repo: string; - /** - * The ref to deploy. This can be a branch, tag, or SHA. - */ - ref: string; - /** - * Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). - */ - task?: string; - /** - * Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. - */ - auto_merge?: boolean; - /** - * The [status](https://developer.github.com/v3/repos/statuses/) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. - */ - required_contexts?: string[]; - /** - * JSON payload with extra information about the deployment. - */ - payload?: any; - /** - * Name for the target deployment environment (e.g., `production`, `staging`, `qa`). - */ - environment?: string; - /** - * Short description of the deployment. - */ - description?: string; - /** - * Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` - * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. - */ - transient_environment?: boolean; - /** - * Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. - * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. - */ - production_environment?: boolean; -}; -declare type ReposCreateDeploymentRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/deployments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateDeploymentResponseData { - url: string; - id: number; - node_id: string; - sha: string; - ref: string; - task: string; - payload: { - deploy: string; - }; - original_environment: string; - environment: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - statuses_url: string; - repository_url: string; - transient_environment: boolean; - production_environment: boolean; -} -export interface ReposCreateDeploymentResponse202Data { - message: string; -} -export interface ReposCreateDeploymentResponse409Data { - message: string; -} -declare type ReposCreateDeploymentStatusEndpoint = { - owner: string; - repo: string; - deployment_id: number; - /** - * The state of the status. Can be one of `error`, `failure`, `inactive`, `in_progress`, `queued` `pending`, or `success`. **Note:** To use the `inactive` state, you must provide the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. To use the `in_progress` and `queued` states, you must provide the [`application/vnd.github.flash-preview+json`](https://developer.github.com/v3/previews/#deployment-statuses) custom media type. When you set a transient deployment to `inactive`, the deployment will be shown as `destroyed` in GitHub. - */ - state: "error" | "failure" | "inactive" | "in_progress" | "queued" | "pending" | "success"; - /** - * The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. **Note:** It's recommended to use the `log_url` parameter, which replaces `target_url`. - */ - target_url?: string; - /** - * The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` - * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. - */ - log_url?: string; - /** - * A short description of the status. The maximum description length is 140 characters. - */ - description?: string; - /** - * Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. **Note:** This parameter requires you to use the [`application/vnd.github.flash-preview+json`](https://developer.github.com/v3/previews/#deployment-statuses) custom media type. - */ - environment?: "production" | "staging" | "qa"; - /** - * Sets the URL for accessing your environment. Default: `""` - * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. - */ - environment_url?: string; - /** - * Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` - * **Note:** To add an `inactive` status to `production` environments, you must use the [`application/vnd.github.flash-preview+json`](https://developer.github.com/v3/previews/#deployment-statuses) custom media type. - * **Note:** This parameter requires you to use the [`application/vnd.github.ant-man-preview+json`](https://developer.github.com/v3/previews/#enhanced-deployments) custom media type. - */ - auto_inactive?: boolean; -}; -declare type ReposCreateDeploymentStatusRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateDeploymentStatusResponseData { - url: string; - id: number; - node_id: string; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - description: string; - environment: string; - target_url: string; - created_at: string; - updated_at: string; - deployment_url: string; - repository_url: string; - environment_url: string; - log_url: string; -} -declare type ReposCreateDispatchEventEndpoint = { - owner: string; - repo: string; - /** - * **Required:** A custom webhook event name. - */ - event_type: string; - /** - * JSON payload with extra information about the webhook event that your action or worklow may use. - */ - client_payload?: ReposCreateDispatchEventParamsClientPayload; -}; -declare type ReposCreateDispatchEventRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/dispatches"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposCreateForAuthenticatedUserEndpoint = { - /** - * The name of the repository. - */ - name: string; - /** - * A short description of the repository. - */ - description?: string; - /** - * A URL with more information about the repository. - */ - homepage?: string; - /** - * Either `true` to create a private repository or `false` to create a public one. - */ - private?: boolean; - /** - * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. For more information, see "[Creating an internal repository](https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-an-internal-repository)". - * The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. - */ - visibility?: "public" | "private" | "visibility" | "internal"; - /** - * Either `true` to enable issues for this repository or `false` to disable them. - */ - has_issues?: boolean; - /** - * Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. - */ - has_projects?: boolean; - /** - * Either `true` to enable the wiki for this repository or `false` to disable it. - */ - has_wiki?: boolean; - /** - * Either `true` to make this repo available as a template repository or `false` to prevent it. - */ - is_template?: boolean; - /** - * The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. - */ - team_id?: number; - /** - * Pass `true` to create an initial commit with empty README. - */ - auto_init?: boolean; - /** - * Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". - */ - gitignore_template?: string; - /** - * Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". - */ - license_template?: string; - /** - * Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. - */ - allow_squash_merge?: boolean; - /** - * Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. - */ - allow_merge_commit?: boolean; - /** - * Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. - */ - allow_rebase_merge?: boolean; - /** - * Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. - */ - delete_branch_on_merge?: boolean; -}; -declare type ReposCreateForAuthenticatedUserRequestOptions = { - method: "POST"; - url: "/user/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateForAuthenticatedUserResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -} -declare type ReposCreateForkEndpoint = { - owner: string; - repo: string; - /** - * Optional parameter to specify the organization name if forking into an organization. - */ - organization?: string; -}; -declare type ReposCreateForkRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/forks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateForkResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -} -declare type ReposCreateInOrgEndpoint = { - org: string; - /** - * The name of the repository. - */ - name: string; - /** - * A short description of the repository. - */ - description?: string; - /** - * A URL with more information about the repository. - */ - homepage?: string; - /** - * Either `true` to create a private repository or `false` to create a public one. - */ - private?: boolean; - /** - * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. For more information, see "[Creating an internal repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)". - * The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. - */ - visibility?: "public" | "private" | "visibility" | "internal"; - /** - * Either `true` to enable issues for this repository or `false` to disable them. - */ - has_issues?: boolean; - /** - * Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. - */ - has_projects?: boolean; - /** - * Either `true` to enable the wiki for this repository or `false` to disable it. - */ - has_wiki?: boolean; - /** - * Either `true` to make this repo available as a template repository or `false` to prevent it. - */ - is_template?: boolean; - /** - * The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. - */ - team_id?: number; - /** - * Pass `true` to create an initial commit with empty README. - */ - auto_init?: boolean; - /** - * Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". - */ - gitignore_template?: string; - /** - * Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". - */ - license_template?: string; - /** - * Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. - */ - allow_squash_merge?: boolean; - /** - * Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. - */ - allow_merge_commit?: boolean; - /** - * Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. - */ - allow_rebase_merge?: boolean; - /** - * Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. - */ - delete_branch_on_merge?: boolean; -}; -declare type ReposCreateInOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateInOrgResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -} -declare type ReposCreateOrUpdateFileContentsEndpoint = { - owner: string; - repo: string; - path: string; - /** - * The commit message. - */ - message: string; - /** - * The new file content, using Base64 encoding. - */ - content: string; - /** - * **Required if you are updating a file**. The blob SHA of the file being replaced. - */ - sha?: string; - /** - * The branch name. Default: the repository’s default branch (usually `master`) - */ - branch?: string; - /** - * The person that committed the file. Default: the authenticated user. - */ - committer?: ReposCreateOrUpdateFileContentsParamsCommitter; - /** - * The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. - */ - author?: ReposCreateOrUpdateFileContentsParamsAuthor; -}; -declare type ReposCreateOrUpdateFileContentsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/contents/:path"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateOrUpdateFileContentsResponseData { - content: { - name: string; - path: string; - sha: string; - size: number; - url: string; - html_url: string; - git_url: string; - download_url: string; - type: string; - _links: { - self: string; - git: string; - html: string; - }; - }; - commit: { - sha: string; - node_id: string; - url: string; - html_url: string; - author: { - date: string; - name: string; - email: string; - }; - committer: { - date: string; - name: string; - email: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - parents: { - url: string; - html_url: string; - sha: string; - }[]; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; -} -export interface ReposCreateOrUpdateFileContentsResponse201Data { - content: { - name: string; - path: string; - sha: string; - size: number; - url: string; - html_url: string; - git_url: string; - download_url: string; - type: string; - _links: { - self: string; - git: string; - html: string; - }; - }; - commit: { - sha: string; - node_id: string; - url: string; - html_url: string; - author: { - date: string; - name: string; - email: string; - }; - committer: { - date: string; - name: string; - email: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - parents: { - url: string; - html_url: string; - sha: string; - }[]; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; -} -declare type ReposCreatePagesSiteEndpoint = { - owner: string; - repo: string; - /** - * The source branch and directory used to publish your Pages site. - */ - source: ReposCreatePagesSiteParamsSource; -} & RequiredPreview<"switcheroo">; -declare type ReposCreatePagesSiteRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreatePagesSiteResponseData { - url: string; - status: string; - cname: string; - custom_404: boolean; - html_url: string; - source: { - branch: string; - directory: string; - }; -} -declare type ReposCreateReleaseEndpoint = { - owner: string; - repo: string; - /** - * The name of the tag. - */ - tag_name: string; - /** - * Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`). - */ - target_commitish?: string; - /** - * The name of the release. - */ - name?: string; - /** - * Text describing the contents of the tag. - */ - body?: string; - /** - * `true` to create a draft (unpublished) release, `false` to create a published one. - */ - draft?: boolean; - /** - * `true` to identify the release as a prerelease. `false` to identify the release as a full release. - */ - prerelease?: boolean; -}; -declare type ReposCreateReleaseRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/releases"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateReleaseResponseData { - url: string; - html_url: string; - assets_url: string; - upload_url: string; - tarball_url: string; - zipball_url: string; - id: number; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - body: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assets: unknown[]; -} -declare type ReposCreateUsingTemplateEndpoint = { - template_owner: string; - template_repo: string; - /** - * The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. - */ - owner?: string; - /** - * The name of the new repository. - */ - name: string; - /** - * A short description of the new repository. - */ - description?: string; - /** - * Either `true` to create a new private repository or `false` to create a new public one. - */ - private?: boolean; -} & RequiredPreview<"baptiste">; -declare type ReposCreateUsingTemplateRequestOptions = { - method: "POST"; - url: "/repos/:template_owner/:template_repo/generate"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateUsingTemplateResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -} -declare type ReposCreateWebhookEndpoint = { - owner: string; - repo: string; - /** - * Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. - */ - name?: string; - /** - * Key/value pairs to provide settings for this webhook. [These are defined below](https://developer.github.com/v3/repos/hooks/#create-hook-config-params). - */ - config: ReposCreateWebhookParamsConfig; - /** - * Determines what [events](https://developer.github.com/webhooks/event-payloads) the hook is triggered for. - */ - events?: string[]; - /** - * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - */ - active?: boolean; -}; -declare type ReposCreateWebhookRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/hooks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposCreateWebhookResponseData { - type: string; - id: number; - name: string; - active: boolean; - events: string[]; - config: { - content_type: string; - insecure_ssl: string; - url: string; - }; - updated_at: string; - created_at: string; - url: string; - test_url: string; - ping_url: string; - last_response: { - code: string; - status: string; - message: string; - }; -} -declare type ReposDeclineInvitationEndpoint = { - invitation_id: number; -}; -declare type ReposDeclineInvitationRequestOptions = { - method: "DELETE"; - url: "/user/repository_invitations/:invitation_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteEndpoint = { - owner: string; - repo: string; -}; -declare type ReposDeleteRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposDeleteResponseData { - message: string; - documentation_url: string; -} -declare type ReposDeleteAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposDeleteAccessRestrictionsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteAdminBranchProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposDeleteAdminBranchProtectionRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteBranchProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposDeleteBranchProtectionRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteCommitCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; -}; -declare type ReposDeleteCommitCommentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteCommitSignatureProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -} & RequiredPreview<"zzzax">; -declare type ReposDeleteCommitSignatureProtectionRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteDeployKeyEndpoint = { - owner: string; - repo: string; - key_id: number; -}; -declare type ReposDeleteDeployKeyRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/keys/:key_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteDeploymentEndpoint = { - owner: string; - repo: string; - deployment_id: number; -}; -declare type ReposDeleteDeploymentRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/deployments/:deployment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteFileEndpoint = { - owner: string; - repo: string; - path: string; - /** - * The commit message. - */ - message: string; - /** - * The blob SHA of the file being replaced. - */ - sha: string; - /** - * The branch name. Default: the repository’s default branch (usually `master`) - */ - branch?: string; - /** - * object containing information about the committer. - */ - committer?: ReposDeleteFileParamsCommitter; - /** - * object containing information about the author. - */ - author?: ReposDeleteFileParamsAuthor; -}; -declare type ReposDeleteFileRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/contents/:path"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposDeleteFileResponseData { - content: { - [k: string]: unknown; - }; - commit: { - sha: string; - node_id: string; - url: string; - html_url: string; - author: { - date: string; - name: string; - email: string; - }; - committer: { - date: string; - name: string; - email: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - parents: { - url: string; - html_url: string; - sha: string; - }[]; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; -} -declare type ReposDeleteInvitationEndpoint = { - owner: string; - repo: string; - invitation_id: number; -}; -declare type ReposDeleteInvitationRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/invitations/:invitation_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeletePagesSiteEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"switcheroo">; -declare type ReposDeletePagesSiteRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/pages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeletePullRequestReviewProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposDeletePullRequestReviewProtectionRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteReleaseEndpoint = { - owner: string; - repo: string; - release_id: number; -}; -declare type ReposDeleteReleaseRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/releases/:release_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteReleaseAssetEndpoint = { - owner: string; - repo: string; - asset_id: number; -}; -declare type ReposDeleteReleaseAssetRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/releases/assets/:asset_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDeleteWebhookEndpoint = { - owner: string; - repo: string; - hook_id: number; -}; -declare type ReposDeleteWebhookRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/hooks/:hook_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDisableAutomatedSecurityFixesEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"london">; -declare type ReposDisableAutomatedSecurityFixesRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/automated-security-fixes"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDisableVulnerabilityAlertsEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"dorian">; -declare type ReposDisableVulnerabilityAlertsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/vulnerability-alerts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposDownloadArchiveEndpoint = { - owner: string; - repo: string; - archive_format: string; - ref: string; -}; -declare type ReposDownloadArchiveRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/:archive_format/:ref"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposEnableAutomatedSecurityFixesEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"london">; -declare type ReposEnableAutomatedSecurityFixesRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/automated-security-fixes"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposEnableVulnerabilityAlertsEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"dorian">; -declare type ReposEnableVulnerabilityAlertsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/vulnerability-alerts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposGetEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - pull: boolean; - triage: boolean; - push: boolean; - maintain: boolean; - admin: boolean; - }; - allow_rebase_merge: boolean; - template_repository: string; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; - organization: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parent: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - source: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - code_of_conduct: { - name: string; - key: string; - url: string; - html_url: string; - }; -} -declare type ReposGetAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetAccessRestrictionsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetAccessRestrictionsResponseData { - url: string; - users_url: string; - teams_url: string; - apps_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - apps: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }[]; -} -declare type ReposGetAdminBranchProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetAdminBranchProtectionRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetAdminBranchProtectionResponseData { - url: string; - enabled: boolean; -} -declare type ReposGetAllStatusCheckContextsEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetAllStatusCheckContextsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetAllStatusCheckContextsResponseData = string[]; -declare type ReposGetAllTopicsEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"mercy">; -declare type ReposGetAllTopicsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/topics"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetAllTopicsResponseData { - names: string[]; -} -declare type ReposGetAppsWithAccessToProtectedBranchEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetAppsWithAccessToProtectedBranchRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetAppsWithAccessToProtectedBranchResponseData = { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; -}[]; -declare type ReposGetBranchEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetBranchRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetBranchResponseData { - name: string; - commit: { - sha: string; - node_id: string; - commit: { - author: { - name: string; - date: string; - email: string; - }; - url: string; - message: string; - tree: { - sha: string; - url: string; - }; - committer: { - name: string; - date: string; - email: string; - }; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - gravatar_id: string; - avatar_url: string; - url: string; - id: number; - login: string; - }; - parents: { - sha: string; - url: string; - }[]; - url: string; - committer: { - gravatar_id: string; - avatar_url: string; - url: string; - id: number; - login: string; - }; - }; - _links: { - html: string; - self: string; - }; - protected: boolean; - protection: { - enabled: boolean; - required_status_checks: { - enforcement_level: string; - contexts: string[]; - }; - }; - protection_url: string; -} -declare type ReposGetBranchProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetBranchProtectionRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetBranchProtectionResponseData { - url: string; - required_status_checks: { - url: string; - strict: boolean; - contexts: string[]; - contexts_url: string; - }; - enforce_admins: { - url: string; - enabled: boolean; - }; - required_pull_request_reviews: { - url: string; - dismissal_restrictions: { - url: string; - users_url: string; - teams_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - }; - dismiss_stale_reviews: boolean; - require_code_owner_reviews: boolean; - required_approving_review_count: number; - }; - restrictions: { - url: string; - users_url: string; - teams_url: string; - apps_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - apps: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }[]; - }; - required_linear_history: { - enabled: boolean; - }; - allow_force_pushes: { - enabled: boolean; - }; - allow_deletions: { - enabled: boolean; - }; -} -declare type ReposGetClonesEndpoint = { - owner: string; - repo: string; - /** - * Must be one of: `day`, `week`. - */ - per?: "day" | "week"; -}; -declare type ReposGetClonesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/traffic/clones"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetClonesResponseData { - count: number; - uniques: number; - clones: { - timestamp: string; - count: number; - uniques: number; - }[]; -} -declare type ReposGetCodeFrequencyStatsEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetCodeFrequencyStatsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/stats/code_frequency"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetCodeFrequencyStatsResponseData = number[][]; -declare type ReposGetCollaboratorPermissionLevelEndpoint = { - owner: string; - repo: string; - username: string; -}; -declare type ReposGetCollaboratorPermissionLevelRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/collaborators/:username/permission"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetCollaboratorPermissionLevelResponseData { - permission: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type ReposGetCombinedStatusForRefEndpoint = { - owner: string; - repo: string; - ref: string; -}; -declare type ReposGetCombinedStatusForRefRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:ref/status"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetCombinedStatusForRefResponseData { - state: string; - statuses: { - url: string; - avatar_url: string; - id: number; - node_id: string; - state: string; - description: string; - target_url: string; - context: string; - created_at: string; - updated_at: string; - }[]; - sha: string; - total_count: number; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - commit_url: string; - url: string; -} -declare type ReposGetCommitEndpoint = { - owner: string; - repo: string; - ref: string; -}; -declare type ReposGetCommitRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:ref"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetCommitResponseData { - url: string; - sha: string; - node_id: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - name: string; - email: string; - date: string; - }; - committer: { - name: string; - email: string; - date: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - sha: string; - }[]; - stats: { - additions: number; - deletions: number; - total: number; - }; - files: { - filename: string; - additions: number; - deletions: number; - changes: number; - status: string; - raw_url: string; - blob_url: string; - patch: string; - }[]; -} -declare type ReposGetCommitActivityStatsEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetCommitActivityStatsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/stats/commit_activity"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetCommitActivityStatsResponseData = { - days: number[]; - total: number; - week: number; -}[]; -declare type ReposGetCommitCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; -}; -declare type ReposGetCommitCommentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetCommitCommentResponseData { - html_url: string; - url: string; - id: number; - node_id: string; - body: string; - path: string; - position: number; - line: number; - commit_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ReposGetCommitSignatureProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -} & RequiredPreview<"zzzax">; -declare type ReposGetCommitSignatureProtectionRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetCommitSignatureProtectionResponseData { - url: string; - enabled: boolean; -} -declare type ReposGetCommunityProfileMetricsEndpoint = { - owner: string; - repo: string; -} & RequiredPreview<"black-panther">; -declare type ReposGetCommunityProfileMetricsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/community/profile"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetCommunityProfileMetricsResponseData { - health_percentage: number; - description: string; - documentation: boolean; - files: { - code_of_conduct: { - name: string; - key: string; - url: string; - html_url: string; - }; - contributing: { - url: string; - html_url: string; - }; - issue_template: { - url: string; - html_url: string; - }; - pull_request_template: { - url: string; - html_url: string; - }; - license: { - name: string; - key: string; - spdx_id: string; - url: string; - html_url: string; - }; - readme: { - url: string; - html_url: string; - }; - }; - updated_at: string; -} -declare type ReposGetContentEndpoint = { - owner: string; - repo: string; - path: string; - /** - * The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) - */ - ref?: string; -}; -declare type ReposGetContentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/contents/:path"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetContentResponseData { - type: string; - encoding: string; - size: number; - name: string; - path: string; - content: string; - sha: string; - url: string; - git_url: string; - html_url: string; - download_url: string; - target: string; - submodule_git_url: string; - _links: { - git: string; - self: string; - html: string; - }; -} -declare type ReposGetContributorsStatsEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetContributorsStatsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/stats/contributors"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetContributorsStatsResponseData = { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - total: number; - weeks: { - w: string; - a: number; - d: number; - c: number; - }[]; -}[]; -declare type ReposGetDeployKeyEndpoint = { - owner: string; - repo: string; - key_id: number; -}; -declare type ReposGetDeployKeyRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/keys/:key_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetDeployKeyResponseData { - id: number; - key: string; - url: string; - title: string; - verified: boolean; - created_at: string; - read_only: boolean; -} -declare type ReposGetDeploymentEndpoint = { - owner: string; - repo: string; - deployment_id: number; -}; -declare type ReposGetDeploymentRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/deployments/:deployment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetDeploymentResponseData { - url: string; - id: number; - node_id: string; - sha: string; - ref: string; - task: string; - payload: { - deploy: string; - }; - original_environment: string; - environment: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - statuses_url: string; - repository_url: string; - transient_environment: boolean; - production_environment: boolean; -} -declare type ReposGetDeploymentStatusEndpoint = { - owner: string; - repo: string; - deployment_id: number; - status_id: number; -}; -declare type ReposGetDeploymentStatusRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetDeploymentStatusResponseData { - url: string; - id: number; - node_id: string; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - description: string; - environment: string; - target_url: string; - created_at: string; - updated_at: string; - deployment_url: string; - repository_url: string; - environment_url: string; - log_url: string; -} -declare type ReposGetLatestPagesBuildEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetLatestPagesBuildRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pages/builds/latest"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetLatestPagesBuildResponseData { - url: string; - status: string; - error: { - message: string; - }; - pusher: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - commit: string; - duration: number; - created_at: string; - updated_at: string; -} -declare type ReposGetLatestReleaseEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetLatestReleaseRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/releases/latest"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetLatestReleaseResponseData { - url: string; - html_url: string; - assets_url: string; - upload_url: string; - tarball_url: string; - zipball_url: string; - id: number; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - body: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assets: { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - }[]; -} -declare type ReposGetPagesEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetPagesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetPagesResponseData { - url: string; - status: string; - cname: string; - custom_404: boolean; - html_url: string; - source: { - branch: string; - directory: string; - }; -} -declare type ReposGetPagesBuildEndpoint = { - owner: string; - repo: string; - build_id: number; -}; -declare type ReposGetPagesBuildRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pages/builds/:build_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetPagesBuildResponseData { - url: string; - status: string; - error: { - message: string; - }; - pusher: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - commit: string; - duration: number; - created_at: string; - updated_at: string; -} -declare type ReposGetParticipationStatsEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetParticipationStatsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/stats/participation"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetParticipationStatsResponseData { - all: number[]; - owner: number[]; -} -declare type ReposGetPullRequestReviewProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetPullRequestReviewProtectionRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetPullRequestReviewProtectionResponseData { - url: string; - dismissal_restrictions: { - url: string; - users_url: string; - teams_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - }; - dismiss_stale_reviews: boolean; - require_code_owner_reviews: boolean; - required_approving_review_count: number; -} -declare type ReposGetPunchCardStatsEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetPunchCardStatsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/stats/punch_card"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetPunchCardStatsResponseData = number[][]; -declare type ReposGetReadmeEndpoint = { - owner: string; - repo: string; - /** - * The name of the commit/branch/tag. Default: the repository’s default branch (usually `master`) - */ - ref?: string; -}; -declare type ReposGetReadmeRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/readme"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetReadmeResponseData { - type: string; - encoding: string; - size: number; - name: string; - path: string; - content: string; - sha: string; - url: string; - git_url: string; - html_url: string; - download_url: string; - target: string; - submodule_git_url: string; - _links: { - git: string; - self: string; - html: string; - }; -} -declare type ReposGetReleaseEndpoint = { - owner: string; - repo: string; - release_id: number; -}; -declare type ReposGetReleaseRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/releases/:release_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetReleaseResponseData { - url: string; - html_url: string; - assets_url: string; - upload_url: string; - tarball_url: string; - zipball_url: string; - id: number; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - body: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assets: { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - }[]; -} -declare type ReposGetReleaseAssetEndpoint = { - owner: string; - repo: string; - asset_id: number; -}; -declare type ReposGetReleaseAssetRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/releases/assets/:asset_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetReleaseAssetResponseData { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type ReposGetReleaseByTagEndpoint = { - owner: string; - repo: string; - tag: string; -}; -declare type ReposGetReleaseByTagRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/releases/tags/:tag"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetReleaseByTagResponseData { - url: string; - html_url: string; - assets_url: string; - upload_url: string; - tarball_url: string; - zipball_url: string; - id: number; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - body: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assets: { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - }[]; -} -declare type ReposGetStatusChecksProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetStatusChecksProtectionRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetStatusChecksProtectionResponseData { - url: string; - strict: boolean; - contexts: string[]; - contexts_url: string; -} -declare type ReposGetTeamsWithAccessToProtectedBranchEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetTeamsWithAccessToProtectedBranchRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetTeamsWithAccessToProtectedBranchResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type ReposGetTopPathsEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetTopPathsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/traffic/popular/paths"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetTopPathsResponseData = { - path: string; - title: string; - count: number; - uniques: number; -}[]; -declare type ReposGetTopReferrersEndpoint = { - owner: string; - repo: string; -}; -declare type ReposGetTopReferrersRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/traffic/popular/referrers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetTopReferrersResponseData = { - referrer: string; - count: number; - uniques: number; -}[]; -declare type ReposGetUsersWithAccessToProtectedBranchEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposGetUsersWithAccessToProtectedBranchRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposGetUsersWithAccessToProtectedBranchResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type ReposGetViewsEndpoint = { - owner: string; - repo: string; - /** - * Must be one of: `day`, `week`. - */ - per?: "day" | "week"; -}; -declare type ReposGetViewsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/traffic/views"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetViewsResponseData { - count: number; - uniques: number; - views: { - timestamp: string; - count: number; - uniques: number; - }[]; -} -declare type ReposGetWebhookEndpoint = { - owner: string; - repo: string; - hook_id: number; -}; -declare type ReposGetWebhookRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/hooks/:hook_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposGetWebhookResponseData { - type: string; - id: number; - name: string; - active: boolean; - events: string[]; - config: { - content_type: string; - insecure_ssl: string; - url: string; - }; - updated_at: string; - created_at: string; - url: string; - test_url: string; - ping_url: string; - last_response: { - code: string; - status: string; - message: string; - }; -} -declare type ReposListBranchesEndpoint = { - owner: string; - repo: string; - /** - * Setting to `true` returns only protected branches. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches. - */ - protected?: boolean; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListBranchesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/branches"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListBranchesResponseData = { - name: string; - commit: { - sha: string; - url: string; - }; - protected: boolean; - protection: { - enabled: boolean; - required_status_checks: { - enforcement_level: string; - contexts: string[]; - }; - }; - protection_url: string; -}[]; -declare type ReposListBranchesForHeadCommitEndpoint = { - owner: string; - repo: string; - commit_sha: string; -} & RequiredPreview<"groot">; -declare type ReposListBranchesForHeadCommitRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListBranchesForHeadCommitResponseData = { - name: string; - commit: { - sha: string; - url: string; - }; - protected: boolean; -}[]; -declare type ReposListCollaboratorsEndpoint = { - owner: string; - repo: string; - /** - * Filter collaborators returned by their affiliation. Can be one of: - * \* `outside`: All outside collaborators of an organization-owned repository. - * \* `direct`: All collaborators with permissions to an organization-owned repository, regardless of organization membership status. - * \* `all`: All collaborators the authenticated user can see. - */ - affiliation?: "outside" | "direct" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListCollaboratorsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/collaborators"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListCollaboratorsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - permissions: { - pull: boolean; - push: boolean; - admin: boolean; - }; -}[]; -declare type ReposListCommentsForCommitEndpoint = { - owner: string; - repo: string; - commit_sha: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListCommentsForCommitRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:commit_sha/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListCommentsForCommitResponseData = { - html_url: string; - url: string; - id: number; - node_id: string; - body: string; - path: string; - position: number; - line: number; - commit_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type ReposListCommitCommentsForRepoEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListCommitCommentsForRepoRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListCommitCommentsForRepoResponseData = { - html_url: string; - url: string; - id: number; - node_id: string; - body: string; - path: string; - position: number; - line: number; - commit_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -}[]; -declare type ReposListCommitStatusesForRefEndpoint = { - owner: string; - repo: string; - ref: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListCommitStatusesForRefRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:ref/statuses"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListCommitStatusesForRefResponseData = { - url: string; - avatar_url: string; - id: number; - node_id: string; - state: string; - description: string; - target_url: string; - context: string; - created_at: string; - updated_at: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -}[]; -declare type ReposListCommitsEndpoint = { - owner: string; - repo: string; - /** - * SHA or branch to start listing commits from. Default: the repository’s default branch (usually `master`). - */ - sha?: string; - /** - * Only commits containing this file path will be returned. - */ - path?: string; - /** - * GitHub login or email address by which to filter by commit author. - */ - author?: string; - /** - * Only commits after this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - since?: string; - /** - * Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. - */ - until?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListCommitsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListCommitsResponseData = { - url: string; - sha: string; - node_id: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - name: string; - email: string; - date: string; - }; - committer: { - name: string; - email: string; - date: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - sha: string; - }[]; -}[]; -declare type ReposListContributorsEndpoint = { - owner: string; - repo: string; - /** - * Set to `1` or `true` to include anonymous contributors in results. - */ - anon?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListContributorsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/contributors"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListContributorsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - contributions: number; -}[]; -declare type ReposListDeployKeysEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListDeployKeysRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListDeployKeysResponseData = { - id: number; - key: string; - url: string; - title: string; - verified: boolean; - created_at: string; - read_only: boolean; -}[]; -declare type ReposListDeploymentStatusesEndpoint = { - owner: string; - repo: string; - deployment_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListDeploymentStatusesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListDeploymentStatusesResponseData = { - url: string; - id: number; - node_id: string; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - description: string; - environment: string; - target_url: string; - created_at: string; - updated_at: string; - deployment_url: string; - repository_url: string; - environment_url: string; - log_url: string; -}[]; -declare type ReposListDeploymentsEndpoint = { - owner: string; - repo: string; - /** - * The SHA recorded at creation time. - */ - sha?: string; - /** - * The name of the ref. This can be a branch, tag, or SHA. - */ - ref?: string; - /** - * The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`). - */ - task?: string; - /** - * The name of the environment that was deployed to (e.g., `staging` or `production`). - */ - environment?: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListDeploymentsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/deployments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListDeploymentsResponseData = { - url: string; - id: number; - node_id: string; - sha: string; - ref: string; - task: string; - payload: { - deploy: string; - }; - original_environment: string; - environment: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - statuses_url: string; - repository_url: string; - transient_environment: boolean; - production_environment: boolean; -}[]; -declare type ReposListForAuthenticatedUserEndpoint = { - /** - * Can be one of `all`, `public`, or `private`. - */ - visibility?: "all" | "public" | "private"; - /** - * Comma-separated list of values. Can include: - * \* `owner`: Repositories that are owned by the authenticated user. - * \* `collaborator`: Repositories that the user has been added to as a collaborator. - * \* `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. - */ - affiliation?: string; - /** - * Can be one of `all`, `owner`, `public`, `private`, `member`. Default: `all` - * - * Will cause a `422` error if used in the same request as **visibility** or **affiliation**. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. - */ - type?: "all" | "owner" | "public" | "private" | "member"; - /** - * Can be one of `created`, `updated`, `pushed`, `full_name`. - */ - sort?: "created" | "updated" | "pushed" | "full_name"; - /** - * Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc` - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposListForOrgEndpoint = { - org: string; - /** - * Specifies the types of repositories you want returned. Can be one of `all`, `public`, `private`, `forks`, `sources`, `member`, `internal`. Default: `all`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `type` can also be `internal`. - */ - type?: "all" | "public" | "private" | "forks" | "sources" | "member" | "internal"; - /** - * Can be one of `created`, `updated`, `pushed`, `full_name`. - */ - sort?: "created" | "updated" | "pushed" | "full_name"; - /** - * Can be one of `asc` or `desc`. Default: when using `full_name`: `asc`, otherwise `desc` - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListForOrgResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type ReposListForUserEndpoint = { - username: string; - /** - * Can be one of `all`, `owner`, `member`. - */ - type?: "all" | "owner" | "member"; - /** - * Can be one of `created`, `updated`, `pushed`, `full_name`. - */ - sort?: "created" | "updated" | "pushed" | "full_name"; - /** - * Can be one of `asc` or `desc`. Default: `asc` when using `full_name`, otherwise `desc` - */ - direction?: "asc" | "desc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListForUserRequestOptions = { - method: "GET"; - url: "/users/:username/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposListForksEndpoint = { - owner: string; - repo: string; - /** - * The sort order. Can be either `newest`, `oldest`, or `stargazers`. - */ - sort?: "newest" | "oldest" | "stargazers"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListForksRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/forks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListForksResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type ReposListInvitationsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListInvitationsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/invitations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListInvitationsResponseData = { - id: number; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - invitee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - permissions: string; - created_at: string; - url: string; - html_url: string; -}[]; -declare type ReposListInvitationsForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListInvitationsForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/repository_invitations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListInvitationsForAuthenticatedUserResponseData = { - id: number; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - invitee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - permissions: string; - created_at: string; - url: string; - html_url: string; -}[]; -declare type ReposListLanguagesEndpoint = { - owner: string; - repo: string; -}; -declare type ReposListLanguagesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/languages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposListLanguagesResponseData { - C: number; - Python: number; -} -declare type ReposListPagesBuildsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListPagesBuildsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/pages/builds"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListPagesBuildsResponseData = { - url: string; - status: string; - error: { - message: string; - }; - pusher: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - commit: string; - duration: number; - created_at: string; - updated_at: string; -}[]; -declare type ReposListPublicEndpoint = { - /** - * The integer ID of the last repository that you've seen. - */ - since?: number; -}; -declare type ReposListPublicRequestOptions = { - method: "GET"; - url: "/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListPublicResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; -}[]; -declare type ReposListPullRequestsAssociatedWithCommitEndpoint = { - owner: string; - repo: string; - commit_sha: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"groot">; -declare type ReposListPullRequestsAssociatedWithCommitRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/commits/:commit_sha/pulls"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListPullRequestsAssociatedWithCommitResponseData = { - url: string; - id: number; - node_id: string; - html_url: string; - diff_url: string; - patch_url: string; - issue_url: string; - commits_url: string; - review_comments_url: string; - review_comment_url: string; - comments_url: string; - statuses_url: string; - number: number; - state: string; - locked: boolean; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - labels: { - id: number; - node_id: string; - url: string; - name: string; - description: string; - color: string; - default: boolean; - }[]; - milestone: { - url: string; - html_url: string; - labels_url: string; - id: number; - node_id: string; - number: number; - state: string; - title: string; - description: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - open_issues: number; - closed_issues: number; - created_at: string; - updated_at: string; - closed_at: string; - due_on: string; - }; - active_lock_reason: string; - created_at: string; - updated_at: string; - closed_at: string; - merged_at: string; - merge_commit_sha: string; - assignee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assignees: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_reviewers: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - requested_teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - head: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - base: { - label: string; - ref: string; - sha: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - repo: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - }; - _links: { - self: { - href: string; - }; - html: { - href: string; - }; - issue: { - href: string; - }; - comments: { - href: string; - }; - review_comments: { - href: string; - }; - review_comment: { - href: string; - }; - commits: { - href: string; - }; - statuses: { - href: string; - }; - }; - author_association: string; - draft: boolean; -}[]; -declare type ReposListReleaseAssetsEndpoint = { - owner: string; - repo: string; - release_id: number; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListReleaseAssetsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/releases/:release_id/assets"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListReleaseAssetsResponseData = { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -}[]; -declare type ReposListReleasesEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListReleasesRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/releases"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListReleasesResponseData = { - url: string; - html_url: string; - assets_url: string; - upload_url: string; - tarball_url: string; - zipball_url: string; - id: number; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - body: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assets: { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - }[]; -}[]; -declare type ReposListTagsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListTagsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/tags"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListTagsResponseData = { - name: string; - commit: { - sha: string; - url: string; - }; - zipball_url: string; - tarball_url: string; -}[]; -declare type ReposListTeamsEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListTeamsRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListTeamsResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type ReposListWebhooksEndpoint = { - owner: string; - repo: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type ReposListWebhooksRequestOptions = { - method: "GET"; - url: "/repos/:owner/:repo/hooks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposListWebhooksResponseData = { - type: string; - id: number; - name: string; - active: boolean; - events: string[]; - config: { - content_type: string; - insecure_ssl: string; - url: string; - }; - updated_at: string; - created_at: string; - url: string; - test_url: string; - ping_url: string; - last_response: { - code: string; - status: string; - message: string; - }; -}[]; -declare type ReposMergeEndpoint = { - owner: string; - repo: string; - /** - * The name of the base branch that the head will be merged into. - */ - base: string; - /** - * The head to merge. This can be a branch name or a commit SHA1. - */ - head: string; - /** - * Commit message to use for the merge commit. If omitted, a default message will be used. - */ - commit_message?: string; -}; -declare type ReposMergeRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/merges"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposMergeResponseData { - sha: string; - node_id: string; - commit: { - author: { - name: string; - date: string; - email: string; - }; - committer: { - name: string; - date: string; - email: string; - }; - message: string; - tree: { - sha: string; - url: string; - }; - url: string; - comment_count: number; - verification: { - verified: boolean; - reason: string; - signature: string; - payload: string; - }; - }; - url: string; - html_url: string; - comments_url: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - sha: string; - url: string; - }[]; -} -export interface ReposMergeResponse404Data { - message: string; -} -export interface ReposMergeResponse409Data { - message: string; -} -declare type ReposPingWebhookEndpoint = { - owner: string; - repo: string; - hook_id: number; -}; -declare type ReposPingWebhookRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/hooks/:hook_id/pings"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposRemoveAppAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * apps parameter - */ - apps: string[]; -}; -declare type ReposRemoveAppAccessRestrictionsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposRemoveAppAccessRestrictionsResponseData = { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; -}[]; -declare type ReposRemoveCollaboratorEndpoint = { - owner: string; - repo: string; - username: string; -}; -declare type ReposRemoveCollaboratorRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/collaborators/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposRemoveStatusCheckContextsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * contexts parameter - */ - contexts: string[]; -}; -declare type ReposRemoveStatusCheckContextsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposRemoveStatusCheckContextsResponseData = string[]; -declare type ReposRemoveStatusCheckProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposRemoveStatusCheckProtectionRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposRemoveTeamAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * teams parameter - */ - teams: string[]; -}; -declare type ReposRemoveTeamAccessRestrictionsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposRemoveTeamAccessRestrictionsResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type ReposRemoveUserAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * users parameter - */ - users: string[]; -}; -declare type ReposRemoveUserAccessRestrictionsRequestOptions = { - method: "DELETE"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposRemoveUserAccessRestrictionsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type ReposReplaceAllTopicsEndpoint = { - owner: string; - repo: string; - /** - * An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. - */ - names: string[]; -} & RequiredPreview<"mercy">; -declare type ReposReplaceAllTopicsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/topics"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposReplaceAllTopicsResponseData { - names: string[]; -} -declare type ReposRequestPagesBuildEndpoint = { - owner: string; - repo: string; -}; -declare type ReposRequestPagesBuildRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/pages/builds"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposRequestPagesBuildResponseData { - url: string; - status: string; -} -declare type ReposSetAdminBranchProtectionEndpoint = { - owner: string; - repo: string; - branch: string; -}; -declare type ReposSetAdminBranchProtectionRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposSetAdminBranchProtectionResponseData { - url: string; - enabled: boolean; -} -declare type ReposSetAppAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * apps parameter - */ - apps: string[]; -}; -declare type ReposSetAppAccessRestrictionsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposSetAppAccessRestrictionsResponseData = { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; -}[]; -declare type ReposSetStatusCheckContextsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * contexts parameter - */ - contexts: string[]; -}; -declare type ReposSetStatusCheckContextsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposSetStatusCheckContextsResponseData = string[]; -declare type ReposSetTeamAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * teams parameter - */ - teams: string[]; -}; -declare type ReposSetTeamAccessRestrictionsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposSetTeamAccessRestrictionsResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type ReposSetUserAccessRestrictionsEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * users parameter - */ - users: string[]; -}; -declare type ReposSetUserAccessRestrictionsRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type ReposSetUserAccessRestrictionsResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type ReposTestPushWebhookEndpoint = { - owner: string; - repo: string; - hook_id: number; -}; -declare type ReposTestPushWebhookRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/hooks/:hook_id/tests"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposTransferEndpoint = { - owner: string; - repo: string; - /** - * **Required:** The username or organization name the repository will be transferred to. - */ - new_owner?: string; - /** - * ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. - */ - team_ids?: number[]; -}; -declare type ReposTransferRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/transfer"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposTransferResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; -} -declare type ReposUpdateEndpoint = { - owner: string; - repo: string; - /** - * The name of the repository. - */ - name?: string; - /** - * A short description of the repository. - */ - description?: string; - /** - * A URL with more information about the repository. - */ - homepage?: string; - /** - * Either `true` to make the repository private or `false` to make it public. Default: `false`. - * **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. - */ - private?: boolean; - /** - * Can be `public` or `private`. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, `visibility` can also be `internal`. The `visibility` parameter overrides the `private` parameter when you use both along with the `nebula-preview` preview header. - */ - visibility?: "public" | "private" | "visibility" | "internal"; - /** - * Either `true` to enable issues for this repository or `false` to disable them. - */ - has_issues?: boolean; - /** - * Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. - */ - has_projects?: boolean; - /** - * Either `true` to enable the wiki for this repository or `false` to disable it. - */ - has_wiki?: boolean; - /** - * Either `true` to make this repo available as a template repository or `false` to prevent it. - */ - is_template?: boolean; - /** - * Updates the default branch for this repository. - */ - default_branch?: string; - /** - * Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. - */ - allow_squash_merge?: boolean; - /** - * Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. - */ - allow_merge_commit?: boolean; - /** - * Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. - */ - allow_rebase_merge?: boolean; - /** - * Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. - */ - delete_branch_on_merge?: boolean; - /** - * `true` to archive this repository. **Note**: You cannot unarchive repositories through the API. - */ - archived?: boolean; -}; -declare type ReposUpdateRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateResponseData { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - pull: boolean; - triage: boolean; - push: boolean; - maintain: boolean; - admin: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - organization: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parent: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - source: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; -} -declare type ReposUpdateBranchProtectionEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * Require status checks to pass before merging. Set to `null` to disable. - */ - required_status_checks: ReposUpdateBranchProtectionParamsRequiredStatusChecks | null; - /** - * Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. - */ - enforce_admins: boolean | null; - /** - * Require at least one approving review on a pull request, before merging. Set to `null` to disable. - */ - required_pull_request_reviews: ReposUpdateBranchProtectionParamsRequiredPullRequestReviews | null; - /** - * Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. - */ - restrictions: ReposUpdateBranchProtectionParamsRestrictions | null; - /** - * Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/github/administering-a-repository/requiring-a-linear-commit-history)". - */ - required_linear_history?: boolean; - /** - * Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)". - */ - allow_force_pushes?: boolean | null; - /** - * Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)". - */ - allow_deletions?: boolean; -}; -declare type ReposUpdateBranchProtectionRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/branches/:branch/protection"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateBranchProtectionResponseData { - url: string; - required_status_checks: { - url: string; - strict: boolean; - contexts: string[]; - contexts_url: string; - }; - enforce_admins: { - url: string; - enabled: boolean; - }; - required_pull_request_reviews: { - url: string; - dismissal_restrictions: { - url: string; - users_url: string; - teams_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - }; - dismiss_stale_reviews: boolean; - require_code_owner_reviews: boolean; - required_approving_review_count: number; - }; - restrictions: { - url: string; - users_url: string; - teams_url: string; - apps_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - apps: { - id: number; - slug: string; - node_id: string; - owner: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - }; - name: string; - description: string; - external_url: string; - html_url: string; - created_at: string; - updated_at: string; - permissions: { - metadata: string; - contents: string; - issues: string; - single_file: string; - }; - events: string[]; - }[]; - }; - required_linear_history: { - enabled: boolean; - }; - allow_force_pushes: { - enabled: boolean; - }; - allow_deletions: { - enabled: boolean; - }; -} -declare type ReposUpdateCommitCommentEndpoint = { - owner: string; - repo: string; - comment_id: number; - /** - * The contents of the comment - */ - body: string; -}; -declare type ReposUpdateCommitCommentRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/comments/:comment_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateCommitCommentResponseData { - html_url: string; - url: string; - id: number; - node_id: string; - body: string; - path: string; - position: number; - line: number; - commit_id: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; -} -declare type ReposUpdateInformationAboutPagesSiteEndpoint = { - owner: string; - repo: string; - /** - * Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/articles/using-a-custom-domain-with-github-pages/)." - */ - cname?: string; - /** - * Update the source for the repository. Must include the branch name and path. - */ - source: ReposUpdateInformationAboutPagesSiteParamsSource; -}; -declare type ReposUpdateInformationAboutPagesSiteRequestOptions = { - method: "PUT"; - url: "/repos/:owner/:repo/pages"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ReposUpdateInvitationEndpoint = { - owner: string; - repo: string; - invitation_id: number; - /** - * The permissions that the associated user will have on the repository. Valid values are `read`, `write`, `maintain`, `triage`, and `admin`. - */ - permissions?: "read" | "write" | "maintain" | "triage" | "admin"; -}; -declare type ReposUpdateInvitationRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/invitations/:invitation_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateInvitationResponseData { - id: number; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - }; - invitee: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - permissions: string; - created_at: string; - url: string; - html_url: string; -} -declare type ReposUpdatePullRequestReviewProtectionEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * Specify which users and teams can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. - */ - dismissal_restrictions?: ReposUpdatePullRequestReviewProtectionParamsDismissalRestrictions; - /** - * Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. - */ - dismiss_stale_reviews?: boolean; - /** - * Blocks merging pull requests until [code owners](https://docs.github.com/articles/about-code-owners/) have reviewed. - */ - require_code_owner_reviews?: boolean; - /** - * Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6. - */ - required_approving_review_count?: number; -}; -declare type ReposUpdatePullRequestReviewProtectionRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdatePullRequestReviewProtectionResponseData { - url: string; - dismissal_restrictions: { - url: string; - users_url: string; - teams_url: string; - users: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }[]; - teams: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - }[]; - }; - dismiss_stale_reviews: boolean; - require_code_owner_reviews: boolean; - required_approving_review_count: number; -} -declare type ReposUpdateReleaseEndpoint = { - owner: string; - repo: string; - release_id: number; - /** - * The name of the tag. - */ - tag_name?: string; - /** - * Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually `master`). - */ - target_commitish?: string; - /** - * The name of the release. - */ - name?: string; - /** - * Text describing the contents of the tag. - */ - body?: string; - /** - * `true` makes the release a draft, and `false` publishes the release. - */ - draft?: boolean; - /** - * `true` to identify the release as a prerelease, `false` to identify the release as a full release. - */ - prerelease?: boolean; -}; -declare type ReposUpdateReleaseRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/releases/:release_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateReleaseResponseData { - url: string; - html_url: string; - assets_url: string; - upload_url: string; - tarball_url: string; - zipball_url: string; - id: number; - node_id: string; - tag_name: string; - target_commitish: string; - name: string; - body: string; - draft: boolean; - prerelease: boolean; - created_at: string; - published_at: string; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - assets: { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - }[]; -} -declare type ReposUpdateReleaseAssetEndpoint = { - owner: string; - repo: string; - asset_id: number; - /** - * The file name of the asset. - */ - name?: string; - /** - * An alternate short description of the asset. Used in place of the filename. - */ - label?: string; -}; -declare type ReposUpdateReleaseAssetRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/releases/assets/:asset_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateReleaseAssetResponseData { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type ReposUpdateStatusCheckPotectionEndpoint = { - owner: string; - repo: string; - branch: string; - /** - * Require branches to be up to date before merging. - */ - strict?: boolean; - /** - * The list of status checks to require in order to merge into this branch - */ - contexts?: string[]; -}; -declare type ReposUpdateStatusCheckPotectionRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateStatusCheckPotectionResponseData { - url: string; - strict: boolean; - contexts: string[]; - contexts_url: string; -} -declare type ReposUpdateWebhookEndpoint = { - owner: string; - repo: string; - hook_id: number; - /** - * Key/value pairs to provide settings for this webhook. [These are defined below](https://developer.github.com/v3/repos/hooks/#create-hook-config-params). - */ - config?: ReposUpdateWebhookParamsConfig; - /** - * Determines what [events](https://developer.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. - */ - events?: string[]; - /** - * Determines a list of events to be added to the list of events that the Hook triggers for. - */ - add_events?: string[]; - /** - * Determines a list of events to be removed from the list of events that the Hook triggers for. - */ - remove_events?: string[]; - /** - * Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. - */ - active?: boolean; -}; -declare type ReposUpdateWebhookRequestOptions = { - method: "PATCH"; - url: "/repos/:owner/:repo/hooks/:hook_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUpdateWebhookResponseData { - type: string; - id: number; - name: string; - active: boolean; - events: string[]; - config: { - content_type: string; - insecure_ssl: string; - url: string; - }; - updated_at: string; - created_at: string; - url: string; - test_url: string; - ping_url: string; - last_response: { - code: string; - status: string; - message: string; - }; -} -declare type ReposUploadReleaseAssetEndpoint = { - /** - * owner parameter - */ - owner: string; - /** - * repo parameter - */ - repo: string; - /** - * release_id parameter - */ - release_id: number; - /** - * name parameter - */ - name?: string; - /** - * label parameter - */ - label?: string; - /** - * The raw file data - */ - data: string | Buffer; - /** - * The URL origin (protocol + host name + port) is included in `upload_url` returned in the response of the "Create a release" endpoint - */ - origin?: string; - /** - * For https://api.github.com, set `baseUrl` to `https://uploads.github.com`. For GitHub Enterprise Server, set it to `/api/uploads` - */ - baseUrl: string; -} & { - headers: { - "content-type": string; - }; -}; -declare type ReposUploadReleaseAssetRequestOptions = { - method: "POST"; - url: "/repos/:owner/:repo/releases/:release_id/assets{?name,label}"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ReposUploadReleaseAssetResponseData { - url: string; - browser_download_url: string; - id: number; - node_id: string; - name: string; - label: string; - state: string; - content_type: string; - size: number; - download_count: number; - created_at: string; - updated_at: string; - uploader: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; -} -declare type ScimDeleteUserFromOrgEndpoint = { - org: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; -}; -declare type ScimDeleteUserFromOrgRequestOptions = { - method: "DELETE"; - url: "/scim/v2/organizations/:org/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type ScimGetProvisioningInformationForUserEndpoint = { - org: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; -}; -declare type ScimGetProvisioningInformationForUserRequestOptions = { - method: "GET"; - url: "/scim/v2/organizations/:org/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ScimGetProvisioningInformationForUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type ScimListProvisionedIdentitiesEndpoint = { - org: string; - /** - * Used for pagination: the index of the first result to return. - */ - startIndex?: number; - /** - * Used for pagination: the number of results to return. - */ - count?: number; - /** - * Filters results using the equals query parameter operator (`eq`). You can filter results that are equal to `id`, `userName`, `emails`, and `external_id`. For example, to search for an identity with the `userName` Octocat, you would use this query: - * - * `?filter=userName%20eq%20\"Octocat\"`. - * - * To filter results for for the identity with the email `octocat@github.com`, you would use this query: - * - * `?filter=emails%20eq%20\"octocat@github.com\"`. - */ - filter?: string; -}; -declare type ScimListProvisionedIdentitiesRequestOptions = { - method: "GET"; - url: "/scim/v2/organizations/:org/Users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ScimListProvisionedIdentitiesResponseData { - schemas: string[]; - totalResults: number; - itemsPerPage: number; - startIndex: number; - Resources: { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - primary: boolean; - type: string; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; - }[]; -} -declare type ScimProvisionAndInviteUserEndpoint = { - org: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * The username for the user. - */ - userName: string; - name: ScimProvisionAndInviteUserParamsName; - /** - * List of user emails. - */ - emails: ScimProvisionAndInviteUserParamsEmails[]; -}; -declare type ScimProvisionAndInviteUserRequestOptions = { - method: "POST"; - url: "/scim/v2/organizations/:org/Users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ScimProvisionAndInviteUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type ScimSetInformationForProvisionedUserEndpoint = { - org: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * The username for the user. - */ - userName: string; - name: ScimSetInformationForProvisionedUserParamsName; - /** - * List of user emails. - */ - emails: ScimSetInformationForProvisionedUserParamsEmails[]; -}; -declare type ScimSetInformationForProvisionedUserRequestOptions = { - method: "PUT"; - url: "/scim/v2/organizations/:org/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ScimSetInformationForProvisionedUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type ScimUpdateAttributeForUserEndpoint = { - org: string; - /** - * Identifier generated by the GitHub SCIM endpoint. - */ - scim_user_id: string; - /** - * The SCIM schema URIs. - */ - schemas: string[]; - /** - * Array of [SCIM operations](https://tools.ietf.org/html/rfc7644#section-3.5.2). - */ - Operations: ScimUpdateAttributeForUserParamsOperations[]; -}; -declare type ScimUpdateAttributeForUserRequestOptions = { - method: "PATCH"; - url: "/scim/v2/organizations/:org/Users/:scim_user_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface ScimUpdateAttributeForUserResponseData { - schemas: string[]; - id: string; - externalId: string; - userName: string; - name: { - givenName: string; - familyName: string; - }; - emails: { - value: string; - type: string; - primary: boolean; - }[]; - active: boolean; - meta: { - resourceType: string; - created: string; - lastModified: string; - location: string; - }; -} -declare type SearchCodeEndpoint = { - /** - * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching code](https://docs.github.com/articles/searching-code/)" for a detailed list of qualifiers. - */ - q: string; - /** - * Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) - */ - sort?: "indexed"; - /** - * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. - */ - order?: "desc" | "asc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type SearchCodeRequestOptions = { - method: "GET"; - url: "/search/code"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchCodeResponseData { - total_count: number; - incomplete_results: boolean; - items: { - name: string; - path: string; - sha: string; - url: string; - git_url: string; - html_url: string; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - forks_url: string; - keys_url: string; - collaborators_url: string; - teams_url: string; - hooks_url: string; - issue_events_url: string; - events_url: string; - assignees_url: string; - branches_url: string; - tags_url: string; - blobs_url: string; - git_tags_url: string; - git_refs_url: string; - trees_url: string; - statuses_url: string; - languages_url: string; - stargazers_url: string; - contributors_url: string; - subscribers_url: string; - subscription_url: string; - commits_url: string; - git_commits_url: string; - comments_url: string; - issue_comment_url: string; - contents_url: string; - compare_url: string; - merges_url: string; - archive_url: string; - downloads_url: string; - issues_url: string; - pulls_url: string; - milestones_url: string; - notifications_url: string; - labels_url: string; - }; - score: number; - }[]; -} -declare type SearchCommitsEndpoint = { - /** - * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching commits](https://docs.github.com/articles/searching-commits/)" for a detailed list of qualifiers. - */ - q: string; - /** - * Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) - */ - sort?: "author-date" | "committer-date"; - /** - * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. - */ - order?: "desc" | "asc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"cloak">; -declare type SearchCommitsRequestOptions = { - method: "GET"; - url: "/search/commits"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchCommitsResponseData { - total_count: number; - incomplete_results: boolean; - items: { - url: string; - sha: string; - html_url: string; - comments_url: string; - commit: { - url: string; - author: { - date: string; - name: string; - email: string; - }; - committer: { - date: string; - name: string; - email: string; - }; - message: string; - tree: { - url: string; - sha: string; - }; - comment_count: number; - }; - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - committer: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parents: { - url: string; - html_url: string; - sha: string; - }[]; - repository: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - forks_url: string; - keys_url: string; - collaborators_url: string; - teams_url: string; - hooks_url: string; - issue_events_url: string; - events_url: string; - assignees_url: string; - branches_url: string; - tags_url: string; - blobs_url: string; - git_tags_url: string; - git_refs_url: string; - trees_url: string; - statuses_url: string; - languages_url: string; - stargazers_url: string; - contributors_url: string; - subscribers_url: string; - subscription_url: string; - commits_url: string; - git_commits_url: string; - comments_url: string; - issue_comment_url: string; - contents_url: string; - compare_url: string; - merges_url: string; - archive_url: string; - downloads_url: string; - issues_url: string; - pulls_url: string; - milestones_url: string; - notifications_url: string; - labels_url: string; - releases_url: string; - deployments_url: string; - }; - score: number; - }[]; -} -declare type SearchIssuesAndPullRequestsEndpoint = { - /** - * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching issues and pull requests](https://docs.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. - */ - q: string; - /** - * Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) - */ - sort?: "comments" | "reactions" | "reactions-+1" | "reactions--1" | "reactions-smile" | "reactions-thinking_face" | "reactions-heart" | "reactions-tada" | "interactions" | "created" | "updated"; - /** - * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. - */ - order?: "desc" | "asc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type SearchIssuesAndPullRequestsRequestOptions = { - method: "GET"; - url: "/search/issues"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchIssuesAndPullRequestsResponseData { - total_count: number; - incomplete_results: boolean; - items: { - url: string; - repository_url: string; - labels_url: string; - comments_url: string; - events_url: string; - html_url: string; - id: number; - node_id: string; - number: number; - title: string; - user: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - }; - labels: { - id: number; - node_id: string; - url: string; - name: string; - color: string; - }[]; - state: string; - assignee: string; - milestone: string; - comments: number; - created_at: string; - updated_at: string; - closed_at: string; - pull_request: { - html_url: string; - diff_url: string; - patch_url: string; - }; - body: string; - score: number; - }[]; -} -declare type SearchLabelsEndpoint = { - /** - * The id of the repository. - */ - repository_id: number; - /** - * The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). - */ - q: string; - /** - * Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) - */ - sort?: "created" | "updated"; - /** - * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. - */ - order?: "desc" | "asc"; -}; -declare type SearchLabelsRequestOptions = { - method: "GET"; - url: "/search/labels"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchLabelsResponseData { - total_count: number; - incomplete_results: boolean; - items: { - id: number; - node_id: string; - url: string; - name: string; - color: string; - default: boolean; - description: string; - score: number; - }[]; -} -declare type SearchReposEndpoint = { - /** - * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. - */ - q: string; - /** - * Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) - */ - sort?: "stars" | "forks" | "help-wanted-issues" | "updated"; - /** - * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. - */ - order?: "desc" | "asc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type SearchReposRequestOptions = { - method: "GET"; - url: "/search/repositories"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchReposResponseData { - total_count: number; - incomplete_results: boolean; - items: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - received_events_url: string; - type: string; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - created_at: string; - updated_at: string; - pushed_at: string; - homepage: string; - size: number; - stargazers_count: number; - watchers_count: number; - language: string; - forks_count: number; - open_issues_count: number; - master_branch: string; - default_branch: string; - score: number; - }[]; -} -declare type SearchTopicsEndpoint = { - /** - * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). - */ - q: string; -} & RequiredPreview<"mercy">; -declare type SearchTopicsRequestOptions = { - method: "GET"; - url: "/search/topics"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchTopicsResponseData { - total_count: number; - incomplete_results: boolean; - items: { - name: string; - display_name: string; - short_description: string; - description: string; - created_by: string; - released: string; - created_at: string; - updated_at: string; - featured: boolean; - curated: boolean; - score: number; - }[]; -} -declare type SearchUsersEndpoint = { - /** - * The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching users](https://docs.github.com/articles/searching-users/)" for a detailed list of qualifiers. - */ - q: string; - /** - * Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) - */ - sort?: "followers" | "repositories" | "joined"; - /** - * Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. - */ - order?: "desc" | "asc"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type SearchUsersRequestOptions = { - method: "GET"; - url: "/search/users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface SearchUsersResponseData { - total_count: number; - incomplete_results: boolean; - items: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - received_events_url: string; - type: string; - score: number; - }[]; -} -declare type TeamsAddMemberLegacyEndpoint = { - team_id: number; - username: string; -}; -declare type TeamsAddMemberLegacyRequestOptions = { - method: "PUT"; - url: "/teams/:team_id/members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsAddMemberLegacyResponseData { - message: string; - errors: { - code: string; - field: string; - resource: string; - }[]; -} -declare type TeamsAddOrUpdateMembershipForUserInOrgEndpoint = { - org: string; - team_slug: string; - username: string; - /** - * The role that this user should have in the team. Can be one of: - * \* `member` - a normal member of the team. - * \* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - */ - role?: "member" | "maintainer"; -}; -declare type TeamsAddOrUpdateMembershipForUserInOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/teams/:team_slug/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsAddOrUpdateMembershipForUserInOrgResponseData { - url: string; - role: string; - state: string; -} -export interface TeamsAddOrUpdateMembershipForUserInOrgResponse422Data { - message: string; - errors: { - code: string; - field: string; - resource: string; - }[]; -} -declare type TeamsAddOrUpdateMembershipForUserLegacyEndpoint = { - team_id: number; - username: string; - /** - * The role that this user should have in the team. Can be one of: - * \* `member` - a normal member of the team. - * \* `maintainer` - a team maintainer. Able to add/remove other team members, promote other team members to team maintainer, and edit the team's name and description. - */ - role?: "member" | "maintainer"; -}; -declare type TeamsAddOrUpdateMembershipForUserLegacyRequestOptions = { - method: "PUT"; - url: "/teams/:team_id/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsAddOrUpdateMembershipForUserLegacyResponseData { - url: string; - role: string; - state: string; -} -export interface TeamsAddOrUpdateMembershipForUserLegacyResponse422Data { - message: string; - errors: { - code: string; - field: string; - resource: string; - }[]; -} -declare type TeamsAddOrUpdateProjectPermissionsInOrgEndpoint = { - org: string; - team_slug: string; - project_id: number; - /** - * The permission to grant to the team for this project. Can be one of: - * \* `read` - team members can read, but not write to or administer this project. - * \* `write` - team members can read and write, but not administer this project. - * \* `admin` - team members can read, write and administer this project. - * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." - */ - permission?: "read" | "write" | "admin"; -} & RequiredPreview<"inertia">; -declare type TeamsAddOrUpdateProjectPermissionsInOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/teams/:team_slug/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsAddOrUpdateProjectPermissionsInOrgResponseData { - message: string; - documentation_url: string; -} -declare type TeamsAddOrUpdateProjectPermissionsLegacyEndpoint = { - team_id: number; - project_id: number; - /** - * The permission to grant to the team for this project. Can be one of: - * \* `read` - team members can read, but not write to or administer this project. - * \* `write` - team members can read and write, but not administer this project. - * \* `admin` - team members can read, write and administer this project. - * Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://developer.github.com/v3/#http-verbs)." - */ - permission?: "read" | "write" | "admin"; -} & RequiredPreview<"inertia">; -declare type TeamsAddOrUpdateProjectPermissionsLegacyRequestOptions = { - method: "PUT"; - url: "/teams/:team_id/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsAddOrUpdateProjectPermissionsLegacyResponseData { - message: string; - documentation_url: string; -} -declare type TeamsAddOrUpdateRepoPermissionsInOrgEndpoint = { - org: string; - team_slug: string; - owner: string; - repo: string; - /** - * The permission to grant the team on this repository. Can be one of: - * \* `pull` - team members can pull, but not push to or administer this repository. - * \* `push` - team members can pull and push, but not administer this repository. - * \* `admin` - team members can pull, push and administer this repository. - * \* `maintain` - team members can manage the repository without access to sensitive or destructive actions. Recommended for project managers. Only applies to repositories owned by organizations. - * \* `triage` - team members can proactively manage issues and pull requests without write access. Recommended for contributors who triage a repository. Only applies to repositories owned by organizations. - * - * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. - */ - permission?: "pull" | "push" | "admin" | "maintain" | "triage"; -}; -declare type TeamsAddOrUpdateRepoPermissionsInOrgRequestOptions = { - method: "PUT"; - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsAddOrUpdateRepoPermissionsLegacyEndpoint = { - team_id: number; - owner: string; - repo: string; - /** - * The permission to grant the team on this repository. Can be one of: - * \* `pull` - team members can pull, but not push to or administer this repository. - * \* `push` - team members can pull and push, but not administer this repository. - * \* `admin` - team members can pull, push and administer this repository. - * - * If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. - */ - permission?: "pull" | "push" | "admin"; -}; -declare type TeamsAddOrUpdateRepoPermissionsLegacyRequestOptions = { - method: "PUT"; - url: "/teams/:team_id/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsCheckPermissionsForProjectInOrgEndpoint = { - org: string; - team_slug: string; - project_id: number; -} & RequiredPreview<"inertia">; -declare type TeamsCheckPermissionsForProjectInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCheckPermissionsForProjectInOrgResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - organization_permission: string; - private: boolean; - permissions: { - read: boolean; - write: boolean; - admin: boolean; - }; -} -declare type TeamsCheckPermissionsForProjectLegacyEndpoint = { - team_id: number; - project_id: number; -} & RequiredPreview<"inertia">; -declare type TeamsCheckPermissionsForProjectLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCheckPermissionsForProjectLegacyResponseData { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - organization_permission: string; - private: boolean; - permissions: { - read: boolean; - write: boolean; - admin: boolean; - }; -} -declare type TeamsCheckPermissionsForRepoInOrgEndpoint = { - org: string; - team_slug: string; - owner: string; - repo: string; -}; -declare type TeamsCheckPermissionsForRepoInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCheckPermissionsForRepoInOrgResponseData { - organization: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parent: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - source: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - permissions: { - pull: boolean; - triage: boolean; - push: boolean; - maintain: boolean; - admin: boolean; - }; -} -declare type TeamsCheckPermissionsForRepoLegacyEndpoint = { - team_id: number; - owner: string; - repo: string; -}; -declare type TeamsCheckPermissionsForRepoLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCheckPermissionsForRepoLegacyResponseData { - organization: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - parent: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - source: { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - allow_rebase_merge: boolean; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - allow_squash_merge: boolean; - delete_branch_on_merge: boolean; - allow_merge_commit: boolean; - subscribers_count: number; - network_count: number; - }; - permissions: { - pull: boolean; - triage: boolean; - push: boolean; - maintain: boolean; - admin: boolean; - }; -} -declare type TeamsCreateEndpoint = { - org: string; - /** - * The name of the team. - */ - name: string; - /** - * The description of the team. - */ - description?: string; - /** - * List GitHub IDs for organization members who will become team maintainers. - */ - maintainers?: string[]; - /** - * The full name (e.g., "organization-name/repository-name") of repositories to add the team to. - */ - repo_names?: string[]; - /** - * The level of privacy this team should have. The options are: - * **For a non-nested team:** - * \* `secret` - only visible to organization owners and members of this team. - * \* `closed` - visible to all members of this organization. - * Default: `secret` - * **For a parent or child team:** - * \* `closed` - visible to all members of this organization. - * Default for child team: `closed` - */ - privacy?: "secret" | "closed"; - /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \* `pull` - team members can pull, but not push to or administer newly-added repositories. - * \* `push` - team members can pull and push, but not administer newly-added repositories. - * \* `admin` - team members can pull, push and administer newly-added repositories. - */ - permission?: "pull" | "push" | "admin"; - /** - * The ID of a team to set as the parent team. - */ - parent_team_id?: number; -}; -declare type TeamsCreateRequestOptions = { - method: "POST"; - url: "/orgs/:org/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - members_count: number; - repos_count: number; - created_at: string; - updated_at: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - }; -} -declare type TeamsCreateDiscussionCommentInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - /** - * The discussion comment's body text. - */ - body: string; -}; -declare type TeamsCreateDiscussionCommentInOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateDiscussionCommentInOrgResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsCreateDiscussionCommentLegacyEndpoint = { - team_id: number; - discussion_number: number; - /** - * The discussion comment's body text. - */ - body: string; -}; -declare type TeamsCreateDiscussionCommentLegacyRequestOptions = { - method: "POST"; - url: "/teams/:team_id/discussions/:discussion_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateDiscussionCommentLegacyResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsCreateDiscussionInOrgEndpoint = { - org: string; - team_slug: string; - /** - * The discussion post's title. - */ - title: string; - /** - * The discussion post's body text. - */ - body: string; - /** - * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. - */ - private?: boolean; -}; -declare type TeamsCreateDiscussionInOrgRequestOptions = { - method: "POST"; - url: "/orgs/:org/teams/:team_slug/discussions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateDiscussionInOrgResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsCreateDiscussionLegacyEndpoint = { - team_id: number; - /** - * The discussion post's title. - */ - title: string; - /** - * The discussion post's body text. - */ - body: string; - /** - * Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. - */ - private?: boolean; -}; -declare type TeamsCreateDiscussionLegacyRequestOptions = { - method: "POST"; - url: "/teams/:team_id/discussions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateDiscussionLegacyResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsCreateOrUpdateIdPGroupConnectionsInOrgEndpoint = { - org: string; - team_slug: string; - /** - * The IdP groups you want to connect to a GitHub team. When updating, the new `groups` object will replace the original one. You must include any existing groups that you don't want to remove. - */ - groups: TeamsCreateOrUpdateIdPGroupConnectionsInOrgParamsGroups[]; -}; -declare type TeamsCreateOrUpdateIdPGroupConnectionsInOrgRequestOptions = { - method: "PATCH"; - url: "/orgs/:org/teams/:team_slug/team-sync/group-mappings"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateOrUpdateIdPGroupConnectionsInOrgResponseData { - groups: { - group_id: string; - group_name: string; - group_description: string; - }; -} -declare type TeamsCreateOrUpdateIdPGroupConnectionsLegacyEndpoint = { - team_id: number; - /** - * The IdP groups you want to connect to a GitHub team. When updating, the new `groups` object will replace the original one. You must include any existing groups that you don't want to remove. - */ - groups: TeamsCreateOrUpdateIdPGroupConnectionsLegacyParamsGroups[]; -}; -declare type TeamsCreateOrUpdateIdPGroupConnectionsLegacyRequestOptions = { - method: "PATCH"; - url: "/teams/:team_id/team-sync/group-mappings"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsCreateOrUpdateIdPGroupConnectionsLegacyResponseData { - groups: { - group_id: string; - group_name: string; - group_description: string; - }[]; -} -declare type TeamsDeleteDiscussionCommentInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - comment_number: number; -}; -declare type TeamsDeleteDiscussionCommentInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsDeleteDiscussionCommentLegacyEndpoint = { - team_id: number; - discussion_number: number; - comment_number: number; -}; -declare type TeamsDeleteDiscussionCommentLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsDeleteDiscussionInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; -}; -declare type TeamsDeleteDiscussionInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsDeleteDiscussionLegacyEndpoint = { - team_id: number; - discussion_number: number; -}; -declare type TeamsDeleteDiscussionLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id/discussions/:discussion_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsDeleteInOrgEndpoint = { - org: string; - team_slug: string; -}; -declare type TeamsDeleteInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsDeleteLegacyEndpoint = { - team_id: number; -}; -declare type TeamsDeleteLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsGetByNameEndpoint = { - org: string; - team_slug: string; -}; -declare type TeamsGetByNameRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetByNameResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - members_count: number; - repos_count: number; - created_at: string; - updated_at: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - }; -} -declare type TeamsGetDiscussionCommentInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - comment_number: number; -}; -declare type TeamsGetDiscussionCommentInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetDiscussionCommentInOrgResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsGetDiscussionCommentLegacyEndpoint = { - team_id: number; - discussion_number: number; - comment_number: number; -}; -declare type TeamsGetDiscussionCommentLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetDiscussionCommentLegacyResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsGetDiscussionInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; -}; -declare type TeamsGetDiscussionInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetDiscussionInOrgResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsGetDiscussionLegacyEndpoint = { - team_id: number; - discussion_number: number; -}; -declare type TeamsGetDiscussionLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/discussions/:discussion_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetDiscussionLegacyResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsGetLegacyEndpoint = { - team_id: number; -}; -declare type TeamsGetLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetLegacyResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - members_count: number; - repos_count: number; - created_at: string; - updated_at: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - }; -} -declare type TeamsGetMemberLegacyEndpoint = { - team_id: number; - username: string; -}; -declare type TeamsGetMemberLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsGetMembershipForUserInOrgEndpoint = { - org: string; - team_slug: string; - username: string; -}; -declare type TeamsGetMembershipForUserInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetMembershipForUserInOrgResponseData { - url: string; - role: string; - state: string; -} -declare type TeamsGetMembershipForUserLegacyEndpoint = { - team_id: number; - username: string; -}; -declare type TeamsGetMembershipForUserLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsGetMembershipForUserLegacyResponseData { - url: string; - role: string; - state: string; -} -declare type TeamsListEndpoint = { - org: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type TeamsListRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; -}[]; -declare type TeamsListChildInOrgEndpoint = { - org: string; - team_slug: string; - /** - * Results per page (max 100) - */ - per_page?: number; + "PUT /enterprises/{enterprise}/actions/permissions": Operation<"/enterprises/{enterprise}/actions/permissions", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/enterprise-admin#set-selected-organizations-enabled-for-github-actions-in-an-enterprise */ - page?: number; -}; -declare type TeamsListChildInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListChildInOrgResponseData = { - id: number; - node_id: string; - url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - }; -}[]; -declare type TeamsListChildLegacyEndpoint = { - team_id: number; + "PUT /enterprises/{enterprise}/actions/permissions/organizations": Operation<"/enterprises/{enterprise}/actions/permissions/organizations", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/enterprise-admin#enable-a-selected-organization-for-github-actions-in-an-enterprise */ - per_page?: number; + "PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}": Operation<"/enterprises/{enterprise}/actions/permissions/organizations/{org_id}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/enterprise-admin#set-allowed-actions-for-an-enterprise */ - page?: number; -}; -declare type TeamsListChildLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListChildLegacyResponseData = { - id: number; - node_id: string; - url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - }; -}[]; -declare type TeamsListDiscussionCommentsInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; + "PUT /enterprises/{enterprise}/actions/permissions/selected-actions": Operation<"/enterprises/{enterprise}/actions/permissions/selected-actions", "put">; /** - * Sorts the discussion comments by the date they were created. To return the oldest comments first, set to `asc`. Can be one of `asc` or `desc`. + * @see https://docs.github.com/rest/reference/enterprise-admin#set-organization-access-to-a-self-hosted-runner-group-in-an-enterprise */ - direction?: "asc" | "desc"; + "PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/enterprise-admin#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise */ - per_page?: number; + "PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/enterprise-admin#set-self-hosted-runners-in-a-group-for-an-enterprise */ - page?: number; -}; -declare type TeamsListDiscussionCommentsInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListDiscussionCommentsInOrgResponseData = { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -}[]; -declare type TeamsListDiscussionCommentsLegacyEndpoint = { - team_id: number; - discussion_number: number; + "PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "put">; /** - * Sorts the discussion comments by the date they were created. To return the oldest comments first, set to `asc`. Can be one of `asc` or `desc`. + * @see https://docs.github.com/rest/reference/enterprise-admin#add-a-self-hosted-runner-to-a-group-for-an-enterprise */ - direction?: "asc" | "desc"; + "PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/gists#star-a-gist */ - per_page?: number; + "PUT /gists/{gist_id}/star": Operation<"/gists/{gist_id}/star", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/activity#mark-notifications-as-read */ - page?: number; -}; -declare type TeamsListDiscussionCommentsLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/discussions/:discussion_number/comments"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListDiscussionCommentsLegacyResponseData = { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -}[]; -declare type TeamsListDiscussionsInOrgEndpoint = { - org: string; - team_slug: string; + "PUT /notifications": Operation<"/notifications", "put">; /** - * Sorts the discussion comments by the date they were created. To return the oldest comments first, set to `asc`. Can be one of `asc` or `desc`. + * @see https://docs.github.com/rest/reference/activity#set-a-thread-subscription */ - direction?: "asc" | "desc"; + "PUT /notifications/threads/{thread_id}/subscription": Operation<"/notifications/threads/{thread_id}/subscription", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/actions#set-github-actions-permissions-for-an-organization */ - per_page?: number; + "PUT /orgs/{org}/actions/permissions": Operation<"/orgs/{org}/actions/permissions", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization */ - page?: number; -}; -declare type TeamsListDiscussionsInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/discussions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListDiscussionsInOrgResponseData = { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -}[]; -declare type TeamsListDiscussionsLegacyEndpoint = { - team_id: number; + "PUT /orgs/{org}/actions/permissions/repositories": Operation<"/orgs/{org}/actions/permissions/repositories", "put">; /** - * Sorts the discussion comments by the date they were created. To return the oldest comments first, set to `asc`. Can be one of `asc` or `desc`. + * @see https://docs.github.com/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization */ - direction?: "asc" | "desc"; + "PUT /orgs/{org}/actions/permissions/repositories/{repository_id}": Operation<"/orgs/{org}/actions/permissions/repositories/{repository_id}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/actions#set-allowed-actions-for-an-organization */ - per_page?: number; + "PUT /orgs/{org}/actions/permissions/selected-actions": Operation<"/orgs/{org}/actions/permissions/selected-actions", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/actions#set-repository-access-to-a-self-hosted-runner-group-in-an-organization */ - page?: number; -}; -declare type TeamsListDiscussionsLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/discussions"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListDiscussionsLegacyResponseData = { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -}[]; -declare type TeamsListForAuthenticatedUserEndpoint = { + "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/actions#add-repository-acess-to-a-self-hosted-runner-group-in-an-organization */ - per_page?: number; + "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization */ - page?: number; -}; -declare type TeamsListForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/teams"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListForAuthenticatedUserResponseData = { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - members_count: number; - repos_count: number; - created_at: string; - updated_at: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - }; -}[]; -declare type TeamsListIdPGroupsForLegacyEndpoint = { - team_id: number; -}; -declare type TeamsListIdPGroupsForLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/team-sync/group-mappings"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsListIdPGroupsForLegacyResponseData { - groups: { - group_id: string; - group_name: string; - group_description: string; - }[]; -} -declare type TeamsListIdPGroupsForOrgEndpoint = { - org: string; + "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-organization */ - per_page?: number; + "PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/actions#create-or-update-an-organization-secret */ - page?: number; -}; -declare type TeamsListIdPGroupsForOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/team-sync/groups"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsListIdPGroupsForOrgResponseData { - groups: { - group_id: string; - group_name: string; - group_description: string; - }[]; -} -declare type TeamsListIdPGroupsInOrgEndpoint = { - org: string; - team_slug: string; -}; -declare type TeamsListIdPGroupsInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/team-sync/group-mappings"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsListIdPGroupsInOrgResponseData { - groups: { - group_id: string; - group_name: string; - group_description: string; - }[]; -} -declare type TeamsListMembersInOrgEndpoint = { - org: string; - team_slug: string; + "PUT /orgs/{org}/actions/secrets/{secret_name}": Operation<"/orgs/{org}/actions/secrets/{secret_name}", "put">; /** - * Filters members returned by their role in the team. Can be one of: - * \* `member` - normal members of the team. - * \* `maintainer` - team maintainers. - * \* `all` - all members of the team. + * @see https://docs.github.com/rest/reference/actions#set-selected-repositories-for-an-organization-secret */ - role?: "member" | "maintainer" | "all"; + "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories": Operation<"/orgs/{org}/actions/secrets/{secret_name}/repositories", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/actions#add-selected-repository-to-an-organization-secret */ - per_page?: number; + "PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/orgs#block-a-user-from-an-organization */ - page?: number; -}; -declare type TeamsListMembersInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/members"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListMembersInOrgResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type TeamsListMembersLegacyEndpoint = { - team_id: number; - /** - * Filters members returned by their role in the team. Can be one of: - * \* `member` - normal members of the team. - * \* `maintainer` - team maintainers. - * \* `all` - all members of the team. - */ - role?: "member" | "maintainer" | "all"; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type TeamsListMembersLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/members"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListMembersLegacyResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type TeamsListPendingInvitationsInOrgEndpoint = { - org: string; - team_slug: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type TeamsListPendingInvitationsInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/invitations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListPendingInvitationsInOrgResponseData = { - id: number; - login: string; - email: string; - role: string; - created_at: string; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - team_count: number; - invitation_team_url: string; -}[]; -declare type TeamsListPendingInvitationsLegacyEndpoint = { - team_id: number; + "PUT /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-an-organization */ - per_page?: number; + "PUT /orgs/{org}/interaction-limits": Operation<"/orgs/{org}/interaction-limits", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/orgs#set-organization-membership-for-a-user */ - page?: number; -}; -declare type TeamsListPendingInvitationsLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/invitations"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListPendingInvitationsLegacyResponseData = { - id: number; - login: string; - email: string; - role: string; - created_at: string; - inviter: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - team_count: number; - invitation_team_url: string; -}[]; -declare type TeamsListProjectsInOrgEndpoint = { - org: string; - team_slug: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -} & RequiredPreview<"inertia">; -declare type TeamsListProjectsInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListProjectsInOrgResponseData = { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - organization_permission: string; - private: boolean; - permissions: { - read: boolean; - write: boolean; - admin: boolean; - }; -}[]; -declare type TeamsListProjectsLegacyEndpoint = { - team_id: number; + "PUT /orgs/{org}/memberships/{username}": Operation<"/orgs/{org}/memberships/{username}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/orgs#convert-an-organization-member-to-outside-collaborator */ - per_page?: number; + "PUT /orgs/{org}/outside_collaborators/{username}": Operation<"/orgs/{org}/outside_collaborators/{username}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/orgs#set-public-organization-membership-for-the-authenticated-user */ - page?: number; -} & RequiredPreview<"inertia">; -declare type TeamsListProjectsLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/projects"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListProjectsLegacyResponseData = { - owner_url: string; - url: string; - html_url: string; - columns_url: string; - id: number; - node_id: string; - name: string; - body: string; - number: number; - state: string; - creator: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - created_at: string; - updated_at: string; - organization_permission: string; - private: boolean; - permissions: { - read: boolean; - write: boolean; - admin: boolean; - }; -}[]; -declare type TeamsListReposInOrgEndpoint = { - org: string; - team_slug: string; + "PUT /orgs/{org}/public_members/{username}": Operation<"/orgs/{org}/public_members/{username}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user */ - per_page?: number; + "PUT /orgs/{org}/teams/{team_slug}/memberships/{username}": Operation<"/orgs/{org}/teams/{team_slug}/memberships/{username}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/teams#add-or-update-team-project-permissions */ - page?: number; -}; -declare type TeamsListReposInOrgRequestOptions = { - method: "GET"; - url: "/orgs/:org/teams/:team_slug/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListReposInOrgResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type TeamsListReposLegacyEndpoint = { - team_id: number; + "PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}": Operation<"/orgs/{org}/teams/{team_slug}/projects/{project_id}", "put", "inertia">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/teams/#add-or-update-team-repository-permissions */ - per_page?: number; + "PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}": Operation<"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/projects#add-project-collaborator */ - page?: number; -}; -declare type TeamsListReposLegacyRequestOptions = { - method: "GET"; - url: "/teams/:team_id/repos"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type TeamsListReposLegacyResponseData = { - id: number; - node_id: string; - name: string; - full_name: string; - owner: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - private: boolean; - html_url: string; - description: string; - fork: boolean; - url: string; - archive_url: string; - assignees_url: string; - blobs_url: string; - branches_url: string; - collaborators_url: string; - comments_url: string; - commits_url: string; - compare_url: string; - contents_url: string; - contributors_url: string; - deployments_url: string; - downloads_url: string; - events_url: string; - forks_url: string; - git_commits_url: string; - git_refs_url: string; - git_tags_url: string; - git_url: string; - issue_comment_url: string; - issue_events_url: string; - issues_url: string; - keys_url: string; - labels_url: string; - languages_url: string; - merges_url: string; - milestones_url: string; - notifications_url: string; - pulls_url: string; - releases_url: string; - ssh_url: string; - stargazers_url: string; - statuses_url: string; - subscribers_url: string; - subscription_url: string; - tags_url: string; - teams_url: string; - trees_url: string; - clone_url: string; - mirror_url: string; - hooks_url: string; - svn_url: string; - homepage: string; - language: string; - forks_count: number; - stargazers_count: number; - watchers_count: number; - size: number; - default_branch: string; - open_issues_count: number; - is_template: boolean; - topics: string[]; - has_issues: boolean; - has_projects: boolean; - has_wiki: boolean; - has_pages: boolean; - has_downloads: boolean; - archived: boolean; - disabled: boolean; - visibility: string; - pushed_at: string; - created_at: string; - updated_at: string; - permissions: { - admin: boolean; - push: boolean; - pull: boolean; - }; - template_repository: { - [k: string]: unknown; - }; - temp_clone_token: string; - delete_branch_on_merge: boolean; - subscribers_count: number; - network_count: number; - license: { - key: string; - name: string; - spdx_id: string; - url: string; - node_id: string; - }; -}[]; -declare type TeamsRemoveMemberLegacyEndpoint = { - team_id: number; - username: string; -}; -declare type TeamsRemoveMemberLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id/members/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsRemoveMembershipForUserInOrgEndpoint = { - org: string; - team_slug: string; - username: string; -}; -declare type TeamsRemoveMembershipForUserInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsRemoveMembershipForUserLegacyEndpoint = { - team_id: number; - username: string; -}; -declare type TeamsRemoveMembershipForUserLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id/memberships/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsRemoveProjectInOrgEndpoint = { - org: string; - team_slug: string; - project_id: number; -}; -declare type TeamsRemoveProjectInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsRemoveProjectLegacyEndpoint = { - team_id: number; - project_id: number; -}; -declare type TeamsRemoveProjectLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id/projects/:project_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsRemoveRepoInOrgEndpoint = { - org: string; - team_slug: string; - owner: string; - repo: string; -}; -declare type TeamsRemoveRepoInOrgRequestOptions = { - method: "DELETE"; - url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsRemoveRepoLegacyEndpoint = { - team_id: number; - owner: string; - repo: string; -}; -declare type TeamsRemoveRepoLegacyRequestOptions = { - method: "DELETE"; - url: "/teams/:team_id/repos/:owner/:repo"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type TeamsUpdateDiscussionCommentInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; - comment_number: number; + "PUT /projects/{project_id}/collaborators/{username}": Operation<"/projects/{project_id}/collaborators/{username}", "put", "inertia">; /** - * The discussion comment's body text. + * @see https://docs.github.com/rest/reference/actions#set-github-actions-permissions-for-a-repository */ - body: string; -}; -declare type TeamsUpdateDiscussionCommentInOrgRequestOptions = { - method: "PATCH"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsUpdateDiscussionCommentInOrgResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsUpdateDiscussionCommentLegacyEndpoint = { - team_id: number; - discussion_number: number; - comment_number: number; + "PUT /repos/{owner}/{repo}/actions/permissions": Operation<"/repos/{owner}/{repo}/actions/permissions", "put">; /** - * The discussion comment's body text. + * @see https://docs.github.com/rest/reference/actions#set-allowed-actions-for-a-repository */ - body: string; -}; -declare type TeamsUpdateDiscussionCommentLegacyRequestOptions = { - method: "PATCH"; - url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsUpdateDiscussionCommentLegacyResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - created_at: string; - last_edited_at: string; - discussion_url: string; - html_url: string; - node_id: string; - number: number; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsUpdateDiscussionInOrgEndpoint = { - org: string; - team_slug: string; - discussion_number: number; + "PUT /repos/{owner}/{repo}/actions/permissions/selected-actions": Operation<"/repos/{owner}/{repo}/actions/permissions/selected-actions", "put">; /** - * The discussion post's title. + * @see https://docs.github.com/rest/reference/actions#create-or-update-a-repository-secret */ - title?: string; + "PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}": Operation<"/repos/{owner}/{repo}/actions/secrets/{secret_name}", "put">; /** - * The discussion post's body text. + * @see https://docs.github.com/rest/reference/actions#disable-a-workflow */ - body?: string; -}; -declare type TeamsUpdateDiscussionInOrgRequestOptions = { - method: "PATCH"; - url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsUpdateDiscussionInOrgResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsUpdateDiscussionLegacyEndpoint = { - team_id: number; - discussion_number: number; + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable", "put">; /** - * The discussion post's title. + * @see https://docs.github.com/rest/reference/actions#enable-a-workflow */ - title?: string; + "PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable", "put">; /** - * The discussion post's body text. + * @see https://docs.github.com/rest/reference/repos#enable-automated-security-fixes */ - body?: string; -}; -declare type TeamsUpdateDiscussionLegacyRequestOptions = { - method: "PATCH"; - url: "/teams/:team_id/discussions/:discussion_number"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsUpdateDiscussionLegacyResponseData { - author: { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - }; - body: string; - body_html: string; - body_version: string; - comments_count: number; - comments_url: string; - created_at: string; - last_edited_at: string; - html_url: string; - node_id: string; - number: number; - pinned: boolean; - private: boolean; - team_url: string; - title: string; - updated_at: string; - url: string; - reactions: { - url: string; - total_count: number; - "+1": number; - "-1": number; - laugh: number; - confused: number; - heart: number; - hooray: number; - }; -} -declare type TeamsUpdateInOrgEndpoint = { - org: string; - team_slug: string; + "PUT /repos/{owner}/{repo}/automated-security-fixes": Operation<"/repos/{owner}/{repo}/automated-security-fixes", "put", "london">; /** - * The name of the team. + * @see https://docs.github.com/rest/reference/repos#update-branch-protection */ - name: string; + "PUT /repos/{owner}/{repo}/branches/{branch}/protection": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection", "put">; /** - * The description of the team. + * @see https://docs.github.com/rest/reference/repos#set-status-check-contexts */ - description?: string; + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", "put">; /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: - * **For a non-nested team:** - * \* `secret` - only visible to organization owners and members of this team. - * \* `closed` - visible to all members of this organization. - * **For a parent or child team:** - * \* `closed` - visible to all members of this organization. + * @see https://docs.github.com/rest/reference/repos#set-app-access-restrictions */ - privacy?: "secret" | "closed"; + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", "put">; /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \* `pull` - team members can pull, but not push to or administer newly-added repositories. - * \* `push` - team members can pull and push, but not administer newly-added repositories. - * \* `admin` - team members can pull, push and administer newly-added repositories. + * @see https://docs.github.com/rest/reference/repos#set-team-access-restrictions */ - permission?: "pull" | "push" | "admin"; + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", "put">; /** - * The ID of a team to set as the parent team. + * @see https://docs.github.com/rest/reference/repos#set-user-access-restrictions */ - parent_team_id?: number; -}; -declare type TeamsUpdateInOrgRequestOptions = { - method: "PATCH"; - url: "/orgs/:org/teams/:team_slug"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsUpdateInOrgResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - members_count: number; - repos_count: number; - created_at: string; - updated_at: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - }; -} -declare type TeamsUpdateLegacyEndpoint = { - team_id: number; + "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users": Operation<"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", "put">; /** - * The name of the team. + * @see https://docs.github.com/rest/reference/repos#add-a-repository-collaborator */ - name: string; + "PUT /repos/{owner}/{repo}/collaborators/{username}": Operation<"/repos/{owner}/{repo}/collaborators/{username}", "put">; /** - * The description of the team. + * @see https://docs.github.com/rest/reference/repos#create-or-update-file-contents */ - description?: string; + "PUT /repos/{owner}/{repo}/contents/{path}": Operation<"/repos/{owner}/{repo}/contents/{path}", "put">; /** - * The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: - * **For a non-nested team:** - * \* `secret` - only visible to organization owners and members of this team. - * \* `closed` - visible to all members of this organization. - * **For a parent or child team:** - * \* `closed` - visible to all members of this organization. + * @see https://docs.github.com/rest/reference/repos#create-or-update-an-environment */ - privacy?: "secret" | "closed"; + "PUT /repos/{owner}/{repo}/environments/{environment_name}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}", "put">; /** - * **Deprecated**. The permission that new repositories will be added to the team with when none is specified. Can be one of: - * \* `pull` - team members can pull, but not push to or administer newly-added repositories. - * \* `push` - team members can pull and push, but not administer newly-added repositories. - * \* `admin` - team members can pull, push and administer newly-added repositories. + * @see https://docs.github.com/rest/reference/migrations#start-an-import */ - permission?: "pull" | "push" | "admin"; + "PUT /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "put">; /** - * The ID of a team to set as the parent team. + * @see https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-a-repository */ - parent_team_id?: number; -}; -declare type TeamsUpdateLegacyRequestOptions = { - method: "PATCH"; - url: "/teams/:team_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface TeamsUpdateLegacyResponseData { - id: number; - node_id: string; - url: string; - html_url: string; - name: string; - slug: string; - description: string; - privacy: string; - permission: string; - members_url: string; - repositories_url: string; - parent: { - [k: string]: unknown; - }; - members_count: number; - repos_count: number; - created_at: string; - updated_at: string; - organization: { - login: string; - id: number; - node_id: string; - url: string; - repos_url: string; - events_url: string; - hooks_url: string; - issues_url: string; - members_url: string; - public_members_url: string; - avatar_url: string; - description: string; - name: string; - company: string; - blog: string; - location: string; - email: string; - twitter_username: string; - is_verified: boolean; - has_organization_projects: boolean; - has_repository_projects: boolean; - public_repos: number; - public_gists: number; - followers: number; - following: number; - html_url: string; - created_at: string; - type: string; - }; -} -declare type UsersAddEmailForAuthenticatedEndpoint = { + "PUT /repos/{owner}/{repo}/interaction-limits": Operation<"/repos/{owner}/{repo}/interaction-limits", "put">; /** - * Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. + * @see https://docs.github.com/rest/reference/issues#set-labels-for-an-issue */ - emails: string[]; -}; -declare type UsersAddEmailForAuthenticatedRequestOptions = { - method: "POST"; - url: "/user/emails"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersAddEmailForAuthenticatedResponseData = { - email: string; - primary: boolean; - verified: boolean; - visibility: string; -}[]; -declare type UsersBlockEndpoint = { - username: string; -}; -declare type UsersBlockRequestOptions = { - method: "PUT"; - url: "/user/blocks/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersCheckBlockedEndpoint = { - username: string; -}; -declare type UsersCheckBlockedRequestOptions = { - method: "GET"; - url: "/user/blocks/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersCheckFollowingForUserEndpoint = { - username: string; - target_user: string; -}; -declare type UsersCheckFollowingForUserRequestOptions = { - method: "GET"; - url: "/users/:username/following/:target_user"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersCheckPersonIsFollowedByAuthenticatedEndpoint = { - username: string; -}; -declare type UsersCheckPersonIsFollowedByAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/following/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersCreateGpgKeyForAuthenticatedEndpoint = { + "PUT /repos/{owner}/{repo}/issues/{issue_number}/labels": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/labels", "put">; /** - * Your GPG key, generated in ASCII-armored format. See "[Generating a new GPG key](https://docs.github.com/articles/generating-a-new-gpg-key/)" for help creating a GPG key. + * @see https://docs.github.com/rest/reference/issues#lock-an-issue */ - armored_public_key?: string; -}; -declare type UsersCreateGpgKeyForAuthenticatedRequestOptions = { - method: "POST"; - url: "/user/gpg_keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersCreateGpgKeyForAuthenticatedResponseData { - id: number; - primary_key_id: string; - key_id: string; - public_key: string; - emails: { - email: string; - verified: boolean; - }[]; - subkeys: { - id: number; - primary_key_id: number; - key_id: string; - public_key: string; - emails: unknown[]; - subkeys: unknown[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; - }[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; -} -declare type UsersCreatePublicSshKeyForAuthenticatedEndpoint = { + "PUT /repos/{owner}/{repo}/issues/{issue_number}/lock": Operation<"/repos/{owner}/{repo}/issues/{issue_number}/lock", "put">; /** - * A descriptive name for the new key. Use a name that will help you recognize this key in your GitHub account. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air". + * @see https://docs.github.com/rest/reference/activity#mark-repository-notifications-as-read */ - title?: string; + "PUT /repos/{owner}/{repo}/notifications": Operation<"/repos/{owner}/{repo}/notifications", "put">; /** - * The public SSH key to add to your GitHub account. See "[Generating a new SSH key](https://docs.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)" for guidance on how to create a public SSH key. + * @see https://docs.github.com/rest/reference/repos#update-information-about-a-github-pages-site */ - key?: string; -}; -declare type UsersCreatePublicSshKeyForAuthenticatedRequestOptions = { - method: "POST"; - url: "/user/keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersCreatePublicSshKeyForAuthenticatedResponseData { - key_id: string; - key: string; -} -declare type UsersDeleteEmailForAuthenticatedEndpoint = { + "PUT /repos/{owner}/{repo}/pages": Operation<"/repos/{owner}/{repo}/pages", "put">; /** - * Deletes one or more email addresses from your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. + * @see https://docs.github.com/rest/reference/pulls#merge-a-pull-request */ - emails: string[]; -}; -declare type UsersDeleteEmailForAuthenticatedRequestOptions = { - method: "DELETE"; - url: "/user/emails"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersDeleteGpgKeyForAuthenticatedEndpoint = { - gpg_key_id: number; -}; -declare type UsersDeleteGpgKeyForAuthenticatedRequestOptions = { - method: "DELETE"; - url: "/user/gpg_keys/:gpg_key_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersDeletePublicSshKeyForAuthenticatedEndpoint = { - key_id: number; -}; -declare type UsersDeletePublicSshKeyForAuthenticatedRequestOptions = { - method: "DELETE"; - url: "/user/keys/:key_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersFollowEndpoint = { - username: string; -}; -declare type UsersFollowRequestOptions = { - method: "PUT"; - url: "/user/following/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersGetAuthenticatedEndpoint = {}; -declare type UsersGetAuthenticatedRequestOptions = { - method: "GET"; - url: "/user"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersGetAuthenticatedResponseData { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - name: string; - company: string; - blog: string; - location: string; - email: string; - hireable: boolean; - bio: string; - twitter_username: string; - public_repos: number; - public_gists: number; - followers: number; - following: number; - created_at: string; - updated_at: string; - private_gists: number; - total_private_repos: number; - owned_private_repos: number; - disk_usage: number; - collaborators: number; - two_factor_authentication: boolean; - plan: { - name: string; - space: number; - private_repos: number; - collaborators: number; - }; -} -declare type UsersGetByUsernameEndpoint = { - username: string; -}; -declare type UsersGetByUsernameRequestOptions = { - method: "GET"; - url: "/users/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersGetByUsernameResponseData { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - name: string; - company: string; - blog: string; - location: string; - email: string; - hireable: boolean; - bio: string; - twitter_username: string; - public_repos: number; - public_gists: number; - followers: number; - following: number; - created_at: string; - updated_at: string; - plan: { - name: string; - space: number; - private_repos: number; - collaborators: number; - }; -} -declare type UsersGetContextForUserEndpoint = { - username: string; + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/merge", "put">; /** - * Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. + * @see https://docs.github.com/rest/reference/pulls#update-a-review-for-a-pull-request */ - subject_type?: "organization" | "repository" | "issue" | "pull_request"; + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}", "put">; /** - * Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`. + * @see https://docs.github.com/rest/reference/pulls#dismiss-a-review-for-a-pull-request */ - subject_id?: string; -}; -declare type UsersGetContextForUserRequestOptions = { - method: "GET"; - url: "/users/:username/hovercard"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersGetContextForUserResponseData { - contexts: { - message: string; - octicon: string; - }[]; -} -declare type UsersGetGpgKeyForAuthenticatedEndpoint = { - gpg_key_id: number; -}; -declare type UsersGetGpgKeyForAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/gpg_keys/:gpg_key_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersGetGpgKeyForAuthenticatedResponseData { - id: number; - primary_key_id: string; - key_id: string; - public_key: string; - emails: { - email: string; - verified: boolean; - }[]; - subkeys: { - id: number; - primary_key_id: number; - key_id: string; - public_key: string; - emails: unknown[]; - subkeys: unknown[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; - }[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; -} -declare type UsersGetPublicSshKeyForAuthenticatedEndpoint = { - key_id: number; -}; -declare type UsersGetPublicSshKeyForAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/keys/:key_id"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersGetPublicSshKeyForAuthenticatedResponseData { - key_id: string; - key: string; -} -declare type UsersListEndpoint = { + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals", "put">; /** - * The integer ID of the last User that you've seen. + * @see https://docs.github.com/rest/reference/pulls#update-a-pull-request-branch */ - since?: string; -}; -declare type UsersListRequestOptions = { - method: "GET"; - url: "/users"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type UsersListBlockedByAuthenticatedEndpoint = {}; -declare type UsersListBlockedByAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/blocks"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListBlockedByAuthenticatedResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type UsersListEmailsForAuthenticatedEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListEmailsForAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/emails"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListEmailsForAuthenticatedResponseData = { - email: string; - primary: boolean; - verified: boolean; - visibility: string; -}[]; -declare type UsersListFollowedByAuthenticatedEndpoint = { + "PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch", "put", "lydian">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/activity#set-a-repository-subscription */ - per_page?: number; + "PUT /repos/{owner}/{repo}/subscription": Operation<"/repos/{owner}/{repo}/subscription", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/repos#replace-all-repository-topics */ - page?: number; -}; -declare type UsersListFollowedByAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/following"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListFollowedByAuthenticatedResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type UsersListFollowersForAuthenticatedUserEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListFollowersForAuthenticatedUserRequestOptions = { - method: "GET"; - url: "/user/followers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListFollowersForAuthenticatedUserResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type UsersListFollowersForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListFollowersForUserRequestOptions = { - method: "GET"; - url: "/users/:username/followers"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListFollowersForUserResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type UsersListFollowingForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListFollowingForUserRequestOptions = { - method: "GET"; - url: "/users/:username/following"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListFollowingForUserResponseData = { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; -}[]; -declare type UsersListGpgKeysForAuthenticatedEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListGpgKeysForAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/gpg_keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListGpgKeysForAuthenticatedResponseData = { - id: number; - primary_key_id: string; - key_id: string; - public_key: string; - emails: { - email: string; - verified: boolean; - }[]; - subkeys: { - id: number; - primary_key_id: number; - key_id: string; - public_key: string; - emails: unknown[]; - subkeys: unknown[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; - }[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; -}[]; -declare type UsersListGpgKeysForUserEndpoint = { - username: string; - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListGpgKeysForUserRequestOptions = { - method: "GET"; - url: "/users/:username/gpg_keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListGpgKeysForUserResponseData = { - id: number; - primary_key_id: string; - key_id: string; - public_key: string; - emails: { - email: string; - verified: boolean; - }[]; - subkeys: { - id: number; - primary_key_id: number; - key_id: string; - public_key: string; - emails: unknown[]; - subkeys: unknown[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; - }[]; - can_sign: boolean; - can_encrypt_comms: boolean; - can_encrypt_storage: boolean; - can_certify: boolean; - created_at: string; - expires_at: string; -}[]; -declare type UsersListPublicEmailsForAuthenticatedEndpoint = { - /** - * Results per page (max 100) - */ - per_page?: number; - /** - * Page number of the results to fetch. - */ - page?: number; -}; -declare type UsersListPublicEmailsForAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/public_emails"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListPublicEmailsForAuthenticatedResponseData = { - email: string; - primary: boolean; - verified: boolean; - visibility: string; -}[]; -declare type UsersListPublicKeysForUserEndpoint = { - username: string; + "PUT /repos/{owner}/{repo}/topics": Operation<"/repos/{owner}/{repo}/topics", "put", "mercy">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/repos#enable-vulnerability-alerts */ - per_page?: number; + "PUT /repos/{owner}/{repo}/vulnerability-alerts": Operation<"/repos/{owner}/{repo}/vulnerability-alerts", "put", "dorian">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/actions#create-or-update-an-environment-secret */ - page?: number; -}; -declare type UsersListPublicKeysForUserRequestOptions = { - method: "GET"; - url: "/users/:username/keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListPublicKeysForUserResponseData = { - id: number; - key: string; -}[]; -declare type UsersListPublicSshKeysForAuthenticatedEndpoint = { + "PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}": Operation<"/repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}", "put">; /** - * Results per page (max 100) + * @see https://docs.github.com/rest/reference/enterprise-admin#set-scim-information-for-a-provisioned-enterprise-group */ - per_page?: number; + "PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}": Operation<"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}", "put">; /** - * Page number of the results to fetch. + * @see https://docs.github.com/rest/reference/enterprise-admin#set-scim-information-for-a-provisioned-enterprise-user */ - page?: number; -}; -declare type UsersListPublicSshKeysForAuthenticatedRequestOptions = { - method: "GET"; - url: "/user/keys"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersListPublicSshKeysForAuthenticatedResponseData = { - key_id: string; - key: string; -}[]; -declare type UsersSetPrimaryEmailVisibilityForAuthenticatedEndpoint = { + "PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}": Operation<"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}", "put">; /** - * Specify the _primary_ email address that needs a visibility change. + * @see https://docs.github.com/rest/reference/scim#set-scim-information-for-a-provisioned-user */ - email: string; + "PUT /scim/v2/organizations/{org}/Users/{scim_user_id}": Operation<"/scim/v2/organizations/{org}/Users/{scim_user_id}", "put">; /** - * Use `public` to enable an authenticated user to view the specified email address, or use `private` so this primary email address cannot be seen publicly. + * @see https://docs.github.com/rest/reference/teams#add-team-member-legacy */ - visibility: string; -}; -declare type UsersSetPrimaryEmailVisibilityForAuthenticatedRequestOptions = { - method: "PATCH"; - url: "/user/email/visibility"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export declare type UsersSetPrimaryEmailVisibilityForAuthenticatedResponseData = { - email: string; - primary: boolean; - verified: boolean; - visibility: string; -}[]; -declare type UsersUnblockEndpoint = { - username: string; -}; -declare type UsersUnblockRequestOptions = { - method: "DELETE"; - url: "/user/blocks/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersUnfollowEndpoint = { - username: string; -}; -declare type UsersUnfollowRequestOptions = { - method: "DELETE"; - url: "/user/following/:username"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -declare type UsersUpdateAuthenticatedEndpoint = { + "PUT /teams/{team_id}/members/{username}": Operation<"/teams/{team_id}/members/{username}", "put">; /** - * The new name of the user. + * @see https://docs.github.com/rest/reference/teams#add-or-update-team-membership-for-a-user-legacy */ - name?: string; + "PUT /teams/{team_id}/memberships/{username}": Operation<"/teams/{team_id}/memberships/{username}", "put">; /** - * The publicly visible email address of the user. + * @see https://docs.github.com/rest/reference/teams/#add-or-update-team-project-permissions-legacy */ - email?: string; + "PUT /teams/{team_id}/projects/{project_id}": Operation<"/teams/{team_id}/projects/{project_id}", "put", "inertia">; /** - * The new blog URL of the user. + * @see https://docs.github.com/rest/reference/teams/#add-or-update-team-repository-permissions-legacy */ - blog?: string; + "PUT /teams/{team_id}/repos/{owner}/{repo}": Operation<"/teams/{team_id}/repos/{owner}/{repo}", "put">; /** - * The new company of the user. + * @see https://docs.github.com/rest/reference/users#block-a-user */ - company?: string; + "PUT /user/blocks/{username}": Operation<"/user/blocks/{username}", "put">; /** - * The new location of the user. + * @see https://docs.github.com/rest/reference/users#follow-a-user */ - location?: string; + "PUT /user/following/{username}": Operation<"/user/following/{username}", "put">; /** - * The new hiring availability of the user. + * @see https://docs.github.com/rest/reference/apps#add-a-repository-to-an-app-installation */ - hireable?: boolean; + "PUT /user/installations/{installation_id}/repositories/{repository_id}": Operation<"/user/installations/{installation_id}/repositories/{repository_id}", "put">; /** - * The new short biography of the user. + * @see https://docs.github.com/rest/reference/interactions#set-interaction-restrictions-for-your-public-repositories */ - bio?: string; + "PUT /user/interaction-limits": Operation<"/user/interaction-limits", "put">; /** - * The new Twitter username of the user. + * @see https://docs.github.com/rest/reference/activity#star-a-repository-for-the-authenticated-user */ - twitter_username?: string; -}; -declare type UsersUpdateAuthenticatedRequestOptions = { - method: "PATCH"; - url: "/user"; - headers: RequestHeaders; - request: RequestRequestOptions; -}; -export interface UsersUpdateAuthenticatedResponseData { - login: string; - id: number; - node_id: string; - avatar_url: string; - gravatar_id: string; - url: string; - html_url: string; - followers_url: string; - following_url: string; - gists_url: string; - starred_url: string; - subscriptions_url: string; - organizations_url: string; - repos_url: string; - events_url: string; - received_events_url: string; - type: string; - site_admin: boolean; - name: string; - company: string; - blog: string; - location: string; - email: string; - hireable: boolean; - bio: string; - twitter_username: string; - public_repos: number; - public_gists: number; - followers: number; - following: number; - created_at: string; - updated_at: string; - private_gists: number; - total_private_repos: number; - owned_private_repos: number; - disk_usage: number; - collaborators: number; - two_factor_authentication: boolean; - plan: { - name: string; - space: number; - private_repos: number; - collaborators: number; - }; + "PUT /user/starred/{owner}/{repo}": Operation<"/user/starred/{owner}/{repo}", "put">; } -declare type ActionsCreateWorkflowDispatchParamsInputs = { - [key: string]: ActionsCreateWorkflowDispatchParamsInputsKeyString; -}; -declare type ActionsCreateWorkflowDispatchParamsInputsKeyString = {}; -declare type AppsCreateInstallationAccessTokenParamsPermissions = { - [key: string]: AppsCreateInstallationAccessTokenParamsPermissionsKeyString; -}; -declare type AppsCreateInstallationAccessTokenParamsPermissionsKeyString = {}; -declare type ChecksCreateParamsOutput = { - title: string; - summary: string; - text?: string; - annotations?: ChecksCreateParamsOutputAnnotations[]; - images?: ChecksCreateParamsOutputImages[]; -}; -declare type ChecksCreateParamsOutputAnnotations = { - path: string; - start_line: number; - end_line: number; - start_column?: number; - end_column?: number; - annotation_level: "notice" | "warning" | "failure"; - message: string; - title?: string; - raw_details?: string; -}; -declare type ChecksCreateParamsOutputImages = { - alt: string; - image_url: string; - caption?: string; -}; -declare type ChecksCreateParamsActions = { - label: string; - description: string; - identifier: string; -}; -declare type ChecksSetSuitesPreferencesParamsAutoTriggerChecks = { - app_id: number; - setting: boolean; -}; -declare type ChecksUpdateParamsOutput = { - title?: string; - summary: string; - text?: string; - annotations?: ChecksUpdateParamsOutputAnnotations[]; - images?: ChecksUpdateParamsOutputImages[]; -}; -declare type ChecksUpdateParamsOutputAnnotations = { - path: string; - start_line: number; - end_line: number; - start_column?: number; - end_column?: number; - annotation_level: "notice" | "warning" | "failure"; - message: string; - title?: string; - raw_details?: string; -}; -declare type ChecksUpdateParamsOutputImages = { - alt: string; - image_url: string; - caption?: string; -}; -declare type ChecksUpdateParamsActions = { - label: string; - description: string; - identifier: string; -}; -declare type EnterpriseAdminProvisionAndInviteEnterpriseGroupParamsMembers = { - value: string; -}; -declare type EnterpriseAdminProvisionAndInviteEnterpriseUserParamsName = { - givenName: string; - familyName: string; -}; -declare type EnterpriseAdminProvisionAndInviteEnterpriseUserParamsEmails = { - value: string; - type: string; - primary: boolean; -}; -declare type EnterpriseAdminProvisionAndInviteEnterpriseUserParamsGroups = { - value?: string; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseGroupParamsMembers = { - value: string; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseUserParamsName = { - givenName: string; - familyName: string; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseUserParamsEmails = { - value: string; - type: string; - primary: boolean; -}; -declare type EnterpriseAdminSetInformationForProvisionedEnterpriseUserParamsGroups = { - value?: string; -}; -declare type EnterpriseAdminUpdateAttributeForEnterpriseGroupParamsOperations = {}; -declare type EnterpriseAdminUpdateAttributeForEnterpriseUserParamsOperations = {}; -declare type GistsCreateParamsFiles = { - [key: string]: GistsCreateParamsFilesKeyString; -}; -declare type GistsCreateParamsFilesKeyString = { - content: string; -}; -declare type GistsUpdateParamsFiles = { - [key: string]: GistsUpdateParamsFilesKeyString; -}; -declare type GistsUpdateParamsFilesKeyString = { - content: string; - filename: string; -}; -declare type GitCreateCommitParamsAuthor = { - name?: string; - email?: string; - date?: string; -}; -declare type GitCreateCommitParamsCommitter = { - name?: string; - email?: string; - date?: string; -}; -declare type GitCreateTagParamsTagger = { - name?: string; - email?: string; - date?: string; -}; -declare type GitCreateTreeParamsTree = { - path?: string; - mode?: "100644" | "100755" | "040000" | "160000" | "120000"; - type?: "blob" | "tree" | "commit"; - sha?: string | null; - content?: string; -}; -declare type OrgsCreateWebhookParamsConfig = { - url: string; - content_type?: string; - secret?: string; - insecure_ssl?: string; -}; -declare type OrgsUpdateWebhookParamsConfig = { - url: string; - content_type?: string; - secret?: string; - insecure_ssl?: string; -}; -declare type PullsCreateReviewParamsComments = { - path: string; - position: number; - body: string; -}; -declare type ReposCreateDispatchEventParamsClientPayload = { - [key: string]: ReposCreateDispatchEventParamsClientPayloadKeyString; -}; -declare type ReposCreateDispatchEventParamsClientPayloadKeyString = {}; -declare type ReposCreateOrUpdateFileContentsParamsCommitter = { - name: string; - email: string; -}; -declare type ReposCreateOrUpdateFileContentsParamsAuthor = { - name: string; - email: string; -}; -declare type ReposCreatePagesSiteParamsSource = { - branch: string; - path?: "/" | "/docs"; -}; -declare type ReposCreateWebhookParamsConfig = { - url: string; - content_type?: string; - secret?: string; - insecure_ssl?: string; -}; -declare type ReposDeleteFileParamsCommitter = { - name?: string; - email?: string; -}; -declare type ReposDeleteFileParamsAuthor = { - name?: string; - email?: string; -}; -declare type ReposUpdateBranchProtectionParamsRequiredStatusChecks = { - strict: boolean; - contexts: string[]; -}; -declare type ReposUpdateBranchProtectionParamsRequiredPullRequestReviews = { - dismissal_restrictions?: ReposUpdateBranchProtectionParamsRequiredPullRequestReviewsDismissalRestrictions; - dismiss_stale_reviews?: boolean; - require_code_owner_reviews?: boolean; - required_approving_review_count?: number; -}; -declare type ReposUpdateBranchProtectionParamsRequiredPullRequestReviewsDismissalRestrictions = { - users?: string[]; - teams?: string[]; -}; -declare type ReposUpdateBranchProtectionParamsRestrictions = { - users: string[]; - teams: string[]; - apps?: string[]; -}; -declare type ReposUpdateInformationAboutPagesSiteParamsSource = { - branch: string; - path: "/" | "/docs"; -}; -declare type ReposUpdatePullRequestReviewProtectionParamsDismissalRestrictions = { - users?: string[]; - teams?: string[]; -}; -declare type ReposUpdateWebhookParamsConfig = { - url: string; - content_type?: string; - secret?: string; - insecure_ssl?: string; -}; -declare type ScimProvisionAndInviteUserParamsName = { - givenName: string; - familyName: string; -}; -declare type ScimProvisionAndInviteUserParamsEmails = { - value: string; - type: string; - primary: boolean; -}; -declare type ScimSetInformationForProvisionedUserParamsName = { - givenName: string; - familyName: string; -}; -declare type ScimSetInformationForProvisionedUserParamsEmails = { - value: string; - type: string; - primary: boolean; -}; -declare type ScimUpdateAttributeForUserParamsOperations = {}; -declare type TeamsCreateOrUpdateIdPGroupConnectionsInOrgParamsGroups = { - group_id: string; - group_name: string; - group_description: string; -}; -declare type TeamsCreateOrUpdateIdPGroupConnectionsLegacyParamsGroups = { - group_id: string; - group_name: string; - group_description: string; -}; export {}; diff --git a/node_modules/@octokit/types/dist-web/index.js b/node_modules/@octokit/types/dist-web/index.js index 4b2cc1b..74d2522 100644 --- a/node_modules/@octokit/types/dist-web/index.js +++ b/node_modules/@octokit/types/dist-web/index.js @@ -1,4 +1,4 @@ -const VERSION = "5.5.0"; +const VERSION = "6.25.0"; export { VERSION }; //# sourceMappingURL=index.js.map diff --git a/node_modules/@octokit/types/package.json b/node_modules/@octokit/types/package.json index db02d02..b1a348e 100644 --- a/node_modules/@octokit/types/package.json +++ b/node_modules/@octokit/types/package.json @@ -1,7 +1,7 @@ { "name": "@octokit/types", "description": "Shared TypeScript definitions for Octokit projects", - "version": "5.5.0", + "version": "6.25.0", "license": "MIT", "files": [ "dist-*/", @@ -16,27 +16,29 @@ "toolkit", "typescript" ], - "repository": "https://github.com/octokit/types.ts", + "repository": "github:octokit/types.ts", "dependencies": { - "@types/node": ">= 8" + "@octokit/openapi-types": "^9.5.0" }, "devDependencies": { - "@octokit/graphql": "^4.2.2", "@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/node": ">= 8", + "github-openapi-graphql-query": "^1.0.5", "handlebars": "^4.7.6", - "json-schema-to-typescript": "^9.1.0", + "json-schema-to-typescript": "^10.0.0", "lodash.set": "^4.3.2", "npm-run-all": "^4.1.5", "pascal-case": "^3.1.1", + "pika-plugin-merge-properties": "^1.0.6", "prettier": "^2.0.0", "semantic-release": "^17.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", - "sort-keys": "^4.0.0", + "sort-keys": "^4.2.0", "string-to-jsdoc-comment": "^1.0.0", - "typedoc": "^0.19.0", + "typedoc": "^0.21.0", "typescript": "^4.0.2" }, "publishConfig": { @@ -44,6 +46,9 @@ }, "source": "dist-src/index.js", "types": "dist-types/index.d.ts", + "octokit": { + "openapi-version": "3.5.0" + }, "main": "dist-node/index.js", "module": "dist-web/index.js" } diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - 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 deleted file mode 100644 index b59fd0a..0000000 --- a/node_modules/@types/node/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for Node.js (http://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Tue, 06 Oct 2020 05:46:06 GMT - * Dependencies: none - * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout` - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alexander T.](https://github.com/a-tarasyuk), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Bruno Scheufler](https://github.com/brunoscheufler), [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), [Flarna](https://github.com/Flarna), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [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), [Jordi Oliveras Rovira](https://github.com/j-oliveras), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [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), [Jason Kwok](https://github.com/JasonHK), and [Victor Perin](https://github.com/victorperin). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts deleted file mode 100644 index 7b9d376..0000000 --- a/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -declare module 'assert' { - /** An alias of `assert.ok()`. */ - function assert(value: any, message?: string | Error): asserts value; - namespace assert { - class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - code: 'ERR_ASSERTION'; - - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string; - /** The `actual` property on the error instance. */ - actual?: any; - /** The `expected` property on the error instance. */ - expected?: any; - /** The `operator` property on the error instance. */ - operator?: string; - /** If provided, the generated stack trace omits frames before this function. */ - stackStartFn?: Function; - }); - } - - class CallTracker { - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - report(): CallTrackerReportInformation[]; - verify(): void; - } - export 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: any) => boolean) | object | Error; - - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: any, - expected: any, - message?: string | Error, - operator?: string, - stackStartFn?: Function, - ): never; - function ok(value: any, message?: string | Error): asserts value; - /** @deprecated since v9.9.0 - use strictEqual() instead. */ - function equal(actual: any, expected: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use notStrictEqual() instead. */ - function notEqual(actual: any, expected: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */ - function deepEqual(actual: any, expected: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */ - function notDeepEqual(actual: any, expected: any, message?: string | Error): void; - function strictEqual(actual: any, expected: T, message?: string | Error): asserts actual is T; - function notStrictEqual(actual: any, expected: any, message?: string | Error): void; - function deepStrictEqual(actual: any, expected: T, message?: string | Error): asserts actual is T; - function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void; - - function throws(block: () => any, message?: string | Error): void; - function throws(block: () => any, error: AssertPredicate, message?: string | Error): void; - function doesNotThrow(block: () => any, message?: string | Error): void; - function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void; - - function ifError(value: any): asserts value is null | undefined; - - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: RegExp | Function, - message?: string | Error, - ): Promise; - - function match(value: string, regExp: RegExp, message?: string | Error): void; - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - - const strict: typeof assert; - } - - export = assert; -} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts deleted file mode 100644 index ab35e5d..0000000 --- a/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Async Hooks module: https://nodejs.org/api/async_hooks.html - */ -declare module "async_hooks" { - /** - * Returns the asyncId of the current execution context. - */ - function executionAsyncId(): number; - - /** - * The resource representing the current execution. - * Useful to store data within the resource. - * - * 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. - */ - function executionAsyncResource(): object; - - /** - * Returns 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. - * @param options the callbacks to register - * @return an AsyncHooks instance used for disabling and enabling hooks - */ - function createHook(options: HookCallbacks): AsyncHook; - - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * Default: `executionAsyncId()` - */ - triggerAsyncId?: number; - - /** - * 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; - } - - /** - * The class AsyncResource was designed to be extended by the embedder's async resources. - * Using this users can easily trigger the lifetime events of their own resources. - */ - 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. - * @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>(fn: Func, type?: string): Func & { asyncResource: AsyncResource }; - - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * @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. - * @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 AsyncHooks destroy callbacks. - */ - emitDestroy(): void; - - /** - * @return the unique ID assigned to this AsyncResource instance. - */ - asyncId(): number; - - /** - * @return the trigger ID for this AsyncResource instance. - */ - triggerAsyncId(): number; - } - - /** - * When having multiple instances of `AsyncLocalStorage`, they are independent - * from each other. It is safe to instantiate this class multiple times. - */ - class AsyncLocalStorage { - /** - * This method disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until - * `asyncLocalStorage.run()` 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. - * - * This method is to be used when the `asyncLocalStorage` is not in use anymore - * in the current process. - */ - disable(): void; - - /** - * This method returns the current store. If this method is called outside of an - * asynchronous context initialized by calling `asyncLocalStorage.run`, it will - * return `undefined`. - */ - getStore(): T | undefined; - - /** - * This methods runs a function synchronously within a context and return its - * return value. The store is not accessible outside of the callback function or - * the asynchronous operations created within the callback. - * - * Optionally, arguments can be passed to the function. They will be passed to the - * callback function. - * - * I the callback function throws an error, it will be thrown by `run` too. The - * stacktrace will not be impacted by this call and the context will be exited. - */ - // TODO: Apply generic vararg once available - run(store: T, callback: (...args: any[]) => R, ...args: any[]): R; - - /** - * This methods runs a function synchronously outside of a context and return its - * return value. The store is not accessible within the callback function or the - * asynchronous operations created within the callback. - * - * Optionally, arguments can be passed to the function. They will be passed to the - * callback function. - * - * If the callback function throws an error, it will be thrown by `exit` too. The - * stacktrace will not be impacted by this call and the context will be - * re-entered. - */ - // TODO: Apply generic vararg once available - exit(callback: (...args: any[]) => R, ...args: any[]): R; - - /** - * Calling `asyncLocalStorage.enterWith(store)` will transition into the context - * for the remainder of the current synchronous execution and will persist - * through any following asynchronous calls. - */ - enterWith(store: T): void; - } -} diff --git a/node_modules/@types/node/base.d.ts b/node_modules/@types/node/base.d.ts deleted file mode 100644 index dcbc7ba..0000000 --- a/node_modules/@types/node/base.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// NOTE: These definitions support NodeJS and TypeScript 3.7. - -// NOTE: TypeScript version-specific augmentations can be found in the following paths: -// - ~/base.d.ts - Shared definitions common to all TypeScript versions -// - ~/index.d.ts - Definitions specific to TypeScript 2.1 -// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7 -// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -// tslint:disable-next-line:no-bad-reference -/// - -// TypeScript 3.7-specific augmentations: -/// diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts deleted file mode 100644 index 76c92cf..0000000 --- a/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -declare module "buffer" { - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - const BuffType: typeof Buffer; - - export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary"; - - 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; - }; - - export { BuffType as Buffer }; -} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts deleted file mode 100644 index 2abc58b..0000000 --- a/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,505 +0,0 @@ -declare module "child_process" { - import { BaseEncodingOptions } from 'fs'; - import * as events from "events"; - import * as net from "net"; - import { Writable, Readable, Stream, Pipe } from "stream"; - - type Serializable = string | object | number | boolean; - type SendHandle = net.Socket | net.Server; - - interface ChildProcess extends events.EventEmitter { - stdin: Writable | null; - stdout: Readable | null; - stderr: Readable | null; - readonly channel?: Pipe | null; - readonly stdio: [ - Writable | null, // stdin - Readable | null, // stdout - Readable | null, // stderr - Readable | Writable | null | undefined, // extra - Readable | Writable | null | undefined // extra - ]; - readonly killed: boolean; - readonly pid: number; - readonly connected: boolean; - readonly exitCode: number | null; - readonly signalCode: NodeJS.Signals | null; - readonly spawnargs: string[]; - readonly spawnfile: string; - kill(signal?: NodeJS.Signals | number): boolean; - 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; - disconnect(): void; - unref(): void; - ref(): void; - - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - */ - - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => 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; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", code: number, signal: NodeJS.Signals): 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; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (code: number, signal: NodeJS.Signals) => 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; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (code: number, signal: NodeJS.Signals) => 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; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => 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; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => 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; - } - - // return this object when stdio option is undefined or not specified - interface ChildProcessWithoutNullStreams extends ChildProcess { - stdin: Writable; - stdout: Readable; - stderr: Readable; - readonly stdio: [ - Writable, // stdin - Readable, // stdout - 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< - I extends null | Writable, - O extends null | Readable, - E extends null | Readable, - > 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; - } - - type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>; - - type SerializationType = 'json' | 'advanced'; - - interface MessagingOptions { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType; - } - - interface ProcessEnvOptions { - uid?: number; - gid?: number; - cwd?: string; - env?: NodeJS.ProcessEnv; - } - - interface CommonOptions extends ProcessEnvOptions { - /** - * @default true - */ - windowsHide?: boolean; - /** - * @default 0 - */ - timeout?: number; - } - - interface CommonSpawnOptions extends CommonOptions, MessagingOptions { - argv0?: string; - stdio?: StdioOptions; - shell?: boolean | string; - windowsVerbatimArguments?: boolean; - } - - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean; - } - - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: 'pipe' | Array; - } - - type StdioNull = 'inherit' | 'ignore' | Stream; - type StdioPipe = undefined | null | 'pipe'; - - interface SpawnOptionsWithStdioTuple< - Stdin extends StdioNull | StdioPipe, - Stdout extends StdioNull | StdioPipe, - Stderr extends StdioNull | StdioPipe, - > extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - - // overloads of spawn without 'args' - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - - function spawn(command: string, options: SpawnOptions): ChildProcess; - - // overloads of spawn with 'args' - function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - function spawn( - command: string, - args: ReadonlyArray, - options: SpawnOptionsWithStdioTuple, - ): ChildProcessByStdio; - - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; - - interface ExecOptions extends CommonOptions { - shell?: string; - maxBuffer?: number; - killSignal?: NodeJS.Signals | number; - } - - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - - interface ExecException extends Error { - cmd?: string; - killed?: boolean; - code?: number; - signal?: NodeJS.Signals; - } - - // no `options` definitely means stdout/stderr are `string`. - function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function exec( - command: string, - options: { encoding: BufferEncoding } & ExecOptions, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function exec( - command: string, - options: (BaseEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - namespace exec { - function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; - function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(command: string, options?: (BaseEncodingOptions & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; - } - - interface ExecFileOptions extends CommonOptions { - maxBuffer?: number; - killSignal?: NodeJS.Signals | number; - windowsVerbatimArguments?: boolean; - shell?: boolean | string; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: 'buffer' | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - - function execFile(file: string): ChildProcess; - function execFile(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - - // no `options` definitely means stdout/stderr are `string`. - function execFile(file: string, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - - // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. - function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void, - ): ChildProcess; - - // `options` with well known `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecException | null, stdout: string, stderr: string) => void, - ): ChildProcess; - - // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. - // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. - function execFile( - file: string, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void, - ): ChildProcess; - - // `options` without an `encoding` means stdout/stderr are definitely `string`. - function execFile(file: string, options: ExecFileOptions, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - callback: (error: ExecException | null, stdout: string, stderr: string) => void - ): ChildProcess; - - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (BaseEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null, - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (BaseEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null, - ): ChildProcess; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(file: string, args: string[] | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; - function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>; - function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; - function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; - function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>; - function __promisify__(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; - function __promisify__( - file: string, - args: string[] | undefined | null, - options: (BaseEncodingOptions & ExecFileOptions) | undefined | null, - ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>; - } - - interface ForkOptions extends ProcessEnvOptions, MessagingOptions { - execPath?: string; - execArgv?: string[]; - silent?: boolean; - stdio?: StdioOptions; - detached?: boolean; - windowsVerbatimArguments?: boolean; - } - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; - - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView; - killSignal?: NodeJS.Signals | number; - maxBuffer?: number; - encoding?: BufferEncoding | 'buffer' | null; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: 'buffer' | null; - } - interface SpawnSyncReturns { - pid: number; - output: string[]; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error; - } - function spawnSync(command: string): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; - - interface ExecSyncOptions extends CommonOptions { - input?: string | Uint8Array; - stdio?: StdioOptions; - shell?: string; - killSignal?: NodeJS.Signals | number; - maxBuffer?: number; - encoding?: BufferEncoding | 'buffer' | null; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: 'buffer' | null; - } - function execSync(command: string): Buffer; - function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; - function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; - function execSync(command: string, options?: ExecSyncOptions): Buffer; - - interface ExecFileSyncOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView; - stdio?: StdioOptions; - killSignal?: NodeJS.Signals | number; - maxBuffer?: number; - encoding?: BufferEncoding; - shell?: boolean | string; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; // specify `null`. - } - function execFileSync(command: string): Buffer; - function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; - function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer; -} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts deleted file mode 100644 index 0ef6c2a..0000000 --- a/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,262 +0,0 @@ -declare module "cluster" { - import * as child from "child_process"; - import * as events from "events"; - import * as net from "net"; - - // interfaces - interface ClusterSettings { - execArgv?: string[]; // default: process.execArgv - exec?: string; - args?: string[]; - silent?: boolean; - stdio?: any[]; - uid?: number; - gid?: number; - inspectPort?: number | (() => number); - } - - interface Address { - address: string; - port: number; - addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" - } - - class Worker extends events.EventEmitter { - id: number; - process: child.ChildProcess; - send(message: child.Serializable, sendHandle?: child.SendHandle, callback?: (error: Error | null) => void): boolean; - kill(signal?: string): void; - destroy(signal?: string): void; - disconnect(): void; - isConnected(): boolean; - isDead(): boolean; - exitedAfterDisconnect: boolean; - - /** - * events.EventEmitter - * 1. disconnect - * 2. error - * 3. exit - * 4. listening - * 5. message - * 6. online - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "exit", listener: (code: number, signal: string) => void): this; - addListener(event: "listening", listener: (address: Address) => void): this; - addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: () => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "exit", code: number, signal: string): boolean; - emit(event: "listening", address: Address): boolean; - emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online"): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "exit", listener: (code: number, signal: string) => void): this; - on(event: "listening", listener: (address: Address) => void): this; - on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "exit", listener: (code: number, signal: string) => void): this; - once(event: "listening", listener: (address: Address) => void): this; - once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependListener(event: "listening", listener: (address: Address) => void): this; - prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; - prependOnceListener(event: "listening", listener: (address: Address) => void): this; - prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "online", listener: () => void): this; - } - - interface Cluster extends events.EventEmitter { - Worker: Worker; - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - isMaster: boolean; - isWorker: boolean; - schedulingPolicy: number; - settings: ClusterSettings; - setupMaster(settings?: ClusterSettings): void; - worker?: Worker; - workers?: NodeJS.Dict; - - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "disconnect", listener: (worker: Worker) => void): this; - addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - addListener(event: "fork", listener: (worker: Worker) => void): this; - addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - addListener(event: "online", listener: (worker: Worker) => void): this; - addListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "disconnect", worker: Worker): boolean; - emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - emit(event: "fork", worker: Worker): boolean; - emit(event: "listening", worker: Worker, address: Address): boolean; - emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - emit(event: "online", worker: Worker): boolean; - emit(event: "setup", settings: ClusterSettings): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "disconnect", listener: (worker: Worker) => void): this; - on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - on(event: "fork", listener: (worker: Worker) => void): this; - on(event: "listening", listener: (worker: Worker, address: Address) => void): this; - on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - on(event: "online", listener: (worker: Worker) => void): this; - on(event: "setup", listener: (settings: ClusterSettings) => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "disconnect", listener: (worker: Worker) => void): this; - once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - once(event: "fork", listener: (worker: Worker) => void): this; - once(event: "listening", listener: (worker: Worker, address: Address) => void): this; - once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - once(event: "online", listener: (worker: Worker) => void): this; - once(event: "setup", listener: (settings: ClusterSettings) => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependListener(event: "fork", listener: (worker: Worker) => void): this; - prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: "online", listener: (worker: Worker) => void): this; - prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; - prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; - prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; - prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; - // the handle is a net.Socket or net.Server object, or undefined. - prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; - prependOnceListener(event: "online", listener: (worker: Worker) => void): this; - prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this; - } - - const SCHED_NONE: number; - const SCHED_RR: number; - - function disconnect(callback?: () => void): void; - function fork(env?: any): Worker; - const isMaster: boolean; - const isWorker: boolean; - let schedulingPolicy: number; - const settings: ClusterSettings; - function setupMaster(settings?: ClusterSettings): void; - const worker: Worker; - const workers: NodeJS.Dict; - - /** - * events.EventEmitter - * 1. disconnect - * 2. exit - * 3. fork - * 4. listening - * 5. message - * 6. online - * 7. setup - */ - function addListener(event: string, listener: (...args: any[]) => void): Cluster; - function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; - function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; - function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; - function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; - // the handle is a net.Socket or net.Server object, or undefined. - function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; - function addListener(event: "online", listener: (worker: Worker) => void): Cluster; - function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; - - function emit(event: string | symbol, ...args: any[]): boolean; - function emit(event: "disconnect", worker: Worker): boolean; - function emit(event: "exit", worker: Worker, code: number, signal: string): boolean; - function emit(event: "fork", worker: Worker): boolean; - function emit(event: "listening", worker: Worker, address: Address): boolean; - function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; - function emit(event: "online", worker: Worker): boolean; - function emit(event: "setup", settings: ClusterSettings): boolean; - - function on(event: string, listener: (...args: any[]) => void): Cluster; - function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; - function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; - function on(event: "fork", listener: (worker: Worker) => void): Cluster; - function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; - function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. - function on(event: "online", listener: (worker: Worker) => void): Cluster; - function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; - - function once(event: string, listener: (...args: any[]) => void): Cluster; - function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; - function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; - function once(event: "fork", listener: (worker: Worker) => void): Cluster; - function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; - function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. - function once(event: "online", listener: (worker: Worker) => void): Cluster; - function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; - - function removeListener(event: string, listener: (...args: any[]) => void): Cluster; - function removeAllListeners(event?: string): Cluster; - function setMaxListeners(n: number): Cluster; - function getMaxListeners(): number; - function listeners(event: string): Function[]; - function listenerCount(type: string): number; - - function prependListener(event: string, listener: (...args: any[]) => void): Cluster; - function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; - function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; - function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; - function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; - // the handle is a net.Socket or net.Server object, or undefined. - function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; - function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; - function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; - - function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster; - function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; - function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; - function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; - function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; - // the handle is a net.Socket or net.Server object, or undefined. - function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; - function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; - function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster; - - function eventNames(): string[]; -} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts deleted file mode 100644 index 01e7a0a..0000000 --- a/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -declare module "console" { - import { InspectOptions } from 'util'; - - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: NodeJS.ConsoleConstructor; - /** - * A simple assertion test that verifies whether `value` is truthy. - * If it is not, an `AssertionError` is thrown. - * If provided, the error `message` is formatted using `util.format()` and used as the error message. - */ - assert(value: any, message?: string, ...optionalParams: any[]): void; - /** - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY. - * When `stdout` is not a TTY, this method does nothing. - */ - clear(): void; - /** - * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link console.log()}. - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by two spaces. - * If one or more `label`s are provided, those are printed first without the additional indentation. - */ - group(...label: any[]): void; - /** - * The `console.groupCollapsed()` function is an alias for {@link console.group()}. - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by two spaces. - */ - groupEnd(): void; - /** - * The {@link console.info()} function is an alias for {@link console.log()}. - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * This method does not display anything unless used in the inspector. - * Prints to `stdout` the array `array` formatted as a table. - */ - table(tabularData: any, properties?: string[]): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`. - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`. - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`. - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code. - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The {@link console.warn()} function is an alias for {@link console.error()}. - */ - warn(message?: any, ...optionalParams: any[]): void; - - // --- Inspector mode only --- - /** - * This method does not display anything unless used in the inspector. - * Starts a JavaScript CPU profile with an optional label. - */ - profile(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. - */ - profileEnd(label?: string): void; - /** - * This method does not display anything unless used in the inspector. - * Adds an event with the label `label` to the Timeline panel of the inspector. - */ - timeStamp(label?: string): void; - } - - var console: Console; - - namespace NodeJS { - interface ConsoleConstructorOptions { - stdout: WritableStream; - stderr?: WritableStream; - ignoreErrors?: boolean; - colorMode?: boolean | 'auto'; - inspectOptions?: InspectOptions; - } - - interface ConsoleConstructor { - prototype: Console; - new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console; - new(options: ConsoleConstructorOptions): Console; - } - - interface Global { - console: typeof console; - } - } - } - - export = console; -} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts deleted file mode 100644 index d124ae6..0000000 --- a/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module "constants" { - import { constants as osConstants, SignalConstants } from 'os'; - import { constants as cryptoConstants } from 'crypto'; - import { constants as fsConstants } from 'fs'; - const exp: typeof osConstants.errno & typeof osConstants.priority & SignalConstants & typeof cryptoConstants & typeof fsConstants; - export = exp; -} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts deleted file mode 100644 index 258ea7f..0000000 --- a/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,707 +0,0 @@ -declare module "crypto" { - import * as stream from "stream"; - - interface Certificate { - exportChallenge(spkac: BinaryLike): Buffer; - exportPublicKey(spkac: BinaryLike): Buffer; - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - const Certificate: { - new(): Certificate; - (): Certificate; - }; - - namespace constants { // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants - const OPENSSL_VERSION_NUMBER: number; - - /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ - const SSL_OP_ALL: number; - /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ - const SSL_OP_CIPHER_SERVER_PREFERENCE: number; - /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ - const SSL_OP_CISCO_ANYCONNECT: number; - /** Instructs OpenSSL to turn on cookie exchange. */ - const SSL_OP_COOKIE_EXCHANGE: number; - /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ - const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ - const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */ - const SSL_OP_EPHEMERAL_RSA: number; - /** Allows initial connection to servers that do not support RI. */ - const SSL_OP_LEGACY_SERVER_CONNECT: number; - const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; - const SSL_OP_MICROSOFT_SESS_ID_BUG: number; - /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */ - const SSL_OP_MSIE_SSLV2_RSA_PADDING: number; - const SSL_OP_NETSCAPE_CA_DN_BUG: number; - const SSL_OP_NETSCAPE_CHALLENGE_BUG: number; - const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; - const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; - /** Instructs OpenSSL to disable support for SSL/TLS compression. */ - const SSL_OP_NO_COMPRESSION: number; - const SSL_OP_NO_QUERY_MTU: number; - /** Instructs OpenSSL to always start a new session when performing renegotiation. */ - const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - const SSL_OP_NO_SSLv2: number; - const SSL_OP_NO_SSLv3: number; - const SSL_OP_NO_TICKET: number; - const SSL_OP_NO_TLSv1: number; - const SSL_OP_NO_TLSv1_1: number; - const SSL_OP_NO_TLSv1_2: number; - const SSL_OP_PKCS1_CHECK_1: number; - const SSL_OP_PKCS1_CHECK_2: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */ - const SSL_OP_SINGLE_DH_USE: number; - /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */ - const SSL_OP_SINGLE_ECDH_USE: number; - const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; - const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; - const SSL_OP_TLS_BLOCK_PADDING_BUG: number; - const SSL_OP_TLS_D5_BUG: number; - /** Instructs OpenSSL to disable version rollback attack detection. */ - const SSL_OP_TLS_ROLLBACK_BUG: number; - - const ENGINE_METHOD_RSA: number; - const ENGINE_METHOD_DSA: number; - const ENGINE_METHOD_DH: number; - const ENGINE_METHOD_RAND: number; - const ENGINE_METHOD_EC: number; - const ENGINE_METHOD_CIPHERS: number; - const ENGINE_METHOD_DIGESTS: number; - const ENGINE_METHOD_PKEY_METHS: number; - const ENGINE_METHOD_PKEY_ASN1_METHS: number; - const ENGINE_METHOD_ALL: number; - const ENGINE_METHOD_NONE: number; - - const DH_CHECK_P_NOT_SAFE_PRIME: number; - const DH_CHECK_P_NOT_PRIME: number; - const DH_UNABLE_TO_CHECK_GENERATOR: number; - const DH_NOT_SUITABLE_GENERATOR: number; - - const ALPN_ENABLED: number; - - const RSA_PKCS1_PADDING: number; - const RSA_SSLV23_PADDING: number; - const RSA_NO_PADDING: number; - const RSA_PKCS1_OAEP_PADDING: number; - const RSA_X931_PADDING: number; - const RSA_PKCS1_PSS_PADDING: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ - const RSA_PSS_SALTLEN_DIGEST: number; - /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ - const RSA_PSS_SALTLEN_MAX_SIGN: number; - /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ - const RSA_PSS_SALTLEN_AUTO: number; - - const POINT_CONVERSION_COMPRESSED: number; - const POINT_CONVERSION_UNCOMPRESSED: number; - const POINT_CONVERSION_HYBRID: number; - - /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ - const defaultCoreCipherList: string; - /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ - const defaultCipherList: string; - } - - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number; - } - - /** @deprecated since v10.0.0 */ - const fips: boolean; - - function createHash(algorithm: string, options?: HashOptions): Hash; - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - - type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1"; - type HexBase64Latin1Encoding = "latin1" | "hex" | "base64"; - type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary"; - type HexBase64BinaryEncoding = "binary" | "base64" | "hex"; - type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; - - class Hash extends stream.Transform { - private constructor(); - copy(): Hash; - update(data: BinaryLike): Hash; - update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash; - digest(): Buffer; - digest(encoding: HexBase64Latin1Encoding): string; - } - class Hmac extends stream.Transform { - private constructor(); - update(data: BinaryLike): Hmac; - update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac; - digest(): Buffer; - digest(encoding: HexBase64Latin1Encoding): string; - } - - type KeyObjectType = 'secret' | 'public' | 'private'; - - interface KeyExportOptions { - type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; - format: T; - cipher?: string; - passphrase?: string | Buffer; - } - - class KeyObject { - private constructor(); - asymmetricKeyType?: KeyType; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number; - export(options: KeyExportOptions<'pem'>): string | Buffer; - export(options?: KeyExportOptions<'der'>): Buffer; - symmetricKeySize?: number; - type: KeyObjectType; - } - - type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; - type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; - - type BinaryLike = string | NodeJS.ArrayBufferView; - - type CipherKey = BinaryLike | KeyObject; - - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number; - } - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; - /** @deprecated since v10.0.0 use `createCipheriv()` */ - function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; - - function createCipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike | null, - options: CipherCCMOptions - ): CipherCCM; - function createCipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike | null, - options?: CipherGCMOptions - ): CipherGCM; - function createCipheriv( - algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions - ): Cipher; - - class Cipher extends stream.Transform { - private constructor(); - update(data: BinaryLike): Buffer; - update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer; - update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string; - update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string; - final(): Buffer; - final(output_encoding: BufferEncoding): string; - setAutoPadding(auto_padding?: boolean): this; - // getAuthTag(): Buffer; - // setAAD(buffer: NodeJS.ArrayBufferView): this; - } - interface CipherCCM extends Cipher { - setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this; - getAuthTag(): Buffer; - } - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - - function createDecipheriv( - algorithm: CipherCCMTypes, - key: CipherKey, - iv: BinaryLike | null, - options: CipherCCMOptions, - ): DecipherCCM; - function createDecipheriv( - algorithm: CipherGCMTypes, - key: CipherKey, - iv: BinaryLike | null, - options?: CipherGCMOptions, - ): DecipherGCM; - function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; - - class Decipher extends stream.Transform { - private constructor(); - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer; - update(data: NodeJS.ArrayBufferView, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string; - update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string; - final(): Buffer; - final(output_encoding: BufferEncoding): string; - setAutoPadding(auto_padding?: boolean): this; - // setAuthTag(tag: NodeJS.ArrayBufferView): this; - // setAAD(buffer: NodeJS.ArrayBufferView): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this; - } - - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat; - type?: 'pkcs1' | 'pkcs8' | 'sec1'; - passphrase?: string | Buffer; - } - - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat; - type?: 'pkcs1' | 'spki'; - } - - function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject; - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject; - function createSecretKey(key: Buffer): KeyObject; - - function createSign(algorithm: string, options?: stream.WritableOptions): Signer; - - type DSAEncoding = 'der' | 'ieee-p1363'; - - interface SigningOptions { - /** - * @See crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number; - saltLength?: number; - dsaEncoding?: DSAEncoding; - } - - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions { - } - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions { - } - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - - type KeyLike = string | Buffer | KeyObject; - - class Signer extends stream.Writable { - private constructor(); - - update(data: BinaryLike): Signer; - update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer; - sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, output_format: HexBase64Latin1Encoding): string; - } - - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - class Verify extends stream.Writable { - private constructor(); - - update(data: BinaryLike): Verify; - update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify; - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: HexBase64Latin1Encoding): boolean; - // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format - // The signature field accepts a TypedArray type, but it is only available starting ES2017 - } - function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman; - function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman; - class DiffieHellman { - private constructor(); - generateKeys(): Buffer; - generateKeys(encoding: HexBase64Latin1Encoding): string; - computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer; - computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; - computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string; - computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; - getPrime(): Buffer; - getPrime(encoding: HexBase64Latin1Encoding): string; - getGenerator(): Buffer; - getGenerator(encoding: HexBase64Latin1Encoding): string; - getPublicKey(): Buffer; - getPublicKey(encoding: HexBase64Latin1Encoding): string; - getPrivateKey(): Buffer; - getPrivateKey(encoding: HexBase64Latin1Encoding): string; - setPublicKey(public_key: NodeJS.ArrayBufferView): void; - setPublicKey(public_key: string, encoding: BufferEncoding): void; - setPrivateKey(private_key: NodeJS.ArrayBufferView): void; - setPrivateKey(private_key: string, encoding: BufferEncoding): void; - verifyError: number; - } - function getDiffieHellman(group_name: string): DiffieHellman; - function pbkdf2( - password: BinaryLike, - salt: BinaryLike, - iterations: number, - keylen: number, - digest: string, - callback: (err: Error | null, derivedKey: Buffer) => any, - ): void; - function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; - - function randomBytes(size: number): Buffer; - function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - function pseudoRandomBytes(size: number): Buffer; - function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; - - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - - function randomFillSync(buffer: T, offset?: number, size?: number): T; - function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; - function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; - - interface ScryptOptions { - N?: number; - r?: number; - p?: number; - maxmem?: number; - } - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scrypt( - password: BinaryLike, - salt: BinaryLike, - keylen: number, - options: ScryptOptions, - callback: (err: Error | null, derivedKey: Buffer) => void, - ): void; - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - - interface RsaPublicKey { - key: KeyLike; - padding?: number; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string; - /** - * @default 'sha1' - */ - oaepHash?: string; - oaepLabel?: NodeJS.TypedArray; - padding?: number; - } - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - function getCiphers(): string[]; - function getCurves(): string[]; - function getFips(): 1 | 0; - function getHashes(): string[]; - class ECDH { - private constructor(); - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: HexBase64Latin1Encoding, - outputEncoding?: "latin1" | "hex" | "base64", - format?: "uncompressed" | "compressed" | "hybrid", - ): Buffer | string; - generateKeys(): Buffer; - generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string; - computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer; - computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; - computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string; - computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; - getPrivateKey(): Buffer; - getPrivateKey(encoding: HexBase64Latin1Encoding): string; - getPublicKey(): Buffer; - getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string; - setPrivateKey(private_key: NodeJS.ArrayBufferView): void; - setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; - } - function createECDH(curve_name: string): ECDH; - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - /** @deprecated since v10.0.0 */ - const DEFAULT_ENCODING: BufferEncoding; - - type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'x25519'; - type KeyFormat = 'pem' | 'der'; - - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string; - passphrase?: string; - } - - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - - interface ED25519KeyPairKeyObjectOptions { - /** - * No options. - */ - } - - interface X25519KeyPairKeyObjectOptions { - /** - * No options. - */ - } - - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - } - - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - - /** - * @default 0x10001 - */ - publicExponent?: number; - } - - interface DSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - - /** - * Size of q in bits - */ - divisorLength: number; - } - - interface RSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number; - - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs1' | 'pkcs8'; - }; - } - - interface DSAKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * Size of q in bits - */ - divisorLength: number; - - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - - interface ECKeyPairOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'sec1' | 'pkcs8'; - }; - } - - interface ED25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; - - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - - namespace generateKeyPair { - function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; - function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; - function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; - function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; - function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise; - - function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; - function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; - function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; - function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; - function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise; - - function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; - function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; - function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; - function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; - function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise; - - function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; - function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; - function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; - function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; - function __promisify__(type: "ed25519", options: ED25519KeyPairKeyObjectOptions): Promise; - - function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>; - function __promisify__(type: "x25519", options: X25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>; - function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>; - function __promisify__(type: "x25519", options: X25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>; - function __promisify__(type: "x25519", options: X25519KeyPairKeyObjectOptions): Promise; - } - - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been - * passed to [`crypto.createPrivateKey()`][]. - */ - function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - - /** - * Calculates and returns the signature for `data` using the given private key and - * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is - * dependent upon the key type (especially Ed25519 and Ed448). - * - * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been - * passed to [`crypto.createPublicKey()`][]. - */ - function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - - /** - * Computes the Diffie-Hellman secret based on a privateKey and a publicKey. - * Both keys must have the same asymmetricKeyType, which must be one of - * 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES). - */ - function diffieHellman(options: { - privateKey: KeyObject; - publicKey: KeyObject - }): Buffer; -} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts deleted file mode 100644 index 91fb0cb..0000000 --- a/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,141 +0,0 @@ -declare module "dgram" { - import { AddressInfo } from "net"; - import * as dns from "dns"; - import * as events from "events"; - - interface RemoteInfo { - address: string; - family: 'IPv4' | 'IPv6'; - port: number; - size: number; - } - - interface BindOptions { - port?: number; - address?: string; - exclusive?: boolean; - fd?: number; - } - - type SocketType = "udp4" | "udp6"; - - interface SocketOptions { - type: SocketType; - reuseAddr?: boolean; - /** - * @default false - */ - ipv6Only?: boolean; - recvBufferSize?: number; - sendBufferSize?: number; - lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; - } - - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - - class Socket extends events.EventEmitter { - addMembership(multicastAddress: string, multicastInterface?: string): void; - address(): AddressInfo; - bind(port?: number, address?: string, callback?: () => void): void; - bind(port?: number, callback?: () => void): void; - bind(callback?: () => void): void; - bind(options: BindOptions, callback?: () => void): void; - close(callback?: () => void): void; - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - disconnect(): void; - dropMembership(multicastAddress: string, multicastInterface?: string): void; - getRecvBufferSize(): number; - getSendBufferSize(): number; - ref(): this; - remoteAddress(): AddressInfo; - send(msg: string | Uint8Array | any[], port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | any[], port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | any[], callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; - setBroadcast(flag: boolean): void; - setMulticastInterface(multicastInterface: string): void; - setMulticastLoopback(flag: boolean): void; - setMulticastTTL(ttl: number): void; - setRecvBufferSize(size: number): void; - setSendBufferSize(size: number): void; - setTTL(ttl: number): void; - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given - * `sourceAddress` and `groupAddress`, using the `multicastInterface` with the - * `IP_ADD_SOURCE_MEMBERSHIP` socket option. - * If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. - * To add membership to every available interface, call - * `socket.addSourceSpecificMembership()` multiple times, once per interface. - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - - /** - * Instructs the kernel to leave a source-specific multicast channel at the given - * `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` - * socket option. This method is automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connect"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connect", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connect", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; - } -} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts deleted file mode 100644 index 8ce8864..0000000 --- a/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,371 +0,0 @@ -declare module "dns" { - // Supported getaddrinfo flags. - const ADDRCONFIG: number; - const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - const ALL: number; - - interface LookupOptions { - family?: number; - hints?: number; - all?: boolean; - verbatim?: boolean; - } - - interface LookupOneOptions extends LookupOptions { - all?: false; - } - - interface LookupAllOptions extends LookupOptions { - all: true; - } - - interface LookupAddress { - address: string; - family: number; - } - - function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; - function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; - function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - - function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; - - namespace lookupService { - function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>; - } - - interface ResolveOptions { - ttl: boolean; - } - - interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - - interface RecordWithTtl { - address: string; - ttl: number; - } - - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - - interface AnyARecord extends RecordWithTtl { - type: "A"; - } - - interface AnyAaaaRecord extends RecordWithTtl { - type: "AAAA"; - } - - interface MxRecord { - priority: number; - exchange: string; - } - - interface AnyMxRecord extends MxRecord { - type: "MX"; - } - - interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - - interface AnyNaptrRecord extends NaptrRecord { - type: "NAPTR"; - } - - interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - - interface AnySoaRecord extends SoaRecord { - type: "SOA"; - } - - interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - - interface AnySrvRecord extends SrvRecord { - type: "SRV"; - } - - interface AnyTxtRecord { - type: "TXT"; - entries: string[]; - } - - interface AnyNsRecord { - type: "NS"; - value: string; - } - - interface AnyPtrRecord { - type: "PTR"; - value: string; - } - - interface AnyCnameRecord { - type: "CNAME"; - value: string; - } - - type AnyRecord = AnyARecord | - AnyAaaaRecord | - AnyCnameRecord | - AnyMxRecord | - AnyNaptrRecord | - AnyNsRecord | - AnyPtrRecord | - AnySoaRecord | - AnySrvRecord | - AnyTxtRecord; - - function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; - function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - function resolve( - hostname: string, - rrtype: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void, - ): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - namespace resolve { - function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; - function __promisify__(hostname: string, rrtype: "ANY"): Promise; - function __promisify__(hostname: string, rrtype: "MX"): Promise; - function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; - function __promisify__(hostname: string, rrtype: "SOA"): Promise; - function __promisify__(hostname: string, rrtype: "SRV"): Promise; - function __promisify__(hostname: string, rrtype: "TXT"): Promise; - function __promisify__(hostname: string, rrtype: string): Promise; - } - - function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - - function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - - function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - - function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - - function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - - function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - - function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - - function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; - namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - - function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - - function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - - function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - - function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; - function setServers(servers: ReadonlyArray): void; - function getServers(): string[]; - - // Error codes - const NODATA: string; - const FORMERR: string; - const SERVFAIL: string; - const NOTFOUND: string; - const NOTIMP: string; - const REFUSED: string; - const BADQUERY: string; - const BADNAME: string; - const BADFAMILY: string; - const BADRESP: string; - const CONNREFUSED: string; - const TIMEOUT: string; - const EOF: string; - const FILE: string; - const NOMEM: string; - const DESTRUCTION: string; - const BADSTR: string; - const BADFLAGS: string; - const NONAME: string; - const BADHINTS: string; - const NOTINITIALIZED: string; - const LOADIPHLPAPI: string; - const ADDRGETNETWORKPARAMS: string; - const CANCELLED: string; - - class Resolver { - getServers: typeof getServers; - setServers: typeof setServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - cancel(): void; - } - - namespace promises { - function getServers(): string[]; - - function lookup(hostname: string, family: number): Promise; - function lookup(hostname: string, options: LookupOneOptions): Promise; - function lookup(hostname: string, options: LookupAllOptions): Promise; - function lookup(hostname: string, options: LookupOptions): Promise; - function lookup(hostname: string): Promise; - - function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>; - - function resolve(hostname: string): Promise; - function resolve(hostname: string, rrtype: "A"): Promise; - function resolve(hostname: string, rrtype: "AAAA"): Promise; - function resolve(hostname: string, rrtype: "ANY"): Promise; - function resolve(hostname: string, rrtype: "CNAME"): Promise; - function resolve(hostname: string, rrtype: "MX"): Promise; - function resolve(hostname: string, rrtype: "NAPTR"): Promise; - function resolve(hostname: string, rrtype: "NS"): Promise; - function resolve(hostname: string, rrtype: "PTR"): Promise; - function resolve(hostname: string, rrtype: "SOA"): Promise; - function resolve(hostname: string, rrtype: "SRV"): Promise; - function resolve(hostname: string, rrtype: "TXT"): Promise; - function resolve(hostname: string, rrtype: string): Promise; - - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - - function resolveAny(hostname: string): Promise; - - function resolveCname(hostname: string): Promise; - - function resolveMx(hostname: string): Promise; - - function resolveNaptr(hostname: string): Promise; - - function resolveNs(hostname: string): Promise; - - function resolvePtr(hostname: string): Promise; - - function resolveSoa(hostname: string): Promise; - - function resolveSrv(hostname: string): Promise; - - function resolveTxt(hostname: string): Promise; - - function reverse(ip: string): Promise; - - function setServers(servers: ReadonlyArray): void; - - class Resolver { - getServers: typeof getServers; - resolve: typeof resolve; - resolve4: typeof resolve4; - resolve6: typeof resolve6; - resolveAny: typeof resolveAny; - resolveCname: typeof resolveCname; - resolveMx: typeof resolveMx; - resolveNaptr: typeof resolveNaptr; - resolveNs: typeof resolveNs; - resolvePtr: typeof resolvePtr; - resolveSoa: typeof resolveSoa; - resolveSrv: typeof resolveSrv; - resolveTxt: typeof resolveTxt; - reverse: typeof reverse; - setServers: typeof setServers; - } - } -} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts deleted file mode 100644 index 63dcc9b..0000000 --- a/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -declare module "domain" { - import { EventEmitter } from "events"; - - global { - namespace NodeJS { - interface Domain extends EventEmitter { - run(fn: (...args: any[]) => T, ...args: any[]): T; - add(emitter: EventEmitter | Timer): void; - remove(emitter: EventEmitter | Timer): void; - bind(cb: T): T; - intercept(cb: T): T; - } - } - } - - interface Domain extends NodeJS.Domain {} - class Domain extends EventEmitter { - members: Array; - enter(): void; - exit(): void; - } - - function create(): Domain; -} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts deleted file mode 100644 index a55b7b5..0000000 --- a/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -declare module "events" { - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean; - } - - interface NodeEventTarget { - once(event: string | symbol, listener: (...args: any[]) => void): this; - } - - interface DOMEventTarget { - addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any; - } - - namespace EventEmitter { - function once(emitter: NodeEventTarget, event: string | symbol): Promise; - function once(emitter: DOMEventTarget, event: string): Promise; - function on(emitter: EventEmitter, event: string): AsyncIterableIterator; - const captureRejectionSymbol: unique symbol; - - /** - * This symbol shall be used to install a listener for only monitoring `'error'` - * events. Listeners installed using this symbol are called before the regular - * `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an - * `'error'` event is emitted, therefore the process will still crash if no - * regular `'error'` listener is installed. - */ - const errorMonitor: unique symbol; - /** - * Sets or gets the default captureRejection value for all emitters. - */ - let captureRejections: boolean; - - interface EventEmitter extends NodeJS.EventEmitter { - } - - class EventEmitter { - constructor(options?: EventEmitterOptions); - /** @deprecated since v4.0.0 */ - static listenerCount(emitter: EventEmitter, event: string | symbol): number; - static defaultMaxListeners: number; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` - * events. Listeners installed using this symbol are called before the regular - * `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an - * `'error'` event is emitted, therefore the process will still crash if no - * regular `'error'` listener is installed. - */ - static readonly errorMonitor: unique symbol; - } - } - - global { - namespace NodeJS { - interface EventEmitter { - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - off(event: string | symbol, listener: (...args: any[]) => void): this; - removeAllListeners(event?: string | symbol): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string | symbol): Function[]; - rawListeners(event: string | symbol): Function[]; - emit(event: string | symbol, ...args: any[]): boolean; - listenerCount(type: string | symbol): number; - // Added in Node 6... - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - eventNames(): Array; - } - } - } - - export = EventEmitter; -} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts deleted file mode 100644 index 140dd08..0000000 --- a/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,2156 +0,0 @@ -declare module "fs" { - import * as stream from "stream"; - import * as events from "events"; - import { URL } from "url"; - import * as promises from 'fs/promises'; - - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - - export type BufferEncodingOption = 'buffer' | { encoding: 'buffer' }; - - export interface BaseEncodingOptions { - encoding?: BufferEncoding | null; - } - - export type OpenMode = number | string; - - export type Mode = number | string; - - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - - export interface Stats extends StatsBase { - } - - export class Stats { - } - - export class Dirent { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - name: string; - } - - /** - * A class representing a directory stream. - */ - export class Dir { - readonly path: string; - - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - */ - close(): Promise; - close(cb: NoParamCallback): void; - - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - */ - closeSync(): void; - - /** - * Asynchronously read the next directory entry via `readdir(3)` as an `Dirent`. - * After the read is completed, a value is returned that will be resolved with an `Dirent`, or `null` if there are no more directory entries to read. - * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms. - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - - /** - * Synchronously read the next directory entry via `readdir(3)` as a `Dirent`. - * If there are no more directory entries to read, null will be returned. - * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms. - */ - readSync(): Dirent; - } - - export interface FSWatcher extends events.EventEmitter { - close(): void; - - /** - * events.EventEmitter - * 1. change - * 2. error - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "close", listener: () => void): this; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "close", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "close", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "close", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - } - - export class ReadStream extends stream.Readable { - close(): void; - bytesRead: number; - path: string | Buffer; - pending: boolean; - - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "ready", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "ready", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - export class WriteStream extends stream.Writable { - close(): void; - bytesWritten: number; - path: string | Buffer; - pending: boolean; - - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "open", listener: (fd: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "ready", listener: () => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "open", listener: (fd: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "ready", listener: () => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "open", listener: (fd: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "ready", listener: () => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "open", listener: (fd: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "ready", listener: () => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "open", listener: (fd: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "ready", listener: () => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace rename { - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; - } - - /** - * Synchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; - - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace truncate { - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(path: PathLike, len?: number | null): Promise; - } - - /** - * Synchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - export function truncateSync(path: PathLike, len?: number | null): void; - - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace ftruncate { - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - function __promisify__(fd: number, len?: number | null): Promise; - } - - /** - * Synchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - * @param len If not specified, defaults to `0`. - */ - export function ftruncateSync(fd: number, len?: number | null): void; - - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace chown { - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - - /** - * Synchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - - /** - * Synchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace lchown { - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, uid: number, gid: number): Promise; - } - - /** - * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace chmod { - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - - /** - * Synchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - export function chmodSync(path: PathLike, mode: Mode): void; - - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace fchmod { - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(fd: number, mode: Mode): Promise; - } - - /** - * Synchronous fchmod(2) - Change permissions of a file. - * @param fd A file descriptor. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - export function fchmodSync(fd: number, mode: Mode): void; - - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace lchmod { - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function __promisify__(path: PathLike, mode: Mode): Promise; - } - - /** - * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function stat(path: PathLike, options: BigIntOptions, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void; - export function stat(path: PathLike, options: StatOptions, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace stat { - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options: BigIntOptions): Promise; - function __promisify__(path: PathLike, options: StatOptions): Promise; - function __promisify__(path: PathLike): Promise; - } - - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function statSync(path: PathLike, options: BigIntOptions): BigIntStats; - export function statSync(path: PathLike, options: StatOptions): Stats | BigIntStats; - export function statSync(path: PathLike): Stats; - - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - - /** - * Synchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - export function fstatSync(fd: number): Stats; - - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace lstat { - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - - /** - * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function lstatSync(path: PathLike): Stats; - - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace link { - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - - /** - * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; - - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace symlink { - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; - - type Type = "dir" | "file" | "junction"; - } - - /** - * Synchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink( - path: PathLike, - options: BaseEncodingOptions | BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, linkString: string) => void - ): void; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlink(path: PathLike, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace readlink { - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: BaseEncodingOptions | string | null): Promise; - } - - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): string; - - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; - - /** - * Synchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readlinkSync(path: PathLike, options?: BaseEncodingOptions | string | null): string | Buffer; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath( - path: PathLike, - options: BaseEncodingOptions | BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void - ): void; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpath(path: PathLike, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace realpath { - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: BaseEncodingOptions | string | null): Promise; - - function native( - path: PathLike, - options: BaseEncodingOptions | BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void - ): void; - function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - function native(path: PathLike, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - } - - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): string; - - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; - - /** - * Synchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function realpathSync(path: PathLike, options?: BaseEncodingOptions | string | null): string | Buffer; - - export namespace realpathSync { - function native(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: BaseEncodingOptions | string | null): string | Buffer; - } - - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace unlink { - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike): Promise; - } - - /** - * Synchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function unlinkSync(path: PathLike): void; - - export interface RmDirOptions { - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, errors are not reported if `path` does not exist, and - * operations are retried on failure. - * @experimental - * @default false - */ - recursive?: boolean; - } - - export interface RmDirAsyncOptions extends RmDirOptions { - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number; - } - - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirAsyncOptions, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace rmdir { - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function __promisify__(path: PathLike, options?: RmDirAsyncOptions): Promise; - } - - /** - * Synchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode; - } - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path: string) => void): void; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir(path: PathLike, options: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null | undefined, callback: NoParamCallback): void; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path: string | undefined) => void): void; - - /** - * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace mkdir { - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - } - - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string; - - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): void; - - /** - * Synchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp(prefix: string, options: BaseEncodingOptions | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void): void; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtemp(prefix: string, options: BaseEncodingOptions | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - */ - export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace mkdtemp { - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options: BufferEncodingOption): Promise; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(prefix: string, options?: BaseEncodingOptions | string | null): Promise; - } - - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): string; - - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; - - /** - * Synchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function mkdtempSync(prefix: string, options?: BaseEncodingOptions | string | null): string | Buffer; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, files: string[]) => void, - ): void; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer", callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void): void; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdir( - path: PathLike, - options: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void, - ): void; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdir(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace readdir { - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false }): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function __promisify__(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }): Promise; - } - - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): string[]; - - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Buffer[]; - - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - export function readdirSync(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): string[] | Buffer[]; - - /** - * Synchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - export function readdirSync(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }): Dirent[]; - - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - export function close(fd: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - - /** - * Synchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - export function closeSync(fd: number): void; - - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - export function open(path: PathLike, flags: OpenMode, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - - /** - * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export function open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace open { - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; - } - - /** - * Synchronous open(2) - open and possibly create a file, returning a file descriptor.. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace utimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; - } - - /** - * Synchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - export function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; - - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace futimes { - /** - * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise; - } - - /** - * Synchronously change file timestamps of the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - export function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void; - - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - export function fsync(fd: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace fsync { - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - - /** - * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param fd A file descriptor. - */ - export function fsyncSync(fd: number): void; - - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - position: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - length: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void, - ): void; - - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - */ - export function write( - fd: number, - buffer: TBuffer, - offset: number | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void - ): void; - - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - */ - export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; - - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | undefined | null, - callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void, - ): void; - - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - */ - export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace write { - /** - * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function __promisify__( - fd: number, - buffer?: TBuffer, - offset?: number, - length?: number, - position?: number | null, - ): Promise<{ bytesWritten: number, buffer: TBuffer }>; - - /** - * Asynchronously writes `string` to the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function __promisify__(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>; - } - - /** - * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; - - /** - * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. - * @param fd A file descriptor. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; - - /** - * Asynchronously reads data from the file referenced by the supplied file descriptor. - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void, - ): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace read { - /** - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - function __promisify__( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: number | null - ): Promise<{ bytesRead: number, buffer: TBuffer }>; - } - - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number; - /** - * @default `length of buffer` - */ - length?: number; - /** - * @default null - */ - position?: number | null; - } - - /** - * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read. - * @param fd A file descriptor. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: number | null): number; - - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFile( - path: PathLike | number, - options: BaseEncodingOptions & { flag?: string; } | string | undefined | null, - callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void, - ): void; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - */ - export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace readFile { - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | string): Promise; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function __promisify__(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | string | null): Promise; - } - - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer; - - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync(path: PathLike | number, options: { encoding: BufferEncoding; flag?: string; } | BufferEncoding): string; - - /** - * Synchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - export function readFileSync(path: PathLike | number, options?: BaseEncodingOptions & { flag?: string; } | BufferEncoding | null): string | Buffer; - - export type WriteFileOptions = BaseEncodingOptions & { mode?: Mode; flag?: string; } | string | null; - - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - export function writeFile(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; - - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function writeFile(path: PathLike | number, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace writeFile { - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function __promisify__(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; - } - - /** - * Synchronously writes data to a file, replacing the file if it already exists. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - export function writeFileSync(path: PathLike | number, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; - - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - export function appendFile(file: PathLike | number, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; - - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - */ - export function appendFile(file: PathLike | number, data: string | Uint8Array, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace appendFile { - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function __promisify__(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions): Promise; - } - - /** - * Synchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a file descriptor is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - export function appendFileSync(file: PathLike | number, data: string | Uint8Array, options?: WriteFileOptions): void; - - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - */ - export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void; - - /** - * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; - - /** - * Stop watching for changes on `filename`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; - - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, - listener?: (event: string, filename: string) => void, - ): FSWatcher; - - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher; - - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `persistent` is not supplied, the default of `true` is used. - * If `recursive` is not supplied, the default of `false` is used. - */ - export function watch( - filename: PathLike, - options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | string | null, - listener?: (event: string, filename: string | Buffer) => void, - ): FSWatcher; - - /** - * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. - * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher; - - /** - * Asynchronously tests whether or not the given path exists by checking with the file system. - * @deprecated since v1.0.0 Use `fs.stat()` or `fs.access()` instead - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace exists { - /** - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike): Promise; - } - - /** - * Synchronously tests whether or not the given path exists by checking with the file system. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function existsSync(path: PathLike): boolean; - - export namespace constants { - // File Access Constants - - /** Constant for fs.access(). File is visible to the calling process. */ - const F_OK: number; - - /** Constant for fs.access(). File can be read by the calling process. */ - const R_OK: number; - - /** Constant for fs.access(). File can be written by the calling process. */ - const W_OK: number; - - /** Constant for fs.access(). File can be executed by the calling process. */ - const X_OK: number; - - // File Copy Constants - - /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ - const COPYFILE_EXCL: number; - - /** - * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. - */ - const COPYFILE_FICLONE: number; - - /** - * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. - * If the underlying platform does not support copy-on-write, then the operation will fail with an error. - */ - const COPYFILE_FICLONE_FORCE: number; - - // File Open Constants - - /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ - const O_RDONLY: number; - - /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ - const O_WRONLY: number; - - /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ - const O_RDWR: number; - - /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ - const O_CREAT: number; - - /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ - const O_EXCL: number; - - /** - * Constant for fs.open(). Flag indicating that if path identifies a terminal device, - * opening the path shall not cause that terminal to become the controlling terminal for the process - * (if the process does not already have one). - */ - const O_NOCTTY: number; - - /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ - const O_TRUNC: number; - - /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ - const O_APPEND: number; - - /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ - const O_DIRECTORY: number; - - /** - * constant for fs.open(). - * Flag indicating reading accesses to the file system will no longer result in - * an update to the atime information associated with the file. - * This flag is available on Linux operating systems only. - */ - const O_NOATIME: number; - - /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ - const O_NOFOLLOW: number; - - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ - const O_SYNC: number; - - /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ - const O_DSYNC: number; - - /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ - const O_SYMLINK: number; - - /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ - const O_DIRECT: number; - - /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ - const O_NONBLOCK: number; - - // File Type Constants - - /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ - const S_IFMT: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ - const S_IFREG: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ - const S_IFDIR: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ - const S_IFCHR: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ - const S_IFBLK: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ - const S_IFIFO: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ - const S_IFLNK: number; - - /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ - const S_IFSOCK: number; - - // File Mode Constants - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ - const S_IRWXU: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ - const S_IRUSR: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ - const S_IWUSR: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ - const S_IXUSR: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ - const S_IRWXG: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ - const S_IRGRP: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ - const S_IWGRP: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ - const S_IXGRP: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ - const S_IRWXO: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ - const S_IROTH: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ - const S_IWOTH: number; - - /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ - const S_IXOTH: number; - - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; - - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace access { - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function __promisify__(path: PathLike, mode?: number): Promise; - } - - /** - * Synchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function accessSync(path: PathLike, mode?: number): void; - - /** - * Returns a new `ReadStream` object. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function createReadStream(path: PathLike, options?: string | { - flags?: string; - encoding?: BufferEncoding; - fd?: number; - mode?: number; - autoClose?: boolean; - /** - * @default false - */ - emitClose?: boolean; - start?: number; - end?: number; - highWaterMark?: number; - }): ReadStream; - - /** - * Returns a new `WriteStream` object. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - export function createWriteStream(path: PathLike, options?: string | { - flags?: string; - encoding?: BufferEncoding; - fd?: number; - mode?: number; - autoClose?: boolean; - emitClose?: boolean; - start?: number; - highWaterMark?: number; - }): WriteStream; - - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace fdatasync { - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - - /** - * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param fd A file descriptor. - */ - export function fdatasyncSync(fd: number): void; - - /** - * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. - * No arguments other than a possible exception are given to the callback function. - * Node.js makes no guarantees about the atomicity of the copy operation. - * If an error occurs after the destination file has been opened for writing, Node.js will attempt - * to remove the destination. - * @param src A path to the source file. - * @param dest A path to the destination file. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - /** - * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. - * No arguments other than a possible exception are given to the callback function. - * Node.js makes no guarantees about the atomicity of the copy operation. - * If an error occurs after the destination file has been opened for writing, Node.js will attempt - * to remove the destination. - * @param src A path to the source file. - * @param dest A path to the destination file. - * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. - */ - export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: NoParamCallback): void; - - // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. - export namespace copyFile { - /** - * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. - * No arguments other than a possible exception are given to the callback function. - * Node.js makes no guarantees about the atomicity of the copy operation. - * If an error occurs after the destination file has been opened for writing, Node.js will attempt - * to remove the destination. - * @param src A path to the source file. - * @param dest A path to the destination file. - * @param flags An optional integer that specifies the behavior of the copy operation. - * The only supported flag is fs.constants.COPYFILE_EXCL, - * which causes the copy operation to fail if dest already exists. - */ - function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise; - } - - /** - * Synchronously copies src to dest. By default, dest is overwritten if it already exists. - * Node.js makes no guarantees about the atomicity of the copy operation. - * If an error occurs after the destination file has been opened for writing, Node.js will attempt - * to remove the destination. - * @param src A path to the source file. - * @param dest A path to the destination file. - * @param flags An optional integer that specifies the behavior of the copy operation. - * The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. - */ - export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; - - /** - * Write an array of ArrayBufferViews to the file specified by fd using writev(). - * position is the offset from the beginning of the file where this data should be written. - * It is unsafe to use fs.writev() multiple times on the same file without waiting for the callback. For this scenario, use fs.createWriteStream(). - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to the end of the file. - */ - export function writev( - fd: number, - buffers: NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export function writev( - fd: number, - buffers: NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - - export namespace writev { - function __promisify__(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise; - } - - /** - * See `writev`. - */ - export function writevSync(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): number; - - export function readv( - fd: number, - buffers: NodeJS.ArrayBufferView[], - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export function readv( - fd: number, - buffers: NodeJS.ArrayBufferView[], - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - - export namespace readv { - function __promisify__(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise; - } - - /** - * See `readv`. - */ - export function readvSync(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): number; - - export interface OpenDirOptions { - encoding?: BufferEncoding; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number; - } - - export function opendirSync(path: string, options?: OpenDirOptions): Dir; - - export function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - - export namespace opendir { - function __promisify__(path: string, options?: OpenDirOptions): Promise; - } - - export interface BigIntStats extends StatsBase { - } - - export class BigIntStats { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - - export interface BigIntOptions { - bigint: true; - } - - export interface StatOptions { - bigint: boolean; - } -} diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts deleted file mode 100644 index 6585d5f..0000000 --- a/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,539 +0,0 @@ -declare module 'fs/promises' { - import { - Stats, - WriteVResult, - ReadVResult, - PathLike, - RmDirAsyncOptions, - MakeDirectoryOptions, - Dirent, - OpenDirOptions, - Dir, - BaseEncodingOptions, - BufferEncodingOption, - OpenMode, - Mode, - } from 'fs'; - - interface FileHandle { - /** - * Gets the file descriptor for this file handle. - */ - readonly fd: number; - - /** - * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for appending. - * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - appendFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise; - - /** - * Asynchronous fchown(2) - Change ownership of a file. - */ - chown(uid: number, gid: number): Promise; - - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - chmod(mode: Mode): Promise; - - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - */ - datasync(): Promise; - - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - */ - sync(): Promise; - - /** - * Asynchronously reads data from the file. - * The `FileHandle` must have been opened for reading. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. - */ - read(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; - - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile(options?: { encoding?: null, flag?: OpenMode } | null): Promise; - - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile(options: { encoding: BufferEncoding, flag?: OpenMode } | BufferEncoding): Promise; - - /** - * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for reading. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - readFile(options?: BaseEncodingOptions & { flag?: OpenMode } | BufferEncoding | null): Promise; - - /** - * Asynchronous fstat(2) - Get file status. - */ - stat(): Promise; - - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param len If not specified, defaults to `0`. - */ - truncate(len?: number): Promise; - - /** - * Asynchronously change file timestamps of the file. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - utimes(atime: string | number | Date, mtime: string | number | Date): Promise; - - /** - * Asynchronously writes `buffer` to the file. - * The `FileHandle` must have been opened for writing. - * @param buffer The buffer that the data will be written to. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - write(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; - - /** - * Asynchronously writes `string` to the file. - * The `FileHandle` must have been opened for writing. - * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise` - * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - write(data: string | Uint8Array, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>; - - /** - * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically. - * The `FileHandle` must have been opened for writing. - * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). - * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - writeFile(data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise; - - /** - * See `fs.writev` promisified version. - */ - writev(buffers: NodeJS.ArrayBufferView[], position?: number): Promise; - - /** - * See `fs.readv` promisified version. - */ - readv(buffers: NodeJS.ArrayBufferView[], position?: number): Promise; - - /** - * Asynchronous close(2) - close a `FileHandle`. - */ - close(): Promise; - } - - /** - * Asynchronously tests a user's permissions for the file specified by path. - * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function access(path: PathLike, mode?: number): Promise; - - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. - * Node.js makes no guarantees about the atomicity of the copy operation. - * If an error occurs after the destination file has been opened for writing, Node.js will attempt - * to remove the destination. - * @param src A path to the source file. - * @param dest A path to the destination file. - * @param flags An optional integer that specifies the behavior of the copy operation. The only - * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if - * `dest` already exists. - */ - function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise; - - /** - * Asynchronous open(2) - open and possibly create a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not - * supplied, defaults to `0o666`. - */ - function open(path: PathLike, flags: string | number, mode?: Mode): Promise; - - /** - * Asynchronously reads data from the file referenced by the supplied `FileHandle`. - * @param handle A `FileHandle`. - * @param buffer The buffer that the data will be written to. - * @param offset The offset in the buffer at which to start writing. - * @param length The number of bytes to read. - * @param position The offset from the beginning of the file from which data should be read. If - * `null`, data will be read from the current position. - */ - function read( - handle: FileHandle, - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null, - ): Promise<{ bytesRead: number, buffer: TBuffer }>; - - /** - * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. - * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` - * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. - * @param handle A `FileHandle`. - * @param buffer The buffer that the data will be written to. - * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. - * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - function write( - handle: FileHandle, - buffer: TBuffer, - offset?: number | null, - length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; - - /** - * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. - * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` - * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. - * @param handle A `FileHandle`. - * @param string A string to write. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - * @param encoding The expected string encoding. - */ - function write(handle: FileHandle, string: string, position?: number | null, encoding?: BufferEncoding | null): Promise<{ bytesWritten: number, buffer: string }>; - - /** - * Asynchronous rename(2) - Change the name or location of a file or directory. - * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - - /** - * Asynchronous truncate(2) - Truncate a file to a specified length. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param len If not specified, defaults to `0`. - */ - function truncate(path: PathLike, len?: number): Promise; - - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param handle A `FileHandle`. - * @param len If not specified, defaults to `0`. - */ - function ftruncate(handle: FileHandle, len?: number): Promise; - - /** - * Asynchronous rmdir(2) - delete a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function rmdir(path: PathLike, options?: RmDirAsyncOptions): Promise; - - /** - * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. - * @param handle A `FileHandle`. - */ - function fdatasync(handle: FileHandle): Promise; - - /** - * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. - * @param handle A `FileHandle`. - */ - function fsync(handle: FileHandle): Promise; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise; - - /** - * Asynchronous mkdir(2) - create a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders - * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. - */ - function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readdir(path: PathLike, options?: BaseEncodingOptions & { withFileTypes?: false } | BufferEncoding | null): Promise; - - /** - * Asynchronous readdir(3) - read a directory. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir(path: PathLike, options: BaseEncodingOptions & { withFileTypes: true }): Promise; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options: BufferEncodingOption): Promise; - - /** - * Asynchronous readlink(2) - read value of a symbolic link. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function readlink(path: PathLike, options?: BaseEncodingOptions | string | null): Promise; - - /** - * Asynchronous symlink(2) - Create a new symbolic link to an existing file. - * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. - * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. - * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). - * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - - /** - * Asynchronous fstat(2) - Get file status. - * @param handle A `FileHandle`. - */ - function fstat(handle: FileHandle): Promise; - - /** - * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function lstat(path: PathLike): Promise; - - /** - * Asynchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function stat(path: PathLike): Promise; - - /** - * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. - * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - - /** - * Asynchronous unlink(2) - delete a name and possibly the file it refers to. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function unlink(path: PathLike): Promise; - - /** - * Asynchronous fchmod(2) - Change permissions of a file. - * @param handle A `FileHandle`. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function fchmod(handle: FileHandle, mode: Mode): Promise; - - /** - * Asynchronous chmod(2) - Change permissions of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function chmod(path: PathLike, mode: Mode): Promise; - - /** - * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param mode A file mode. If a string is passed, it is parsed as an octal integer. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - - /** - * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param handle A `FileHandle`. - */ - function fchown(handle: FileHandle, uid: number, gid: number): Promise; - - /** - * Asynchronous chown(2) - Change ownership of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - - /** - * Asynchronously change file timestamps of the file referenced by the supplied path. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; - - /** - * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`. - * @param handle A `FileHandle`. - * @param atime The last access time. If a string is provided, it will be coerced to number. - * @param mtime The last modified time. If a string is provided, it will be coerced to number. - */ - function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options: BufferEncodingOption): Promise; - - /** - * Asynchronous realpath(3) - return the canonicalized absolute pathname. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function realpath(path: PathLike, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; - - /** - * Asynchronously creates a unique temporary directory. - * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. - * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. - */ - function mkdtemp(prefix: string, options?: BaseEncodingOptions | BufferEncoding | null): Promise; - - /** - * Asynchronously writes data to a file, replacing the file if it already exists. - * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'w'` is used. - */ - function writeFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise; - - /** - * Asynchronously append data to a file, creating the file if it does not exist. - * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. - * URL support is _experimental_. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. - * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. - * If `encoding` is not supplied, the default of `'utf8'` is used. - * If `mode` is not supplied, the default of `0o666` is used. - * If `mode` is a string, it is parsed as an octal integer. - * If `flag` is not supplied, the default of `'a'` is used. - */ - function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: BaseEncodingOptions & { mode?: Mode, flag?: OpenMode } | BufferEncoding | null): Promise; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: OpenMode } | null): Promise; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: OpenMode } | BufferEncoding): Promise; - - /** - * Asynchronously reads the entire contents of a file. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. - * @param options An object that may contain an optional flag. - * If a flag is not provided, it defaults to `'r'`. - */ - function readFile(path: PathLike | FileHandle, options?: BaseEncodingOptions & { flag?: OpenMode } | BufferEncoding | null): Promise; - - function opendir(path: string, options?: OpenDirOptions): Promise; -} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts deleted file mode 100644 index 76247f9..0000000 --- a/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,606 +0,0 @@ -// Declare "static" methods in Error -interface ErrorConstructor { - /** Create .stack property on a target object */ - captureStackTrace(targetObject: object, constructorOpt?: Function): void; - - /** - * Optional override for formatting stack traces - * - * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces - */ - prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any; - - stackTraceLimit: number; -} - -// Node.js ESNEXT support -interface String { - /** Removes whitespace from the left end of a string. */ - trimLeft(): string; - /** Removes whitespace from the right end of a string. */ - trimRight(): string; - - /** Returns a copy with leading whitespace removed. */ - trimStart(): string; - /** Returns a copy with trailing whitespace removed. */ - trimEnd(): string; -} - -interface ImportMeta { - url: string; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require {} -interface RequireResolve extends NodeJS.RequireResolve {} -interface NodeModule extends NodeJS.Module {} - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; -declare namespace setTimeout { - function __promisify__(ms: number): Promise; - function __promisify__(ms: number, value: T): Promise; -} -declare function clearTimeout(timeoutId: NodeJS.Timeout): void; -declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; -declare function clearInterval(intervalId: NodeJS.Timeout): void; -declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; -declare namespace setImmediate { - function __promisify__(): Promise; - function __promisify__(value: T): Promise; -} -declare function clearImmediate(immediateId: NodeJS.Immediate): void; - -declare function queueMicrotask(callback: () => void): void; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -// Buffer class -type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"; - -/** - * 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'|'binary'(deprecated)|'hex' - */ -declare class Buffer extends Uint8Array { - /** - * 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. - */ - constructor(str: string, encoding?: BufferEncoding); - /** - * 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()`). - */ - constructor(size: number); - /** - * 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. - */ - constructor(array: Uint8Array); - /** - * 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. - */ - constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer); - /** - * 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. - */ - constructor(array: any[]); - /** - * 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. - */ - constructor(buffer: Buffer); - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer() - */ - static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - static from(data: number[]): Buffer; - static from(data: Uint8Array): Buffer; - /** - * Creates a new buffer containing the coerced value of an object - * A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants. - * @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`. - */ - static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): 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'. - */ - static from(str: string, encoding?: BufferEncoding): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - static of(...items: number[]): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength( - string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, - encoding?: BufferEncoding - ): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Uint8Array[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Uint8Array, buf2: Uint8Array): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initalizing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; - /** - * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. - */ - static poolSize: number; - - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - toJSON(): { type: 'Buffer'; data: number[] }; - equals(otherBuffer: Uint8Array): boolean; - compare( - otherBuffer: Uint8Array, - targetStart?: number, - targetEnd?: number, - sourceStart?: number, - sourceEnd?: number - ): number; - copy(targetBuffer: 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 method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory. - * - * @param begin Where the new `Buffer` will start. Default: `0`. - * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`. - */ - slice(begin?: 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. - * - * This method is compatible with `Uint8Array#subarray()`. - * - * @param begin Where the new `Buffer` will start. Default: `0`. - * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`. - */ - subarray(begin?: number, end?: number): Buffer; - writeBigInt64BE(value: bigint, offset?: number): number; - writeBigInt64LE(value: bigint, offset?: number): number; - writeBigUInt64BE(value: bigint, offset?: number): number; - writeBigUInt64LE(value: bigint, offset?: number): number; - writeUIntLE(value: number, offset: number, byteLength: number): number; - writeUIntBE(value: number, offset: number, byteLength: number): number; - writeIntLE(value: number, offset: number, byteLength: number): number; - writeIntBE(value: number, offset: number, byteLength: number): number; - readBigUInt64BE(offset?: number): bigint; - readBigUInt64LE(offset?: number): bigint; - readBigInt64BE(offset?: number): bigint; - readBigInt64LE(offset?: number): bigint; - readUIntLE(offset: number, byteLength: number): number; - readUIntBE(offset: number, byteLength: number): number; - readIntLE(offset: number, byteLength: number): number; - readIntBE(offset: number, byteLength: number): number; - readUInt8(offset?: number): number; - readUInt16LE(offset?: number): number; - readUInt16BE(offset?: number): number; - readUInt32LE(offset?: number): number; - readUInt32BE(offset?: number): number; - readInt8(offset?: number): number; - readInt16LE(offset?: number): number; - readInt16BE(offset?: number): number; - readInt32LE(offset?: number): number; - readInt32BE(offset?: number): number; - readFloatLE(offset?: number): number; - readFloatBE(offset?: number): number; - readDoubleLE(offset?: number): number; - readDoubleBE(offset?: number): number; - reverse(): this; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset?: number): number; - writeUInt16LE(value: number, offset?: number): number; - writeUInt16BE(value: number, offset?: number): number; - writeUInt32LE(value: number, offset?: number): number; - writeUInt32BE(value: number, offset?: number): number; - writeInt8(value: number, offset?: number): number; - writeInt16LE(value: number, offset?: number): number; - writeInt16BE(value: number, offset?: number): number; - writeInt32LE(value: number, offset?: number): number; - writeInt32BE(value: number, offset?: number): number; - writeFloatLE(value: number, offset?: number): number; - writeFloatBE(value: number, offset?: number): number; - writeDoubleLE(value: number, offset?: number): number; - writeDoubleBE(value: number, offset?: number): number; - - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - entries(): IterableIterator<[number, number]>; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - keys(): IterableIterator; - values(): IterableIterator; -} - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface InspectOptions { - /** - * If set to `true`, getters are going to be - * inspected as well. If set to `'get'` only getters without setter are going - * to be inspected. If set to `'set'` only getters having a corresponding - * setter are going to be inspected. This might cause side effects depending on - * the getter function. - * @default `false` - */ - getters?: 'get' | 'set' | boolean; - showHidden?: boolean; - /** - * @default 2 - */ - depth?: number | null; - colors?: boolean; - customInspect?: boolean; - showProxy?: boolean; - maxArrayLength?: number | null; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default Infinity - */ - maxStringLength?: number | null; - breakLength?: number; - /** - * Setting this to `false` causes each object key - * to be displayed on a new line. It will also add new lines to text that is - * longer than `breakLength`. If set to a number, the most `n` inner elements - * are united on a single line as long as all properties fit into - * `breakLength`. Short array elements are also grouped together. Note that no - * text will be reduced below 16 characters, no matter the `breakLength` size. - * For more information, see the example below. - * @default `true` - */ - compact?: boolean | number; - sorted?: boolean | ((a: string, b: string) => number); - } - - interface CallSite { - /** - * Value of "this" - */ - getThis(): any; - - /** - * Type of "this" as a string. - * This is the name of the function stored in the constructor field of - * "this", if available. Otherwise the object's [[Class]] internal - * property. - */ - getTypeName(): string | null; - - /** - * Current function - */ - getFunction(): Function | undefined; - - /** - * Name of the current function, typically its name property. - * If a name property is not available an attempt will be made to try - * to infer a name from the function's context. - */ - getFunctionName(): string | null; - - /** - * Name of the property [of "this" or one of its prototypes] that holds - * the current function - */ - getMethodName(): string | null; - - /** - * Name of the script [if this function was defined in a script] - */ - getFileName(): string | null; - - /** - * Current line number [if this function was defined in a script] - */ - getLineNumber(): number | null; - - /** - * Current column number [if this function was defined in a script] - */ - getColumnNumber(): number | null; - - /** - * A call site object representing the location where eval was called - * [if this function was created using a call to eval] - */ - getEvalOrigin(): string | undefined; - - /** - * Is this a toplevel invocation, that is, is "this" the global object? - */ - isToplevel(): boolean; - - /** - * Does this call take place in code defined by a call to eval? - */ - isEval(): boolean; - - /** - * Is this call in native V8 code? - */ - isNative(): boolean; - - /** - * Is this a constructor call? - */ - isConstructor(): boolean; - } - - interface ErrnoException extends Error { - errno?: number; - code?: string; - path?: string; - syscall?: string; - stack?: string; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: WritableStream): this; - unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; - wrap(oldStream: ReadableStream): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; - write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): void; - end(data: string | Uint8Array, cb?: () => void): void; - end(str: string, encoding?: BufferEncoding, cb?: () => void): void; - } - - interface ReadWriteStream extends ReadableStream, WritableStream { } - - interface Global { - Array: typeof Array; - ArrayBuffer: typeof ArrayBuffer; - Boolean: typeof Boolean; - Buffer: typeof Buffer; - DataView: typeof DataView; - Date: typeof Date; - Error: typeof Error; - EvalError: typeof EvalError; - Float32Array: typeof Float32Array; - Float64Array: typeof Float64Array; - Function: typeof Function; - Infinity: typeof Infinity; - Int16Array: typeof Int16Array; - Int32Array: typeof Int32Array; - Int8Array: typeof Int8Array; - Intl: typeof Intl; - JSON: typeof JSON; - Map: MapConstructor; - Math: typeof Math; - NaN: typeof NaN; - Number: typeof Number; - Object: typeof Object; - Promise: typeof Promise; - RangeError: typeof RangeError; - ReferenceError: typeof ReferenceError; - RegExp: typeof RegExp; - Set: SetConstructor; - String: typeof String; - Symbol: Function; - SyntaxError: typeof SyntaxError; - TypeError: typeof TypeError; - URIError: typeof URIError; - Uint16Array: typeof Uint16Array; - Uint32Array: typeof Uint32Array; - Uint8Array: typeof Uint8Array; - Uint8ClampedArray: typeof Uint8ClampedArray; - WeakMap: WeakMapConstructor; - WeakSet: WeakSetConstructor; - clearImmediate: (immediateId: Immediate) => void; - clearInterval: (intervalId: Timeout) => void; - clearTimeout: (timeoutId: Timeout) => void; - decodeURI: typeof decodeURI; - decodeURIComponent: typeof decodeURIComponent; - encodeURI: typeof encodeURI; - encodeURIComponent: typeof encodeURIComponent; - escape: (str: string) => string; - eval: typeof eval; - global: Global; - isFinite: typeof isFinite; - isNaN: typeof isNaN; - parseFloat: typeof parseFloat; - parseInt: typeof parseInt; - setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate; - setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout; - setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout; - queueMicrotask: typeof queueMicrotask; - undefined: typeof undefined; - unescape: (str: string) => string; - gc: () => void; - v8debug?: any; - } - - interface RefCounted { - ref(): this; - unref(): this; - } - - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - } - - interface Immediate extends RefCounted { - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - } - - interface Timeout extends Timer { - hasRef(): boolean; - refresh(): this; - } - - type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - /* tslint:disable-next-line:callable-types */ - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[]; }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - '.js': (m: Module, filename: string) => any; - '.json': (m: Module, filename: string) => any; - '.node': (m: Module, filename: string) => any; - } - interface Module { - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since 11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } -} diff --git a/node_modules/@types/node/globals.global.d.ts b/node_modules/@types/node/globals.global.d.ts deleted file mode 100644 index d66acba..0000000 --- a/node_modules/@types/node/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: NodeJS.Global & typeof globalThis; diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts deleted file mode 100644 index 0cfb456..0000000 --- a/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,412 +0,0 @@ -declare module "http" { - import * as stream from "stream"; - import { URL } from "url"; - import { Socket, Server as NetServer } from "net"; - - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - 'accept'?: string; - 'accept-language'?: string; - 'accept-patch'?: string; - 'accept-ranges'?: string; - 'access-control-allow-credentials'?: string; - 'access-control-allow-headers'?: string; - 'access-control-allow-methods'?: string; - 'access-control-allow-origin'?: string; - 'access-control-expose-headers'?: string; - 'access-control-max-age'?: string; - 'access-control-request-headers'?: string; - 'access-control-request-method'?: string; - 'age'?: string; - 'allow'?: string; - 'alt-svc'?: string; - 'authorization'?: string; - 'cache-control'?: string; - 'connection'?: string; - 'content-disposition'?: string; - 'content-encoding'?: string; - 'content-language'?: string; - 'content-length'?: string; - 'content-location'?: string; - 'content-range'?: string; - 'content-type'?: string; - 'cookie'?: string; - 'date'?: string; - 'expect'?: string; - 'expires'?: string; - 'forwarded'?: string; - 'from'?: string; - 'host'?: string; - 'if-match'?: string; - 'if-modified-since'?: string; - 'if-none-match'?: string; - 'if-unmodified-since'?: string; - 'last-modified'?: string; - 'location'?: string; - 'origin'?: string; - 'pragma'?: string; - 'proxy-authenticate'?: string; - 'proxy-authorization'?: string; - 'public-key-pins'?: string; - 'range'?: string; - 'referer'?: string; - 'retry-after'?: string; - 'set-cookie'?: string[]; - 'strict-transport-security'?: string; - 'tk'?: string; - 'trailer'?: string; - 'transfer-encoding'?: string; - 'upgrade'?: string; - 'user-agent'?: string; - 'vary'?: string; - 'via'?: string; - 'warning'?: string; - 'www-authenticate'?: string; - } - - // outgoing headers allows numbers (as they are converted internally to strings) - interface OutgoingHttpHeaders extends NodeJS.Dict { - } - - interface ClientRequestArgs { - protocol?: string | null; - host?: string | null; - hostname?: string | null; - family?: number; - port?: number | string | null; - defaultPort?: number | string; - localAddress?: string; - socketPath?: string; - /** - * @default 8192 - */ - maxHeaderSize?: number; - method?: string; - path?: string | null; - headers?: OutgoingHttpHeaders; - auth?: string | null; - agent?: Agent | boolean; - _defaultAgent?: Agent; - timeout?: number; - setHost?: boolean; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket; - } - - interface ServerOptions { - IncomingMessage?: typeof IncomingMessage; - ServerResponse?: typeof ServerResponse; - /** - * Optionally overrides the value of - * [`--max-http-header-size`][] for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 8192 - */ - maxHeaderSize?: number; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when true. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean; - } - - type RequestListener = (req: IncomingMessage, res: ServerResponse) => void; - - interface HttpBase { - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @default 2000 - * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount} - */ - maxHeadersCount: number | null; - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP headers. - * @default 60000 - * {@link https://nodejs.org/api/http.html#http_server_headerstimeout} - */ - headersTimeout: number; - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from the client. - * @default 0 - * {@link https://nodejs.org/api/http.html#http_server_requesttimeout} - */ - requestTimeout: number; - } - - interface Server extends HttpBase {} - class Server extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - } - - // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js - class OutgoingMessage extends stream.Writable { - upgrading: boolean; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - headersSent: boolean; - /** - * @deprecate Use `socket` instead. - */ - connection: Socket | null; - socket: Socket | null; - - constructor(); - - setTimeout(msecs: number, callback?: () => void): this; - setHeader(name: string, value: number | string | string[]): void; - getHeader(name: string): number | string | string[] | undefined; - getHeaders(): OutgoingHttpHeaders; - getHeaderNames(): string[]; - hasHeader(name: string): boolean; - removeHeader(name: string): void; - addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void; - flushHeaders(): void; - } - - // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256 - class ServerResponse extends OutgoingMessage { - statusCode: number; - statusMessage: string; - - constructor(req: IncomingMessage); - - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53 - // no args in writeContinue callback - writeContinue(callback?: () => void): void; - writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeProcessing(): void; - } - - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 - class ClientRequest extends OutgoingMessage { - aborted: number; - - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - - method: string; - path: string; - abort(): void; - onSocket(socket: Socket): void; - setTimeout(timeout: number, callback?: () => void): this; - setNoDelay(noDelay?: boolean): void; - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - - addListener(event: 'abort', listener: () => void): this; - addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - addListener(event: 'continue', listener: () => void): this; - addListener(event: 'information', listener: (info: InformationEvent) => void): this; - addListener(event: 'response', listener: (response: IncomingMessage) => void): this; - addListener(event: 'socket', listener: (socket: Socket) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'drain', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'finish', listener: () => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - on(event: 'abort', listener: () => void): this; - on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'continue', listener: () => void): this; - on(event: 'information', listener: (info: InformationEvent) => void): this; - on(event: 'response', listener: (response: IncomingMessage) => void): this; - on(event: 'socket', listener: (socket: Socket) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'drain', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'finish', listener: () => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: 'abort', listener: () => void): this; - once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'continue', listener: () => void): this; - once(event: 'information', listener: (info: InformationEvent) => void): this; - once(event: 'response', listener: (response: IncomingMessage) => void): this; - once(event: 'socket', listener: (socket: Socket) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'drain', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: 'abort', listener: () => void): this; - prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependListener(event: 'continue', listener: () => void): this; - prependListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependListener(event: 'socket', listener: (socket: Socket) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'drain', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: 'abort', listener: () => void): this; - prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependOnceListener(event: 'continue', listener: () => void): this; - prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'drain', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - - aborted: boolean; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - complete: boolean; - /** - * @deprecate Use `socket` instead. - */ - connection: Socket; - socket: Socket; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - trailers: NodeJS.Dict; - rawTrailers: string[]; - setTimeout(msecs: number, callback?: () => void): this; - /** - * Only valid for request obtained from http.Server. - */ - method?: string; - /** - * Only valid for request obtained from http.Server. - */ - url?: string; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusCode?: number; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusMessage?: string; - destroy(error?: Error): void; - } - - interface AgentOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number; - /** - * Scheduling strategy to apply when picking the next free socket to use. Default: 'fifo'. - */ - scheduling?: 'fifo' | 'lifo'; - } - - class Agent { - maxFreeSockets: number; - maxSockets: number; - readonly freeSockets: NodeJS.ReadOnlyDict; - readonly sockets: NodeJS.ReadOnlyDict; - readonly requests: NodeJS.ReadOnlyDict; - - constructor(opts?: AgentOptions); - - /** - * Destroy any sockets that are currently in use by the agent. - * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, - * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, - * sockets may hang open for quite a long time before the server terminates them. - */ - destroy(): void; - } - - const METHODS: string[]; - - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - - function createServer(requestListener?: RequestListener): Server; - function createServer(options: ServerOptions, requestListener?: RequestListener): Server; - - // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, - // create interface RequestOptions would make the naming more clear to developers - interface RequestOptions extends ClientRequestArgs { } - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - let globalAgent: Agent; - - /** - * Read-only property specifying the maximum allowed size of HTTP headers in bytes. - * Defaults to 16KB. Configurable using the [`--max-http-header-size`][] CLI option. - */ - const maxHeaderSize: number; -} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts deleted file mode 100644 index e2a5ef4..0000000 --- a/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,952 +0,0 @@ -declare module "http2" { - import * as events from "events"; - import * as fs from "fs"; - import * as net from "net"; - import * as stream from "stream"; - import * as tls from "tls"; - import * as url from "url"; - - import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from "http"; - export { OutgoingHttpHeaders } from "http"; - - export interface IncomingHttpStatusHeader { - ":status"?: number; - } - - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ":path"?: string; - ":method"?: string; - ":authority"?: string; - ":scheme"?: string; - } - - // Http2Stream - - export interface StreamPriorityOptions { - exclusive?: boolean; - parent?: number; - weight?: number; - silent?: boolean; - } - - export interface StreamState { - localWindowSize?: number; - state?: number; - localClose?: number; - remoteClose?: number; - sumDependencyWeight?: number; - weight?: number; - } - - export interface ServerStreamResponseOptions { - endStream?: boolean; - waitForTrailers?: boolean; - } - - export interface StatOptions { - offset: number; - length: number; - } - - export interface ServerStreamFileResponseOptions { - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean; - offset?: number; - length?: number; - } - - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - - export interface Http2Stream extends stream.Duplex { - readonly aborted: boolean; - readonly bufferSize: number; - readonly closed: boolean; - readonly destroyed: boolean; - /** - * Set the true if the END_STREAM flag was set in the request or response HEADERS frame received, - * indicating that no additional data should be received and the readable side of the Http2Stream will be closed. - */ - readonly endAfterHeaders: boolean; - readonly id?: number; - readonly pending: boolean; - readonly rstCode: number; - readonly sentHeaders: OutgoingHttpHeaders; - readonly sentInfoHeaders?: OutgoingHttpHeaders[]; - readonly sentTrailers?: OutgoingHttpHeaders; - readonly session: Http2Session; - readonly state: StreamState; - - close(code?: number, callback?: () => void): void; - priority(options: StreamPriorityOptions): void; - setTimeout(msecs: number, callback?: () => void): void; - sendTrailers(headers: OutgoingHttpHeaders): void; - - addListener(event: "aborted", listener: () => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: "streamClosed", listener: (code: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "wantTrailers", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "aborted"): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "frameError", frameType: number, errorCode: number): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: "streamClosed", code: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "wantTrailers"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "aborted", listener: () => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: "streamClosed", listener: (code: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "wantTrailers", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "aborted", listener: () => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: "streamClosed", listener: (code: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "wantTrailers", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "aborted", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "streamClosed", listener: (code: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "wantTrailers", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "aborted", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "wantTrailers", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - export interface ClientHttp2Stream extends Http2Stream { - addListener(event: "continue", listener: () => {}): this; - addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "continue"): boolean; - emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "continue", listener: () => {}): this; - on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "continue", listener: () => {}): this; - once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "continue", listener: () => {}): this; - prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "continue", listener: () => {}): this; - prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - export interface ServerHttp2Stream extends Http2Stream { - readonly headersSent: boolean; - readonly pushAllowed: boolean; - additionalHeaders(headers: OutgoingHttpHeaders): void; - pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; - respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; - } - - // Http2Session - - export interface Settings { - headerTableSize?: number; - enablePush?: boolean; - initialWindowSize?: number; - maxFrameSize?: number; - maxConcurrentStreams?: number; - maxHeaderListSize?: number; - enableConnectProtocol?: boolean; - } - - export interface ClientSessionRequestOptions { - endStream?: boolean; - exclusive?: boolean; - parent?: number; - weight?: number; - waitForTrailers?: boolean; - } - - export interface SessionState { - effectiveLocalWindowSize?: number; - effectiveRecvDataLength?: number; - nextStreamID?: number; - localWindowSize?: number; - lastProcStreamID?: number; - remoteWindowSize?: number; - outboundQueueSize?: number; - deflateDynamicTableSize?: number; - inflateDynamicTableSize?: number; - } - - export interface Http2Session extends events.EventEmitter { - readonly alpnProtocol?: string; - readonly closed: boolean; - readonly connecting: boolean; - readonly destroyed: boolean; - readonly encrypted?: boolean; - readonly localSettings: Settings; - readonly originSet?: string[]; - readonly pendingSettingsAck: boolean; - readonly remoteSettings: Settings; - readonly socket: net.Socket | tls.TLSSocket; - readonly state: SessionState; - readonly type: number; - - close(callback?: () => void): void; - destroy(error?: Error, code?: number): void; - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ref(): void; - setTimeout(msecs: number, callback?: () => void): void; - settings(settings: Settings): void; - unref(): void; - - addListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - addListener(event: "localSettings", listener: (settings: Settings) => void): this; - addListener(event: "ping", listener: () => void): this; - addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "close"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; - emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; - emit(event: "localSettings", settings: Settings): boolean; - emit(event: "ping"): boolean; - emit(event: "remoteSettings", settings: Settings): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "close", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - on(event: "localSettings", listener: (settings: Settings) => void): this; - on(event: "ping", listener: () => void): this; - on(event: "remoteSettings", listener: (settings: Settings) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - once(event: "localSettings", listener: (settings: Settings) => void): this; - once(event: "ping", listener: () => void): this; - once(event: "remoteSettings", listener: (settings: Settings) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependListener(event: "ping", listener: () => void): this; - prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; - prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; - prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "ping", listener: () => void): this; - prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - export interface ClientHttp2Session extends Http2Session { - request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; - - addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - addListener(event: "origin", listener: (origins: string[]) => void): this; - addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; - emit(event: "origin", origins: string[]): boolean; - emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - on(event: "origin", listener: (origins: string[]) => void): this; - on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - once(event: "origin", listener: (origins: string[]) => void): this; - once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependListener(event: "origin", listener: (origins: string[]) => void): this; - prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; - prependOnceListener(event: "origin", listener: (origins: string[]) => void): this; - prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - export interface AlternativeServiceOptions { - origin: number | string | url.URL; - } - - export interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - origin(...args: Array): void; - - addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; - prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - // Http2Server - - export interface SessionOptions { - maxDeflateDynamicTableSize?: number; - maxSessionMemory?: number; - maxHeaderListPairs?: number; - maxOutstandingPings?: number; - maxSendHeaderBlockLength?: number; - paddingStrategy?: number; - peerMaxConcurrentStreams?: number; - settings?: Settings; - - selectPadding?(frameLen: number, maxFrameLen: number): number; - createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; - } - - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number; - createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex; - protocol?: 'http:' | 'https:'; - } - - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage; - Http1ServerResponse?: typeof ServerResponse; - Http2ServerRequest?: typeof Http2ServerRequest; - Http2ServerResponse?: typeof Http2ServerResponse; - } - - export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } - export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } - - export interface ServerOptions extends ServerSessionOptions { } - - export interface SecureServerOptions extends SecureServerSessionOptions { - allowHTTP1?: boolean; - origins?: string[]; - } - - export interface Http2Server extends net.Server { - addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - - setTimeout(msec?: number, callback?: () => void): this; - } - - export interface Http2SecureServer extends tls.Server { - addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - addListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - addListener(event: "sessionError", listener: (err: Error) => void): this; - addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - addListener(event: "timeout", listener: () => void): this; - addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; - emit(event: "session", session: ServerHttp2Session): boolean; - emit(event: "sessionError", err: Error): boolean; - emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; - emit(event: "timeout"): boolean; - emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - on(event: "session", listener: (session: ServerHttp2Session) => void): this; - on(event: "sessionError", listener: (err: Error) => void): this; - on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - on(event: "timeout", listener: () => void): this; - on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - once(event: "session", listener: (session: ServerHttp2Session) => void): this; - once(event: "sessionError", listener: (err: Error) => void): this; - once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - once(event: "timeout", listener: () => void): this; - once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependListener(event: "sessionError", listener: (err: Error) => void): this; - prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependListener(event: "timeout", listener: () => void): this; - prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; - prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this; - prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; - prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - - setTimeout(msec?: number, callback?: () => void): this; - } - - export class Http2ServerRequest extends stream.Readable { - constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: string[]); - - readonly aborted: boolean; - readonly authority: string; - readonly connection: net.Socket | tls.TLSSocket; - readonly complete: boolean; - readonly headers: IncomingHttpHeaders; - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - readonly method: string; - readonly rawHeaders: string[]; - readonly rawTrailers: string[]; - readonly scheme: string; - readonly socket: net.Socket | tls.TLSSocket; - readonly stream: ServerHttp2Stream; - readonly trailers: IncomingHttpHeaders; - readonly url: string; - - setTimeout(msecs: number, callback?: () => void): void; - read(size?: number): Buffer | string | null; - - addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: Buffer | string) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "aborted", hadError: boolean, code: number): boolean; - emit(event: "close"): boolean; - emit(event: "data", chunk: Buffer | string): boolean; - emit(event: "end"): boolean; - emit(event: "readable"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: Buffer | string) => void): this; - on(event: "end", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: Buffer | string) => void): this; - once(event: "end", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - export class Http2ServerResponse extends stream.Stream { - constructor(stream: ServerHttp2Stream); - - readonly connection: net.Socket | tls.TLSSocket; - readonly finished: boolean; - readonly headersSent: boolean; - readonly socket: net.Socket | tls.TLSSocket; - readonly stream: ServerHttp2Stream; - sendDate: boolean; - statusCode: number; - statusMessage: ''; - addTrailers(trailers: OutgoingHttpHeaders): void; - end(callback?: () => void): void; - end(data: string | Uint8Array, callback?: () => void): void; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): void; - getHeader(name: string): string; - getHeaderNames(): string[]; - getHeaders(): OutgoingHttpHeaders; - hasHeader(name: string): boolean; - removeHeader(name: string): void; - setHeader(name: string, value: number | string | string[]): void; - setTimeout(msecs: number, callback?: () => void): void; - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - writeContinue(): void; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; - - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (error: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: stream.Readable) => void): this; - addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", error: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: stream.Readable): boolean; - emit(event: "unpipe", src: stream.Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (error: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: stream.Readable) => void): this; - on(event: "unpipe", listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (error: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: stream.Readable) => void): this; - once(event: "unpipe", listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (error: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (error: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - // Public API - - export namespace constants { - const NGHTTP2_SESSION_SERVER: number; - const NGHTTP2_SESSION_CLIENT: number; - const NGHTTP2_STREAM_STATE_IDLE: number; - const NGHTTP2_STREAM_STATE_OPEN: number; - const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; - const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; - const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; - const NGHTTP2_STREAM_STATE_CLOSED: number; - const NGHTTP2_NO_ERROR: number; - const NGHTTP2_PROTOCOL_ERROR: number; - const NGHTTP2_INTERNAL_ERROR: number; - const NGHTTP2_FLOW_CONTROL_ERROR: number; - const NGHTTP2_SETTINGS_TIMEOUT: number; - const NGHTTP2_STREAM_CLOSED: number; - const NGHTTP2_FRAME_SIZE_ERROR: number; - const NGHTTP2_REFUSED_STREAM: number; - const NGHTTP2_CANCEL: number; - const NGHTTP2_COMPRESSION_ERROR: number; - const NGHTTP2_CONNECT_ERROR: number; - const NGHTTP2_ENHANCE_YOUR_CALM: number; - const NGHTTP2_INADEQUATE_SECURITY: number; - const NGHTTP2_HTTP_1_1_REQUIRED: number; - const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; - const NGHTTP2_FLAG_NONE: number; - const NGHTTP2_FLAG_END_STREAM: number; - const NGHTTP2_FLAG_END_HEADERS: number; - const NGHTTP2_FLAG_ACK: number; - const NGHTTP2_FLAG_PADDED: number; - const NGHTTP2_FLAG_PRIORITY: number; - const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; - const DEFAULT_SETTINGS_ENABLE_PUSH: number; - const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; - const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; - const MAX_MAX_FRAME_SIZE: number; - const MIN_MAX_FRAME_SIZE: number; - const MAX_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_DEFAULT_WEIGHT: number; - const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; - const NGHTTP2_SETTINGS_ENABLE_PUSH: number; - const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; - const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; - const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; - const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; - const PADDING_STRATEGY_NONE: number; - const PADDING_STRATEGY_MAX: number; - const PADDING_STRATEGY_CALLBACK: number; - const HTTP2_HEADER_STATUS: string; - const HTTP2_HEADER_METHOD: string; - const HTTP2_HEADER_AUTHORITY: string; - const HTTP2_HEADER_SCHEME: string; - const HTTP2_HEADER_PATH: string; - const HTTP2_HEADER_ACCEPT_CHARSET: string; - const HTTP2_HEADER_ACCEPT_ENCODING: string; - const HTTP2_HEADER_ACCEPT_LANGUAGE: string; - const HTTP2_HEADER_ACCEPT_RANGES: string; - const HTTP2_HEADER_ACCEPT: string; - const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; - const HTTP2_HEADER_AGE: string; - const HTTP2_HEADER_ALLOW: string; - const HTTP2_HEADER_AUTHORIZATION: string; - const HTTP2_HEADER_CACHE_CONTROL: string; - const HTTP2_HEADER_CONNECTION: string; - const HTTP2_HEADER_CONTENT_DISPOSITION: string; - const HTTP2_HEADER_CONTENT_ENCODING: string; - const HTTP2_HEADER_CONTENT_LANGUAGE: string; - const HTTP2_HEADER_CONTENT_LENGTH: string; - const HTTP2_HEADER_CONTENT_LOCATION: string; - const HTTP2_HEADER_CONTENT_MD5: string; - const HTTP2_HEADER_CONTENT_RANGE: string; - const HTTP2_HEADER_CONTENT_TYPE: string; - const HTTP2_HEADER_COOKIE: string; - const HTTP2_HEADER_DATE: string; - const HTTP2_HEADER_ETAG: string; - const HTTP2_HEADER_EXPECT: string; - const HTTP2_HEADER_EXPIRES: string; - const HTTP2_HEADER_FROM: string; - const HTTP2_HEADER_HOST: string; - const HTTP2_HEADER_IF_MATCH: string; - const HTTP2_HEADER_IF_MODIFIED_SINCE: string; - const HTTP2_HEADER_IF_NONE_MATCH: string; - const HTTP2_HEADER_IF_RANGE: string; - const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; - const HTTP2_HEADER_LAST_MODIFIED: string; - const HTTP2_HEADER_LINK: string; - const HTTP2_HEADER_LOCATION: string; - const HTTP2_HEADER_MAX_FORWARDS: string; - const HTTP2_HEADER_PREFER: string; - const HTTP2_HEADER_PROXY_AUTHENTICATE: string; - const HTTP2_HEADER_PROXY_AUTHORIZATION: string; - const HTTP2_HEADER_RANGE: string; - const HTTP2_HEADER_REFERER: string; - const HTTP2_HEADER_REFRESH: string; - const HTTP2_HEADER_RETRY_AFTER: string; - const HTTP2_HEADER_SERVER: string; - const HTTP2_HEADER_SET_COOKIE: string; - const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; - const HTTP2_HEADER_TRANSFER_ENCODING: string; - const HTTP2_HEADER_TE: string; - const HTTP2_HEADER_UPGRADE: string; - const HTTP2_HEADER_USER_AGENT: string; - const HTTP2_HEADER_VARY: string; - const HTTP2_HEADER_VIA: string; - const HTTP2_HEADER_WWW_AUTHENTICATE: string; - const HTTP2_HEADER_HTTP2_SETTINGS: string; - const HTTP2_HEADER_KEEP_ALIVE: string; - const HTTP2_HEADER_PROXY_CONNECTION: string; - const HTTP2_METHOD_ACL: string; - const HTTP2_METHOD_BASELINE_CONTROL: string; - const HTTP2_METHOD_BIND: string; - const HTTP2_METHOD_CHECKIN: string; - const HTTP2_METHOD_CHECKOUT: string; - const HTTP2_METHOD_CONNECT: string; - const HTTP2_METHOD_COPY: string; - const HTTP2_METHOD_DELETE: string; - const HTTP2_METHOD_GET: string; - const HTTP2_METHOD_HEAD: string; - const HTTP2_METHOD_LABEL: string; - const HTTP2_METHOD_LINK: string; - const HTTP2_METHOD_LOCK: string; - const HTTP2_METHOD_MERGE: string; - const HTTP2_METHOD_MKACTIVITY: string; - const HTTP2_METHOD_MKCALENDAR: string; - const HTTP2_METHOD_MKCOL: string; - const HTTP2_METHOD_MKREDIRECTREF: string; - const HTTP2_METHOD_MKWORKSPACE: string; - const HTTP2_METHOD_MOVE: string; - const HTTP2_METHOD_OPTIONS: string; - const HTTP2_METHOD_ORDERPATCH: string; - const HTTP2_METHOD_PATCH: string; - const HTTP2_METHOD_POST: string; - const HTTP2_METHOD_PRI: string; - const HTTP2_METHOD_PROPFIND: string; - const HTTP2_METHOD_PROPPATCH: string; - const HTTP2_METHOD_PUT: string; - const HTTP2_METHOD_REBIND: string; - const HTTP2_METHOD_REPORT: string; - const HTTP2_METHOD_SEARCH: string; - const HTTP2_METHOD_TRACE: string; - const HTTP2_METHOD_UNBIND: string; - const HTTP2_METHOD_UNCHECKOUT: string; - const HTTP2_METHOD_UNLINK: string; - const HTTP2_METHOD_UNLOCK: string; - const HTTP2_METHOD_UPDATE: string; - const HTTP2_METHOD_UPDATEREDIRECTREF: string; - const HTTP2_METHOD_VERSION_CONTROL: string; - const HTTP_STATUS_CONTINUE: number; - const HTTP_STATUS_SWITCHING_PROTOCOLS: number; - const HTTP_STATUS_PROCESSING: number; - const HTTP_STATUS_OK: number; - const HTTP_STATUS_CREATED: number; - const HTTP_STATUS_ACCEPTED: number; - const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; - const HTTP_STATUS_NO_CONTENT: number; - const HTTP_STATUS_RESET_CONTENT: number; - const HTTP_STATUS_PARTIAL_CONTENT: number; - const HTTP_STATUS_MULTI_STATUS: number; - const HTTP_STATUS_ALREADY_REPORTED: number; - const HTTP_STATUS_IM_USED: number; - const HTTP_STATUS_MULTIPLE_CHOICES: number; - const HTTP_STATUS_MOVED_PERMANENTLY: number; - const HTTP_STATUS_FOUND: number; - const HTTP_STATUS_SEE_OTHER: number; - const HTTP_STATUS_NOT_MODIFIED: number; - const HTTP_STATUS_USE_PROXY: number; - const HTTP_STATUS_TEMPORARY_REDIRECT: number; - const HTTP_STATUS_PERMANENT_REDIRECT: number; - const HTTP_STATUS_BAD_REQUEST: number; - const HTTP_STATUS_UNAUTHORIZED: number; - const HTTP_STATUS_PAYMENT_REQUIRED: number; - const HTTP_STATUS_FORBIDDEN: number; - const HTTP_STATUS_NOT_FOUND: number; - const HTTP_STATUS_METHOD_NOT_ALLOWED: number; - const HTTP_STATUS_NOT_ACCEPTABLE: number; - const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; - const HTTP_STATUS_REQUEST_TIMEOUT: number; - const HTTP_STATUS_CONFLICT: number; - const HTTP_STATUS_GONE: number; - const HTTP_STATUS_LENGTH_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_FAILED: number; - const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; - const HTTP_STATUS_URI_TOO_LONG: number; - const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; - const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; - const HTTP_STATUS_EXPECTATION_FAILED: number; - const HTTP_STATUS_TEAPOT: number; - const HTTP_STATUS_MISDIRECTED_REQUEST: number; - const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; - const HTTP_STATUS_LOCKED: number; - const HTTP_STATUS_FAILED_DEPENDENCY: number; - const HTTP_STATUS_UNORDERED_COLLECTION: number; - const HTTP_STATUS_UPGRADE_REQUIRED: number; - const HTTP_STATUS_PRECONDITION_REQUIRED: number; - const HTTP_STATUS_TOO_MANY_REQUESTS: number; - const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; - const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; - const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; - const HTTP_STATUS_NOT_IMPLEMENTED: number; - const HTTP_STATUS_BAD_GATEWAY: number; - const HTTP_STATUS_SERVICE_UNAVAILABLE: number; - const HTTP_STATUS_GATEWAY_TIMEOUT: number; - const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; - const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; - const HTTP_STATUS_INSUFFICIENT_STORAGE: number; - const HTTP_STATUS_LOOP_DETECTED: number; - const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; - const HTTP_STATUS_NOT_EXTENDED: number; - const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; - } - - export function getDefaultSettings(): Settings; - export function getPackedSettings(settings: Settings): Buffer; - export function getUnpackedSettings(buf: Uint8Array): Settings; - - export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - - export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - - export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; - export function connect( - authority: string | url.URL, - options?: ClientSessionOptions | SecureClientSessionOptions, - listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void - ): ClientHttp2Session; -} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts deleted file mode 100644 index 24326c9..0000000 --- a/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare module "https" { - import * as tls from "tls"; - import * as events from "events"; - import * as http from "http"; - import { URL } from "url"; - - type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - - type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { - rejectUnauthorized?: boolean; // Defaults to true - servername?: string; // SNI TLS Extension - }; - - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean; - maxCachedSessions?: number; - } - - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - - interface Server extends http.HttpBase {} - class Server extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor(options: ServerOptions, requestListener?: http.RequestListener); - } - - function createServer(requestListener?: http.RequestListener): Server; - function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server; - function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; - let globalAgent: Agent; -} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts deleted file mode 100644 index e65d170..0000000 --- a/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Type definitions for non-npm package Node.js 14.11 -// Project: http://nodejs.org/ -// Definitions by: Microsoft TypeScript -// DefinitelyTyped -// Alberto Schiabel -// Alexander T. -// Alvis HT Tang -// Andrew Makarov -// Benjamin Toueg -// Bruno Scheufler -// Chigozirim C. -// David Junger -// Deividas Bakanas -// Eugene Y. Q. Shen -// Flarna -// Hannes Magnusson -// Hoàng Văn Khải -// Huw -// Kelvin Jin -// Klaus Meinhardt -// Lishude -// Mariusz Wiktorczyk -// Mohsen Azimi -// Nicolas Even -// Nikita Galkin -// Parambir Singh -// Sebastian Silbermann -// Simon Schick -// Thomas den Hollander -// Wilco Bakker -// wwwy3y3 -// Samuel Ainsworth -// Kyle Uehlein -// Jordi Oliveras Rovira -// Thanik Bhongbhibhat -// Marcin Kopacz -// Trivikram Kamat -// Minh Son Nguyen -// Junxiao Shi -// Ilia Baryshnikov -// ExE Boss -// Surasak Chaisurin -// Piotr Błażejewicz -// Anna Henningsen -// Jason Kwok -// Victor Perin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// NOTE: These definitions support NodeJS and TypeScript 3.7. -// Typically type modifications should be made in base.d.ts instead of here - -/// - -// NOTE: TypeScript version-specific augmentations can be found in the following paths: -// - ~/base.d.ts - Shared definitions common to all TypeScript versions -// - ~/index.d.ts - Definitions specific to TypeScript 2.8 -// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5 - -// NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides -// within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions -// prior to TypeScript 3.5, so the older definitions will be found here. diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts deleted file mode 100644 index 1c57734..0000000 --- a/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,3041 +0,0 @@ -// tslint:disable-next-line:dt-header -// Type definitions for inspector - -// These definitions are auto-generated. -// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 -// for more information. - -// tslint:disable:max-line-length - -/** - * The inspector module provides an API for interacting with the V8 inspector. - */ -declare module "inspector" { - import { EventEmitter } from 'events'; - - interface InspectorNotification { - method: string; - params: T; - } - - namespace Schema { - /** - * Description of the protocol domain. - */ - interface Domain { - /** - * Domain name. - */ - name: string; - /** - * Domain version. - */ - version: string; - } - - interface GetDomainsReturnType { - /** - * List of supported domains. - */ - domains: Domain[]; - } - } - - namespace Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - - /** - * Primitive value which cannot be JSON-stringified. - */ - type UnserializableValue = string; - - /** - * Mirror object referencing original JavaScript object. - */ - interface RemoteObject { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string; - /** - * Remote object value in case of primitive values or JSON values (if it was requested). - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified does not have value, but gets this property. - */ - unserializableValue?: UnserializableValue; - /** - * String representation of the object. - */ - description?: string; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview; - /** - * @experimental - */ - customPreview?: CustomPreview; - } - - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId; - } - - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string; - /** - * String representation of the object. - */ - description?: string; - /** - * True iff some of the properties or entries of the original object did not fit. - */ - overflow: boolean; - /** - * List of the properties. - */ - properties: PropertyPreview[]; - /** - * List of the entries. Specified for map and set subtype values only. - */ - entries?: EntryPreview[]; - } - - /** - * @experimental - */ - interface PropertyPreview { - /** - * Property name. - */ - name: string; - /** - * Object type. Accessor means that the property itself is an accessor property. - */ - type: string; - /** - * User-friendly property value string. - */ - value?: string; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string; - } - - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview; - /** - * Preview of the value. - */ - value: ObjectPreview; - } - - /** - * Object property descriptor. - */ - interface PropertyDescriptor { - /** - * Property name or symbol description. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject; - /** - * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. - */ - configurable: boolean; - /** - * True if this property shows up during enumeration of the properties on the corresponding object. - */ - enumerable: boolean; - /** - * True if the result was thrown during the evaluation. - */ - wasThrown?: boolean; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject; - } - - /** - * Object internal property descriptor. This property isn't normally visible in JavaScript code. - */ - interface InternalPropertyDescriptor { - /** - * Conventional property name. - */ - name: string; - /** - * The value associated with the property. - */ - value?: RemoteObject; - } - - /** - * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. - */ - interface CallArgument { - /** - * Primitive value or serializable javascript object. - */ - value?: any; - /** - * Primitive value which can not be JSON-stringified. - */ - unserializableValue?: UnserializableValue; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId; - } - - /** - * Id of an execution context. - */ - type ExecutionContextId = number; - - /** - * Description of an isolated world. - */ - interface ExecutionContextDescription { - /** - * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. - */ - id: ExecutionContextId; - /** - * Execution context origin. - */ - origin: string; - /** - * Human readable name describing given context. - */ - name: string; - /** - * Embedder-specific auxiliary data. - */ - auxData?: {}; - } - - /** - * Detailed information about exception (or error) that was thrown during script compilation or execution. - */ - interface ExceptionDetails { - /** - * Exception id. - */ - exceptionId: number; - /** - * Exception text, which should be used together with exception object when available. - */ - text: string; - /** - * Line number of the exception location (0-based). - */ - lineNumber: number; - /** - * Column number of the exception location (0-based). - */ - columnNumber: number; - /** - * Script ID of the exception location. - */ - scriptId?: ScriptId; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace; - /** - * Exception object if available. - */ - exception?: RemoteObject; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId; - } - - /** - * Number of milliseconds since epoch. - */ - type Timestamp = number; - - /** - * Stack entry for runtime errors and assertions. - */ - interface CallFrame { - /** - * JavaScript function name. - */ - functionName: string; - /** - * JavaScript script id. - */ - scriptId: ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * JavaScript script line number (0-based). - */ - lineNumber: number; - /** - * JavaScript script column number (0-based). - */ - columnNumber: number; - } - - /** - * Call frames for assertions or error messages. - */ - interface StackTrace { - /** - * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. - */ - description?: string; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId; - } - - /** - * Unique identifier of current debugger. - * @experimental - */ - type UniqueDebuggerId = string; - - /** - * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. - * @experimental - */ - interface StackTraceId { - id: string; - debuggerId?: UniqueDebuggerId; - } - - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - contextId?: ExecutionContextId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean; - } - - interface AwaitPromiseParameterType { - /** - * Identifier of the promise. - */ - promiseObjectId: RemoteObjectId; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean; - } - - interface CallFunctionOnParameterType { - /** - * Declaration of the function to call. - */ - functionDeclaration: string; - /** - * Identifier of the object to call function on. Either objectId or executionContextId should be specified. - */ - objectId?: RemoteObjectId; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[]; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId; - /** - * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. - */ - objectGroup?: string; - } - - interface GetPropertiesParameterType { - /** - * Identifier of the object to return properties for. - */ - objectId: RemoteObjectId; - /** - * If true, returns properties belonging only to the element itself, not to its prototype chain. - */ - ownProperties?: boolean; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean; - } - - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - - interface CompileScriptParameterType { - /** - * Expression to compile. - */ - expression: string; - /** - * Source url to be set for the script. - */ - sourceURL: string; - /** - * Specifies whether the compiled script should be persisted. - */ - persistScript: boolean; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId; - } - - interface RunScriptParameterType { - /** - * Id of the script to run. - */ - scriptId: ScriptId; - /** - * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. - */ - executionContextId?: ExecutionContextId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean; - } - - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId; - } - - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails; - } - - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails; - } - - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails; - } - - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[]; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails; - } - - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails; - } - - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails; - } - - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - - interface ConsoleAPICalledEventDataType { - /** - * Type of the call. - */ - type: string; - /** - * Call arguments. - */ - args: RemoteObject[]; - /** - * Identifier of the context where the call was made. - */ - executionContextId: ExecutionContextId; - /** - * Call timestamp. - */ - timestamp: Timestamp; - /** - * Stack trace captured when the call was made. - */ - stackTrace?: StackTrace; - /** - * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. - * @experimental - */ - context?: string; - } - - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - - namespace Debugger { - /** - * Breakpoint identifier. - */ - type BreakpointId = string; - - /** - * Call frame identifier. - */ - type CallFrameId = string; - - /** - * Location in the source code. - */ - interface Location { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number; - } - - /** - * Location in the source code. - * @experimental - */ - interface ScriptPosition { - lineNumber: number; - columnNumber: number; - } - - /** - * JavaScript call frame. Array of call frames form the call stack. - */ - interface CallFrame { - /** - * Call frame identifier. This identifier is only valid while the virtual machine is paused. - */ - callFrameId: CallFrameId; - /** - * Name of the JavaScript function called on this call frame. - */ - functionName: string; - /** - * Location in the source code. - */ - functionLocation?: Location; - /** - * Location in the source code. - */ - location: Location; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Scope chain for this call frame. - */ - scopeChain: Scope[]; - /** - * this object for this call frame. - */ - this: Runtime.RemoteObject; - /** - * The value being returned, if the function is at return point. - */ - returnValue?: Runtime.RemoteObject; - } - - /** - * Scope description. - */ - interface Scope { - /** - * Scope type. - */ - type: string; - /** - * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. - */ - object: Runtime.RemoteObject; - name?: string; - /** - * Location in the source code where scope starts - */ - startLocation?: Location; - /** - * Location in the source code where scope ends - */ - endLocation?: Location; - } - - /** - * Search match for resource. - */ - interface SearchMatch { - /** - * Line number in resource content. - */ - lineNumber: number; - /** - * Line with match content. - */ - lineContent: string; - } - - interface BreakLocation { - /** - * Script identifier as reported in the Debugger.scriptParsed. - */ - scriptId: Runtime.ScriptId; - /** - * Line number in the script (0-based). - */ - lineNumber: number; - /** - * Column number in the script (0-based). - */ - columnNumber?: number; - type?: string; - } - - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string; - } - - interface SetBreakpointParameterType { - /** - * Location to set breakpoint in. - */ - location: Location; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string; - } - - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - - interface GetPossibleBreakpointsParameterType { - /** - * Start of range to search possible breakpoint locations in. - */ - start: Location; - /** - * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. - */ - end?: Location; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean; - } - - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string; - } - - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean; - } - - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - - interface SearchInContentParameterType { - /** - * Id of the script to search in. - */ - scriptId: Runtime.ScriptId; - /** - * String to search for. - */ - query: string; - /** - * If true, search is case sensitive. - */ - caseSensitive?: boolean; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean; - } - - interface SetScriptSourceParameterType { - /** - * Id of the script to edit. - */ - scriptId: Runtime.ScriptId; - /** - * New content of the script. - */ - scriptSource: string; - /** - * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. - */ - dryRun?: boolean; - } - - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: string; - } - - interface EvaluateOnCallFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - /** - * Expression to evaluate. - */ - expression: string; - /** - * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). - */ - objectGroup?: string; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean; - } - - interface SetVariableValueParameterType { - /** - * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. - */ - scopeNumber: number; - /** - * Variable name. - */ - variableName: string; - /** - * New variable value. - */ - newValue: Runtime.CallArgument; - /** - * Id of callframe that holds variable. - */ - callFrameId: CallFrameId; - } - - interface SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - - interface SetAsyncCallStackDepthParameterType { - /** - * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). - */ - maxDepth: number; - } - - interface SetBlackboxPatternsParameterType { - /** - * Array of regexps that will be used to check script url for blackbox state. - */ - patterns: string[]; - } - - interface SetBlackboxedRangesParameterType { - /** - * Id of the script. - */ - scriptId: Runtime.ScriptId; - positions: ScriptPosition[]; - } - - interface EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - - interface SetBreakpointByUrlReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * List of the locations this breakpoint resolved into upon addition. - */ - locations: Location[]; - } - - interface SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[]; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails; - } - - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId; - } - - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails; - } - - interface ScriptParsedEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {}; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean; - /** - * This script length. - */ - length?: number; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace; - } - - interface ScriptFailedToParseEventDataType { - /** - * Identifier of the script parsed. - */ - scriptId: Runtime.ScriptId; - /** - * URL or name of the script parsed (if any). - */ - url: string; - /** - * Line offset of the script within the resource with given URL (for script tags). - */ - startLine: number; - /** - * Column offset of the script within the resource with given URL. - */ - startColumn: number; - /** - * Last line of the script. - */ - endLine: number; - /** - * Length of the last line of the script. - */ - endColumn: number; - /** - * Specifies script creation context. - */ - executionContextId: Runtime.ExecutionContextId; - /** - * Content hash of the script. - */ - hash: string; - /** - * Embedder-specific auxiliary data. - */ - executionContextAuxData?: {}; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean; - /** - * This script length. - */ - length?: number; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace; - } - - interface BreakpointResolvedEventDataType { - /** - * Breakpoint unique identifier. - */ - breakpointId: BreakpointId; - /** - * Actual breakpoint location. - */ - location: Location; - } - - interface PausedEventDataType { - /** - * Call stack the virtual machine stopped on. - */ - callFrames: CallFrame[]; - /** - * Pause reason. - */ - reason: string; - /** - * Object containing break-specific auxiliary properties. - */ - data?: {}; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId; - /** - * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. - * @experimental - */ - asyncCallStackTraceId?: Runtime.StackTraceId; - } - } - - namespace Console { - /** - * Console message. - */ - interface ConsoleMessage { - /** - * Message source. - */ - source: string; - /** - * Message severity. - */ - level: string; - /** - * Message text. - */ - text: string; - /** - * URL of the message origin. - */ - url?: string; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number; - } - - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - - namespace Profiler { - /** - * Profile node. Holds callsite information, execution statistics and child nodes. - */ - interface ProfileNode { - /** - * Unique id of the node. - */ - id: number; - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Number of samples where this node was on top of the call stack. - */ - hitCount?: number; - /** - * Child node ids. - */ - children?: number[]; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[]; - } - - /** - * Profile. - */ - interface Profile { - /** - * The list of profile nodes. First item is the root node. - */ - nodes: ProfileNode[]; - /** - * Profiling start timestamp in microseconds. - */ - startTime: number; - /** - * Profiling end timestamp in microseconds. - */ - endTime: number; - /** - * Ids of samples top nodes. - */ - samples?: number[]; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[]; - } - - /** - * Specifies a number of samples attributed to a certain source position. - */ - interface PositionTickInfo { - /** - * Source line number (1-based). - */ - line: number; - /** - * Number of samples attributed to the source line. - */ - ticks: number; - } - - /** - * Coverage data for a source range. - */ - interface CoverageRange { - /** - * JavaScript script source offset for the range start. - */ - startOffset: number; - /** - * JavaScript script source offset for the range end. - */ - endOffset: number; - /** - * Collected execution count of the source range. - */ - count: number; - } - - /** - * Coverage data for a JavaScript function. - */ - interface FunctionCoverage { - /** - * JavaScript function name. - */ - functionName: string; - /** - * Source ranges inside the function with coverage data. - */ - ranges: CoverageRange[]; - /** - * Whether coverage data for this function has block granularity. - */ - isBlockCoverage: boolean; - } - - /** - * Coverage data for a JavaScript script. - */ - interface ScriptCoverage { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Functions contained in the script that has coverage data. - */ - functions: FunctionCoverage[]; - } - - /** - * Describes a type collected during runtime. - * @experimental - */ - interface TypeObject { - /** - * Name of a type collected with type profiling. - */ - name: string; - } - - /** - * Source offset and types for a parameter or return value. - * @experimental - */ - interface TypeProfileEntry { - /** - * Source offset of the parameter or end of function for return values. - */ - offset: number; - /** - * The types for this parameter or return value. - */ - types: TypeObject[]; - } - - /** - * Type profile data collected during runtime for a JavaScript script. - * @experimental - */ - interface ScriptTypeProfile { - /** - * JavaScript script id. - */ - scriptId: Runtime.ScriptId; - /** - * JavaScript script name or url. - */ - url: string; - /** - * Type profile entries for parameters and return values of the functions in the script. - */ - entries: TypeProfileEntry[]; - } - - interface SetSamplingIntervalParameterType { - /** - * New sampling interval in microseconds. - */ - interval: number; - } - - interface StartPreciseCoverageParameterType { - /** - * Collect accurate call counts beyond simple 'covered' or 'not covered'. - */ - callCount?: boolean; - /** - * Collect block-based coverage. - */ - detailed?: boolean; - } - - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string; - } - - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string; - } - } - - namespace HeapProfiler { - /** - * Heap snapshot object id. - */ - type HeapSnapshotObjectId = string; - - /** - * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. - */ - interface SamplingHeapProfileNode { - /** - * Function location. - */ - callFrame: Runtime.CallFrame; - /** - * Allocations size in bytes for the node excluding children. - */ - selfSize: number; - /** - * Child nodes. - */ - children: SamplingHeapProfileNode[]; - } - - /** - * Profile. - */ - interface SamplingHeapProfile { - head: SamplingHeapProfileNode; - } - - interface StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean; - } - - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean; - } - - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean; - } - - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string; - } - - interface AddInspectedHeapObjectParameterType { - /** - * Heap snapshot object id to be accessible by means of $x command line API. - */ - heapObjectId: HeapSnapshotObjectId; - } - - interface GetHeapObjectIdParameterType { - /** - * Identifier of the object to get heap object id for. - */ - objectId: Runtime.RemoteObjectId; - } - - interface StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number; - } - - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean; - } - - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - - interface HeapStatsUpdateEventDataType { - /** - * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. - */ - statsUpdate: number[]; - } - } - - namespace NodeTracing { - interface TraceConfig { - /** - * Controls how the trace buffer stores data. - */ - recordMode?: string; - /** - * Included category filters. - */ - includedCategories: string[]; - } - - interface StartParameterType { - traceConfig: TraceConfig; - } - - interface GetCategoriesReturnType { - /** - * A list of supported tracing categories. - */ - categories: string[]; - } - - interface DataCollectedEventDataType { - value: Array<{}>; - } - } - - namespace NodeWorker { - type WorkerID = string; - - /** - * Unique identifier of attached debugging session. - */ - type SessionID = string; - - interface WorkerInfo { - workerId: WorkerID; - type: string; - title: string; - url: string; - } - - interface SendMessageToWorkerParameterType { - message: string; - /** - * Identifier of the session. - */ - sessionId: SessionID; - } - - interface EnableParameterType { - /** - * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` - * message to run them. - */ - waitForDebuggerOnStart: boolean; - } - - interface DetachParameterType { - sessionId: SessionID; - } - - interface AttachedToWorkerEventDataType { - /** - * Identifier assigned to the session used to send/receive messages. - */ - sessionId: SessionID; - workerInfo: WorkerInfo; - waitingForDebugger: boolean; - } - - interface DetachedFromWorkerEventDataType { - /** - * Detached session identifier. - */ - sessionId: SessionID; - } - - interface ReceivedMessageFromWorkerEventDataType { - /** - * Identifier of a session which sends a message. - */ - sessionId: SessionID; - message: string; - } - } - - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - - /** - * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. - */ - class Session extends EventEmitter { - /** - * Create a new instance of the inspector.Session class. - * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. - */ - constructor(); - - /** - * Connects a session to the inspector back-end. - * An exception will be thrown if there is already a connected session established either - * through the API or by a front-end connected to the Inspector WebSocket port. - */ - connect(): void; - - /** - * Immediately close the session. All pending message callbacks will be called with an error. - * session.connect() will need to be called to be able to send messages again. - * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. - */ - disconnect(): void; - - /** - * Posts a message to the inspector back-end. callback will be notified when a response is received. - * callback is a function that accepts two optional arguments - error and message-specific result. - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - - /** - * Returns supported domains. - */ - post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; - - /** - * Evaluates expression on global object. - */ - post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; - - /** - * Add handler to promise with given promise object id. - */ - post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; - - /** - * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. - */ - post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; - - /** - * Returns properties of a given object. Object group of the result is inherited from the target object. - */ - post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; - - /** - * Releases remote object with given id. - */ - post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; - - /** - * Releases all remote objects that belong to a given group. - */ - post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; - - /** - * Tells inspected instance to run if it was waiting for debugger to attach. - */ - post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; - - /** - * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. - */ - post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables reporting of execution contexts creation. - */ - post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; - - /** - * Discards collected exceptions and console API calls. - */ - post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; - - /** - * @experimental - */ - post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; - - /** - * Compiles expression. - */ - post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; - - /** - * Runs script with given id in a given context. - */ - post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; - - post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; - - /** - * Returns all let, const and class variables from global scope. - */ - post( - method: "Runtime.globalLexicalScopeNames", - params?: Runtime.GlobalLexicalScopeNamesParameterType, - callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void - ): void; - post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; - - /** - * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. - */ - post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; - - /** - * Disables debugger for given page. - */ - post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; - - /** - * Activates / deactivates all breakpoints on the page. - */ - post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; - - /** - * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). - */ - post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; - - /** - * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. - */ - post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; - - /** - * Sets JavaScript breakpoint at a given location. - */ - post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; - - /** - * Removes JavaScript breakpoint. - */ - post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; - - /** - * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. - */ - post( - method: "Debugger.getPossibleBreakpoints", - params?: Debugger.GetPossibleBreakpointsParameterType, - callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void - ): void; - post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; - - /** - * Continues execution until specific location is reached. - */ - post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; - - /** - * @experimental - */ - post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void; - - /** - * Steps over the statement. - */ - post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; - - /** - * Steps into the function call. - */ - post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; - - /** - * Steps out of the function call. - */ - post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; - - /** - * Stops on the next JavaScript statement. - */ - post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; - - /** - * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. - * @experimental - */ - post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; - - /** - * Resumes JavaScript execution. - */ - post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; - - /** - * Returns stack trace with given stackTraceId. - * @experimental - */ - post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; - - /** - * Searches for given string in script content. - */ - post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; - - /** - * Edits JavaScript source live. - */ - post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; - - /** - * Restarts particular call frame from the beginning. - */ - post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; - - /** - * Returns source for the script with given id. - */ - post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; - - /** - * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. - */ - post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; - - /** - * Evaluates expression on a given call frame. - */ - post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; - - /** - * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. - */ - post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; - - /** - * Changes return value in top frame. Available only at return break position. - * @experimental - */ - post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void; - - /** - * Enables or disables async call stacks tracking. - */ - post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; - - /** - * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. - * @experimental - */ - post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; - - /** - * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. - * @experimental - */ - post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; - post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; - - /** - * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. - */ - post(method: "Console.enable", callback?: (err: Error | null) => void): void; - - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: "Console.disable", callback?: (err: Error | null) => void): void; - - /** - * Does nothing. - */ - post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; - - /** - * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. - */ - post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.start", callback?: (err: Error | null) => void): void; - - post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; - - /** - * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. - */ - post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; - post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; - - /** - * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. - */ - post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; - - /** - * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. - */ - post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; - - /** - * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. - */ - post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; - - /** - * Enable type profile. - * @experimental - */ - post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void; - - /** - * Disable type profile. Disabling releases type profile data collected so far. - * @experimental - */ - post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void; - - /** - * Collect type profile. - * @experimental - */ - post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - - post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; - - post( - method: "HeapProfiler.getObjectByHeapObjectId", - params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, - callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void - ): void; - post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; - - /** - * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). - */ - post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; - - post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; - - post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - - post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; - - /** - * Gets supported tracing categories. - */ - post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; - - /** - * Start trace events collection. - */ - post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; - post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void; - - /** - * Stop trace events collection. Remaining collected events will be sent as a sequence of - * dataCollected events followed by tracingComplete event. - */ - post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void; - - /** - * Sends protocol message over session with given id. - */ - post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; - post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void; - - /** - * Instructs the inspector to attach to running workers. Will also attach to new workers - * as they start - */ - post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; - post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void; - - /** - * Detaches from all running workers and disables attaching to new workers as they are started. - */ - post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void; - - /** - * Detached from the worker with given sessionId. - */ - post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void; - - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void; - - // Events - - addListener(event: string, listener: (...args: any[]) => void): this; - - /** - * Emitted when any notification from the V8 Inspector is received. - */ - addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; - - /** - * Issued when new execution context is created. - */ - addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine resumed execution. - */ - addListener(event: "Debugger.resumed", listener: () => void): this; - - /** - * Issued when new console message is added. - */ - addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; - - /** - * Sent when new profile recording is started using console.profile() call. - */ - addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - - addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; - - /** - * Contains an bucket of collected trace events. - */ - addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; - - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - addListener(event: "NodeTracing.tracingComplete", listener: () => void): this; - - /** - * Issued when attached to a worker. - */ - addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when detached from the worker. - */ - addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; - emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; - emit(event: "Runtime.executionContextsCleared"): boolean; - emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; - emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; - emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; - emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; - emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; - emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; - emit(event: "Debugger.paused", message: InspectorNotification): boolean; - emit(event: "Debugger.resumed"): boolean; - emit(event: "Console.messageAdded", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; - emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.resetProfiles"): boolean; - emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; - emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; - emit(event: "NodeTracing.dataCollected", message: InspectorNotification): boolean; - emit(event: "NodeTracing.tracingComplete"): boolean; - emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification): boolean; - emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification): boolean; - emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification): boolean; - emit(event: "NodeRuntime.waitingForDisconnect"): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - - /** - * Emitted when any notification from the V8 Inspector is received. - */ - on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; - - /** - * Issued when new execution context is created. - */ - on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - on(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine resumed execution. - */ - on(event: "Debugger.resumed", listener: () => void): this; - - /** - * Issued when new console message is added. - */ - on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; - - /** - * Sent when new profile recording is started using console.profile() call. - */ - on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - - on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - on(event: "HeapProfiler.resetProfiles", listener: () => void): this; - on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; - - /** - * Contains an bucket of collected trace events. - */ - on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; - - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - on(event: "NodeTracing.tracingComplete", listener: () => void): this; - - /** - * Issued when attached to a worker. - */ - on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when detached from the worker. - */ - on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - - /** - * Emitted when any notification from the V8 Inspector is received. - */ - once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; - - /** - * Issued when new execution context is created. - */ - once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - once(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine resumed execution. - */ - once(event: "Debugger.resumed", listener: () => void): this; - - /** - * Issued when new console message is added. - */ - once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; - - /** - * Sent when new profile recording is started using console.profile() call. - */ - once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - - once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - once(event: "HeapProfiler.resetProfiles", listener: () => void): this; - once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; - - /** - * Contains an bucket of collected trace events. - */ - once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; - - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - once(event: "NodeTracing.tracingComplete", listener: () => void): this; - - /** - * Issued when attached to a worker. - */ - once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when detached from the worker. - */ - once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; - - /** - * Issued when new execution context is created. - */ - prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine resumed execution. - */ - prependListener(event: "Debugger.resumed", listener: () => void): this; - - /** - * Issued when new console message is added. - */ - prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; - - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - - prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; - - /** - * Contains an bucket of collected trace events. - */ - prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; - - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this; - - /** - * Issued when attached to a worker. - */ - prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when detached from the worker. - */ - prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - - /** - * Emitted when any notification from the V8 Inspector is received. - */ - prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; - - /** - * Issued when new execution context is created. - */ - prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when execution context is destroyed. - */ - prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when all executionContexts were cleared in browser - */ - prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; - - /** - * Issued when exception was thrown and unhandled. - */ - prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when console API was called. - */ - prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when object should be inspected (for example, as a result of inspect() command line API call). - */ - prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. - */ - prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when breakpoint is resolved to an actual script and location. - */ - prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. - */ - prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; - - /** - * Fired when the virtual machine resumed execution. - */ - prependOnceListener(event: "Debugger.resumed", listener: () => void): this; - - /** - * Issued when new console message is added. - */ - prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; - - /** - * Sent when new profile recording is started using console.profile() call. - */ - prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; - - prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; - prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. - */ - prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; - - /** - * If heap objects tracking has been started then backend may send update for one or more fragments - */ - prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; - - /** - * Contains an bucket of collected trace events. - */ - prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification) => void): this; - - /** - * Signals that tracing is stopped and there is no trace buffers pending flush, all data were - * delivered via dataCollected events. - */ - prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this; - - /** - * Issued when attached to a worker. - */ - prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Issued when detached from the worker. - */ - prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * Notifies about a new protocol message received from the session - * (session ID is provided in attachedToWorker notification). - */ - prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification) => void): this; - - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this; - } - - // Top Level API - - /** - * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started. - * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. - * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI. - * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI. - * @param wait Block until a client has connected. Optional, defaults to false. - */ - function open(port?: number, host?: string, wait?: boolean): void; - - /** - * Deactivate the inspector. Blocks until there are no active connections. - */ - function close(): void; - - /** - * Return the URL of the active inspector, or `undefined` if there is none. - */ - function url(): string | undefined; - - /** - * Blocks until a client (existing or connected later) has sent - * `Runtime.runIfWaitingForDebugger` command. - * An exception will be thrown if there is no active inspector. - */ - function waitForDebugger(): void; -} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts deleted file mode 100644 index ffb4a6e..0000000 --- a/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -declare module "module" { - import { URL } from "url"; - namespace Module { - /** - * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports. - * It does not add or remove exported names from the ES Modules. - */ - function syncBuiltinESMExports(): void; - - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - - class SourceMap { - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - findEntry(line: number, column: number): SourceMapping; - } - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - - /** - * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead. - */ - static createRequireFromPath(path: string): NodeRequire; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - - static Module: typeof Module; - - constructor(id: string, parent?: Module); - } - export = Module; -} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts deleted file mode 100644 index c45aaa2..0000000 --- a/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,268 +0,0 @@ -declare module "net" { - import * as stream from "stream"; - import * as events from "events"; - import * as dns from "dns"; - - type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; - - interface AddressInfo { - address: string; - family: string; - port: number; - } - - interface SocketConstructorOpts { - fd?: number; - allowHalfOpen?: boolean; - readable?: boolean; - writable?: boolean; - } - - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts; - } - - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string; - localAddress?: string; - localPort?: number; - hints?: number; - family?: number; - lookup?: LookupFunction; - } - - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - - // Extended base methods - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - - connect(options: SocketConnectOpts, connectionListener?: () => void): this; - connect(port: number, host: string, connectionListener?: () => void): this; - connect(port: number, connectionListener?: () => void): this; - connect(path: string, connectionListener?: () => void): this; - - setEncoding(encoding?: BufferEncoding): this; - pause(): this; - resume(): this; - setTimeout(timeout: number, callback?: () => void): this; - setNoDelay(noDelay?: boolean): this; - setKeepAlive(enable?: boolean, initialDelay?: number): this; - address(): AddressInfo | string; - unref(): this; - ref(): this; - - readonly bufferSize: number; - readonly bytesRead: number; - readonly bytesWritten: number; - readonly connecting: boolean; - readonly destroyed: boolean; - readonly localAddress: string; - readonly localPort: number; - readonly remoteAddress?: string; - readonly remoteFamily?: string; - readonly remotePort?: number; - - // Extended base methods - end(cb?: () => void): void; - end(buffer: Uint8Array | string, cb?: () => void): void; - end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void): void; - - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. data - * 4. drain - * 5. end - * 6. error - * 7. lookup - * 8. timeout - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: (had_error: boolean) => void): this; - addListener(event: "connect", listener: () => void): this; - addListener(event: "data", listener: (data: Buffer) => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; - addListener(event: "timeout", listener: () => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close", had_error: boolean): boolean; - emit(event: "connect"): boolean; - emit(event: "data", data: Buffer): boolean; - emit(event: "drain"): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; - emit(event: "timeout"): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: (had_error: boolean) => void): this; - on(event: "connect", listener: () => void): this; - on(event: "data", listener: (data: Buffer) => void): this; - on(event: "drain", listener: () => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; - on(event: "timeout", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: (had_error: boolean) => void): this; - once(event: "connect", listener: () => void): this; - once(event: "data", listener: (data: Buffer) => void): this; - once(event: "drain", listener: () => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; - once(event: "timeout", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: (had_error: boolean) => void): this; - prependListener(event: "connect", listener: () => void): this; - prependListener(event: "data", listener: (data: Buffer) => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependListener(event: "timeout", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; - prependOnceListener(event: "connect", listener: () => void): this; - prependOnceListener(event: "data", listener: (data: Buffer) => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; - prependOnceListener(event: "timeout", listener: () => void): this; - } - - interface ListenOptions { - port?: number; - host?: string; - backlog?: number; - path?: string; - exclusive?: boolean; - readableAll?: boolean; - writableAll?: boolean; - /** - * @default false - */ - ipv6Only?: boolean; - } - - // https://github.com/nodejs/node/blob/master/lib/net.js - class Server extends events.EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void); - - listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, hostname?: string, listeningListener?: () => void): this; - listen(port?: number, backlog?: number, listeningListener?: () => void): this; - listen(port?: number, listeningListener?: () => void): this; - listen(path: string, backlog?: number, listeningListener?: () => void): this; - listen(path: string, listeningListener?: () => void): this; - listen(options: ListenOptions, listeningListener?: () => void): this; - listen(handle: any, backlog?: number, listeningListener?: () => void): this; - listen(handle: any, listeningListener?: () => void): this; - close(callback?: (err?: Error) => void): this; - address(): AddressInfo | string | null; - getConnections(cb: (error: Error | null, count: number) => void): void; - ref(): this; - unref(): this; - maxConnections: number; - connections: number; - listening: boolean; - - /** - * events.EventEmitter - * 1. close - * 2. connection - * 3. error - * 4. listening - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "connection", listener: (socket: Socket) => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "listening", listener: () => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "connection", socket: Socket): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "listening"): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "connection", listener: (socket: Socket) => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "listening", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "connection", listener: (socket: Socket) => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "listening", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "connection", listener: (socket: Socket) => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "listening", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "listening", listener: () => void): this; - } - - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number; - } - - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number; - } - - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - function isIP(input: string): number; - function isIPv4(input: string): boolean; - function isIPv6(input: string): boolean; -} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts deleted file mode 100644 index 1aadc68..0000000 --- a/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,239 +0,0 @@ -declare module "os" { - interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - - interface NetworkInterfaceBase { - address: string; - netmask: string; - mac: string; - internal: boolean; - cidr: string | null; - } - - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { - family: "IPv4"; - } - - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { - family: "IPv6"; - scopeid: number; - } - - interface UserInfo { - username: T; - uid: number; - gid: number; - shell: T; - homedir: T; - } - - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; - - function hostname(): string; - function loadavg(): number[]; - function uptime(): number; - function freemem(): number; - function totalmem(): number; - function cpus(): CpuInfo[]; - function type(): string; - function release(): string; - function networkInterfaces(): NodeJS.Dict; - function homedir(): string; - function userInfo(options: { encoding: 'buffer' }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - const E2BIG: number; - const EACCES: number; - const EADDRINUSE: number; - const EADDRNOTAVAIL: number; - const EAFNOSUPPORT: number; - const EAGAIN: number; - const EALREADY: number; - const EBADF: number; - const EBADMSG: number; - const EBUSY: number; - const ECANCELED: number; - const ECHILD: number; - const ECONNABORTED: number; - const ECONNREFUSED: number; - const ECONNRESET: number; - const EDEADLK: number; - const EDESTADDRREQ: number; - const EDOM: number; - const EDQUOT: number; - const EEXIST: number; - const EFAULT: number; - const EFBIG: number; - const EHOSTUNREACH: number; - const EIDRM: number; - const EILSEQ: number; - const EINPROGRESS: number; - const EINTR: number; - const EINVAL: number; - const EIO: number; - const EISCONN: number; - const EISDIR: number; - const ELOOP: number; - const EMFILE: number; - const EMLINK: number; - const EMSGSIZE: number; - const EMULTIHOP: number; - const ENAMETOOLONG: number; - const ENETDOWN: number; - const ENETRESET: number; - const ENETUNREACH: number; - const ENFILE: number; - const ENOBUFS: number; - const ENODATA: number; - const ENODEV: number; - const ENOENT: number; - const ENOEXEC: number; - const ENOLCK: number; - const ENOLINK: number; - const ENOMEM: number; - const ENOMSG: number; - const ENOPROTOOPT: number; - const ENOSPC: number; - const ENOSR: number; - const ENOSTR: number; - const ENOSYS: number; - const ENOTCONN: number; - const ENOTDIR: number; - const ENOTEMPTY: number; - const ENOTSOCK: number; - const ENOTSUP: number; - const ENOTTY: number; - const ENXIO: number; - const EOPNOTSUPP: number; - const EOVERFLOW: number; - const EPERM: number; - const EPIPE: number; - const EPROTO: number; - const EPROTONOSUPPORT: number; - const EPROTOTYPE: number; - const ERANGE: number; - const EROFS: number; - const ESPIPE: number; - const ESRCH: number; - const ESTALE: number; - const ETIME: number; - const ETIMEDOUT: number; - const ETXTBSY: number; - const EWOULDBLOCK: number; - const EXDEV: number; - const WSAEINTR: number; - const WSAEBADF: number; - const WSAEACCES: number; - const WSAEFAULT: number; - const WSAEINVAL: number; - const WSAEMFILE: number; - const WSAEWOULDBLOCK: number; - const WSAEINPROGRESS: number; - const WSAEALREADY: number; - const WSAENOTSOCK: number; - const WSAEDESTADDRREQ: number; - const WSAEMSGSIZE: number; - const WSAEPROTOTYPE: number; - const WSAENOPROTOOPT: number; - const WSAEPROTONOSUPPORT: number; - const WSAESOCKTNOSUPPORT: number; - const WSAEOPNOTSUPP: number; - const WSAEPFNOSUPPORT: number; - const WSAEAFNOSUPPORT: number; - const WSAEADDRINUSE: number; - const WSAEADDRNOTAVAIL: number; - const WSAENETDOWN: number; - const WSAENETUNREACH: number; - const WSAENETRESET: number; - const WSAECONNABORTED: number; - const WSAECONNRESET: number; - const WSAENOBUFS: number; - const WSAEISCONN: number; - const WSAENOTCONN: number; - const WSAESHUTDOWN: number; - const WSAETOOMANYREFS: number; - const WSAETIMEDOUT: number; - const WSAECONNREFUSED: number; - const WSAELOOP: number; - const WSAENAMETOOLONG: number; - const WSAEHOSTDOWN: number; - const WSAEHOSTUNREACH: number; - const WSAENOTEMPTY: number; - const WSAEPROCLIM: number; - const WSAEUSERS: number; - const WSAEDQUOT: number; - const WSAESTALE: number; - const WSAEREMOTE: number; - const WSASYSNOTREADY: number; - const WSAVERNOTSUPPORTED: number; - const WSANOTINITIALISED: number; - const WSAEDISCON: number; - const WSAENOMORE: number; - const WSAECANCELLED: number; - const WSAEINVALIDPROCTABLE: number; - const WSAEINVALIDPROVIDER: number; - const WSAEPROVIDERFAILEDINIT: number; - const WSASYSCALLFAILURE: number; - const WSASERVICE_NOT_FOUND: number; - const WSATYPE_NOT_FOUND: number; - const WSA_E_NO_MORE: number; - const WSA_E_CANCELLED: number; - const WSAEREFUSED: number; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - - function arch(): string; - /** - * Returns a string identifying the kernel version. - * On POSIX systems, the operating system release is determined by calling - * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available, - * `GetVersionExW()` will be used. See - * https://en.wikipedia.org/wiki/Uname#Examples for more information. - */ - function version(): string; - function platform(): NodeJS.Platform; - function tmpdir(): string; - const EOL: string; - function endianness(): "BE" | "LE"; - /** - * Gets the priority of a process. - * Defaults to current process. - */ - function getPriority(pid?: number): number; - /** - * Sets the priority of the current process. - * @param priority Must be in range of -20 to 19 - */ - function setPriority(priority: number): void; - /** - * Sets the priority of the process specified process. - * @param priority Must be in range of -20 to 19 - */ - function setPriority(pid: number, priority: number): void; -} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json deleted file mode 100644 index c1d31b6..0000000 --- a/node_modules/@types/node/package.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "name": "@types/node", - "version": "14.11.5", - "description": "TypeScript definitions for Node.js", - "license": "MIT", - "contributors": [ - { - "name": "Microsoft TypeScript", - "url": "https://github.com/Microsoft", - "githubUsername": "Microsoft" - }, - { - "name": "DefinitelyTyped", - "url": "https://github.com/DefinitelyTyped", - "githubUsername": "DefinitelyTyped" - }, - { - "name": "Alberto Schiabel", - "url": "https://github.com/jkomyno", - "githubUsername": "jkomyno" - }, - { - "name": "Alexander T.", - "url": "https://github.com/a-tarasyuk", - "githubUsername": "a-tarasyuk" - }, - { - "name": "Alvis HT Tang", - "url": "https://github.com/alvis", - "githubUsername": "alvis" - }, - { - "name": "Andrew Makarov", - "url": "https://github.com/r3nya", - "githubUsername": "r3nya" - }, - { - "name": "Benjamin Toueg", - "url": "https://github.com/btoueg", - "githubUsername": "btoueg" - }, - { - "name": "Bruno Scheufler", - "url": "https://github.com/brunoscheufler", - "githubUsername": "brunoscheufler" - }, - { - "name": "Chigozirim C.", - "url": "https://github.com/smac89", - "githubUsername": "smac89" - }, - { - "name": "David Junger", - "url": "https://github.com/touffy", - "githubUsername": "touffy" - }, - { - "name": "Deividas Bakanas", - "url": "https://github.com/DeividasBakanas", - "githubUsername": "DeividasBakanas" - }, - { - "name": "Eugene Y. Q. Shen", - "url": "https://github.com/eyqs", - "githubUsername": "eyqs" - }, - { - "name": "Flarna", - "url": "https://github.com/Flarna", - "githubUsername": "Flarna" - }, - { - "name": "Hannes Magnusson", - "url": "https://github.com/Hannes-Magnusson-CK", - "githubUsername": "Hannes-Magnusson-CK" - }, - { - "name": "Hoàng Văn Khải", - "url": "https://github.com/KSXGitHub", - "githubUsername": "KSXGitHub" - }, - { - "name": "Huw", - "url": "https://github.com/hoo29", - "githubUsername": "hoo29" - }, - { - "name": "Kelvin Jin", - "url": "https://github.com/kjin", - "githubUsername": "kjin" - }, - { - "name": "Klaus Meinhardt", - "url": "https://github.com/ajafff", - "githubUsername": "ajafff" - }, - { - "name": "Lishude", - "url": "https://github.com/islishude", - "githubUsername": "islishude" - }, - { - "name": "Mariusz Wiktorczyk", - "url": "https://github.com/mwiktorczyk", - "githubUsername": "mwiktorczyk" - }, - { - "name": "Mohsen Azimi", - "url": "https://github.com/mohsen1", - "githubUsername": "mohsen1" - }, - { - "name": "Nicolas Even", - "url": "https://github.com/n-e", - "githubUsername": "n-e" - }, - { - "name": "Nikita Galkin", - "url": "https://github.com/galkin", - "githubUsername": "galkin" - }, - { - "name": "Parambir Singh", - "url": "https://github.com/parambirs", - "githubUsername": "parambirs" - }, - { - "name": "Sebastian Silbermann", - "url": "https://github.com/eps1lon", - "githubUsername": "eps1lon" - }, - { - "name": "Simon Schick", - "url": "https://github.com/SimonSchick", - "githubUsername": "SimonSchick" - }, - { - "name": "Thomas den Hollander", - "url": "https://github.com/ThomasdenH", - "githubUsername": "ThomasdenH" - }, - { - "name": "Wilco Bakker", - "url": "https://github.com/WilcoBakker", - "githubUsername": "WilcoBakker" - }, - { - "name": "wwwy3y3", - "url": "https://github.com/wwwy3y3", - "githubUsername": "wwwy3y3" - }, - { - "name": "Samuel Ainsworth", - "url": "https://github.com/samuela", - "githubUsername": "samuela" - }, - { - "name": "Kyle Uehlein", - "url": "https://github.com/kuehlein", - "githubUsername": "kuehlein" - }, - { - "name": "Jordi Oliveras Rovira", - "url": "https://github.com/j-oliveras", - "githubUsername": "j-oliveras" - }, - { - "name": "Thanik Bhongbhibhat", - "url": "https://github.com/bhongy", - "githubUsername": "bhongy" - }, - { - "name": "Marcin Kopacz", - "url": "https://github.com/chyzwar", - "githubUsername": "chyzwar" - }, - { - "name": "Trivikram Kamat", - "url": "https://github.com/trivikr", - "githubUsername": "trivikr" - }, - { - "name": "Minh Son Nguyen", - "url": "https://github.com/nguymin4", - "githubUsername": "nguymin4" - }, - { - "name": "Junxiao Shi", - "url": "https://github.com/yoursunny", - "githubUsername": "yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "url": "https://github.com/qwelias", - "githubUsername": "qwelias" - }, - { - "name": "ExE Boss", - "url": "https://github.com/ExE-Boss", - "githubUsername": "ExE-Boss" - }, - { - "name": "Surasak Chaisurin", - "url": "https://github.com/Ryan-Willpower", - "githubUsername": "Ryan-Willpower" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax", - "githubUsername": "addaleax" - }, - { - "name": "Jason Kwok", - "url": "https://github.com/JasonHK", - "githubUsername": "JasonHK" - }, - { - "name": "Victor Perin", - "url": "https://github.com/victorperin", - "githubUsername": "victorperin" - } - ], - "main": "", - "types": "index.d.ts", - "typesVersions": { - "<=3.4": { - "*": [ - "ts3.4/*" - ] - }, - "<=3.6": { - "*": [ - "ts3.6/*" - ] - } - }, - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "5e34ee10bcfbd6459166c194b3c6ba92abd61512eb102d4c4365c95af0c67dbc", - "typeScriptVersion": "3.2" -} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts deleted file mode 100644 index 0273d58..0000000 --- a/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -declare module "path" { - namespace path { - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - - interface FormatInputPathObject { - /** - * The root of the path such as '/' or 'c:\' - */ - root?: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string; - /** - * The file extension (if any) such as '.html' - */ - ext?: string; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string; - } - - interface PlatformPath { - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param p string path to normalize. - */ - normalize(p: string): string; - /** - * Join all arguments together and normalize the resulting path. - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. - * - * @param paths paths to join. - */ - join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} parameter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, - * until an absolute path is found. If after using all {from} paths still no absolute path is found, - * the current working directory is used as well. The resulting path is normalized, - * and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param pathSegments string paths to join. Non-string arguments are ignored. - */ - resolve(...pathSegments: string[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * @param path path to test. - */ - isAbsolute(p: string): boolean; - /** - * Solve the relative path from {from} to {to}. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - */ - relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param p the path to evaluate. - */ - dirname(p: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param p the path to evaluate. - * @param ext optionally, an extension to remove from the result. - */ - basename(p: string, ext?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string - * - * @param p the path to evaluate. - */ - extname(p: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: string; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: string; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param pathString path to evaluate. - */ - parse(p: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathString path to evaluate. - */ - format(pP: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100644 index 2bc1806..0000000 --- a/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,271 +0,0 @@ -declare module 'perf_hooks' { - import { AsyncResource } from 'async_hooks'; - - type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; - - interface PerformanceEntry { - /** - * The total number of milliseconds elapsed for this entry. - * This value will not be meaningful for all Performance Entry types. - */ - readonly duration: number; - - /** - * The name of the performance entry. - */ - readonly name: string; - - /** - * The high resolution millisecond timestamp marking the starting time of the Performance Entry. - */ - readonly startTime: number; - - /** - * The type of the performance entry. - * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. - */ - readonly entryType: EntryType; - - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number; - - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number; - } - - interface PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. - */ - readonly bootstrapComplete: number; - - /** - * The high resolution millisecond timestamp at which the Node.js process completed bootstrapping. - * If bootstrapping has not yet finished, the property has the value of -1. - */ - readonly environment: number; - - /** - * The high resolution millisecond timestamp at which the Node.js environment was initialized. - */ - readonly idleTime: number; - - /** - * The high resolution millisecond timestamp of the amount of time the event loop has been idle - * within the event loop's event provider (e.g. `epoll_wait`). This does not take CPU usage - * into consideration. If the event loop has not yet started (e.g., in the first tick of the main script), - * the property has the value of 0. - */ - readonly loopExit: number; - - /** - * The high resolution millisecond timestamp at which the Node.js event loop started. - * If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1. - */ - readonly loopStart: number; - - /** - * The high resolution millisecond timestamp at which the V8 platform was initialized. - */ - readonly v8Start: number; - } - - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - - interface Performance { - /** - * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. - * If name is provided, removes only the named mark. - * @param name - */ - clearMarks(name?: string): void; - - /** - * Creates a new PerformanceMark entry in the Performance Timeline. - * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', - * and whose performanceEntry.duration is always 0. - * Performance marks are used to mark specific significant moments in the Performance Timeline. - * @param name - */ - mark(name?: string): void; - - /** - * Creates a new PerformanceMeasure entry in the Performance Timeline. - * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', - * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. - * - * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify - * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, - * then startMark is set to timeOrigin by default. - * - * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp - * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. - * @param name - * @param startMark - * @param endMark - */ - measure(name: string, startMark: string, endMark: string): void; - - /** - * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. - */ - readonly nodeTiming: PerformanceNodeTiming; - - /** - * @return the current high resolution millisecond timestamp - */ - now(): number; - - /** - * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. - */ - readonly timeOrigin: number; - - /** - * Wraps a function within a new function that measures the running time of the wrapped function. - * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. - * @param fn - */ - timerify any>(fn: T): T; - - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - * - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - eventLoopUtilization(util1?: EventLoopUtilization, util2?: EventLoopUtilization): EventLoopUtilization; - } - - interface PerformanceObserverEntryList { - /** - * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. - */ - getEntries(): PerformanceEntry[]; - - /** - * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime - * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - - /** - * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime - * whose performanceEntry.entryType is equal to type. - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - - /** - * Disconnects the PerformanceObserver instance from all notifications. - */ - disconnect(): void; - - /** - * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. - * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. - * Property buffered defaults to false. - * @param options - */ - observe(options: { entryTypes: EntryType[]; buffered?: boolean }): void; - } - - namespace constants { - const NODE_PERFORMANCE_GC_MAJOR: number; - const NODE_PERFORMANCE_GC_MINOR: number; - const NODE_PERFORMANCE_GC_INCREMENTAL: number; - const NODE_PERFORMANCE_GC_WEAKCB: number; - - const NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - - const performance: Performance; - - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number; - } - - interface EventLoopDelayMonitor { - /** - * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started. - */ - enable(): boolean; - /** - * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped. - */ - disable(): boolean; - - /** - * Resets the collected histogram data. - */ - reset(): void; - - /** - * Returns the value at the given percentile. - * @param percentile A percentile value between 1 and 100. - */ - percentile(percentile: number): number; - - /** - * A `Map` object detailing the accumulated percentile distribution. - */ - readonly percentiles: Map; - - /** - * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold. - */ - readonly exceeds: number; - - /** - * The minimum recorded event loop delay. - */ - readonly min: number; - - /** - * The maximum recorded event loop delay. - */ - readonly max: number; - - /** - * The mean of the recorded event loop delays. - */ - readonly mean: number; - - /** - * The standard deviation of the recorded event loop delays. - */ - readonly stddev: number; - } - - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor; -} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts deleted file mode 100644 index 07c9183..0000000 --- a/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,406 +0,0 @@ -declare module "process" { - import * as tty from "tty"; - - global { - var process: NodeJS.Process; - - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - - interface CpuUsage { - user: number; - system: number; - } - - interface ProcessRelease { - name: string; - sourceUrl?: string; - headersUrl?: string; - libUrl?: string; - lts?: string; - } - - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - - type Platform = 'aix' - | 'android' - | 'darwin' - | 'freebsd' - | 'linux' - | 'openbsd' - | 'sunos' - | 'win32' - | 'cygwin' - | 'netbsd'; - - type Signals = - "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | - "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | - "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | - "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; - - type MultipleResolveType = 'resolve' | 'reject'; - - type BeforeExitListener = (code: number) => void; - type DisconnectListener = () => void; - type ExitListener = (code: number) => void; - type RejectionHandledListener = (promise: Promise) => void; - type UncaughtExceptionListener = (error: Error) => void; - type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: any, sendHandle: any) => void; - type SignalsListener = (signal: Signals) => void; - type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; - type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; - type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: any) => void; - - interface Socket extends ReadWriteStream { - isTTY?: true; - } - - // Alias for compatibility - interface ProcessEnv extends Dict {} - - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - - interface ProcessReport { - /** - * Directory where the report is written. - * working directory of the Node.js process. - * @default '' indicating that reports are written to the current - */ - directory: string; - - /** - * Filename where the report is written. - * The default value is the empty string. - * @default '' the output filename will be comprised of a timestamp, - * PID, and sequence number. - */ - filename: string; - - /** - * Returns a JSON-formatted diagnostic report for the running process. - * The report's JavaScript stack trace is taken from err, if present. - */ - getReport(err?: Error): string; - - /** - * If true, a diagnostic report is generated on fatal errors, - * such as out of memory errors or failed C++ assertions. - * @default false - */ - reportOnFatalError: boolean; - - /** - * If true, a diagnostic report is generated when the process - * receives the signal specified by process.report.signal. - * @defaul false - */ - reportOnSignal: boolean; - - /** - * If true, a diagnostic report is generated on uncaught exception. - * @default false - */ - reportOnUncaughtException: boolean; - - /** - * The signal used to trigger the creation of a diagnostic report. - * @default 'SIGUSR2' - */ - signal: Signals; - - /** - * Writes a diagnostic report to a file. If filename is not provided, the default filename - * includes the date, time, PID, and a sequence number. - * The report's JavaScript stack trace is taken from err, if present. - * - * @param fileName Name of the file where the report is written. - * This should be a relative path, that will be appended to the directory specified in - * `process.report.directory`, or the current working directory of the Node.js process, - * if unspecified. - * @param error A custom error used for reporting the JavaScript stack. - * @return Filename of the generated report. - */ - writeReport(fileName?: string): string; - writeReport(error?: Error): string; - writeReport(fileName?: string, err?: Error): string; - } - - interface ResourceUsage { - fsRead: number; - fsWrite: number; - involuntaryContextSwitches: number; - ipcReceived: number; - ipcSent: number; - majorPageFault: number; - maxRSS: number; - minorPageFault: number; - sharedMemorySize: number; - signalsCount: number; - swappedOut: number; - systemCPUTime: number; - unsharedDataSize: number; - unsharedStackSize: number; - userCPUTime: number; - voluntaryContextSwitches: number; - } - - interface Process extends EventEmitter { - /** - * Can also be a tty.WriteStream, not typed due to limitations. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * Can also be a tty.WriteStream, not typed due to limitations. - */ - stderr: WriteStream & { - fd: 2; - }; - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - argv: string[]; - argv0: string; - execArgv: string[]; - execPath: string; - abort(): void; - chdir(directory: string): void; - cwd(): string; - debugPort: number; - emitWarning(warning: string | Error, name?: string, ctor?: Function): void; - env: ProcessEnv; - exit(code?: number): never; - exitCode?: number; - getgid(): number; - setgid(id: number | string): void; - getuid(): number; - setuid(id: number | string): void; - geteuid(): number; - seteuid(id: number | string): void; - getegid(): number; - setegid(id: number | string): void; - getgroups(): number[]; - setgroups(groups: Array): void; - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - hasUncaughtExceptionCaptureCallback(): boolean; - version: string; - versions: ProcessVersions; - config: { - target_defaults: { - cflags: any[]; - default_configuration: string; - defines: string[]; - include_dirs: string[]; - libraries: string[]; - }; - variables: { - clang: number; - host_arch: string; - node_install_npm: boolean; - node_install_waf: boolean; - node_prefix: string; - node_shared_openssl: boolean; - node_shared_v8: boolean; - node_shared_zlib: boolean; - node_use_dtrace: boolean; - node_use_etw: boolean; - node_use_openssl: boolean; - target_arch: string; - v8_no_strict_aliasing: number; - v8_use_snapshot: boolean; - visibility: string; - }; - }; - kill(pid: number, signal?: string | number): true; - pid: number; - ppid: number; - title: string; - arch: string; - platform: Platform; - /** @deprecated since v14.0.0 - use `require.main` instead. */ - mainModule?: Module; - memoryUsage(): MemoryUsage; - cpuUsage(previousValue?: CpuUsage): CpuUsage; - nextTick(callback: Function, ...args: any[]): void; - release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * @deprecated since v14.0.0 - Calling process.umask() with no argument causes - * the process-wide umask to be written twice. This introduces a race condition between threads, - * and is a potential security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: number): number; - uptime(): number; - hrtime: HRTime; - domain: Domain; - - // Worker - send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean; - disconnect(): void; - connected: boolean; - - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][] - * environment variable. - */ - allowedNodeEnvironmentFlags: ReadonlySet; - - /** - * Only available with `--experimental-report` - */ - report?: ProcessReport; - - resourceUsage(): ResourceUsage; - - /* EventEmitter */ - addListener(event: "beforeExit", listener: BeforeExitListener): this; - addListener(event: "disconnect", listener: DisconnectListener): this; - addListener(event: "exit", listener: ExitListener): this; - addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - addListener(event: "warning", listener: WarningListener): this; - addListener(event: "message", listener: MessageListener): this; - addListener(event: Signals, listener: SignalsListener): this; - addListener(event: "newListener", listener: NewListenerListener): this; - addListener(event: "removeListener", listener: RemoveListenerListener): this; - addListener(event: "multipleResolves", listener: MultipleResolveListener): this; - - emit(event: "beforeExit", code: number): boolean; - emit(event: "disconnect"): boolean; - emit(event: "exit", code: number): boolean; - emit(event: "rejectionHandled", promise: Promise): boolean; - emit(event: "uncaughtException", error: Error): boolean; - emit(event: "uncaughtExceptionMonitor", error: Error): boolean; - emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; - emit(event: "warning", warning: Error): boolean; - emit(event: "message", message: any, sendHandle: any): this; - emit(event: Signals, signal: Signals): boolean; - emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; - emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; - emit(event: "multipleResolves", listener: MultipleResolveListener): this; - - on(event: "beforeExit", listener: BeforeExitListener): this; - on(event: "disconnect", listener: DisconnectListener): this; - on(event: "exit", listener: ExitListener): this; - on(event: "rejectionHandled", listener: RejectionHandledListener): this; - on(event: "uncaughtException", listener: UncaughtExceptionListener): this; - on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - on(event: "warning", listener: WarningListener): this; - on(event: "message", listener: MessageListener): this; - on(event: Signals, listener: SignalsListener): this; - on(event: "newListener", listener: NewListenerListener): this; - on(event: "removeListener", listener: RemoveListenerListener): this; - on(event: "multipleResolves", listener: MultipleResolveListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "beforeExit", listener: BeforeExitListener): this; - once(event: "disconnect", listener: DisconnectListener): this; - once(event: "exit", listener: ExitListener): this; - once(event: "rejectionHandled", listener: RejectionHandledListener): this; - once(event: "uncaughtException", listener: UncaughtExceptionListener): this; - once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - once(event: "warning", listener: WarningListener): this; - once(event: "message", listener: MessageListener): this; - once(event: Signals, listener: SignalsListener): this; - once(event: "newListener", listener: NewListenerListener): this; - once(event: "removeListener", listener: RemoveListenerListener): this; - once(event: "multipleResolves", listener: MultipleResolveListener): this; - - prependListener(event: "beforeExit", listener: BeforeExitListener): this; - prependListener(event: "disconnect", listener: DisconnectListener): this; - prependListener(event: "exit", listener: ExitListener): this; - prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependListener(event: "warning", listener: WarningListener): this; - prependListener(event: "message", listener: MessageListener): this; - prependListener(event: Signals, listener: SignalsListener): this; - prependListener(event: "newListener", listener: NewListenerListener): this; - prependListener(event: "removeListener", listener: RemoveListenerListener): this; - prependListener(event: "multipleResolves", listener: MultipleResolveListener): this; - - prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; - prependOnceListener(event: "disconnect", listener: DisconnectListener): this; - prependOnceListener(event: "exit", listener: ExitListener): this; - prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; - prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this; - prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; - prependOnceListener(event: "warning", listener: WarningListener): this; - prependOnceListener(event: "message", listener: MessageListener): this; - prependOnceListener(event: Signals, listener: SignalsListener): this; - prependOnceListener(event: "newListener", listener: NewListenerListener): this; - prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this; - prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this; - - listeners(event: "beforeExit"): BeforeExitListener[]; - listeners(event: "disconnect"): DisconnectListener[]; - listeners(event: "exit"): ExitListener[]; - listeners(event: "rejectionHandled"): RejectionHandledListener[]; - listeners(event: "uncaughtException"): UncaughtExceptionListener[]; - listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[]; - listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; - listeners(event: "warning"): WarningListener[]; - listeners(event: "message"): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: "newListener"): NewListenerListener[]; - listeners(event: "removeListener"): RemoveListenerListener[]; - listeners(event: "multipleResolves"): MultipleResolveListener[]; - } - - interface Global { - process: Process; - } - } - } - - export = process; -} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts deleted file mode 100644 index 75d2811..0000000 --- a/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module "punycode" { - function decode(string: string): string; - function encode(string: string): string; - function toUnicode(domain: string): string; - function toASCII(domain: string): string; - const ucs2: ucs2; - interface ucs2 { - decode(string: string): number[]; - encode(codePoints: number[]): string; - } - const version: string; -} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts deleted file mode 100644 index 3e204e7..0000000 --- a/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -declare module "querystring" { - interface StringifyOptions { - encodeURIComponent?: (str: string) => string; - } - - interface ParseOptions { - maxKeys?: number; - decodeURIComponent?: (str: string) => string; - } - - interface ParsedUrlQuery extends NodeJS.Dict { } - - interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> { - } - - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; - /** - * The querystring.encode() function is an alias for querystring.stringify(). - */ - const encode: typeof stringify; - /** - * The querystring.decode() function is an alias for querystring.parse(). - */ - const decode: typeof parse; - function escape(str: string): string; - function unescape(str: string): string; -} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts deleted file mode 100644 index fbe4836..0000000 --- a/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -declare module "readline" { - import * as events from "events"; - import * as stream from "stream"; - - interface Key { - sequence?: string; - name?: string; - ctrl?: boolean; - meta?: boolean; - shift?: boolean; - } - - class Interface extends events.EventEmitter { - readonly terminal: boolean; - - // Need direct access to line/cursor data, for use in external processes - // see: https://github.com/nodejs/node/issues/30347 - /** The current input data */ - readonly line: string; - /** The current cursor position in the input line */ - readonly cursor: number; - - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); - /** - * NOTE: According to the documentation: - * - * > Instances of the `readline.Interface` class are constructed using the - * > `readline.createInterface()` method. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface - */ - protected constructor(options: ReadLineOptions); - - setPrompt(prompt: string): void; - prompt(preserveCursor?: boolean): void; - question(query: string, callback: (answer: string) => void): void; - pause(): this; - resume(): this; - close(): void; - write(data: string | Buffer, key?: Key): void; - - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - */ - getCursorPos(): CursorPos; - - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - */ - - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - type ReadLine = Interface; // type forwarded for backwards compatiblity - - type Completer = (line: string) => CompleterResult; - type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any; - - type CompleterResult = [string[], string]; - - interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - completer?: Completer | AsyncCompleter; - terminal?: boolean; - historySize?: number; - prompt?: string; - crlfDelay?: number; - removeHistoryDuplicates?: boolean; - escapeCodeTimeout?: number; - tabSize?: number; - } - - function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; - function createInterface(options: ReadLineOptions): Interface; - function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - - type Direction = -1 | 0 | 1; - - interface CursorPos { - rows: number; - cols: number; - } - - /** - * Clears the current line of this WriteStream in a direction identified by `dir`. - */ - function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * Clears this `WriteStream` from the current cursor down. - */ - function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * Moves this WriteStream's cursor to the specified position. - */ - function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * Moves this WriteStream's cursor relative to its current position. - */ - function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts deleted file mode 100644 index ef9da37..0000000 --- a/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,387 +0,0 @@ -declare module "repl" { - import { Interface, Completer, AsyncCompleter } from "readline"; - import { Context } from "vm"; - import { InspectOptions } from "util"; - - interface ReplOptions { - /** - * The input prompt to display. - * Default: `"> "` - */ - prompt?: string; - /** - * The `Readable` stream from which REPL input will be read. - * Default: `process.stdin` - */ - input?: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - * Default: `process.stdout` - */ - output?: NodeJS.WritableStream; - /** - * If `true`, specifies that the output should be treated as a TTY terminal, and have - * ANSI/VT100 escape codes written to it. - * Default: checking the value of the `isTTY` property on the output stream upon - * instantiation. - */ - terminal?: boolean; - /** - * The function to be used when evaluating each given line of input. - * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can - * error with `repl.Recoverable` to indicate the input was incomplete and prompt for - * additional lines. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions - */ - eval?: REPLEval; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean; - /** - * If `true`, specifies that the default `writer` function should include ANSI color - * styling to REPL output. If a custom `writer` function is provided then this has no - * effect. - * Default: the REPL instance's `terminal` value. - */ - useColors?: boolean; - /** - * If `true`, specifies that the default evaluation function will use the JavaScript - * `global` as the context as opposed to creating a new separate context for the REPL - * instance. The node CLI REPL sets this value to `true`. - * Default: `false`. - */ - useGlobal?: boolean; - /** - * If `true`, specifies that the default writer will not output the return value of a - * command if it evaluates to `undefined`. - * Default: `false`. - */ - ignoreUndefined?: boolean; - /** - * The function to invoke to format the output of each command before writing to `output`. - * Default: a wrapper for `util.inspect`. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output - */ - writer?: REPLWriter; - /** - * An optional function used for custom Tab auto completion. - * - * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function - */ - completer?: Completer | AsyncCompleter; - /** - * A flag that specifies whether the default evaluator executes all JavaScript commands in - * strict mode or default (sloppy) mode. - * Accepted values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - /** - * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is - * pressed. This cannot be used together with a custom `eval` function. - * Default: `false`. - */ - breakEvalOnSigint?: boolean; - } - - type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; - type REPLWriter = (this: REPLServer, obj: any) => string; - - /** - * This is the default "writer" value, if none is passed in the REPL options, - * and it can be overridden by custom print functions. - */ - const writer: REPLWriter & { options: InspectOptions }; - - type REPLCommandAction = (this: REPLServer, text: string) => void; - - interface REPLCommand { - /** - * Help text to be displayed when `.help` is entered. - */ - help?: string; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - - /** - * Provides a customizable Read-Eval-Print-Loop (REPL). - * - * Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those - * according to a user-defined evaluation function, then output the result. Input and output - * may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`. - * - * Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style - * line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session - * state, error recovery, and customizable evaluation functions. - * - * Instances of `repl.REPLServer` are created using the `repl.start()` method and _should not_ - * be created directly using the JavaScript `new` keyword. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * A value indicating whether the REPL is currently in "editor mode". - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys - */ - readonly editorMode: boolean; - /** - * A value indicating whether the `_` variable has been assigned. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreAssigned: boolean; - /** - * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly last: any; - /** - * A value indicating whether the `_error` variable has been assigned. - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly underscoreErrAssigned: boolean; - /** - * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). - * - * @since v9.8.0 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable - */ - readonly lastError: any; - /** - * Specified in the REPL options, this is the function to be used when evaluating each - * given line of input. If not specified in the REPL options, this is an async wrapper - * for the JavaScript `eval()` function. - */ - readonly eval: REPLEval; - /** - * Specified in the REPL options, this is a value indicating whether the default - * `writer` function should include ANSI color styling to REPL output. - */ - readonly useColors: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `eval` - * function will use the JavaScript `global` as the context as opposed to creating a new - * separate context for the REPL instance. - */ - readonly useGlobal: boolean; - /** - * Specified in the REPL options, this is a value indicating whether the default `writer` - * function should output the result of a command if it evaluates to `undefined`. - */ - readonly ignoreUndefined: boolean; - /** - * Specified in the REPL options, this is the function to invoke to format the output of - * each command before writing to `outputStream`. If not specified in the REPL options, - * this will be a wrapper for `util.inspect`. - */ - readonly writer: REPLWriter; - /** - * Specified in the REPL options, this is the function to use for custom Tab auto-completion. - */ - readonly completer: Completer | AsyncCompleter; - /** - * Specified in the REPL options, this is a flag that specifies whether the default `eval` - * function should execute all JavaScript commands in strict mode or default (sloppy) mode. - * Possible values are: - * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. - * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to - * prefacing every repl statement with `'use strict'`. - */ - readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; - - /** - * NOTE: According to the documentation: - * - * > Instances of `repl.REPLServer` are created using the `repl.start()` method and - * > _should not_ be created directly using the JavaScript `new` keyword. - * - * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver - */ - private constructor(); - - /** - * Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked - * by typing a `.` followed by the `keyword`. - * - * @param keyword The command keyword (_without_ a leading `.` character). - * @param cmd The function to invoke when the command is processed. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * Readies the REPL instance for input from the user, printing the configured `prompt` to a - * new line in the `output` and resuming the `input` to accept new input. - * - * When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'. - * - * This method is primarily intended to be called from within the action function for - * commands registered using the `replServer.defineCommand()` method. - * - * @param preserveCursor When `true`, the cursor placement will not be reset to `0`. - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * Clears any command that has been buffered but not yet executed. - * - * This method is primarily intended to be called from within the action function for - * commands registered using the `replServer.defineCommand()` method. - * - * @since v9.0.0 - */ - clearBufferedCommand(): void; - - /** - * Initializes a history log file for the REPL instance. When executing the - * Node.js binary and using the command line REPL, a history file is initialized - * by default. However, this is not the case when creating a REPL - * programmatically. Use this method to initialize a history log file when working - * with REPL instances programmatically. - * @param path The path to the history file - */ - setupHistory(path: string, cb: (err: Error | null, repl: this) => void): void; - - /** - * events.EventEmitter - * 1. close - inherited from `readline.Interface` - * 2. line - inherited from `readline.Interface` - * 3. pause - inherited from `readline.Interface` - * 4. resume - inherited from `readline.Interface` - * 5. SIGCONT - inherited from `readline.Interface` - * 6. SIGINT - inherited from `readline.Interface` - * 7. SIGTSTP - inherited from `readline.Interface` - * 8. exit - * 9. reset - */ - - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "close", listener: () => void): this; - addListener(event: "line", listener: (input: string) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: "SIGCONT", listener: () => void): this; - addListener(event: "SIGINT", listener: () => void): this; - addListener(event: "SIGTSTP", listener: () => void): this; - addListener(event: "exit", listener: () => void): this; - addListener(event: "reset", listener: (context: Context) => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "close"): boolean; - emit(event: "line", input: string): boolean; - emit(event: "pause"): boolean; - emit(event: "resume"): boolean; - emit(event: "SIGCONT"): boolean; - emit(event: "SIGINT"): boolean; - emit(event: "SIGTSTP"): boolean; - emit(event: "exit"): boolean; - emit(event: "reset", context: Context): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "close", listener: () => void): this; - on(event: "line", listener: (input: string) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: "SIGCONT", listener: () => void): this; - on(event: "SIGINT", listener: () => void): this; - on(event: "SIGTSTP", listener: () => void): this; - on(event: "exit", listener: () => void): this; - on(event: "reset", listener: (context: Context) => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "close", listener: () => void): this; - once(event: "line", listener: (input: string) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: "SIGCONT", listener: () => void): this; - once(event: "SIGINT", listener: () => void): this; - once(event: "SIGTSTP", listener: () => void): this; - once(event: "exit", listener: () => void): this; - once(event: "reset", listener: (context: Context) => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "close", listener: () => void): this; - prependListener(event: "line", listener: (input: string) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: "SIGCONT", listener: () => void): this; - prependListener(event: "SIGINT", listener: () => void): this; - prependListener(event: "SIGTSTP", listener: () => void): this; - prependListener(event: "exit", listener: () => void): this; - prependListener(event: "reset", listener: (context: Context) => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "line", listener: (input: string) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: "SIGCONT", listener: () => void): this; - prependOnceListener(event: "SIGINT", listener: () => void): this; - prependOnceListener(event: "SIGTSTP", listener: () => void): this; - prependOnceListener(event: "exit", listener: () => void): this; - prependOnceListener(event: "reset", listener: (context: Context) => void): this; - } - - /** - * A flag passed in the REPL options. Evaluates expressions in sloppy mode. - */ - const REPL_MODE_SLOPPY: unique symbol; - - /** - * A flag passed in the REPL options. Evaluates expressions in strict mode. - * This is equivalent to prefacing every repl statement with `'use strict'`. - */ - const REPL_MODE_STRICT: unique symbol; - - /** - * Creates and starts a `repl.REPLServer` instance. - * - * @param options The options for the `REPLServer`. If `options` is a string, then it specifies - * the input prompt. - */ - function start(options?: string | ReplOptions): REPLServer; - - /** - * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. - * - * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors - */ - class Recoverable extends SyntaxError { - err: Error; - - constructor(err: Error); - } -} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts deleted file mode 100644 index 78f8743..0000000 --- a/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,351 +0,0 @@ -declare module "stream" { - import * as events from "events"; - - class internal extends events.EventEmitter { - pipe(destination: T, options?: { end?: boolean; }): T; - } - - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - - interface ReadableOptions { - highWaterMark?: number; - encoding?: BufferEncoding; - objectMode?: boolean; - read?(this: Readable, size: number): void; - destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean; - } - - class Readable extends Stream implements NodeJS.ReadableStream { - /** - * A utility method for creating Readable Streams out of iterators. - */ - static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; - - readable: boolean; - readonly readableEncoding: BufferEncoding | null; - readonly readableEnded: boolean; - readonly readableFlowing: boolean | null; - readonly readableHighWaterMark: number; - readonly readableLength: number; - readonly readableObjectMode: boolean; - destroyed: boolean; - constructor(opts?: ReadableOptions); - _read(size: number): void; - read(size?: number): any; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - unpipe(destination?: NodeJS.WritableStream): this; - unshift(chunk: any, encoding?: BufferEncoding): void; - wrap(oldStream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - destroy(error?: Error): void; - - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "data", listener: (chunk: any) => void): this; - addListener(event: "end", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "pause", listener: () => void): this; - addListener(event: "readable", listener: () => void): this; - addListener(event: "resume", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "close"): boolean; - emit(event: "data", chunk: any): boolean; - emit(event: "end"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "pause"): boolean; - emit(event: "readable"): boolean; - emit(event: "resume"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "close", listener: () => void): this; - on(event: "data", listener: (chunk: any) => void): this; - on(event: "end", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "pause", listener: () => void): this; - on(event: "readable", listener: () => void): this; - on(event: "resume", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "data", listener: (chunk: any) => void): this; - once(event: "end", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "pause", listener: () => void): this; - once(event: "readable", listener: () => void): this; - once(event: "resume", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "data", listener: (chunk: any) => void): this; - prependListener(event: "end", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "pause", listener: () => void): this; - prependListener(event: "readable", listener: () => void): this; - prependListener(event: "resume", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "data", listener: (chunk: any) => void): this; - prependOnceListener(event: "end", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "pause", listener: () => void): this; - prependOnceListener(event: "readable", listener: () => void): this; - prependOnceListener(event: "resume", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - - removeListener(event: "close", listener: () => void): this; - removeListener(event: "data", listener: (chunk: any) => void): this; - removeListener(event: "end", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "pause", listener: () => void): this; - removeListener(event: "readable", listener: () => void): this; - removeListener(event: "resume", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - - [Symbol.asyncIterator](): AsyncIterableIterator; - } - - interface WritableOptions { - highWaterMark?: number; - decodeStrings?: boolean; - defaultEncoding?: BufferEncoding; - objectMode?: boolean; - emitClose?: boolean; - write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?(this: Writable, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; - destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - autoDestroy?: boolean; - } - - class Writable extends Stream implements NodeJS.WritableStream { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - destroyed: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?(chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): void; - end(chunk: any, cb?: () => void): void; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): void; - cork(): void; - uncork(): void; - destroy(error?: Error): void; - - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. drain - * 3. error - * 4. finish - * 5. pipe - * 6. unpipe - */ - addListener(event: "close", listener: () => void): this; - addListener(event: "drain", listener: () => void): this; - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "finish", listener: () => void): this; - addListener(event: "pipe", listener: (src: Readable) => void): this; - addListener(event: "unpipe", listener: (src: Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "close"): boolean; - emit(event: "drain"): boolean; - emit(event: "error", err: Error): boolean; - emit(event: "finish"): boolean; - emit(event: "pipe", src: Readable): boolean; - emit(event: "unpipe", src: Readable): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "close", listener: () => void): this; - on(event: "drain", listener: () => void): this; - on(event: "error", listener: (err: Error) => void): this; - on(event: "finish", listener: () => void): this; - on(event: "pipe", listener: (src: Readable) => void): this; - on(event: "unpipe", listener: (src: Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "drain", listener: () => void): this; - once(event: "error", listener: (err: Error) => void): this; - once(event: "finish", listener: () => void): this; - once(event: "pipe", listener: (src: Readable) => void): this; - once(event: "unpipe", listener: (src: Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "drain", listener: () => void): this; - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "finish", listener: () => void): this; - prependListener(event: "pipe", listener: (src: Readable) => void): this; - prependListener(event: "unpipe", listener: (src: Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "drain", listener: () => void): this; - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "finish", listener: () => void): this; - prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; - prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - - removeListener(event: "close", listener: () => void): this; - removeListener(event: "drain", listener: () => void): this; - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "finish", listener: () => void): this; - removeListener(event: "pipe", listener: (src: Readable) => void): this; - removeListener(event: "unpipe", listener: (src: Readable) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - - interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean; - readableObjectMode?: boolean; - writableObjectMode?: boolean; - readableHighWaterMark?: number; - writableHighWaterMark?: number; - writableCorked?: number; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; - final?(this: Duplex, callback: (error?: Error | null) => void): void; - destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; - } - - // Note: Duplex extends both Readable and Writable. - class Duplex extends Readable implements Writable { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - constructor(opts?: DuplexOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?(chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): void; - end(chunk: any, cb?: () => void): void; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): void; - cork(): void; - uncork(): void; - } - - type TransformCallback = (error?: Error | null, data?: any) => void; - - interface TransformOptions extends DuplexOptions { - read?(this: Transform, size: number): void; - write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?(this: Transform, chunks: Array<{ chunk: any, encoding: BufferEncoding }>, callback: (error?: Error | null) => void): void; - final?(this: Transform, callback: (error?: Error | null) => void): void; - destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; - transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - - class PassThrough extends Transform { } - - interface FinishedOptions { - error?: boolean; - readable?: boolean; - writable?: boolean; - } - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - namespace finished { - function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - } - - function pipeline(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException | null) => void): T; - function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException | null) => void): T; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream, - stream3: NodeJS.ReadWriteStream, - stream4: T, - callback?: (err: NodeJS.ErrnoException | null) => void, - ): T; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream, - stream3: NodeJS.ReadWriteStream, - stream4: NodeJS.ReadWriteStream, - stream5: T, - callback?: (err: NodeJS.ErrnoException | null) => void, - ): T; - function pipeline(streams: Array, callback?: (err: NodeJS.ErrnoException | null) => void): NodeJS.WritableStream; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array void)>, - ): NodeJS.WritableStream; - namespace pipeline { - function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.WritableStream): Promise; - function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.WritableStream): Promise; - function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.WritableStream): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream, - stream3: NodeJS.ReadWriteStream, - stream4: NodeJS.ReadWriteStream, - stream5: NodeJS.WritableStream, - ): Promise; - function __promisify__(streams: Array): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array, - ): Promise; - } - - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - } - - export = internal; -} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts deleted file mode 100644 index a6a4060..0000000 --- a/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -declare module "string_decoder" { - class StringDecoder { - constructor(encoding?: BufferEncoding); - write(buffer: Buffer): string; - end(buffer?: Buffer): string; - } -} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts deleted file mode 100644 index e64a673..0000000 --- a/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare module "timers" { - function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; - namespace setTimeout { - function __promisify__(ms: number): Promise; - function __promisify__(ms: number, value: T): Promise; - } - function clearTimeout(timeoutId: NodeJS.Timeout): void; - function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout; - function clearInterval(intervalId: NodeJS.Timeout): void; - function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate; - namespace setImmediate { - function __promisify__(): Promise; - function __promisify__(value: T): Promise; - } - function clearImmediate(immediateId: NodeJS.Immediate): void; -} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts deleted file mode 100644 index 6d28a37..0000000 --- a/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,777 +0,0 @@ -declare module "tls" { - import * as crypto from "crypto"; - import * as dns from "dns"; - import * as net from "net"; - import * as stream from "stream"; - - const CLIENT_RENEG_LIMIT: number; - const CLIENT_RENEG_WINDOW: number; - - interface Certificate { - /** - * Country code. - */ - C: string; - /** - * Street. - */ - ST: string; - /** - * Locality. - */ - L: string; - /** - * Organization. - */ - O: string; - /** - * Organizational unit. - */ - OU: string; - /** - * Common name. - */ - CN: string; - } - - interface PeerCertificate { - subject: Certificate; - issuer: Certificate; - subjectaltname: string; - infoAccess: NodeJS.Dict; - modulus: string; - exponent: string; - valid_from: string; - valid_to: string; - fingerprint: string; - fingerprint256: string; - ext_key_usage: string[]; - serialNumber: string; - raw: Buffer; - } - - interface DetailedPeerCertificate extends PeerCertificate { - issuerCertificate: DetailedPeerCertificate; - } - - interface CipherNameAndProtocol { - /** - * The cipher name. - */ - name: string; - /** - * SSL/TLS protocol version. - */ - version: string; - - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string; - } - - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string; - } - - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean; - /** - * An optional net.Server instance. - */ - server?: net.Server; - - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer; - /** - * If true, specifies that the OCSP status request extension will be - * added to the client hello and an 'OCSPResponse' event will be - * emitted on the socket before establishing a secure communication - */ - requestOCSP?: boolean; - } - - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket, options?: TLSSocketOptions); - - /** - * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. - */ - authorized: boolean; - /** - * The reason why the peer's certificate has not been verified. - * This property becomes available only when tlsSocket.authorized === false. - */ - authorizationError: Error; - /** - * Static boolean value, always true. - * May be used to distinguish TLS sockets from regular ones. - */ - encrypted: boolean; - - /** - * String containing the selected ALPN protocol. - * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol?: string; - - /** - * Returns an object representing the local certificate. The returned - * object has some properties corresponding to the fields of the - * certificate. - * - * See tls.TLSSocket.getPeerCertificate() for an example of the - * certificate structure. - * - * If there is no local certificate, an empty object will be returned. - * If the socket has been destroyed, null will be returned. - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. - * @returns Returns an object representing the cipher name - * and the SSL/TLS protocol version of the current connection. - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter - * of an ephemeral key exchange in Perfect Forward Secrecy on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; null is - * returned if called on a server socket. The supported types are 'DH' - * and 'ECDH'. The name property is available only when type is 'ECDH'. - * - * For example: { type: 'ECDH', name: 'prime256v1', size: 256 }. - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * Returns the latest Finished message that has - * been sent to the socket as part of a SSL/TLS handshake, or undefined - * if no Finished message has been sent yet. - * - * As the Finished messages are message digests of the complete - * handshake (with a total of 192 bits for TLS 1.0 and more for SSL - * 3.0), they can be used for external authentication procedures when - * the authentication provided by SSL/TLS is not desired or is not - * enough. - * - * Corresponds to the SSL_get_finished routine in OpenSSL and may be - * used to implement the tls-unique channel binding from RFC 5929. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. - * The returned object has some properties corresponding to the field of the certificate. - * If detailed argument is true the full chain with issuer property will be returned, - * if false only the top certificate without issuer property. - * If the peer does not provide a certificate, it returns null or an empty object. - * @param detailed - If true; the full chain with issuer property will be returned. - * @returns An object representing the peer's certificate. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * Returns the latest Finished message that is expected or has actually - * been received from the socket as part of a SSL/TLS handshake, or - * undefined if there is no Finished message so far. - * - * As the Finished messages are message digests of the complete - * handshake (with a total of 192 bits for TLS 1.0 and more for SSL - * 3.0), they can be used for external authentication procedures when - * the authentication provided by SSL/TLS is not desired or is not - * enough. - * - * Corresponds to the SSL_get_peer_finished routine in OpenSSL and may - * be used to implement the tls-unique channel binding from RFC 5929. - */ - getPeerFinished(): Buffer | undefined; - /** - * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. - * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. - * The value `null` will be returned for server sockets or disconnected client sockets. - * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. - * @returns negotiated SSL/TLS protocol version of the current connection - */ - getProtocol(): string | null; - /** - * Could be used to speed up handshake establishment when reconnecting to the server. - * @returns ASN.1 encoded TLS session or undefined if none was negotiated. - */ - getSession(): Buffer | undefined; - /** - * Returns a list of signature algorithms shared between the server and - * the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * NOTE: Works only with client TLS sockets. - * Useful only for debugging, for session reuse provide session option to tls.connect(). - * @returns TLS session ticket or undefined if none was negotiated. - */ - getTLSTicket(): Buffer | undefined; - /** - * Returns true if the session was reused, false otherwise. - */ - isSessionReused(): boolean; - /** - * Initiate TLS renegotiation process. - * - * NOTE: Can be used to request peer's certificate after the secure connection has been established. - * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. - * @param options - The options may contain the following fields: rejectUnauthorized, - * requestCert (See tls.createServer() for details). - * @param callback - callback(err) will be executed with null as err, once the renegotiation - * is successfully completed. - * @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated. - */ - renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean; - /** - * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). - * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by - * the TLS layer until the entire fragment is received and its integrity is verified; - * large fragments can span multiple roundtrips, and their processing can be delayed due to packet - * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, - * which may decrease overall server throughput. - * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). - * @returns Returns true on success, false otherwise. - */ - setMaxSendFragment(size: number): boolean; - - /** - * Disables TLS renegotiation for this TLSSocket instance. Once called, - * attempts to renegotiate will trigger an 'error' event on the - * TLSSocket. - */ - disableRenegotiation(): void; - - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * - * Note: The format of the output is identical to the output of `openssl s_client - * -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's - * `SSL_trace()` function, the format is undocumented, can change without notice, - * and should not be relied on. - */ - enableTrace(): void; - - /** - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the - * [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context optionally provide a context. - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - addListener(event: "secureConnect", listener: () => void): this; - addListener(event: "session", listener: (session: Buffer) => void): this; - addListener(event: "keylog", listener: (line: Buffer) => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "OCSPResponse", response: Buffer): boolean; - emit(event: "secureConnect"): boolean; - emit(event: "session", session: Buffer): boolean; - emit(event: "keylog", line: Buffer): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "OCSPResponse", listener: (response: Buffer) => void): this; - on(event: "secureConnect", listener: () => void): this; - on(event: "session", listener: (session: Buffer) => void): this; - on(event: "keylog", listener: (line: Buffer) => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "OCSPResponse", listener: (response: Buffer) => void): this; - once(event: "secureConnect", listener: () => void): this; - once(event: "session", listener: (session: Buffer) => void): this; - once(event: "keylog", listener: (line: Buffer) => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependListener(event: "secureConnect", listener: () => void): this; - prependListener(event: "session", listener: (session: Buffer) => void): this; - prependListener(event: "keylog", listener: (line: Buffer) => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; - prependOnceListener(event: "secureConnect", listener: () => void): this; - prependOnceListener(event: "session", listener: (session: Buffer) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this; - } - - interface CommonConnectionOptions { - /** - * An optional TLS context object from tls.createSecureContext() - */ - secureContext?: SecureContext; - - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array; - /** - * SNICallback(servername, cb) A function that will be - * called if the client supports SNI TLS extension. Two arguments - * will be passed when called: servername and cb. SNICallback should - * invoke cb(null, ctx), where ctx is a SecureContext instance. - * (tls.createSecureContext(...) can be used to get a proper - * SecureContext.) If SNICallback wasn't provided the default callback - * with high-level API will be used (see below). - */ - SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void; - /** - * If true the server will reject any connection which is not - * authorized with the list of supplied CAs. This option only has an - * effect if requestCert is true. - * @default true - */ - rejectUnauthorized?: boolean; - } - - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer; - - /** - * - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string; - } - - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identitty: string; - } - - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string; - port?: number; - path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity; - servername?: string; // SNI TLS Extension - session?: Buffer; - minDHSize?: number; - lookup?: net.LookupFunction; - timeout?: number; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - - class Server extends net.Server { - /** - * The server.addContext() method adds a secure context that will be - * used if the client request's SNI name matches the supplied hostname - * (or wildcard). - */ - addContext(hostName: string, credentials: SecureContextOptions): void; - /** - * Returns the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * - * The server.setSecureContext() method replaces the - * secure context of an existing server. Existing connections to the - * server are not interrupted. - */ - setSecureContext(details: SecureContextOptions): void; - /** - * The server.setSecureContext() method replaces the secure context of - * an existing server. Existing connections to the server are not - * interrupted. - */ - setTicketKeys(keys: Buffer): void; - - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - addListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - addListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; - emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; - emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; - emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; - emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; - emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - on(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - once(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - once(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; - prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; - prependOnceListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; - prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; - prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; - } - - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - - type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; - - interface SecureContextOptions { - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array; - /** - * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use - * openssl dhparam to create the parameters. The key length must be - * greater than or equal to 1024 bits or else an error will be thrown. - * Although 1024 bits is permissible, use 2048 bits or larger for - * stronger security. If omitted or invalid, the parameters are - * silently discarded and DHE ciphers will not be available. - */ - dhparam?: string | Buffer; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string; - /** - * Optionally set the maximum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. - * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using - * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to - * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. - */ - maxVersion?: SecureVersion; - /** - * Optionally set the minimum TLS version to allow. One - * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the - * `secureProtocol` option, use one or the other. It is not recommended to use - * less than TLSv1.2, but it may be required for interoperability. - * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using - * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to - * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. - */ - minVersion?: SecureVersion; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string; - /** - * 48 bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer; - /** - * The number of seconds after which a TLS session created by the server - * will no longer be resumable. - */ - sessionTimeout?: number; - } - - interface SecureContext { - context: any; - } - - /* - * Verifies the certificate `cert` is issued to host `host`. - * @host The hostname to verify the certificate against - * @cert PeerCertificate representing the peer's certificate - * - * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. - */ - function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - function createSecureContext(details: SecureContextOptions): SecureContext; - function getCiphers(): string[]; - - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: - * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets - * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to - * 'TLSv1.3'. If multiple of the options are provided, the highest maximum - * is used. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using - * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options - * are provided, the lowest minimum is used. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: ReadonlyArray; -} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts deleted file mode 100644 index 1f3a89c..0000000 --- a/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -declare module "trace_events" { - /** - * The `Tracing` object is used to enable or disable tracing for sets of - * categories. Instances are created using the - * `trace_events.createTracing()` method. - * - * When created, the `Tracing` object is disabled. Calling the - * `tracing.enable()` method adds the categories to the set of enabled trace - * event categories. Calling `tracing.disable()` will remove the categories - * from the set of enabled trace event categories. - */ - interface Tracing { - /** - * A comma-separated list of the trace event categories covered by this - * `Tracing` object. - */ - readonly categories: string; - - /** - * Disables this `Tracing` object. - * - * Only trace event categories _not_ covered by other enabled `Tracing` - * objects and _not_ specified by the `--trace-event-categories` flag - * will be disabled. - */ - disable(): void; - - /** - * Enables this `Tracing` object for the set of categories covered by - * the `Tracing` object. - */ - enable(): void; - - /** - * `true` only if the `Tracing` object has been enabled. - */ - readonly enabled: boolean; - } - - interface CreateTracingOptions { - /** - * An array of trace category names. Values included in the array are - * coerced to a string when possible. An error will be thrown if the - * value cannot be coerced. - */ - categories: string[]; - } - - /** - * Creates and returns a Tracing object for the given set of categories. - */ - function createTracing(options: CreateTracingOptions): Tracing; - - /** - * Returns a comma-separated list of all currently-enabled trace event - * categories. The current set of enabled trace event categories is - * determined by the union of all currently-enabled `Tracing` objects and - * any categories enabled using the `--trace-event-categories` flag. - */ - function getEnabledCategories(): string | undefined; -} diff --git a/node_modules/@types/node/ts3.4/assert.d.ts b/node_modules/@types/node/ts3.4/assert.d.ts deleted file mode 100644 index 68b189c..0000000 --- a/node_modules/@types/node/ts3.4/assert.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -declare module 'assert' { - function assert(value: any, message?: string | Error): void; - namespace assert { - class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - code: 'ERR_ASSERTION'; - - constructor(options?: { - message?: string; - actual?: any; - expected?: any; - operator?: string; - stackStartFn?: Function; - }); - } - - type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error; - - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use `fail([message])` or other assert functions instead. */ - function fail( - actual: any, - expected: any, - message?: string | Error, - operator?: string, - stackStartFn?: Function, - ): never; - function ok(value: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use `strictEqual()` instead. */ - function equal(actual: any, expected: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use `notStrictEqual()` instead. */ - function notEqual(actual: any, expected: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use `deepStrictEqual()` instead. */ - function deepEqual(actual: any, expected: any, message?: string | Error): void; - /** @deprecated since v9.9.0 - use `notDeepStrictEqual()` instead. */ - function notDeepEqual(actual: any, expected: any, message?: string | Error): void; - function strictEqual(actual: any, expected: any, message?: string | Error): void; - function notStrictEqual(actual: any, expected: any, message?: string | Error): void; - function deepStrictEqual(actual: any, expected: any, message?: string | Error): void; - function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void; - - function throws(block: () => any, message?: string | Error): void; - function throws(block: () => any, error: AssertPredicate, message?: string | Error): void; - function doesNotThrow(block: () => any, message?: string | Error): void; - function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void; - - function ifError(value: any): void; - - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects( - block: (() => Promise) | Promise, - error: AssertPredicate, - message?: string | Error, - ): Promise; - function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; - function doesNotReject( - block: (() => Promise) | Promise, - error: RegExp | Function, - message?: string | Error, - ): Promise; - - function match(value: string, regExp: RegExp, message?: string | Error): void; - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - - const strict: typeof assert; - } - - export = assert; -} diff --git a/node_modules/@types/node/ts3.4/base.d.ts b/node_modules/@types/node/ts3.4/base.d.ts deleted file mode 100644 index 2ea04f5..0000000 --- a/node_modules/@types/node/ts3.4/base.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -// NOTE: These definitions support NodeJS and TypeScript 3.2 - 3.4. - -// NOTE: TypeScript version-specific augmentations can be found in the following paths: -// - ~/base.d.ts - Shared definitions common to all TypeScript versions -// - ~/index.d.ts - Definitions specific to TypeScript 2.1 -// - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2 -// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with global and assert pulled in - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/node_modules/@types/node/ts3.4/globals.global.d.ts b/node_modules/@types/node/ts3.4/globals.global.d.ts deleted file mode 100644 index 8e85466..0000000 --- a/node_modules/@types/node/ts3.4/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: NodeJS.Global; diff --git a/node_modules/@types/node/ts3.4/index.d.ts b/node_modules/@types/node/ts3.4/index.d.ts deleted file mode 100644 index 506b32a..0000000 --- a/node_modules/@types/node/ts3.4/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// NOTE: These definitions support NodeJS and TypeScript 3.2 - 3.4. -// This is required to enable globalThis support for global in ts3.5 without causing errors -// This is required to enable typing assert in ts3.7 without causing errors -// Typically type modifiations should be made in base.d.ts instead of here - -/// -/// -/// diff --git a/node_modules/@types/node/ts3.6/base.d.ts b/node_modules/@types/node/ts3.6/base.d.ts deleted file mode 100644 index 081a535..0000000 --- a/node_modules/@types/node/ts3.6/base.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -// NOTE: These definitions support NodeJS and TypeScript 3.5. - -// NOTE: TypeScript version-specific augmentations can be found in the following paths: -// - ~/base.d.ts - Shared definitions common to all TypeScript versions -// - ~/index.d.ts - Definitions specific to TypeScript 2.1 -// - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.5 -// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5 with assert pulled in - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -// tslint:disable-next-line:no-bad-reference -/// - -// TypeScript 3.5-specific augmentations: -/// - -// TypeScript 3.5-specific augmentations: -/// diff --git a/node_modules/@types/node/ts3.6/index.d.ts b/node_modules/@types/node/ts3.6/index.d.ts deleted file mode 100644 index 23b9a61..0000000 --- a/node_modules/@types/node/ts3.6/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6. -// This is required to enable typing assert in ts3.7 without causing errors -// Typically type modifications should be made in base.d.ts instead of here - -/// - -// tslint:disable-next-line:no-bad-reference -/// diff --git a/node_modules/@types/node/tty.d.ts b/node_modules/@types/node/tty.d.ts deleted file mode 100644 index 7854366..0000000 --- a/node_modules/@types/node/tty.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -declare module "tty" { - import * as net from "net"; - - function isatty(fd: number): boolean; - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - isRaw: boolean; - setRawMode(mode: boolean): this; - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - class WriteStream extends net.Socket { - constructor(fd: number); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: "resize", listener: () => void): this; - - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: "resize"): boolean; - - on(event: string, listener: (...args: any[]) => void): this; - on(event: "resize", listener: () => void): this; - - once(event: string, listener: (...args: any[]) => void): this; - once(event: "resize", listener: () => void): this; - - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: "resize", listener: () => void): this; - - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: "resize", listener: () => void): this; - - /** - * Clears the current line of this WriteStream in a direction identified by `dir`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * Clears this `WriteStream` from the current cursor down. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * Moves this WriteStream's cursor to the specified position. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * Moves this WriteStream's cursor relative to its current position. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * @default `process.env` - */ - getColorDepth(env?: {}): number; - hasColors(depth?: number): boolean; - hasColors(env?: {}): boolean; - hasColors(depth: number, env?: {}): boolean; - getWindowSize(): [number, number]; - columns: number; - rows: number; - isTTY: boolean; - } -} diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts deleted file mode 100644 index 152ef5d..0000000 --- a/node_modules/@types/node/url.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -declare module "url" { - import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring'; - - // Input to `url.format` - interface UrlObject { - auth?: string | null; - hash?: string | null; - host?: string | null; - hostname?: string | null; - href?: string | null; - pathname?: string | null; - protocol?: string | null; - search?: string | null; - slashes?: boolean | null; - port?: string | number | null; - query?: string | null | ParsedUrlQueryInput; - } - - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - - interface UrlWithStringQuery extends Url { - query: string | null; - } - - function parse(urlStr: string): UrlWithStringQuery; - function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; - function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - - function format(URL: URL, options?: URLFormatOptions): string; - function format(urlObject: UrlObject | string): string; - function resolve(from: string, to: string): string; - - function domainToASCII(domain: string): string; - function domainToUnicode(domain: string): string; - - /** - * This function ensures the correct decodings of percent-encoded characters as - * well as ensuring a cross-platform valid absolute path string. - * @param url The file URL string or URL object to convert to a path. - */ - function fileURLToPath(url: string | URL): string; - - /** - * This function ensures that path is resolved absolutely, and that the URL - * control characters are correctly encoded when converting into a File URL. - * @param url The path to convert to a File URL. - */ - function pathToFileURL(url: string): URL; - - interface URLFormatOptions { - auth?: boolean; - fragment?: boolean; - search?: boolean; - unicode?: boolean; - } - - class URL { - constructor(input: string, base?: string | URL); - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - readonly searchParams: URLSearchParams; - username: string; - toString(): string; - toJSON(): string; - } - - class URLSearchParams implements Iterable<[string, string]> { - constructor(init?: URLSearchParams | string | NodeJS.Dict | Iterable<[string, string]> | Array<[string, string]>); - append(name: string, value: string): void; - delete(name: string): void; - entries(): IterableIterator<[string, string]>; - forEach(callback: (value: string, name: string, searchParams: this) => void): void; - get(name: string): string | null; - getAll(name: string): string[]; - has(name: string): boolean; - keys(): IterableIterator; - set(name: string, value: string): void; - sort(): void; - toString(): string; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } -} diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts deleted file mode 100644 index f4d1bda..0000000 --- a/node_modules/@types/node/util.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -declare module "util" { - interface InspectOptions extends NodeJS.InspectOptions { } - type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; - type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string; - interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - function format(format: any, ...param: any[]): string; - function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string; - /** @deprecated since v0.11.3 - use a third party module instead. */ - function log(string: string): void; - function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - function inspect(object: any, options: InspectOptions): string; - namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - const custom: unique symbol; - } - /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */ - function isArray(object: any): object is any[]; - /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */ - function isRegExp(object: any): object is RegExp; - /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */ - function isDate(object: any): object is Date; - /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */ - function isError(object: any): object is Error; - function inherits(constructor: any, superConstructor: any): void; - function debuglog(key: string): (msg: string, ...param: any[]) => void; - /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */ - function isBoolean(object: any): object is boolean; - /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */ - function isBuffer(object: any): object is Buffer; - /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */ - function isFunction(object: any): boolean; - /** @deprecated since v4.0.0 - use `value === null` instead. */ - function isNull(object: any): object is null; - /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */ - function isNullOrUndefined(object: any): object is null | undefined; - /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */ - function isNumber(object: any): object is number; - /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */ - function isObject(object: any): boolean; - /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */ - function isPrimitive(object: any): boolean; - /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */ - function isString(object: any): object is string; - /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */ - function isSymbol(object: any): object is symbol; - /** @deprecated since v4.0.0 - use `value === undefined` instead. */ - function isUndefined(object: any): object is undefined; - function deprecate(fn: T, message: string, code?: string): T; - function isDeepStrictEqual(val1: any, val2: any): boolean; - - function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; - function callbackify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - - interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - - interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - - type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; - - function promisify(fn: CustomPromisify): TCustom; - function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; - function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; - function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; - function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): - (arg1: T1, arg2: T2, arg3: T3) => Promise; - function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): - (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void, - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - function promisify(fn: Function): Function; - namespace promisify { - const custom: unique symbol; - } - - namespace types { - function isAnyArrayBuffer(object: any): boolean; - function isArgumentsObject(object: any): object is IArguments; - function isArrayBuffer(object: any): object is ArrayBuffer; - function isArrayBufferView(object: any): object is ArrayBufferView; - function isAsyncFunction(object: any): boolean; - function isBigInt64Array(value: any): value is BigInt64Array; - function isBigUint64Array(value: any): value is BigUint64Array; - function isBooleanObject(object: any): object is Boolean; - function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */); - function isDataView(object: any): object is DataView; - function isDate(object: any): object is Date; - function isExternal(object: any): boolean; - function isFloat32Array(object: any): object is Float32Array; - function isFloat64Array(object: any): object is Float64Array; - function isGeneratorFunction(object: any): boolean; - function isGeneratorObject(object: any): boolean; - function isInt8Array(object: any): object is Int8Array; - function isInt16Array(object: any): object is Int16Array; - function isInt32Array(object: any): object is Int32Array; - function isMap(object: any): boolean; - function isMapIterator(object: any): boolean; - function isModuleNamespaceObject(value: any): boolean; - function isNativeError(object: any): object is Error; - function isNumberObject(object: any): object is Number; - function isPromise(object: any): boolean; - function isProxy(object: any): boolean; - function isRegExp(object: any): object is RegExp; - function isSet(object: any): boolean; - function isSetIterator(object: any): boolean; - function isSharedArrayBuffer(object: any): boolean; - function isStringObject(object: any): boolean; - function isSymbolObject(object: any): boolean; - function isTypedArray(object: any): object is NodeJS.TypedArray; - function isUint8Array(object: any): object is Uint8Array; - function isUint8ClampedArray(object: any): object is Uint8ClampedArray; - function isUint16Array(object: any): object is Uint16Array; - function isUint32Array(object: any): object is Uint32Array; - function isWeakMap(object: any): boolean; - function isWeakSet(object: any): boolean; - function isWebAssemblyCompiledModule(object: any): boolean; - } - - class TextDecoder { - readonly encoding: string; - readonly fatal: boolean; - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { fatal?: boolean; ignoreBOM?: boolean } - ); - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { stream?: boolean } - ): string; - } - - interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - - class TextEncoder { - readonly encoding: string; - encode(input?: string): Uint8Array; - encodeInto(input: string, output: Uint8Array): EncodeIntoResult; - } -} diff --git a/node_modules/@types/node/v8.d.ts b/node_modules/@types/node/v8.d.ts deleted file mode 100644 index 7d95082..0000000 --- a/node_modules/@types/node/v8.d.ts +++ /dev/null @@ -1,187 +0,0 @@ -declare module "v8" { - import { Readable } from "stream"; - - interface HeapSpaceInfo { - space_name: string; - space_size: number; - space_used_size: number; - space_available_size: number; - physical_space_size: number; - } - - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ - type DoesZapCodeSpaceFlag = 0 | 1; - - interface HeapInfo { - total_heap_size: number; - total_heap_size_executable: number; - total_physical_size: number; - total_available_size: number; - used_heap_size: number; - heap_size_limit: number; - malloced_memory: number; - peak_malloced_memory: number; - does_zap_garbage: DoesZapCodeSpaceFlag; - number_of_native_contexts: number; - number_of_detached_contexts: number; - } - - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - - /** - * Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features. - * This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8. - */ - function cachedDataVersionTag(): number; - - function getHeapStatistics(): HeapInfo; - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - function setFlagsFromString(flags: string): void; - /** - * Generates a snapshot of the current V8 heap and returns a Readable - * Stream that may be used to read the JSON serialized representation. - * This conversation was marked as resolved by joyeecheung - * This JSON stream format is intended to be used with tools such as - * Chrome DevTools. The JSON schema is undocumented and specific to the - * V8 engine, and may change from one version of V8 to the next. - */ - function getHeapSnapshot(): Readable; - - /** - * - * @param fileName The file path where the V8 heap snapshot is to be - * saved. If not specified, a file name with the pattern - * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be - * generated, where `{pid}` will be the PID of the Node.js process, - * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from - * the main Node.js thread or the id of a worker thread. - */ - function writeHeapSnapshot(fileName?: string): string; - - function getHeapCodeStatistics(): HeapCodeStatistics; - - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - - /** - * Serializes a JavaScript value and adds the serialized representation to the internal buffer. - * This throws an error if value cannot be serialized. - */ - writeValue(val: any): boolean; - - /** - * Returns the stored internal buffer. - * This serializer should not be used once the buffer is released. - * Calling this method results in undefined behavior if a previous write has failed. - */ - releaseBuffer(): Buffer; - - /** - * Marks an ArrayBuffer as having its contents transferred out of band.\ - * Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer(). - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - - /** - * Write a raw 32-bit unsigned integer. - */ - writeUint32(value: number): void; - - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - */ - writeUint64(hi: number, lo: number): void; - - /** - * Write a JS number value. - */ - writeDouble(value: number): void; - - /** - * Write raw bytes into the serializer’s internal buffer. - * The deserializer will require a way to compute the length of the buffer. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - - /** - * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects, - * and only stores the part of their underlying `ArrayBuffers` that they are referring to. - */ - class DefaultSerializer extends Serializer { - } - - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. - * In that case, an Error is thrown. - */ - readHeader(): boolean; - - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - - /** - * Marks an ArrayBuffer as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer() - * (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers). - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - - /** - * Reads the underlying wire format version. - * Likely mostly to be useful to legacy code reading old wire format versions. - * May not be called before .readHeader(). - */ - getWireFormatVersion(): number; - - /** - * Read a raw 32-bit unsigned integer and return it. - */ - readUint32(): number; - - /** - * Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries. - */ - readUint64(): [number, number]; - - /** - * Read a JS number value. - */ - readDouble(): number; - - /** - * Read raw bytes from the deserializer’s internal buffer. - * The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes(). - */ - readRawBytes(length: number): Buffer; - } - - /** - * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects, - * and only stores the part of their underlying `ArrayBuffers` that they are referring to. - */ - class DefaultDeserializer extends Deserializer { - } - - /** - * Uses a `DefaultSerializer` to serialize value into a buffer. - */ - function serialize(value: any): Buffer; - - /** - * Uses a `DefaultDeserializer` with default options to read a JS value from a buffer. - */ - function deserialize(data: NodeJS.TypedArray): any; -} diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts deleted file mode 100644 index bfa81d9..0000000 --- a/node_modules/@types/node/vm.d.ts +++ /dev/null @@ -1,146 +0,0 @@ -declare module "vm" { - interface Context extends NodeJS.Dict { } - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * Default: `''`. - */ - filename?: string; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * Default: `0`. - */ - lineOffset?: number; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * Default: `0` - */ - columnOffset?: number; - } - interface ScriptOptions extends BaseOptions { - displayErrors?: boolean; - timeout?: number; - cachedData?: Buffer; - produceCachedData?: boolean; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * Default: `true`. - */ - displayErrors?: boolean; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * Default: `false`. - */ - breakOnSigint?: boolean; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate'; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer; - /** - * Specifies whether to produce new cache data. - * Default: `false`, - */ - produceCachedData?: boolean; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context; - - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[]; - } - - interface CreateContextOptions { - /** - * Human-readable name of the newly created context. - * @default 'VM Context i' Where i is an ascending numerical index of the created context. - */ - name?: string; - /** - * Corresponds to the newly created context for display purposes. - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), - * like the value of the `url.origin` property of a URL object. - * Most notably, this string should omit the trailing slash, as that denotes a path. - * @default '' - */ - origin?: string; - codeGeneration?: { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean; - }; - } - - type MeasureMemoryMode = 'summary' | 'detailed'; - - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode; - context?: Context; - } - - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - - class Script { - constructor(code: string, options?: ScriptOptions); - runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; - runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; - runInThisContext(options?: RunningScriptOptions): any; - createCachedData(): Buffer; - } - function createContext(sandbox?: Context, options?: CreateContextOptions): Context; - function isContext(sandbox: Context): boolean; - function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; - function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; - function runInThisContext(code: string, options?: RunningScriptOptions | string): any; - function compileFunction(code: string, params?: string[], options?: CompileFunctionOptions): Function; - - /** - * Measure the memory known to V8 and used by the current execution context or a specified context. - * - * The format of the object that the returned Promise may resolve with is - * specific to the V8 engine and may change from one version of V8 to the next. - * - * The returned result is different from the statistics returned by - * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures - * the memory reachable by V8 from a specific context, while - * `v8.getHeapSpaceStatistics()` measures the memory used by an instance - * of V8 engine, which can switch among multiple contexts that reference - * objects in the heap of one engine. - * - * @experimental - */ - function measureMemory(options?: MeasureMemoryOptions): Promise; -} diff --git a/node_modules/@types/node/wasi.d.ts b/node_modules/@types/node/wasi.d.ts deleted file mode 100644 index fe2b2aa..0000000 --- a/node_modules/@types/node/wasi.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -declare module 'wasi' { - interface WASIOptions { - /** - * An array of strings that the WebAssembly application will - * see as command line arguments. The first argument is the virtual path to the - * WASI command itself. - */ - args?: string[]; - - /** - * An object similar to `process.env` that the WebAssembly - * application will see as its environment. - */ - env?: object; - - /** - * This object represents the WebAssembly application's - * sandbox directory structure. The string keys of `preopens` are treated as - * directories within the sandbox. The corresponding values in `preopens` are - * the real paths to those directories on the host machine. - */ - preopens?: NodeJS.Dict; - - /** - * By default, WASI applications terminate the Node.js - * process via the `__wasi_proc_exit()` function. Setting this option to `true` - * causes `wasi.start()` to return the exit code rather than terminate the - * process. - * @default false - */ - returnOnExit?: boolean; - - /** - * The file descriptor used as standard input in the WebAssembly application. - * @default 0 - */ - stdin?: number; - - /** - * The file descriptor used as standard output in the WebAssembly application. - * @default 1 - */ - stdout?: number; - - /** - * The file descriptor used as standard error in the WebAssembly application. - * @default 2 - */ - stderr?: number; - } - - class WASI { - constructor(options?: WASIOptions); - /** - * - * Attempt to begin execution of `instance` by invoking its `_start()` export. - * If `instance` does not contain a `_start()` export, then `start()` attempts to - * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports - * is present on `instance`, then `start()` does nothing. - * - * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named - * `memory`. If `instance` does not have a `memory` export an exception is thrown. - * - * If `start()` is called more than once, an exception is thrown. - */ - start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib. - - /** - * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present. - * If `instance` contains a `_start()` export, then an exception is thrown. - * - * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named - * `memory`. If `instance` does not have a `memory` export an exception is thrown. - * - * If `initialize()` is called more than once, an exception is thrown. - */ - initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib. - - /** - * Is an object that implements the WASI system call API. This object - * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a - * [`WebAssembly.Instance`][]. - */ - readonly wasiImport: NodeJS.Dict; // TODO: Narrow to DOM types - } -} diff --git a/node_modules/@types/node/worker_threads.d.ts b/node_modules/@types/node/worker_threads.d.ts deleted file mode 100644 index 1aea5d4..0000000 --- a/node_modules/@types/node/worker_threads.d.ts +++ /dev/null @@ -1,192 +0,0 @@ -declare module "worker_threads" { - import { Context } from "vm"; - import { EventEmitter } from "events"; - import { Readable, Writable } from "stream"; - import { URL } from "url"; - - const isMainThread: boolean; - const parentPort: null | MessagePort; - const SHARE_ENV: unique symbol; - const threadId: number; - const workerData: any; - - class MessageChannel { - readonly port1: MessagePort; - readonly port2: MessagePort; - } - - class MessagePort extends EventEmitter { - close(): void; - postMessage(value: any, transferList?: Array): void; - ref(): void; - unref(): void; - start(): void; - - addListener(event: "close", listener: () => void): this; - addListener(event: "message", listener: (value: any) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "close"): boolean; - emit(event: "message", value: any): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "close", listener: () => void): this; - on(event: "message", listener: (value: any) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "close", listener: () => void): this; - once(event: "message", listener: (value: any) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "close", listener: () => void): this; - prependListener(event: "message", listener: (value: any) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "close", listener: () => void): this; - prependOnceListener(event: "message", listener: (value: any) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - - removeListener(event: "close", listener: () => void): this; - removeListener(event: "message", listener: (value: any) => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - - off(event: "close", listener: () => void): this; - off(event: "message", listener: (value: any) => void): this; - off(event: string | symbol, listener: (...args: any[]) => void): this; - } - - interface WorkerOptions { - /** - * List of arguments which would be stringified and appended to - * `process.argv` in the worker. This is mostly similar to the `workerData` - * but the values will be available on the global `process.argv` as if they - * were passed as CLI options to the script. - */ - argv?: any[]; - env?: NodeJS.Dict | typeof SHARE_ENV; - eval?: boolean; - workerData?: any; - stdin?: boolean; - stdout?: boolean; - stderr?: boolean; - execArgv?: string[]; - resourceLimits?: ResourceLimits; - /** - * Additional data to send in the first worker message. - */ - transferList?: Array; - trackUnmanagedFds?: boolean; - } - - interface ResourceLimits { - maxYoungGenerationSizeMb?: number; - maxOldGenerationSizeMb?: number; - codeRangeSizeMb?: number; - } - - class Worker extends EventEmitter { - readonly stdin: Writable | null; - readonly stdout: Readable; - readonly stderr: Readable; - readonly threadId: number; - readonly resourceLimits?: ResourceLimits; - - /** - * @param filename The path to the Worker’s main script or module. - * Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../, - * or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path. - */ - constructor(filename: string | URL, options?: WorkerOptions); - - postMessage(value: any, transferList?: Array): void; - ref(): void; - unref(): void; - /** - * Stop all JavaScript execution in the worker thread as soon as possible. - * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted. - */ - terminate(): Promise; - - /** - * Returns a readable stream for a V8 snapshot of the current state of the Worker. - * See [`v8.getHeapSnapshot()`][] for more details. - * - * If the Worker thread is no longer running, which may occur before the - * [`'exit'` event][] is emitted, the returned `Promise` will be rejected - * immediately with an [`ERR_WORKER_NOT_RUNNING`][] error - */ - getHeapSnapshot(): Promise; - - addListener(event: "error", listener: (err: Error) => void): this; - addListener(event: "exit", listener: (exitCode: number) => void): this; - addListener(event: "message", listener: (value: any) => void): this; - addListener(event: "online", listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - - emit(event: "error", err: Error): boolean; - emit(event: "exit", exitCode: number): boolean; - emit(event: "message", value: any): boolean; - emit(event: "online"): boolean; - emit(event: string | symbol, ...args: any[]): boolean; - - on(event: "error", listener: (err: Error) => void): this; - on(event: "exit", listener: (exitCode: number) => void): this; - on(event: "message", listener: (value: any) => void): this; - on(event: "online", listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - - once(event: "error", listener: (err: Error) => void): this; - once(event: "exit", listener: (exitCode: number) => void): this; - once(event: "message", listener: (value: any) => void): this; - once(event: "online", listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - - prependListener(event: "error", listener: (err: Error) => void): this; - prependListener(event: "exit", listener: (exitCode: number) => void): this; - prependListener(event: "message", listener: (value: any) => void): this; - prependListener(event: "online", listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - - prependOnceListener(event: "error", listener: (err: Error) => void): this; - prependOnceListener(event: "exit", listener: (exitCode: number) => void): this; - prependOnceListener(event: "message", listener: (value: any) => void): this; - prependOnceListener(event: "online", listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - - removeListener(event: "error", listener: (err: Error) => void): this; - removeListener(event: "exit", listener: (exitCode: number) => void): this; - removeListener(event: "message", listener: (value: any) => void): this; - removeListener(event: "online", listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - - off(event: "error", listener: (err: Error) => void): this; - off(event: "exit", listener: (exitCode: number) => void): this; - off(event: "message", listener: (value: any) => void): this; - off(event: "online", listener: () => void): this; - off(event: string | symbol, listener: (...args: any[]) => void): this; - } - - /** - * Transfer a `MessagePort` to a different `vm` Context. The original `port` - * object will be rendered unusable, and the returned `MessagePort` instance will - * take its place. - * - * The returned `MessagePort` will be an object in the target context, and will - * inherit from its global `Object` class. Objects passed to the - * `port.onmessage()` listener will also be created in the target context - * and inherit from its global `Object` class. - * - * However, the created `MessagePort` will no longer inherit from - * `EventEmitter`, and only `port.onmessage()` can be used to receive - * events using it. - */ - function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort; - - /** - * Receive a single message from a given `MessagePort`. If no message is available, - * `undefined` is returned, otherwise an object with a single `message` property - * that contains the message payload, corresponding to the oldest message in the - * `MessagePort`’s queue. - */ - function receiveMessageOnPort(port: MessagePort): { message: any } | undefined; -} diff --git a/node_modules/@types/node/zlib.d.ts b/node_modules/@types/node/zlib.d.ts deleted file mode 100644 index 5af44d6..0000000 --- a/node_modules/@types/node/zlib.d.ts +++ /dev/null @@ -1,355 +0,0 @@ -declare module "zlib" { - import * as stream from "stream"; - - interface ZlibOptions { - /** - * @default constants.Z_NO_FLUSH - */ - flush?: number; - /** - * @default constants.Z_FINISH - */ - finishFlush?: number; - /** - * @default 16*1024 - */ - chunkSize?: number; - windowBits?: number; - level?: number; // compression only - memLevel?: number; // compression only - strategy?: number; // compression only - dictionary?: NodeJS.ArrayBufferView | ArrayBuffer; // deflate/inflate only, empty dictionary by default - info?: boolean; - maxOutputLength?: number; - } - - interface BrotliOptions { - /** - * @default constants.BROTLI_OPERATION_PROCESS - */ - flush?: number; - /** - * @default constants.BROTLI_OPERATION_FINISH - */ - finishFlush?: number; - /** - * @default 16*1024 - */ - chunkSize?: number; - params?: { - /** - * Each key is a `constants.BROTLI_*` constant. - */ - [key: number]: boolean | number; - }; - maxOutputLength?: number; - } - - interface Zlib { - /** @deprecated Use bytesWritten instead. */ - readonly bytesRead: number; - readonly bytesWritten: number; - shell?: boolean | string; - close(callback?: () => void): void; - flush(kind?: number | (() => void), callback?: () => void): void; - } - - interface ZlibParams { - params(level: number, strategy: number, callback: () => void): void; - } - - interface ZlibReset { - reset(): void; - } - - interface BrotliCompress extends stream.Transform, Zlib { } - interface BrotliDecompress extends stream.Transform, Zlib { } - interface Gzip extends stream.Transform, Zlib { } - interface Gunzip extends stream.Transform, Zlib { } - interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { } - interface Inflate extends stream.Transform, Zlib, ZlibReset { } - interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { } - interface InflateRaw extends stream.Transform, Zlib, ZlibReset { } - interface Unzip extends stream.Transform, Zlib { } - - function createBrotliCompress(options?: BrotliOptions): BrotliCompress; - function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress; - function createGzip(options?: ZlibOptions): Gzip; - function createGunzip(options?: ZlibOptions): Gunzip; - function createDeflate(options?: ZlibOptions): Deflate; - function createInflate(options?: ZlibOptions): Inflate; - function createDeflateRaw(options?: ZlibOptions): DeflateRaw; - function createInflateRaw(options?: ZlibOptions): InflateRaw; - function createUnzip(options?: ZlibOptions): Unzip; - - type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView; - - type CompressCallback = (error: Error | null, result: Buffer) => void; - - function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void; - function brotliCompress(buf: InputType, callback: CompressCallback): void; - function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer; - function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void; - function brotliDecompress(buf: InputType, callback: CompressCallback): void; - function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer; - function deflate(buf: InputType, callback: CompressCallback): void; - function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; - function deflateRaw(buf: InputType, callback: CompressCallback): void; - function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; - function gzip(buf: InputType, callback: CompressCallback): void; - function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; - function gunzip(buf: InputType, callback: CompressCallback): void; - function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; - function inflate(buf: InputType, callback: CompressCallback): void; - function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; - function inflateRaw(buf: InputType, callback: CompressCallback): void; - function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; - function unzip(buf: InputType, callback: CompressCallback): void; - function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void; - function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; - - namespace constants { - const BROTLI_DECODE: number; - const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number; - const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number; - const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number; - const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number; - const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number; - const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number; - const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number; - const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number; - const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number; - const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number; - const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number; - const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number; - const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number; - const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number; - const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number; - const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number; - const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number; - const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number; - const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number; - const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number; - const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number; - const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number; - const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number; - const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number; - const BROTLI_DECODER_ERROR_UNREACHABLE: number; - const BROTLI_DECODER_NEEDS_MORE_INPUT: number; - const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number; - const BROTLI_DECODER_NO_ERROR: number; - const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number; - const BROTLI_DECODER_PARAM_LARGE_WINDOW: number; - const BROTLI_DECODER_RESULT_ERROR: number; - const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number; - const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number; - const BROTLI_DECODER_RESULT_SUCCESS: number; - const BROTLI_DECODER_SUCCESS: number; - - const BROTLI_DEFAULT_MODE: number; - const BROTLI_DEFAULT_QUALITY: number; - const BROTLI_DEFAULT_WINDOW: number; - const BROTLI_ENCODE: number; - const BROTLI_LARGE_MAX_WINDOW_BITS: number; - const BROTLI_MAX_INPUT_BLOCK_BITS: number; - const BROTLI_MAX_QUALITY: number; - const BROTLI_MAX_WINDOW_BITS: number; - const BROTLI_MIN_INPUT_BLOCK_BITS: number; - const BROTLI_MIN_QUALITY: number; - const BROTLI_MIN_WINDOW_BITS: number; - - const BROTLI_MODE_FONT: number; - const BROTLI_MODE_GENERIC: number; - const BROTLI_MODE_TEXT: number; - - const BROTLI_OPERATION_EMIT_METADATA: number; - const BROTLI_OPERATION_FINISH: number; - const BROTLI_OPERATION_FLUSH: number; - const BROTLI_OPERATION_PROCESS: number; - - const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number; - const BROTLI_PARAM_LARGE_WINDOW: number; - const BROTLI_PARAM_LGBLOCK: number; - const BROTLI_PARAM_LGWIN: number; - const BROTLI_PARAM_MODE: number; - const BROTLI_PARAM_NDIRECT: number; - const BROTLI_PARAM_NPOSTFIX: number; - const BROTLI_PARAM_QUALITY: number; - const BROTLI_PARAM_SIZE_HINT: number; - - const DEFLATE: number; - const DEFLATERAW: number; - const GUNZIP: number; - const GZIP: number; - const INFLATE: number; - const INFLATERAW: number; - const UNZIP: number; - - const Z_BEST_COMPRESSION: number; - const Z_BEST_SPEED: number; - const Z_BLOCK: number; - const Z_BUF_ERROR: number; - const Z_DATA_ERROR: number; - - const Z_DEFAULT_CHUNK: number; - const Z_DEFAULT_COMPRESSION: number; - const Z_DEFAULT_LEVEL: number; - const Z_DEFAULT_MEMLEVEL: number; - const Z_DEFAULT_STRATEGY: number; - const Z_DEFAULT_WINDOWBITS: number; - - const Z_ERRNO: number; - const Z_FILTERED: number; - const Z_FINISH: number; - const Z_FIXED: number; - const Z_FULL_FLUSH: number; - const Z_HUFFMAN_ONLY: number; - const Z_MAX_CHUNK: number; - const Z_MAX_LEVEL: number; - const Z_MAX_MEMLEVEL: number; - const Z_MAX_WINDOWBITS: number; - const Z_MEM_ERROR: number; - const Z_MIN_CHUNK: number; - const Z_MIN_LEVEL: number; - const Z_MIN_MEMLEVEL: number; - const Z_MIN_WINDOWBITS: number; - const Z_NEED_DICT: number; - const Z_NO_COMPRESSION: number; - const Z_NO_FLUSH: number; - const Z_OK: number; - const Z_PARTIAL_FLUSH: number; - const Z_RLE: number; - const Z_STREAM_END: number; - const Z_STREAM_ERROR: number; - const Z_SYNC_FLUSH: number; - const Z_VERSION_ERROR: number; - const ZLIB_VERNUM: number; - } - - /** - * @deprecated - */ - const Z_NO_FLUSH: number; - /** - * @deprecated - */ - const Z_PARTIAL_FLUSH: number; - /** - * @deprecated - */ - const Z_SYNC_FLUSH: number; - /** - * @deprecated - */ - const Z_FULL_FLUSH: number; - /** - * @deprecated - */ - const Z_FINISH: number; - /** - * @deprecated - */ - const Z_BLOCK: number; - /** - * @deprecated - */ - const Z_TREES: number; - /** - * @deprecated - */ - const Z_OK: number; - /** - * @deprecated - */ - const Z_STREAM_END: number; - /** - * @deprecated - */ - const Z_NEED_DICT: number; - /** - * @deprecated - */ - const Z_ERRNO: number; - /** - * @deprecated - */ - const Z_STREAM_ERROR: number; - /** - * @deprecated - */ - const Z_DATA_ERROR: number; - /** - * @deprecated - */ - const Z_MEM_ERROR: number; - /** - * @deprecated - */ - const Z_BUF_ERROR: number; - /** - * @deprecated - */ - const Z_VERSION_ERROR: number; - /** - * @deprecated - */ - const Z_NO_COMPRESSION: number; - /** - * @deprecated - */ - const Z_BEST_SPEED: number; - /** - * @deprecated - */ - const Z_BEST_COMPRESSION: number; - /** - * @deprecated - */ - const Z_DEFAULT_COMPRESSION: number; - /** - * @deprecated - */ - const Z_FILTERED: number; - /** - * @deprecated - */ - const Z_HUFFMAN_ONLY: number; - /** - * @deprecated - */ - const Z_RLE: number; - /** - * @deprecated - */ - const Z_FIXED: number; - /** - * @deprecated - */ - const Z_DEFAULT_STRATEGY: number; - /** - * @deprecated - */ - const Z_BINARY: number; - /** - * @deprecated - */ - const Z_TEXT: number; - /** - * @deprecated - */ - const Z_ASCII: number; - /** - * @deprecated - */ - const Z_UNKNOWN: number; - /** - * @deprecated - */ - const Z_DEFLATED: number; -} diff --git a/node_modules/base32-decode/index.d.ts b/node_modules/base32-decode/index.d.ts new file mode 100644 index 0000000..ea1f85d --- /dev/null +++ b/node_modules/base32-decode/index.d.ts @@ -0,0 +1,3 @@ +type Variant = 'RFC3548' | 'RFC4648' | 'RFC4648-HEX' | 'Crockford' +declare function base32Decode(input: string, variant: Variant): ArrayBuffer +export = base32Decode diff --git a/node_modules/base32-decode/index.js b/node_modules/base32-decode/index.js new file mode 100644 index 0000000..3cf497d --- /dev/null +++ b/node_modules/base32-decode/index.js @@ -0,0 +1,55 @@ +var RFC4648 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' +var RFC4648_HEX = '0123456789ABCDEFGHIJKLMNOPQRSTUV' +var CROCKFORD = '0123456789ABCDEFGHJKMNPQRSTVWXYZ' + +function readChar (alphabet, char) { + var idx = alphabet.indexOf(char) + + if (idx === -1) { + throw new Error('Invalid character found: ' + char) + } + + return idx +} + +module.exports = function base32Decode (input, variant) { + var alphabet + + switch (variant) { + case 'RFC3548': + case 'RFC4648': + alphabet = RFC4648 + input = input.replace(/=+$/, '') + break + case 'RFC4648-HEX': + alphabet = RFC4648_HEX + input = input.replace(/=+$/, '') + break + case 'Crockford': + alphabet = CROCKFORD + input = input.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1') + break + default: + throw new Error('Unknown base32 variant: ' + variant) + } + + var length = input.length + + var bits = 0 + var value = 0 + + var index = 0 + var output = new Uint8Array((length * 5 / 8) | 0) + + for (var i = 0; i < length; i++) { + value = (value << 5) | readChar(alphabet, input[i]) + bits += 5 + + if (bits >= 8) { + output[index++] = (value >>> (bits - 8)) & 255 + bits -= 8 + } + } + + return output.buffer +} diff --git a/node_modules/base32-decode/package.json b/node_modules/base32-decode/package.json new file mode 100644 index 0000000..a3de4b0 --- /dev/null +++ b/node_modules/base32-decode/package.json @@ -0,0 +1,24 @@ +{ + "name": "base32-decode", + "version": "1.0.0", + "license": "MIT", + "repository": "LinusU/base32-decode", + "scripts": { + "test": "standard && node test" + }, + "devDependencies": { + "arraybuffer-equal": "^1.0.4", + "hex-to-array-buffer": "^0.1.0", + "standard": "^8.0.0-beta.5" + }, + "keywords": [ + "base32 decode", + "base32 decoder", + "base32", + "base32hex", + "crockford", + "decoder", + "rfc3548", + "rfc4648" + ] +} diff --git a/node_modules/base32-decode/readme.md b/node_modules/base32-decode/readme.md new file mode 100644 index 0000000..498a405 --- /dev/null +++ b/node_modules/base32-decode/readme.md @@ -0,0 +1,44 @@ +# Base32 Decode + +Base32 decoder with support for multiple variants. + +## Installation + +```sh +npm install --save base32-decode +``` + +## Usage + +```js +const base32Decode = require('base32-decode') + +console.log(base32Decode('EHJQ6X0', 'Crockford')) +//=> ArrayBuffer { 4 } + +console.log(base32Decode('ORSXG5A=', 'RFC4648')) +//=> ArrayBuffer { 4 } + +console.log(base32Decode('EHIN6T0=', 'RFC4648-HEX')) +//=> ArrayBuffer { 4 } +``` + +## API + +### base32Decode(input, variant) + +- `input` <String> +- `variant` <String> +- Return: <ArrayBuffer> The decoded raw data + +Decode the data in `input`. `variant` should be one of the supported variants +listed below. + +- `'RFC3548'` - Alias for `'RFC4648'` +- `'RFC4648'` - [Base32 from RFC4648](https://tools.ietf.org/html/rfc4648) +- `'RFC4648-HEX'` - [base32hex from RFC4648](https://tools.ietf.org/html/rfc4648) +- `'Crockford'` - [Crockford's Base32](http://www.crockford.com/wrmg/base32.html) + +## See also + +- [base32-encode](https://github.com/LinusU/base32-encode) - Base32 encoder diff --git a/node_modules/base32-decode/test.js b/node_modules/base32-decode/test.js new file mode 100644 index 0000000..97eae9c --- /dev/null +++ b/node_modules/base32-decode/test.js @@ -0,0 +1,76 @@ +var assert = require('assert') +var base32Decode = require('./') +var isEqual = require('arraybuffer-equal') +var hexToArrayBuffer = require('hex-to-array-buffer') + +var testCases = [ + // RFC 4648 - Test vectors + ['RFC4648', '', ''], + ['RFC4648', '66', 'MY======'], + ['RFC4648', '666f', 'MZXQ===='], + ['RFC4648', '666f6f', 'MZXW6==='], + ['RFC4648', '666f6f62', 'MZXW6YQ='], + ['RFC4648', '666f6f6261', 'MZXW6YTB'], + ['RFC4648', '666f6f626172', 'MZXW6YTBOI======'], + + // RFC 4648 - Hex test vectors + ['RFC4648-HEX', '', ''], + ['RFC4648-HEX', '66', 'CO======'], + ['RFC4648-HEX', '666f', 'CPNG===='], + ['RFC4648-HEX', '666f6f', 'CPNMU==='], + ['RFC4648-HEX', '666f6f62', 'CPNMUOG='], + ['RFC4648-HEX', '666f6f6261', 'CPNMUOJ1'], + ['RFC4648-HEX', '666f6f626172', 'CPNMUOJ1E8======'], + + // RFC 4648 - Random data + ['RFC4648', '73', 'OM======'], + ['RFC4648', 'f80c', '7AGA===='], + ['RFC4648', '6450', 'MRIA===='], + ['RFC4648', 'cc91d0', 'ZSI5A==='], + ['RFC4648', '6c60c0', 'NRQMA==='], + ['RFC4648', '4f6a23', 'J5VCG==='], + ['RFC4648', '88b44f18', 'RC2E6GA='], + ['RFC4648', '90bad04714', 'SC5NARYU'], + ['RFC4648', 'e9ef1def8086', '5HXR334AQY======'], + ['RFC4648', '83fe3f9c1e9302', 'QP7D7HA6SMBA===='], + ['RFC4648', '15aa1f7cafc17cb8', 'CWVB67FPYF6LQ==='], + ['RFC4648', 'da51d4fed48b4c32dc', '3JI5J7WURNGDFXA='], + ['RFC4648', 'c4be14228512d7299831', 'YS7BIIUFCLLSTGBR'], + ['RFC4648', '2f273c5b5ef04724fab944', 'F4TTYW266BDSJ6VZIQ======'], + ['RFC4648', '969da1b80ec2442d2bdd4bdb', 'S2O2DOAOYJCC2K65JPNQ===='], + ['RFC4648', '31f5adb50792f549d3714f3f99', 'GH223NIHSL2UTU3RJ47ZS==='], + ['RFC4648', '6a654f7a072c29951930700c0a61', 'NJSU66QHFQUZKGJQOAGAUYI='], + ['RFC4648', '0fe29d6825ad999e87d9b7cac3589d', 'B7RJ22BFVWMZ5B6ZW7FMGWE5'], + ['RFC4648', '0f960ab44e165973a5172ccd294b3412', 'B6LAVNCOCZMXHJIXFTGSSSZUCI======'], + ['RFC4648', '325b9fd847a41fb0d485c207a1a5b02dcf', 'GJNZ7WCHUQP3BVEFYID2DJNQFXHQ===='], + ['RFC4648', 'ddf80ebe21bf1b1e12a64c5cc6a74b5d92dd', '3X4A5PRBX4NR4EVGJROMNJ2LLWJN2==='], + ['RFC4648', 'c0cae52c6f641ce04a7ee5b9a8fa8ded121bca', 'YDFOKLDPMQOOAST64W42R6UN5UJBXSQ='], + ['RFC4648', '872840a355c8c70586f462c9e669ee760cb3537e', 'Q4UEBI2VZDDQLBXUMLE6M2POOYGLGU36'], + ['RFC4648', '5773fe22662818a120c5688824c935fe018208a496', 'K5Z74ITGFAMKCIGFNCECJSJV7YAYECFESY======'], + ['RFC4648', '416e23abc524d1b85736e2bea6cfecd5192789034a28', 'IFXCHK6FETI3QVZW4K7KNT7M2UMSPCIDJIUA===='], + ['RFC4648', '83d2386ebdd7e8e818ec00e3ccd882aa933b905b7e2e44', 'QPJDQ3V527UOQGHMADR4ZWECVKJTXEC3PYXEI==='], + ['RFC4648', 'a2fa8b881f3b8024f52745763c4ae08ea12bdf8bef1a72f8', 'UL5IXCA7HOACJ5JHIV3DYSXAR2QSXX4L54NHF6A='], + ['RFC4648', 'b074ae8b9efde0f17f37bccadde006d039997b59c8efb05add', 'WB2K5C467XQPC7ZXXTFN3YAG2A4ZS62ZZDX3AWW5'], + ['RFC4648', '764fef941aee7e416dc204ae5ab9c5b9ce644567798e6849aea9', 'OZH67FA25Z7EC3OCASXFVOOFXHHGIRLHPGHGQSNOVE======'], + ['RFC4648', '4995d9811f37f59797d7c3b9b9e5325aa78277415f70f4accf588c', 'JGK5TAI7G72ZPF6XYO43TZJSLKTYE52BL5YPJLGPLCGA===='], + ['RFC4648', '24f0812ca8eed58374c11a7008f0b262698b72fd2792709208eaacb2', 'ETYICLFI53KYG5GBDJYAR4FSMJUYW4X5E6JHBEQI5KWLE==='], + ['RFC4648', 'd70692543810d4bf50d81cf44a55801a557a388a341367c7ea077ca306', '24DJEVBYCDKL6UGYDT2EUVMADJKXUOEKGQJWPR7KA56KGBQ='], + ['RFC4648', '6e08a89ca36b677ff8fe99e68a1241c8d8cef2570a5f60b6417d2538b30c', 'NYEKRHFDNNTX76H6THTIUESBZDMM54SXBJPWBNSBPUSTRMYM'], + ['RFC4648', 'f2fc2319bd29457ccd01e8e194ee9bd7e97298b6610df4ab0f3d5baa0b2d7ccf69829edb74edef', '6L6CGGN5FFCXZTIB5DQZJ3U327UXFGFWMEG7JKYPHVN2UCZNPTHWTAU63N2O33Y='], + + // Crockford - Small samples + ['Crockford', '', ''], + ['Crockford', '61', 'C4'], + ['Crockford', '61', 'c4'], + ['Crockford', '74657374', 'EHJQ6X0'], + ['Crockford', '74657374', 'EHJQ6XO'], + ['Crockford', '6c696e7573', 'DHMPWXBK'], + ['Crockford', '6c696e7573', 'DhmPWXbK'], + ['Crockford', '666f6f626172', 'CSQPYRK1E8'], + ['Crockford', '666f6f626172', 'CSQPYRKLE8'], + ['Crockford', '666f6f626172', 'CSQPYRKIE8'] +] + +testCases.forEach(function (testCase) { + assert(isEqual(base32Decode(testCase[2], testCase[0]), hexToArrayBuffer(testCase[1]))) +}) diff --git a/node_modules/before-after-hook/README.md b/node_modules/before-after-hook/README.md index 68c927d..1439db3 100644 --- a/node_modules/before-after-hook/README.md +++ b/node_modules/before-after-hook/README.md @@ -11,47 +11,46 @@ ### Singular hook -Recommended for [TypeScript](#typescript) - ```js // instantiate singular hook API -const hook = new Hook.Singular() +const hook = new Hook.Singular(); // Create a hook -function getData (options) { +function getData(options) { return hook(fetchFromDatabase, options) .then(handleData) - .catch(handleGetError) + .catch(handleGetError); } // register before/error/after hooks. // The methods can be async or return a promise -hook.before(beforeHook) -hook.error(errorHook) -hook.after(afterHook) +hook.before(beforeHook); +hook.error(errorHook); +hook.after(afterHook); -getData({id: 123}) +getData({ id: 123 }); ``` ### Hook collection + ```js // instantiate hook collection API -const hookCollection = new Hook.Collection() +const hookCollection = new Hook.Collection(); // Create a hook -function getData (options) { - return hookCollection('get', fetchFromDatabase, options) +function getData(options) { + return hookCollection("get", fetchFromDatabase, options) .then(handleData) - .catch(handleGetError) + .catch(handleGetError); } // register before/error/after hooks. // The methods can be async or return a promise -hookCollection.before('get', beforeHook) -hookCollection.error('get', errorHook) -hookCollection.after('get', afterHook) +hookCollection.before("get", beforeHook); +hookCollection.error("get", errorHook); +hookCollection.after("get", afterHook); -getData({id: 123}) +getData({ id: 123 }); ``` ### Hook.Singular vs Hook.Collection @@ -63,7 +62,7 @@ The methods are executed in the following order 1. `beforeHook` 2. `fetchFromDatabase` 3. `afterHook` -4. `getData` +4. `handleData` `beforeHook` can mutate `options` before it’s passed to `fetchFromDatabase`. @@ -71,25 +70,25 @@ If an error is thrown in `beforeHook` or `fetchFromDatabase` then `errorHook` is called next. If `afterHook` throws an error then `handleGetError` is called instead -of `getData`. +of `handleData`. If `errorHook` throws an error then `handleGetError` is called next, otherwise -`afterHook` and `getData`. +`afterHook` and `handleData`. You can also use `hook.wrap` to achieve the same thing as shown above (collection example): ```js -hookCollection.wrap('get', async (getData, options) => { - await beforeHook(options) +hookCollection.wrap("get", async (getData, options) => { + await beforeHook(options); try { - const result = getData(options) + const result = getData(options); } catch (error) { - await errorHook(error, options) + await errorHook(error, options); } - await afterHook(result, options) -}) + await afterHook(result, options); +}); ``` ## Install @@ -122,8 +121,9 @@ The `Hook.Singular` constructor has no options and returns a `hook` instance wit methods below: ```js -const hook = new Hook.Singular() +const hook = new Hook.Singular(); ``` + Using the singular hook is recommended for [TypeScript](#typescript) ### Singular API @@ -131,30 +131,31 @@ Using the singular hook is recommended for [TypeScript](#typescript) The singular hook is a reference to a single hook. This means that there's no need to pass along any identifier (such as a `name` as can be seen in the [Hook.Collection API](#hookcollectionapi)). The API of a singular hook is exactly the same as a collection hook and we therefore suggest you read the [Hook.Collection API](#hookcollectionapi) and leave out any use of the `name` argument. Just skip it like described in this example: + ```js -const hook = new Hook.Singular() +const hook = new Hook.Singular(); // good -hook.before(beforeHook) -hook.after(afterHook) -hook(fetchFromDatabase, options) +hook.before(beforeHook); +hook.after(afterHook); +hook(fetchFromDatabase, options); // bad -hook.before('get', beforeHook) -hook.after('get', afterHook) -hook('get', fetchFromDatabase, options) +hook.before("get", beforeHook); +hook.after("get", afterHook); +hook("get", fetchFromDatabase, options); ``` ## Hook collection API - [Collection constructor](#collection-constructor) -- [collection.api](#collectionapi) -- [collection()](#collection) -- [collection.before()](#collectionbefore) -- [collection.error()](#collectionerror) -- [collection.after()](#collectionafter) -- [collection.wrap()](#collectionwrap) -- [collection.remove()](#collectionremove) +- [hookCollection.api](#hookcollectionapi) +- [hookCollection()](#hookcollection) +- [hookCollection.before()](#hookcollectionbefore) +- [hookCollection.error()](#hookcollectionerror) +- [hookCollection.after()](#hookcollectionafter) +- [hookCollection.wrap()](#hookcollectionwrap) +- [hookCollection.remove()](#hookcollectionremove) ### Collection constructor @@ -162,7 +163,7 @@ The `Hook.Collection` constructor has no options and returns a `hookCollection` methods below ```js -const hookCollection = new Hook.Collection() +const hookCollection = new Hook.Collection(); ``` ### hookCollection.api @@ -182,7 +183,7 @@ That way you don’t need to expose the [hookCollection()](#hookcollection) meth Invoke before and after hooks. Returns a promise. ```js -hookCollection(nameOrNames, method /*, options */) +hookCollection(nameOrNames, method /*, options */); ``` @@ -224,49 +225,65 @@ Rejects with error that is thrown or rejected with by Simple Example ```js -hookCollection('save', function (record) { - return store.save(record) -}, record) +hookCollection( + "save", + function (record) { + return store.save(record); + }, + record +); // shorter: hookCollection('save', store.save, record) -hookCollection.before('save', function addTimestamps (record) { - const now = new Date().toISOString() +hookCollection.before("save", function addTimestamps(record) { + const now = new Date().toISOString(); if (record.createdAt) { - record.updatedAt = now + record.updatedAt = now; } else { - record.createdAt = now + record.createdAt = now; } -}) +}); ``` Example defining multiple hooks at once. ```js -hookCollection(['add', 'save'], function (record) { - return store.save(record) -}, record) - -hookCollection.before('add', function addTimestamps (record) { +hookCollection( + ["add", "save"], + function (record) { + return store.save(record); + }, + record +); + +hookCollection.before("add", function addTimestamps(record) { if (!record.type) { - throw new Error('type property is required') + throw new Error("type property is required"); } -}) +}); -hookCollection.before('save', function addTimestamps (record) { +hookCollection.before("save", function addTimestamps(record) { if (!record.type) { - throw new Error('type property is required') + throw new Error("type property is required"); } -}) +}); ``` Defining multiple hooks is helpful if you have similar methods for which you want to define separate hooks, but also an additional hook that gets called for all at once. The example above is equal to this: ```js -hookCollection('add', function (record) { - return hookCollection('save', function (record) { - return store.save(record) - }, record) -}, record) +hookCollection( + "add", + function (record) { + return hookCollection( + "save", + function (record) { + return store.save(record); + }, + record + ); + }, + record +); ``` ### hookCollection.before() @@ -274,7 +291,7 @@ hookCollection('add', function (record) { Add before hook for given name. ```js -hookCollection.before(name, method) +hookCollection.before(name, method); ```
@@ -307,11 +324,11 @@ hookCollection.before(name, method) Example ```js -hookCollection.before('save', function validate (record) { +hookCollection.before("save", function validate(record) { if (!record.name) { - throw new Error('name property is required') + throw new Error("name property is required"); } -}) +}); ``` ### hookCollection.error() @@ -319,7 +336,7 @@ hookCollection.before('save', function validate (record) { Add error hook for given name. ```js -hookCollection.error(name, method) +hookCollection.error(name, method); ```
@@ -354,10 +371,10 @@ hookCollection.error(name, method) Example ```js -hookCollection.error('save', function (error, options) { - if (error.ignore) return - throw error -}) +hookCollection.error("save", function (error, options) { + if (error.ignore) return; + throw error; +}); ``` ### hookCollection.after() @@ -365,7 +382,7 @@ hookCollection.error('save', function (error, options) { Add after hook for given name. ```js -hookCollection.after(name, method) +hookCollection.after(name, method); ```
@@ -397,13 +414,13 @@ hookCollection.after(name, method) Example ```js -hookCollection.after('save', function (result, options) { +hookCollection.after("save", function (result, options) { if (result.updatedAt) { - app.emit('update', result) + app.emit("update", result); } else { - app.emit('create', result) + app.emit("create", result); } -}) +}); ``` ### hookCollection.wrap() @@ -411,7 +428,7 @@ hookCollection.after('save', function (result, options) { Add wrap hook for given name. ```js -hookCollection.wrap(name, method) +hookCollection.wrap(name, method); ```
@@ -442,26 +459,26 @@ hookCollection.wrap(name, method) Example ```js -hookCollection.wrap('save', async function (saveInDatabase, options) { +hookCollection.wrap("save", async function (saveInDatabase, options) { if (!record.name) { - throw new Error('name property is required') + throw new Error("name property is required"); } try { - const result = await saveInDatabase(options) + const result = await saveInDatabase(options); if (result.updatedAt) { - app.emit('update', result) + app.emit("update", result); } else { - app.emit('create', result) + app.emit("create", result); } - return result + return result; } catch (error) { - if (error.ignore) return - throw error + if (error.ignore) return; + throw error; } -}) +}); ``` See also: [Test mock example](examples/test-mock-example.md) @@ -471,7 +488,7 @@ See also: [Test mock example](examples/test-mock-example.md) Removes hook for given name. ```js -hookCollection.remove(name, hookMethod) +hookCollection.remove(name, hookMethod); ```
@@ -502,59 +519,123 @@ hookCollection.remove(name, hookMethod) Example ```js -hookCollection.remove('save', validateRecord) +hookCollection.remove("save", validateRecord); ``` ## TypeScript -This library contains type definitions for TypeScript. When you use TypeScript we highly recommend using the `Hook.Singular` constructor for your hooks as this allows you to pass along type information for the options object. For example: +This library contains type definitions for TypeScript. + +### Type support for `Singular`: ```ts +import { Hook } from "before-after-hook"; -import {Hook} from 'before-after-hook' +type TOptions = { foo: string }; // type for options +type TResult = { bar: number }; // type for result +type TError = Error; // type for error -interface Foo { - bar: string - num: number; -} +const hook = new Hook.Singular(); -const hook = new Hook.Singular(); +hook.before((options) => { + // `options.foo` has `string` type -hook.before(function (foo) { + // not allowed + options.foo = 42; - // typescript will complain about the following mutation attempts - foo.hello = 'world' - foo.bar = 123 + // allowed + options.foo = "Forty-Two"; +}); - // yet this is valid - foo.bar = 'other-string' - foo.num = 123 -}) +const hookedMethod = hook( + (options) => { + // `options.foo` has `string` type -const foo = hook(function(foo) { - // handle `foo` - foo.bar = 'another-string' -}, {bar: 'random-string'}) + // not allowed, because it does not satisfy the `R` type + return { foo: 42 }; -// foo outputs -{ - bar: 'another-string', - num: 123 -} + // allowed + return { bar: 42 }; + }, + { foo: "Forty-Two" } +); +``` + +You can choose not to pass the types for options, result or error. So, these are completely valid: + +```ts +const hook = new Hook.Singular(); +const hook = new Hook.Singular(); +const hook = new Hook.Singular(); +``` + +In these cases, the omitted types will implicitly be `any`. + +### Type support for `Collection`: + +`Collection` also has strict type support. You can use it like this: + +```ts +import { Hook } from "before-after-hook"; + +type HooksType = { + add: { + Options: { type: string }; + Result: { id: number }; + Error: Error; + }; + save: { + Options: { type: string }; + Result: { id: number }; + }; + read: { + Options: { id: number; foo: number }; + }; + destroy: { + Options: { id: number; foo: string }; + }; +}; + +const hooks = new Hook.Collection(); + +hooks.before("destroy", (options) => { + // `options.id` has `number` type +}); + +hooks.error("add", (err, options) => { + // `options.type` has `string` type + // `err` is `instanceof Error` +}); + +hooks.error("save", (err, options) => { + // `options.type` has `string` type + // `err` has type `any` +}); + +hooks.after("save", (result, options) => { + // `options.type` has `string` type + // `result.id` has `number` type +}); +``` + +You can choose not to pass the types altogether. In that case, everything will implicitly be `any`: + +```ts +const hook = new Hook.Collection(); ``` -An alternative import: +Alternative imports: ```ts -import {Singular, Collection} from 'before-after-hook' +import { Singular, Collection } from "before-after-hook"; -const hook = new Singular<{foo: string}>(); -const hookCollection = new Collection(); +const hook = new Singular(); +const hooks = new Collection(); ``` ## Upgrading to 1.4 -Since version 1.4 the `Hook` constructor has been deprecated in favor of returning `Hook.Singular` in an upcoming breaking release. +Since version 1.4 the `Hook` constructor has been deprecated in favor of returning `Hook.Singular` in an upcoming breaking release. Version 1.4 is still 100% backwards-compatible, but if you want to continue using hook collections, we recommend using the `Hook.Collection` constructor instead before the next release. diff --git a/node_modules/before-after-hook/index.d.ts b/node_modules/before-after-hook/index.d.ts index 3c19a5c..9c95de3 100644 --- a/node_modules/before-after-hook/index.d.ts +++ b/node_modules/before-after-hook/index.d.ts @@ -1,82 +1,172 @@ -type HookMethod = (options: O) => R | Promise +type HookMethod = ( + options: Options +) => Result | Promise -type BeforeHook = (options: O) => void -type ErrorHook = (error: E, options: O) => void -type AfterHook = (result: R, options: O) => void -type WrapHook = ( - hookMethod: HookMethod, - options: O -) => R | Promise +type BeforeHook = (options: Options) => void | Promise +type ErrorHook = ( + error: Error, + options: Options +) => void | Promise +type AfterHook = ( + result: Result, + options: Options +) => void | Promise +type WrapHook = ( + hookMethod: HookMethod, + options: Options +) => Result | Promise -type AnyHook = - | BeforeHook - | ErrorHook - | AfterHook - | WrapHook +type AnyHook = + | BeforeHook + | ErrorHook + | AfterHook + | WrapHook -export interface HookCollection { +type TypeStoreKeyLong = 'Options' | 'Result' | 'Error' +type TypeStoreKeyShort = 'O' | 'R' | 'E' +type TypeStore = + | ({ [key in TypeStoreKeyLong]?: any } & + { [key in TypeStoreKeyShort]?: never }) + | ({ [key in TypeStoreKeyLong]?: never } & + { [key in TypeStoreKeyShort]?: any }) +type GetType< + Store extends TypeStore, + LongKey extends TypeStoreKeyLong, + ShortKey extends TypeStoreKeyShort +> = LongKey extends keyof Store + ? Store[LongKey] + : ShortKey extends keyof Store + ? Store[ShortKey] + : any + +export interface HookCollection< + HooksType extends Record = Record< + string, + { Options: any; Result: any; Error: any } + >, + HookName extends keyof HooksType = keyof HooksType +> { /** * Invoke before and after hooks */ - ( - name: string | string[], - hookMethod: HookMethod, - options?: any - ): Promise + ( + name: Name | Name[], + hookMethod: HookMethod< + GetType, + GetType + >, + options?: GetType + ): Promise> /** * Add `before` hook for given `name` */ - before(name: string, beforeHook: BeforeHook): void + before( + name: Name, + beforeHook: BeforeHook> + ): void /** * Add `error` hook for given `name` */ - error(name: string, errorHook: ErrorHook): void + error( + name: Name, + errorHook: ErrorHook< + GetType, + GetType + > + ): void /** * Add `after` hook for given `name` */ - after(name: string, afterHook: AfterHook): void + after( + name: Name, + afterHook: AfterHook< + GetType, + GetType + > + ): void /** * Add `wrap` hook for given `name` */ - wrap(name: string, wrapHook: WrapHook): void + wrap( + name: Name, + wrapHook: WrapHook< + GetType, + GetType + > + ): void /** * Remove added hook for given `name` */ - remove(name: string, hook: AnyHook): void + remove( + name: Name, + hook: AnyHook< + GetType, + GetType, + GetType + > + ): void + /** + * Public API + */ + api: Pick< + HookCollection, + 'before' | 'error' | 'after' | 'wrap' | 'remove' + > } -export interface HookSingular { +export interface HookSingular { /** * Invoke before and after hooks */ - (hookMethod: HookMethod, options?: O): Promise + (hookMethod: HookMethod, options?: Options): Promise /** * Add `before` hook */ - before(beforeHook: BeforeHook): void + before(beforeHook: BeforeHook): void /** * Add `error` hook */ - error(errorHook: ErrorHook): void + error(errorHook: ErrorHook): void /** * Add `after` hook */ - after(afterHook: AfterHook): void + after(afterHook: AfterHook): void /** * Add `wrap` hook */ - wrap(wrapHook: WrapHook): void + wrap(wrapHook: WrapHook): void /** * Remove added hook */ - remove(hook: AnyHook): void + remove(hook: AnyHook): void + /** + * Public API + */ + api: Pick< + HookSingular, + 'before' | 'error' | 'after' | 'wrap' | 'remove' + > } -type Collection = new () => HookCollection -type Singular = new () => HookSingular +type Collection = new < + HooksType extends Record = Record< + string, + { Options: any; Result: any; Error: any } + > +>() => HookCollection +type Singular = new < + Options = any, + Result = any, + Error = any +>() => HookSingular interface Hook { - new (): HookCollection + new < + HooksType extends Record = Record< + string, + { Options: any; Result: any; Error: any } + > + >(): HookCollection /** * Creates a collection of hooks diff --git a/node_modules/before-after-hook/lib/add.js b/node_modules/before-after-hook/lib/add.js index a34e3f4..f379eab 100644 --- a/node_modules/before-after-hook/lib/add.js +++ b/node_modules/before-after-hook/lib/add.js @@ -1,46 +1,46 @@ -module.exports = addHook +module.exports = addHook; -function addHook (state, kind, name, hook) { - var orig = hook +function addHook(state, kind, name, hook) { + var orig = hook; if (!state.registry[name]) { - state.registry[name] = [] + state.registry[name] = []; } - if (kind === 'before') { + if (kind === "before") { hook = function (method, options) { return Promise.resolve() .then(orig.bind(null, options)) - .then(method.bind(null, options)) - } + .then(method.bind(null, options)); + }; } - if (kind === 'after') { + if (kind === "after") { hook = function (method, options) { - var result + var result; return Promise.resolve() .then(method.bind(null, options)) .then(function (result_) { - result = result_ - return orig(result, options) + result = result_; + return orig(result, options); }) .then(function () { - return result - }) - } + return result; + }); + }; } - if (kind === 'error') { + if (kind === "error") { hook = function (method, options) { return Promise.resolve() .then(method.bind(null, options)) .catch(function (error) { - return orig(error, options) - }) - } + return orig(error, options); + }); + }; } state.registry[name].push({ hook: hook, - orig: orig - }) + orig: orig, + }); } diff --git a/node_modules/before-after-hook/lib/register.js b/node_modules/before-after-hook/lib/register.js index b3d01fd..f0d3d4e 100644 --- a/node_modules/before-after-hook/lib/register.js +++ b/node_modules/before-after-hook/lib/register.js @@ -1,28 +1,27 @@ -module.exports = register +module.exports = register; -function register (state, name, method, options) { - if (typeof method !== 'function') { - throw new Error('method for before hook must be a function') +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); } if (!options) { - options = {} + options = {}; } if (Array.isArray(name)) { return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options) - }, method)() + return register.bind(null, state, name, callback, options); + }, method)(); } - return Promise.resolve() - .then(function () { - if (!state.registry[name]) { - return method(options) - } + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); + } - return (state.registry[name]).reduce(function (method, registered) { - return registered.hook.bind(null, method, options) - }, method)() - }) + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); } diff --git a/node_modules/before-after-hook/lib/remove.js b/node_modules/before-after-hook/lib/remove.js index e357c51..590b963 100644 --- a/node_modules/before-after-hook/lib/remove.js +++ b/node_modules/before-after-hook/lib/remove.js @@ -1,17 +1,19 @@ -module.exports = removeHook +module.exports = removeHook; -function removeHook (state, name, method) { +function removeHook(state, name, method) { if (!state.registry[name]) { - return + return; } var index = state.registry[name] - .map(function (registered) { return registered.orig }) - .indexOf(method) + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); if (index === -1) { - return + return; } - state.registry[name].splice(index, 1) + state.registry[name].splice(index, 1); } diff --git a/node_modules/before-after-hook/package.json b/node_modules/before-after-hook/package.json index 1aa58a5..25f4756 100644 --- a/node_modules/before-after-hook/package.json +++ b/node_modules/before-after-hook/package.json @@ -1,7 +1,8 @@ { "name": "before-after-hook", - "version": "2.1.0", + "version": "2.2.2", "description": "asynchronous before/error/after hooks for internal functionality", + "main": "index.js", "files": [ "index.js", "index.d.ts", @@ -12,7 +13,9 @@ "prebuild": "rimraf dist && mkdirp dist", "build": "browserify index.js --standalone=Hook > dist/before-after-hook.js", "postbuild": "uglifyjs dist/before-after-hook.js -mc > dist/before-after-hook.min.js", - "pretest": "standard", + "lint": "prettier --check '{lib,test,examples}/**/*' README.md package.json", + "lint:fix": "prettier --write '{lib,test,examples}/**/*' README.md package.json", + "pretest": "npm run -s lint", "test": "npm run -s test:node | tap-spec", "posttest": "npm run validate:ts", "test:node": "node test", @@ -24,10 +27,7 @@ "presemantic-release": "npm run build", "semantic-release": "semantic-release" }, - "repository": { - "type": "git", - "url": "https://github.com/gr2m/before-after-hook.git" - }, + "repository": "github:gr2m/before-after-hook", "keywords": [ "hook", "hooks", @@ -35,26 +35,22 @@ ], "author": "Gregor Martynus", "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/gr2m/before-after-hook/issues" - }, - "homepage": "https://github.com/gr2m/before-after-hook#readme", "dependencies": {}, "devDependencies": { "browserify": "^16.0.0", "gaze-cli": "^0.2.0", "istanbul": "^0.4.0", "istanbul-coveralls": "^1.0.3", - "mkdirp": "^0.5.1", - "rimraf": "^2.4.4", - "semantic-release": "^15.0.0", + "mkdirp": "^1.0.3", + "prettier": "^2.0.0", + "rimraf": "^3.0.0", + "semantic-release": "^17.0.0", "simple-mock": "^0.8.0", - "standard": "^13.0.1", "tap-min": "^2.0.0", "tap-spec": "^5.0.0", - "tape": "^4.2.2", + "tape": "^5.0.0", "typescript": "^3.5.3", - "uglify-js": "^3.0.0" + "uglify-js": "^3.9.0" }, "release": { "publish": [ diff --git a/node_modules/blakejs/.github/workflows/ci.yml b/node_modules/blakejs/.github/workflows/ci.yml new file mode 100644 index 0000000..1a184ff --- /dev/null +++ b/node_modules/blakejs/.github/workflows/ci.yml @@ -0,0 +1,9 @@ +name: Lint and Unit Test +on: [push] +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: npm ci + - run: npm run test diff --git a/node_modules/blakejs/.npmignore b/node_modules/blakejs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/blakejs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/blakejs/.travis.yml b/node_modules/blakejs/.travis.yml deleted file mode 100644 index 2197832..0000000 --- a/node_modules/blakejs/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "node" diff --git a/node_modules/blakejs/LICENSE b/node_modules/blakejs/LICENSE new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/node_modules/blakejs/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/node_modules/blakejs/README.md b/node_modules/blakejs/README.md index 0672dc8..178812f 100644 --- a/node_modules/blakejs/README.md +++ b/node_modules/blakejs/README.md @@ -1,10 +1,10 @@ -BLAKE.js +blakejs ==== [![travis ci](https://travis-ci.org/dcposch/blakejs.svg?branch=master)](https://travis-ci.org/dcposch/blakejs) [![npm version](https://badge.fury.io/js/blakejs.svg)](https://badge.fury.io/js/blakejs) -**blake.js is a pure Javascript implementation of the BLAKE2b and BLAKE2s hash functions.** +**blakejs is a pure Javascript implementation of the BLAKE2b and BLAKE2s hash functions.** ![blake1](https://cloud.githubusercontent.com/assets/169280/25921238/9bf1877a-3589-11e7-8a93-74b69c3874bb.jpg) @@ -16,10 +16,19 @@ BLAKE is the default family of hash functions in the venerable NaCl crypto libra Of course, this implementation is in Javascript, so it won't be winning any speed records. More under Performance below. It's short and sweet, less than 500 LOC. -**As far as I know, this is the only package available today to compute BLAKE in a browser.** +**As far as I know, this package is the easiest way to compute Blake2 in the browser.** + +Other options to consider: +- [@nazar-pc](https://github.com/nazar-pc) has WebAssembly implementation for higher performance where supported: [blake2.wasm](https://github.com/nazar-pc/blake2.wasm) +- [@emilbayes](https://github.com/emilbayes) has a Blake2b-only implementation with salt support; WASM with automatic JS fallback: [blake2b](https://github.com/emilbayes/blake2b) +- On node, you probably want the native wrapper [node-blake2](https://github.com/ludios/node-blake2) Quick Start --- +``` +$ npm install --save blakejs +``` + ```js var blake = require('blakejs') console.log(blake.blake2bHex('abc')) diff --git a/node_modules/blakejs/blake2b.js b/node_modules/blakejs/blake2b.js index 5300800..9021f30 100644 --- a/node_modules/blakejs/blake2b.js +++ b/node_modules/blakejs/blake2b.js @@ -2,14 +2,14 @@ // Adapted from the reference implementation in RFC7693 // Ported to Javascript by DC - https://github.com/dcposch -var util = require('./util') +const util = require('./util') // 64-bit unsigned addition // Sets v[a,a+1] += v[b,b+1] // v should be a Uint32Array function ADD64AA (v, a, b) { - var o0 = v[a] + v[b] - var o1 = v[a + 1] + v[b + 1] + const o0 = v[a] + v[b] + let o1 = v[a + 1] + v[b + 1] if (o0 >= 0x100000000) { o1++ } @@ -21,11 +21,11 @@ function ADD64AA (v, a, b) { // Sets v[a,a+1] += b // b0 is the low 32 bits of b, b1 represents the high 32 bits function ADD64AC (v, a, b0, b1) { - var o0 = v[a] + b0 + let o0 = v[a] + b0 if (b0 < 0) { o0 += 0x100000000 } - var o1 = v[a + 1] + b1 + let o1 = v[a + 1] + b1 if (o0 >= 0x100000000) { o1++ } @@ -35,26 +35,23 @@ function ADD64AC (v, a, b0, b1) { // Little-endian byte access function B2B_GET32 (arr, i) { - return (arr[i] ^ - (arr[i + 1] << 8) ^ - (arr[i + 2] << 16) ^ - (arr[i + 3] << 24)) + return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24) } // G Mixing function // The ROTRs are inlined for speed function B2B_G (a, b, c, d, ix, iy) { - var x0 = m[ix] - var x1 = m[ix + 1] - var y0 = m[iy] - var y1 = m[iy + 1] + const x0 = m[ix] + const x1 = m[ix + 1] + const y0 = m[iy] + const y1 = m[iy + 1] ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits - var xor0 = v[d] ^ v[a] - var xor1 = v[d + 1] ^ v[a + 1] + let xor0 = v[d] ^ v[a] + let xor1 = v[d + 1] ^ v[a + 1] v[d] = xor1 v[d + 1] = xor0 @@ -85,39 +82,235 @@ function B2B_G (a, b, c, d, ix, iy) { } // Initialization Vector -var BLAKE2B_IV32 = new Uint32Array([ - 0xF3BCC908, 0x6A09E667, 0x84CAA73B, 0xBB67AE85, - 0xFE94F82B, 0x3C6EF372, 0x5F1D36F1, 0xA54FF53A, - 0xADE682D1, 0x510E527F, 0x2B3E6C1F, 0x9B05688C, - 0xFB41BD6B, 0x1F83D9AB, 0x137E2179, 0x5BE0CD19 +const BLAKE2B_IV32 = new Uint32Array([ + 0xf3bcc908, + 0x6a09e667, + 0x84caa73b, + 0xbb67ae85, + 0xfe94f82b, + 0x3c6ef372, + 0x5f1d36f1, + 0xa54ff53a, + 0xade682d1, + 0x510e527f, + 0x2b3e6c1f, + 0x9b05688c, + 0xfb41bd6b, + 0x1f83d9ab, + 0x137e2179, + 0x5be0cd19 ]) -var SIGMA8 = [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 +const SIGMA8 = [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3 ] // These are offsets into a uint64 buffer. // Multiply them all by 2 to make them offsets into a uint32 buffer, // because this is Javascript and we don't have uint64s -var SIGMA82 = new Uint8Array(SIGMA8.map(function (x) { return x * 2 })) +const SIGMA82 = new Uint8Array( + SIGMA8.map(function (x) { + return x * 2 + }) +) // Compression function. 'last' flag indicates last block. // Note we're representing 16 uint64s as 32 uint32s -var v = new Uint32Array(32) -var m = new Uint32Array(32) +const v = new Uint32Array(32) +const m = new Uint32Array(32) function blake2bCompress (ctx, last) { - var i = 0 + let i = 0 // init work variables for (i = 0; i < 16; i++) { @@ -176,7 +369,7 @@ function blake2bInit (outlen, key) { } // state, 'param block' - var ctx = { + const ctx = { b: new Uint8Array(128), h: new Uint32Array(16), t: 0, // input count @@ -185,10 +378,10 @@ function blake2bInit (outlen, key) { } // initialize hash state - for (var i = 0; i < 16; i++) { + for (let i = 0; i < 16; i++) { ctx.h[i] = BLAKE2B_IV32[i] } - var keylen = key ? key.length : 0 + const keylen = key ? key.length : 0 ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen // key the hash, if applicable @@ -204,8 +397,9 @@ function blake2bInit (outlen, key) { // Updates a BLAKE2b streaming hash // Requires hash context and Uint8Array (byte array) function blake2bUpdate (ctx, input) { - for (var i = 0; i < input.length; i++) { - if (ctx.c === 128) { // buffer full ? + for (let i = 0; i < input.length; i++) { + if (ctx.c === 128) { + // buffer full ? ctx.t += ctx.c // add counters blake2bCompress(ctx, false) // compress (not last) ctx.c = 0 // counter to zero @@ -219,14 +413,15 @@ function blake2bUpdate (ctx, input) { function blake2bFinal (ctx) { ctx.t += ctx.c // mark last block offset - while (ctx.c < 128) { // fill up with zeros + while (ctx.c < 128) { + // fill up with zeros ctx.b[ctx.c++] = 0 } blake2bCompress(ctx, true) // final block flag = 1 // little endian convert and store - var out = new Uint8Array(ctx.outlen) - for (var i = 0; i < ctx.outlen; i++) { + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { out[i] = ctx.h[i >> 2] >> (8 * (i & 3)) } return out @@ -246,7 +441,7 @@ function blake2b (input, key, outlen) { input = util.normalizeInput(input) // do the math - var ctx = blake2bInit(outlen, key) + const ctx = blake2bInit(outlen, key) blake2bUpdate(ctx, input) return blake2bFinal(ctx) } @@ -260,7 +455,7 @@ function blake2b (input, key, outlen) { // - key - optional key Uint8Array, up to 64 bytes // - outlen - optional output length in bytes, default 64 function blake2bHex (input, key, outlen) { - var output = blake2b(input, key, outlen) + const output = blake2b(input, key, outlen) return util.toHex(output) } diff --git a/node_modules/blakejs/blake2s.js b/node_modules/blakejs/blake2s.js index 2a73510..517b136 100644 --- a/node_modules/blakejs/blake2s.js +++ b/node_modules/blakejs/blake2s.js @@ -2,7 +2,7 @@ // Adapted from the reference implementation in RFC7693 // Ported to Javascript by DC - https://github.com/dcposch -var util = require('./util') +const util = require('./util') // Little-endian byte access. // Expects a Uint8Array and an index @@ -31,39 +31,200 @@ function ROTR32 (x, y) { } // Initialization Vector. -var BLAKE2S_IV = new Uint32Array([ - 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, - 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19]) - -var SIGMA = new Uint8Array([ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, - 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, - 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, - 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, - 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, - 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, - 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, - 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, - 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0]) +const BLAKE2S_IV = new Uint32Array([ + 0x6a09e667, + 0xbb67ae85, + 0x3c6ef372, + 0xa54ff53a, + 0x510e527f, + 0x9b05688c, + 0x1f83d9ab, + 0x5be0cd19 +]) + +const SIGMA = new Uint8Array([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 14, + 10, + 4, + 8, + 9, + 15, + 13, + 6, + 1, + 12, + 0, + 2, + 11, + 7, + 5, + 3, + 11, + 8, + 12, + 0, + 5, + 2, + 15, + 13, + 10, + 14, + 3, + 6, + 7, + 1, + 9, + 4, + 7, + 9, + 3, + 1, + 13, + 12, + 11, + 14, + 2, + 6, + 5, + 10, + 4, + 0, + 15, + 8, + 9, + 0, + 5, + 7, + 2, + 4, + 10, + 15, + 14, + 1, + 11, + 12, + 6, + 8, + 3, + 13, + 2, + 12, + 6, + 10, + 0, + 11, + 8, + 3, + 4, + 13, + 7, + 5, + 15, + 14, + 1, + 9, + 12, + 5, + 1, + 15, + 14, + 13, + 4, + 10, + 0, + 7, + 6, + 3, + 9, + 2, + 8, + 11, + 13, + 11, + 7, + 14, + 12, + 1, + 3, + 9, + 5, + 0, + 15, + 4, + 8, + 6, + 2, + 10, + 6, + 15, + 14, + 9, + 11, + 3, + 0, + 8, + 12, + 2, + 13, + 7, + 1, + 4, + 10, + 5, + 10, + 2, + 8, + 4, + 7, + 6, + 1, + 5, + 15, + 11, + 9, + 14, + 3, + 12, + 13, + 0 +]) // Compression function. "last" flag indicates last block -var v = new Uint32Array(16) -var m = new Uint32Array(16) +const v = new Uint32Array(16) +const m = new Uint32Array(16) function blake2sCompress (ctx, last) { - var i = 0 - for (i = 0; i < 8; i++) { // init work variables + let i = 0 + for (i = 0; i < 8; i++) { + // init work variables v[i] = ctx.h[i] v[i + 8] = BLAKE2S_IV[i] } v[12] ^= ctx.t // low 32 bits of offset - v[13] ^= (ctx.t / 0x100000000) // high 32 bits - if (last) { // last block flag set ? + v[13] ^= ctx.t / 0x100000000 // high 32 bits + if (last) { + // last block flag set ? v[14] = ~v[14] } - for (i = 0; i < 16; i++) { // get little-endian words + for (i = 0; i < 16; i++) { + // get little-endian words m[i] = B2S_GET32(ctx.b, 4 * i) } @@ -97,14 +258,14 @@ function blake2sInit (outlen, key) { if (!(outlen > 0 && outlen <= 32)) { throw new Error('Incorrect output length, should be in [1, 32]') } - var keylen = key ? key.length : 0 + const keylen = key ? key.length : 0 if (key && !(keylen > 0 && keylen <= 32)) { throw new Error('Incorrect key length, should be in [1, 32]') } - var ctx = { + const ctx = { h: new Uint32Array(BLAKE2S_IV), // hash state - b: new Uint32Array(64), // input block + b: new Uint8Array(64), // input block c: 0, // pointer within block t: 0, // input count outlen: outlen // output length in bytes @@ -122,8 +283,9 @@ function blake2sInit (outlen, key) { // Updates a BLAKE2s streaming hash // Requires hash context and Uint8Array (byte array) function blake2sUpdate (ctx, input) { - for (var i = 0; i < input.length; i++) { - if (ctx.c === 64) { // buffer full ? + for (let i = 0; i < input.length; i++) { + if (ctx.c === 64) { + // buffer full ? ctx.t += ctx.c // add counters blake2sCompress(ctx, false) // compress (not last) ctx.c = 0 // counter to zero @@ -136,15 +298,16 @@ function blake2sUpdate (ctx, input) { // Returns a Uint8Array containing the message digest function blake2sFinal (ctx) { ctx.t += ctx.c // mark last block offset - while (ctx.c < 64) { // fill up with zeros + while (ctx.c < 64) { + // fill up with zeros ctx.b[ctx.c++] = 0 } blake2sCompress(ctx, true) // final block flag = 1 // little endian convert and store - var out = new Uint8Array(ctx.outlen) - for (var i = 0; i < ctx.outlen; i++) { - out[i] = (ctx.h[i >> 2] >> (8 * (i & 3))) & 0xFF + const out = new Uint8Array(ctx.outlen) + for (let i = 0; i < ctx.outlen; i++) { + out[i] = (ctx.h[i >> 2] >> (8 * (i & 3))) & 0xff } return out } @@ -163,7 +326,7 @@ function blake2s (input, key, outlen) { input = util.normalizeInput(input) // do the math - var ctx = blake2sInit(outlen, key) + const ctx = blake2sInit(outlen, key) blake2sUpdate(ctx, input) return blake2sFinal(ctx) } @@ -177,7 +340,7 @@ function blake2s (input, key, outlen) { // - key - optional key Uint8Array, up to 32 bytes // - outlen - optional output length in bytes, default 64 function blake2sHex (input, key, outlen) { - var output = blake2s(input, key, outlen) + const output = blake2s(input, key, outlen) return util.toHex(output) } diff --git a/node_modules/blakejs/index.d.ts b/node_modules/blakejs/index.d.ts new file mode 100644 index 0000000..7ca28ca --- /dev/null +++ b/node_modules/blakejs/index.d.ts @@ -0,0 +1,96 @@ +export interface Blake2bCTX { + b: Uint8Array; + h: Uint32Array; + t: number; + c: number; + outlen: number; +} + +/** + * Creates a Blake2b hashing context + * @param outlen between 1 and 64 + * @param key optional + * @returns the hashing context + */ +export declare function blake2bInit(outlen?: number, key?: Uint8Array): Blake2bCTX; + +/** + * Updates a Blake2b streaming hash + * @param ctx hashing context from blake2bInit() + * @param input Byte array + */ +export declare function blake2bUpdate(ctx: Blake2bCTX, input: ArrayLike): void; + +/** + * Completes a Blake2b streaming hash + * @param ctx hashing context from blake2bInit() + * @returns the final hash + */ +export declare function blake2bFinal(ctx: Blake2bCTX): Uint8Array; + +/** + * + * @param input the input bytes, as a string, Buffer, or Uint8Array + * @param key optional key Uint8Array, up to 64 bytes + * @param outlen optional output length in bytes, defaults to 64 + * @returns an n-byte Uint8Array + */ +export declare function blake2b(input: string | Uint8Array, key?: Uint8Array, outlen?: number): Uint8Array; + +/** + * Computes the Blake2b hash of a string or byte array + * + * @param input the input bytes, as a string, Buffer, or Uint8Array + * @param key optional key Uint8Array, up to 64 bytes + * @param outlen outlen - optional output length in bytes, defaults to 64 + * @returns an n-byte hash in hex, all lowercase + */ +export declare function blake2bHex(input: string | Uint8Array, key?: Uint8Array, outlen?: number): string; + +export interface Blake2sCTX { + h: Uint32Array; + b: Uint8Array; + c: number; + t: number; + outlen: number; +} + +/** + * Creates a Blake2s hashing context + * @param outlen between 1 and 32 + * @param key optional Uint8Array key + * @returns the hashing context + */ +export declare function blake2sInit(outlen: number, key?: Uint8Array): Blake2sCTX; + +/** + * Updates a Blake2s streaming hash + * @param ctx hashing context from blake2sinit() + * @param input byte array + */ +export declare function blake2sUpdate(ctx: Blake2sCTX, input: ArrayLike): void; + +/** + * Completes a Blake2s streaming hash + * @param ctx hashing context from blake2sinit() + * @returns Uint8Array containing the message digest + */ +export declare function blake2sFinal(ctx: Blake2sCTX): Uint8Array; + +/** + * Computes the Blake2s hash of a string or byte array, and returns a Uint8Array + * @param input the input bytes, as a string, Buffer, or Uint8Array + * @param key optional key Uint8Array, up to 32 bytes + * @param outlen optional output length in bytes, defaults to 64 + * @returns an n-byte Uint8Array + */ +export declare function blake2s(input: string | Uint8Array, key?: Uint8Array, outlen?: number): Uint8Array; + +/** + * + * @param input the input bytes, as a string, Buffer, or Uint8Array + * @param key optional key Uint8Array, up to 32 bytes + * @param outlen optional output length in bytes, defaults to 64 + * @returns an n-byte hash in hex, all lowercase + */ +export declare function blake2sHex(input: string | Uint8Array, key?: Uint8Array, outlen?: number): string; diff --git a/node_modules/blakejs/index.js b/node_modules/blakejs/index.js index 84a4582..37bbcb3 100644 --- a/node_modules/blakejs/index.js +++ b/node_modules/blakejs/index.js @@ -1,5 +1,5 @@ -var b2b = require('./blake2b') -var b2s = require('./blake2s') +const b2b = require('./blake2b') +const b2s = require('./blake2s') module.exports = { blake2b: b2b.blake2b, diff --git a/node_modules/blakejs/package.json b/node_modules/blakejs/package.json index 26821b7..179b09e 100644 --- a/node_modules/blakejs/package.json +++ b/node_modules/blakejs/package.json @@ -1,6 +1,6 @@ { "name": "blakejs", - "version": "1.1.0", + "version": "1.1.1", "description": "Pure Javascript implementation of the BLAKE2b and BLAKE2s hash functions", "main": "index.js", "scripts": { diff --git a/node_modules/blakejs/test_blake2b.js b/node_modules/blakejs/test_blake2b.js index 7708d5e..66d9502 100644 --- a/node_modules/blakejs/test_blake2b.js +++ b/node_modules/blakejs/test_blake2b.js @@ -1,9 +1,9 @@ -var test = require('tape') -var blake2b = require('./blake2b') -var util = require('./util') -var fs = require('fs') +const test = require('tape') +const blake2b = require('./blake2b') +const util = require('./util') +const fs = require('fs') -var blake2bHex = blake2b.blake2bHex +const blake2bHex = blake2b.blake2bHex test('BLAKE2b basic', function (t) { // From the example computation in the RFC @@ -31,16 +31,16 @@ test('Input types', function (t) { }) test('BLAKE2b generated test vectors', function (t) { - var contents = fs.readFileSync('generated_test_vectors.txt', 'utf8') + const contents = fs.readFileSync('generated_test_vectors.txt', 'utf8') contents.split('\n').forEach(function (line) { if (line.length === 0) { return } - var parts = line.split('\t') - var inputHex = parts[0] - var keyHex = parts[1] - var outLen = parts[2] - var outHex = parts[3] + const parts = line.split('\t') + const inputHex = parts[0] + const keyHex = parts[1] + const outLen = parts[2] + const outHex = parts[3] t.equal(blake2bHex(hexToBytes(inputHex), hexToBytes(keyHex), outLen), outHex) }) @@ -48,8 +48,8 @@ test('BLAKE2b generated test vectors', function (t) { }) test('BLAKE2b performance', function (t) { - var N = 1 << 22 // number of bytes to hash - var RUNS = 3 // how often to repeat, to allow JIT to finish + const N = 1 << 22 // number of bytes to hash + const RUNS = 3 // how often to repeat, to allow JIT to finish console.log('Benchmarking BLAKE2b(' + (N >> 20) + ' MB input)') util.testSpeed(blake2bHex, N, RUNS) @@ -57,16 +57,16 @@ test('BLAKE2b performance', function (t) { }) test('Byte counter should support values up to 2**53', function (t) { - var testCases = [ - {t: 1, a0: 1, a1: 0}, - {t: 0xffffffff, a0: 0xffffffff, a1: 0}, - {t: 0x100000000, a0: 0, a1: 1}, - {t: 0x123456789abcd, a0: 0x6789abcd, a1: 0x12345}, + const testCases = [ + { t: 1, a0: 1, a1: 0 }, + { t: 0xffffffff, a0: 0xffffffff, a1: 0 }, + { t: 0x100000000, a0: 0, a1: 1 }, + { t: 0x123456789abcd, a0: 0x6789abcd, a1: 0x12345 }, // test 2**53 - 1 - {t: 0x1fffffffffffff, a0: 0xffffffff, a1: 0x1fffff}] + { t: 0x1fffffffffffff, a0: 0xffffffff, a1: 0x1fffff }] testCases.forEach(function (testCase) { - var arr = new Uint32Array([0, 0]) + const arr = new Uint32Array([0, 0]) // test the code that's inlined in both blake2s.js and blake2b.js // to make sure it splits byte counters up to 2**53 into uint32s correctly @@ -80,8 +80,8 @@ test('Byte counter should support values up to 2**53', function (t) { }) function hexToBytes (hex) { - var ret = new Uint8Array(hex.length / 2) - for (var i = 0; i < ret.length; i++) { + const ret = new Uint8Array(hex.length / 2) + for (let i = 0; i < ret.length; i++) { ret[i] = parseInt(hex.substring(i * 2, i * 2 + 2), 16) } return ret diff --git a/node_modules/blakejs/test_blake2s.js b/node_modules/blakejs/test_blake2s.js index 6f1788a..c4ffa86 100644 --- a/node_modules/blakejs/test_blake2s.js +++ b/node_modules/blakejs/test_blake2s.js @@ -1,12 +1,12 @@ -var test = require('tape') -var toHex = require('./util').toHex -var util = require('./util') -var b2s = require('./blake2s') -var blake2s = b2s.blake2s -var blake2sHex = b2s.blake2sHex -var blake2sInit = b2s.blake2sInit -var blake2sUpdate = b2s.blake2sUpdate -var blake2sFinal = b2s.blake2sFinal +const test = require('tape') +const toHex = require('./util').toHex +const util = require('./util') +const b2s = require('./blake2s') +const blake2s = b2s.blake2s +const blake2sHex = b2s.blake2sHex +const blake2sInit = b2s.blake2sInit +const blake2sUpdate = b2s.blake2sUpdate +const blake2sFinal = b2s.blake2sFinal test('BLAKE2s basic', function (t) { // From the example computation in the RFC @@ -21,47 +21,47 @@ test('BLAKE2s basic', function (t) { test('BLAKE2s self test', function (t) { // Grand hash of hash results - var expectedHash = [ + const expectedHash = [ 0x6A, 0x41, 0x1F, 0x08, 0xCE, 0x25, 0xAD, 0xCD, 0xFB, 0x02, 0xAB, 0xA6, 0x41, 0x45, 0x1C, 0xEC, 0x53, 0xC5, 0x98, 0xB2, 0x4F, 0x4F, 0xC7, 0x87, 0xFB, 0xDC, 0x88, 0x79, 0x7F, 0x4C, 0x1D, 0xFE] // Parameter sets - var outputLengths = [16, 20, 28, 32] - var inputLengths = [0, 3, 64, 65, 255, 1024] + const outputLengths = [16, 20, 28, 32] + const inputLengths = [0, 3, 64, 65, 255, 1024] // 256-bit hash for testing - var ctx = blake2sInit(32) + const ctx = blake2sInit(32) - for (var i = 0; i < 4; i++) { - var outlen = outputLengths[i] - for (var j = 0; j < 6; j++) { - var inlen = inputLengths[j] + for (let i = 0; i < 4; i++) { + const outlen = outputLengths[i] + for (let j = 0; j < 6; j++) { + const inlen = inputLengths[j] - var arr = generateInput(inlen, inlen) - var hash = blake2s(arr, null, outlen) // unkeyed hash + const arr = generateInput(inlen, inlen) + let hash = blake2s(arr, null, outlen) // unkeyed hash blake2sUpdate(ctx, hash) // hash the hash - var key = generateInput(outlen, outlen) + const key = generateInput(outlen, outlen) hash = blake2s(arr, key, outlen) // keyed hash blake2sUpdate(ctx, hash) // hash the hash } } // Compute and compare the hash of hashes - var finalHash = blake2sFinal(ctx) + const finalHash = blake2sFinal(ctx) t.equal(toHex(finalHash), toHex(expectedHash)) t.end() }) // Returns a Uint8Array of len bytes function generateInput (len, seed) { - var out = new Uint8Array(len) - var a = new Uint32Array(3) + const out = new Uint8Array(len) + const a = new Uint32Array(3) a[0] = 0xDEAD4BAD * seed // prime a[1] = 1 - for (var i = 0; i < len; i++) { // fill the buf + for (let i = 0; i < len; i++) { // fill the buf a[2] = a[0] + a[1] a[0] = a[1] a[1] = a[2] @@ -71,8 +71,8 @@ function generateInput (len, seed) { } test('BLAKE2s performance', function (t) { - var N = 1 << 22 // number of bytes to hash - var RUNS = 3 // how often to repeat, to allow JIT to finish + const N = 1 << 22 // number of bytes to hash + const RUNS = 3 // how often to repeat, to allow JIT to finish console.log('Benchmarking BLAKE2s(' + (N >> 20) + ' MB input)') util.testSpeed(blake2sHex, N, RUNS) diff --git a/node_modules/blakejs/util.js b/node_modules/blakejs/util.js index 1d84267..556e758 100644 --- a/node_modules/blakejs/util.js +++ b/node_modules/blakejs/util.js @@ -1,13 +1,13 @@ -var ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array' +const ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array' // For convenience, let people hash a string, not just a Uint8Array function normalizeInput (input) { - var ret + let ret if (input instanceof Uint8Array) { ret = input } else if (input instanceof Buffer) { ret = new Uint8Array(input) - } else if (typeof (input) === 'string') { + } else if (typeof input === 'string') { ret = new Uint8Array(Buffer.from(input, 'utf8')) } else { throw new Error(ERROR_MSG_INPUT) @@ -18,9 +18,11 @@ function normalizeInput (input) { // Converts a Uint8Array to a hexadecimal string // For example, toHex([255, 0, 255]) returns "ff00ff" function toHex (bytes) { - return Array.prototype.map.call(bytes, function (n) { - return (n < 16 ? '0' : '') + n.toString(16) - }).join('') + return Array.prototype.map + .call(bytes, function (n) { + return (n < 16 ? '0' : '') + n.toString(16) + }) + .join('') } // Converts any value in [0...2^32-1] to an 8-character hex string @@ -31,8 +33,8 @@ function uint32ToHex (val) { // For debugging: prints out hash state in the same format as the RFC // sample computation exactly, so that you can diff function debugPrint (label, arr, size) { - var msg = '\n' + label + ' = ' - for (var i = 0; i < arr.length; i += 2) { + let msg = '\n' + label + ' = ' + for (let i = 0; i < arr.length; i += 2) { if (size === 32) { msg += uint32ToHex(arr[i]).toUpperCase() msg += ' ' @@ -53,23 +55,25 @@ function debugPrint (label, arr, size) { // For performance testing: generates N bytes of input, hashes M times // Measures and prints MB/second hash performance each time function testSpeed (hashFn, N, M) { - var startMs = new Date().getTime() + let startMs = new Date().getTime() - var input = new Uint8Array(N) - for (var i = 0; i < N; i++) { + const input = new Uint8Array(N) + for (let i = 0; i < N; i++) { input[i] = i % 256 } - var genMs = new Date().getTime() + const genMs = new Date().getTime() console.log('Generated random input in ' + (genMs - startMs) + 'ms') startMs = genMs - for (i = 0; i < M; i++) { - var hashHex = hashFn(input) - var hashMs = new Date().getTime() - var ms = hashMs - startMs + for (let i = 0; i < M; i++) { + const hashHex = hashFn(input) + const hashMs = new Date().getTime() + const ms = hashMs - startMs startMs = hashMs console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...') - console.log(Math.round(N / (1 << 20) / (ms / 1000) * 100) / 100 + ' MB PER SECOND') + console.log( + Math.round((N / (1 << 20) / (ms / 1000)) * 100) / 100 + ' MB PER SECOND' + ) } } diff --git a/node_modules/buffer-from/index.js b/node_modules/buffer-from/index.js new file mode 100644 index 0000000..d92a83d --- /dev/null +++ b/node_modules/buffer-from/index.js @@ -0,0 +1,69 @@ +var toString = Object.prototype.toString + +var isModern = ( + typeof Buffer.alloc === 'function' && + typeof Buffer.allocUnsafe === 'function' && + typeof Buffer.from === 'function' +) + +function isArrayBuffer (input) { + return toString.call(input).slice(8, -1) === 'ArrayBuffer' +} + +function fromArrayBuffer (obj, byteOffset, length) { + byteOffset >>>= 0 + + var maxLength = obj.byteLength - byteOffset + + if (maxLength < 0) { + throw new RangeError("'offset' is out of bounds") + } + + if (length === undefined) { + length = maxLength + } else { + length >>>= 0 + + if (length > maxLength) { + throw new RangeError("'length' is out of bounds") + } + } + + return isModern + ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) + : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + return isModern + ? Buffer.from(string, encoding) + : new Buffer(string, encoding) +} + +function bufferFrom (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (isArrayBuffer(value)) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + return isModern + ? Buffer.from(value) + : new Buffer(value) +} + +module.exports = bufferFrom diff --git a/node_modules/buffer-from/package.json b/node_modules/buffer-from/package.json new file mode 100644 index 0000000..99c3b1e --- /dev/null +++ b/node_modules/buffer-from/package.json @@ -0,0 +1,16 @@ +{ + "name": "buffer-from", + "version": "0.1.2", + "license": "MIT", + "repository": "LinusU/buffer-from", + "scripts": { + "test": "standard && node test" + }, + "devDependencies": { + "standard": "^7.1.2" + }, + "keywords": [ + "buffer", + "buffer from" + ] +} diff --git a/node_modules/buffer-from/readme.md b/node_modules/buffer-from/readme.md new file mode 100644 index 0000000..9880a55 --- /dev/null +++ b/node_modules/buffer-from/readme.md @@ -0,0 +1,69 @@ +# Buffer From + +A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. + +## Installation + +```sh +npm install --save buffer-from +``` + +## Usage + +```js +const bufferFrom = require('buffer-from') + +console.log(bufferFrom([1, 2, 3, 4])) +//=> + +const arr = new Uint8Array([1, 2, 3, 4]) +console.log(bufferFrom(arr.buffer, 1, 2)) +//=> + +console.log(bufferFrom('test', 'utf8')) +//=> + +const buf = bufferFrom('test') +console.log(bufferFrom(buf)) +//=> +``` + +## API + +### bufferFrom(array) + +- `array` <Array> + +Allocates a new `Buffer` using an `array` of octets. + +### bufferFrom(arrayBuffer[, byteOffset[, length]]) + +- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer +- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0` +- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a TypedArray instance, the +newly created `Buffer` will share the same allocated memory as the TypedArray. + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +### bufferFrom(buffer) + +- `buffer` <Buffer> An existing `Buffer` to copy data from + +Copies the passed `buffer` data onto a new `Buffer` instance. + +### bufferFrom(string[, encoding]) + +- `string` <String> A string to encode. +- `encoding` <String> The encoding of `string`. **Default:** `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `string`. If +provided, the `encoding` parameter identifies the character encoding of +`string`. + +## See also + +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` diff --git a/node_modules/buffer-from/test.js b/node_modules/buffer-from/test.js new file mode 100644 index 0000000..527620b --- /dev/null +++ b/node_modules/buffer-from/test.js @@ -0,0 +1,12 @@ +var bufferFrom = require('./') +var assert = require('assert') + +assert.equal(bufferFrom([1, 2, 3, 4]).toString('hex'), '01020304') + +var arr = new Uint8Array([1, 2, 3, 4]) +assert.equal(bufferFrom(arr.buffer, 1, 2).toString('hex'), '0203') + +assert.equal(bufferFrom('test', 'utf8').toString('hex'), '74657374') + +var buf = bufferFrom('test') +assert.equal(bufferFrom(buf).toString('hex'), '74657374') diff --git a/node_modules/buffer/AUTHORS.md b/node_modules/buffer/AUTHORS.md index 63cdd9d..468aa19 100644 --- a/node_modules/buffer/AUTHORS.md +++ b/node_modules/buffer/AUTHORS.md @@ -68,5 +68,6 @@ - mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com) - jkkang (jkkang@smartauth.kr) - Deklan Webster (deklanw@gmail.com) +- Martin Heidegger (martin.heidegger@gmail.com) #### Generated by bin/update-authors.sh. diff --git a/node_modules/buffer/index.d.ts b/node_modules/buffer/index.d.ts index 5aa3549..07096a2 100644 --- a/node_modules/buffer/index.d.ts +++ b/node_modules/buffer/index.d.ts @@ -4,7 +4,7 @@ export class Buffer extends Uint8Array { toString(encoding?: string, start?: number, end?: number): string; toJSON(): { type: 'Buffer', data: any[] }; equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; slice(start?: number, end?: number): Buffer; writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; @@ -163,11 +163,11 @@ export class Buffer extends Uint8Array { * @param totalLength Total length of the buffers when concatenated. * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. */ - static concat(list: Buffer[], totalLength?: number): Buffer; + static concat(list: Uint8Array[], totalLength?: number): Buffer; /** * The same as buf1.compare(buf2). */ - static compare(buf1: Buffer, buf2: Buffer): number; + static compare(buf1: Uint8Array, buf2: Uint8Array): number; /** * Allocates a new buffer of {size} octets. * diff --git a/node_modules/buffer/package.json b/node_modules/buffer/package.json index 9af6e2a..ca1ad9a 100644 --- a/node_modules/buffer/package.json +++ b/node_modules/buffer/package.json @@ -1,7 +1,7 @@ { "name": "buffer", "description": "Node.js Buffer API, for the browser", - "version": "6.0.2", + "version": "6.0.3", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", diff --git a/node_modules/call-bind/.eslintignore b/node_modules/call-bind/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/call-bind/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/call-bind/.eslintrc b/node_modules/call-bind/.eslintrc deleted file mode 100644 index e5d3c9a..0000000 --- a/node_modules/call-bind/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "id-length": 0, - "new-cap": [2, { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - "no-magic-numbers": 0, - "operator-linebreak": [2, "before"], - }, -} diff --git a/node_modules/call-bind/.github/FUNDING.yml b/node_modules/call-bind/.github/FUNDING.yml deleted file mode 100644 index c70c2ec..0000000 --- a/node_modules/call-bind/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/call-bind -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bind/.nycrc b/node_modules/call-bind/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/call-bind/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/call-bind/CHANGELOG.md b/node_modules/call-bind/CHANGELOG.md deleted file mode 100644 index 62a3727..0000000 --- a/node_modules/call-bind/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 - -### Commits - -- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) - -## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 - -### Commits - -- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) -- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) -- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) -- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) -- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) -- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) -- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) -- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) - -## v1.0.0 - 2020-10-30 - -### Commits - -- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) -- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) -- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) -- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) -- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) -- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) -- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) -- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) -- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/node_modules/call-bind/LICENSE b/node_modules/call-bind/LICENSE deleted file mode 100644 index 48f05d0..0000000 --- a/node_modules/call-bind/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -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/call-bind/README.md b/node_modules/call-bind/README.md deleted file mode 100644 index 53649eb..0000000 --- a/node_modules/call-bind/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# call-bind -Robustly `.call.bind()` a function. diff --git a/node_modules/call-bind/callBound.js b/node_modules/call-bind/callBound.js deleted file mode 100644 index 8374adf..0000000 --- a/node_modules/call-bind/callBound.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; diff --git a/node_modules/call-bind/index.js b/node_modules/call-bind/index.js deleted file mode 100644 index 6fa3e4a..0000000 --- a/node_modules/call-bind/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} diff --git a/node_modules/call-bind/package.json b/node_modules/call-bind/package.json deleted file mode 100644 index 4360556..0000000 --- a/node_modules/call-bind/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "call-bind", - "version": "1.0.2", - "description": "Robustly `.call.bind()` a function", - "main": "index.js", - "exports": { - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ], - "./callBound": [ - { - "default": "./callBound.js" - }, - "./callBound.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "prepublish": "safe-publish-latest", - "lint": "eslint --ext=.js,.mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/*'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bind.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "callbind", - "callbound", - "call", - "bind", - "bound", - "call-bind", - "call-bound", - "function", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/call-bind/issues" - }, - "homepage": "https://github.com/ljharb/call-bind#readme", - "devDependencies": { - "@ljharb/eslint-config": "^17.3.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "eslint": "^7.17.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.1.1" - }, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - } -} diff --git a/node_modules/call-bind/test/callBound.js b/node_modules/call-bind/test/callBound.js deleted file mode 100644 index 209ce3c..0000000 --- a/node_modules/call-bind/test/callBound.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var callBound = require('../callBound'); - -test('callBound', function (t) { - // static primitive - t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); - t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); - - // static non-function object - t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); - t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); - t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); - t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); - - // static function - t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); - t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); - - // prototype primitive - t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); - t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); - - // prototype function - t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); - t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); - t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); - t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); - - t['throws']( - function () { callBound('does not exist'); }, - SyntaxError, - 'nonexistent intrinsic throws' - ); - t['throws']( - function () { callBound('does not exist', true); }, - SyntaxError, - 'allowMissing arg still throws for unknown intrinsic' - ); - - /* globals WeakRef: false */ - t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { - st['throws']( - function () { callBound('WeakRef'); }, - TypeError, - 'real but absent intrinsic throws' - ); - st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/call-bind/test/index.js b/node_modules/call-bind/test/index.js deleted file mode 100644 index bf6769c..0000000 --- a/node_modules/call-bind/test/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -var callBind = require('../'); -var bind = require('function-bind'); - -var test = require('tape'); - -/* - * older engines have length nonconfigurable - * in io.js v3, it is configurable except on bound functions, hence the .bind() - */ -var functionsHaveConfigurableLengths = !!( - Object.getOwnPropertyDescriptor - && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable -); - -test('callBind', function (t) { - var sentinel = { sentinel: true }; - var func = function (a, b) { - // eslint-disable-next-line no-invalid-this - return [this, a, b]; - }; - t.equal(func.length, 2, 'original function length is 2'); - t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); - t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); - t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); - - var bound = callBind(func); - t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); - t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args'); - t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args'); - - var boundR = callBind(func, sentinel); - t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); - t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); - t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); - - var boundArg = callBind(func, sentinel, 1); - t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); - t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); - t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); - - t.test('callBind.apply', function (st) { - var aBound = callBind.apply(func); - st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); - st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - - var aBoundArg = callBind.apply(func); - st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); - st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - - var aBoundR = callBind.apply(func, sentinel); - st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); - st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); - st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/combine-errors/.npmignore b/node_modules/combine-errors/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/node_modules/combine-errors/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/node_modules/combine-errors/History.md b/node_modules/combine-errors/History.md new file mode 100644 index 0000000..6cb1bf7 --- /dev/null +++ b/node_modules/combine-errors/History.md @@ -0,0 +1,35 @@ + +3.0.3 / 2016-06-28 +================== + + * use ES5 syntax for browser support + +3.0.2 / 2016-06-07 +================== + + * fix combining repeated errors and handle the stack better + +3.0.1 / 2016-04-24 +================== + + * use custom-error-instance + +3.0.0 / 2016-03-25 +================== + + * extend with a custom error + +2.0.0 / 2016-03-23 +================== + + * use a semicolon to separate errors :-X + +1.0.1 / 2016-03-11 +================== + + * quick tests and fix error.message + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/combine-errors/Makefile b/node_modules/combine-errors/Makefile new file mode 100644 index 0000000..d02dec8 --- /dev/null +++ b/node_modules/combine-errors/Makefile @@ -0,0 +1,6 @@ + +test: + @./node_modules/.bin/mocha \ + --reporter spec + +.PHONY: test diff --git a/node_modules/combine-errors/Readme.md b/node_modules/combine-errors/Readme.md new file mode 100644 index 0000000..c464255 --- /dev/null +++ b/node_modules/combine-errors/Readme.md @@ -0,0 +1,63 @@ + +# combine-errors + + Simple, dependency-free way to combine multiple errors into one. + + This is useful for handling multiple asynchronous errors, where you want to catch all the errors and combine them to return just a single error. + +## Features + +- `error instanceof Error === true` +- composable: `error([error([err1, err2]), err3])` +- stack and message are combined in a nice way +- array-like object, so you can access the original errors by looping over the error +- If you just have one error, it looks exactly like raw error meaning, `error(err).message === err.message && error(err).stack === err.stack` +- zero dependencies +- should work in the browser, though I haven't tested it yet + +## Installation + +``` +npm install combine-errors +``` + +## Usage + +```js +var error = require('combine-errors') +var err = error([ + new Error('boom'), + new Error('kablam') +]) +throw err +/* +=> +Error: boom + at repl:2:1 + at REPLServer.defaultEval (repl.js:262:27) + at bound (domain.js:287:14) + at REPLServer.runBound [as eval] (domain.js:300:12) + at REPLServer. (repl.js:431:12) + at emitOne (events.js:95:20) + at REPLServer.emit (events.js:182:7) + at REPLServer.Interface._onLine (readline.js:211:10) + at REPLServer.Interface._line (readline.js:550:8) + at REPLServer.Interface._ttyWrite (readline.js:827:14) + +Error: kablam + at repl:3:1 + at REPLServer.defaultEval (repl.js:262:27) + at bound (domain.js:287:14) + at REPLServer.runBound [as eval] (domain.js:300:12) + at REPLServer. (repl.js:431:12) + at emitOne (events.js:95:20) + at REPLServer.emit (events.js:182:7) + at REPLServer.Interface._onLine (readline.js:211:10) + at REPLServer.Interface._line (readline.js:550:8) + at REPLServer.Interface._ttyWrite (readline.js:827:14) +*/ +``` + +## License + +MIT diff --git a/node_modules/combine-errors/index.js b/node_modules/combine-errors/index.js new file mode 100644 index 0000000..1f9bfe6 --- /dev/null +++ b/node_modules/combine-errors/index.js @@ -0,0 +1,46 @@ +'use strict' + +/** + * Module Dependencies + */ + +var Custom = require('custom-error-instance') +var uniq = require('lodash.uniqby') + +/** + * Use a custom error type + */ + +var MultiError = Custom('MultiError') + +/** + * Export `Error` + */ + +module.exports = error + +/** + * Initialize an error + */ + +function error (errors) { + if (!(this instanceof error)) return new error(errors) + errors = Array.isArray(errors) ? errors : [ errors ] + errors = uniq(errors, function (err) { return err.stack }) + if (errors.length === 1) return errors[0] + var multierror = new MultiError({ + message: errors.map(function (err) { return err.message }).join('; '), + errors: errors.reduce(function (errs, err) { return errs.concat(err.errors || err) }, []), + }) + + // lazily get/set the stack + multierror.__defineGetter__('stack', function() { + return errors.map(function (err) { return err.stack }).join('\n\n') + }) + + multierror.__defineSetter__('stack', function(value) { + return [value].concat(multierror.stack).join('\n\n') + }) + + return multierror +} diff --git a/node_modules/combine-errors/package.json b/node_modules/combine-errors/package.json new file mode 100644 index 0000000..1f517f0 --- /dev/null +++ b/node_modules/combine-errors/package.json @@ -0,0 +1,25 @@ +{ + "name": "combine-errors", + "version": "3.0.3", + "description": "Combine errors into one", + "keywords": [ + "combine", + "errors", + "compose", + "error", + "handling" + ], + "author": "Matthew Mueller ", + "repository": { + "type": "git", + "url": "git://github.com/MatthewMueller/combine-errors.git" + }, + "dependencies": { + "custom-error-instance": "2.1.1", + "lodash.uniqby": "4.5.0" + }, + "main": "index", + "devDependencies": { + "mocha": "2.4.5" + } +} \ No newline at end of file diff --git a/node_modules/combine-errors/test.js b/node_modules/combine-errors/test.js new file mode 100644 index 0000000..2818136 --- /dev/null +++ b/node_modules/combine-errors/test.js @@ -0,0 +1,64 @@ +'use strict' + +/** + * Module Dependencies + */ + +let assert = require('assert') +var errors = require('./') + +/** + * Tests + */ + +describe('combine-errors', function() { + it('should pass through single errors', function() { + var a = new TypeError('a') + assert.ok(errors(a).message === a.message) + assert.ok(errors(a).stack === a.stack) + assert.ok(errors(a) instanceof Error) + }) + + it('should create a multierror for multiple errors', function() { + var a = new TypeError('a') + var b = new Error('b') + var err = errors([a, b]) + assert.ok(err instanceof Error) + assert.equal(err.message, 'a; b') + assert.ok(~err.stack.indexOf('TypeError: a')) + assert.ok(~err.stack.indexOf('Error: b')) + }) + + it('should group multiple errors that are the same into one', function() { + var a = new TypeError('a') + var err = errors([a, a]) + assert.ok(err instanceof Error) + assert.equal(err.message, 'a') + assert.ok(~err.stack.indexOf('TypeError: a')) + }) + + it('should allow you to overwrite the message', function() { + var a = new TypeError('a') + var b = new Error('b') + var err = errors([a, b]) + assert.ok(err instanceof Error) + err.message = err.message + ' (at: file)' + assert.equal(err.message, 'a; b (at: file)') + assert.ok(~err.stack.indexOf('TypeError: a')) + assert.ok(~err.stack.indexOf('Error: b')) + }) + + it('should compose nicely', function() { + var a = new SyntaxError('a') + var b = new TypeError('b') + var c = new Error('c') + var ab = errors([a, b]) + var abc = errors([ab, c]) + abc.message = abc.message + ' (at: file)' + assert.equal(abc.message, 'a; b; c (at: file)') + assert.ok(~abc.stack.indexOf('SyntaxError: a')) + assert.ok(~abc.stack.indexOf('TypeError: b')) + assert.ok(~abc.stack.indexOf('Error: c')) + assert.equal(abc.errors.length, 3) + }) +}) diff --git a/node_modules/custom-error-instance/.npmignore b/node_modules/custom-error-instance/.npmignore new file mode 100644 index 0000000..670c85a --- /dev/null +++ b/node_modules/custom-error-instance/.npmignore @@ -0,0 +1,135 @@ +# Created by .ignore support plugin (hsz.mobi) + +### Windows template +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + +### Linux template +*~ + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +### OSX template +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Node template +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git +node_modules + diff --git a/node_modules/custom-error-instance/README.md b/node_modules/custom-error-instance/README.md new file mode 100644 index 0000000..87706a7 --- /dev/null +++ b/node_modules/custom-error-instance/README.md @@ -0,0 +1,246 @@ +# custom-error-instance + +## Why? + +Errors are thrown when your code enters a state of instability, but depending on the error you may want to handle it differently. This module provides a way for you to define distinctive errors so that you can respond to them accordingly. See the *practical example* section for an example. + +## About + +Produce custom JavaScript errors that: + + - Integrate seamlessly with NodeJS' existing Error implementation. + - Extend the Error object without altering it. + - Create an inheritance hierarchy of custom errors and sub custom errors. + - Have instanceof types and instance constructor names. + - Accept additional properties. + - Produce custom error output. + - Will produce a stack trace of the length you specify. + - Plugable, create your own error instance generators. + +## Install + +```sh +npm install custom-error-instance +``` + +## Basic Example + +```js +var CustomError = require('custom-error-instance'); +var e; + +// define a custom error with a default message +var Parent = CustomError('ParentError', { message: 'Parent error' }); + +// define a custom error that inherits from the Parent custom error +var Child = CustomError('ChildError', Parent, { message: 'Child error' }); + +// create an error instance that uses defaults +e = Parent(); +console.log(e.toString()); // "ParentError: Parent error" +console.log(e.message); // "Parent error" +console.log(e.name); // "ParentError" +console.log(e.constructor.name); // "ParentError" +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true + +// create an error instance that overwrites the default message +e = Parent('Hello'); +console.log(e.toString()); // "ParentError: Hello" +console.log(e.message); // "Hello" +console.log(e.name); // "ParentError" +console.log(e.constructor.name); // "ParentError" +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true + +// create an error instance that overwrites the default message and defines a code +e = Parent({ message: 'Hello', code: 'XYZ' }); +console.log(e.toString()); // "ParentError XYZ: Hello" +console.log(e.message); // "Hello" +console.log(e.name); // "ParentError" +console.log(e.constructor.name); // "ParentError" +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true + +// create an error instance of the Child custom error +e = Child(); +console.log(e.toString()); // "ParentError: Child error" +console.log(e.message); // "Child error" +console.log(e.name); // "ChildError" +console.log(e.constructor.name); // "ChildError" +console.log(e instanceof Child); // true +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true +``` + +## Practical Example + +```js +var CustomError = require('custom-error-instance'); +var store = {}; + +var Err = CustomError('MapError'); +Err.inuse = CustomError(Err, { message: 'The specified key is already in use.', code: 'INUSE' }); + +function add(key, value) { + if (Math.random() < .3) throw new Err('Random Error'); + if (store.hasOwnProperty(key)) throw new Err.inuse(); + store[key] = value; +} + +try { + add('x', 1); + add('x', 2); +} catch (e) { + if (e instanceof Err.inuse) { + console.error(e.toString()); // "MapError INUSE: The specified key is already in use." + } else if (e instanceof Err) { + console.error('Unexpected ' + e); // "Unexpected MapError: Random Error" + } else { + throw e; + } +} +``` + +## API + +This module has just one function that is used to produce custom error constructors. + +#### CustomError ( [ name ] [, parent ] [, properties ] [, factory ] ) + +Call this function to create a custom error constructor function. + +**Parameters** + +- **name** - an optional string that defines the name for the error. This name is also applied to the constructor name property. Defaults to `'Error'` or the name of the parent custom error. +- **parent** - an optional constructor function to inherit from. This function must be the `Error` function or a custom error constructor. Defaults to `Error`. +- **properties** - an optional object with properties and values that will be merged with any properties provided when an instance is created from this custom error constructor. Defaults to `{}` +- **factory** - an optional function to call to modify the properties of the custom error instance. If not provided and this constructor's parent is `Error` then the root factory will be used. + +**Returns** a constructor function. + +## Constructor Function + +Defining a custom error returns a constructor function. You call the constructor to generate an `Error` instance. + +```js +var myErrConstructor = CustomError('MyErr', { message: 'Error occurred' }); +throw new myErrConstructor(); +``` + +The constructor function takes two optional parameters: + +1. **message** - This can be a string to fill the message property with or it can be an object that defines properties. Any properties defined here will overwrite properties specified when the constructor was being created by the `CustomError` function. +2. **config** - A configuration that can modify the behavior of the factory. + +## Factories + +A factory is used for modify the Error instance as it is being generated. By default the *root factory* will be applied to CustomError's that inherit directly from `Error`, but it is possible to specify the factory to call when you define a CustomError. When a factory is called, it is called with `this` being the `Error` or CustomError instance. The factory should modify `this` to make it into its desired state. + +When a factory function is called it receives these parameters: + +1. **properties** - The merged properties object (merging properties defined through CustomError inheritance with those provided when calling the constructor to create the instance). +2. **configuration** - An object that contains instructions for the factories to know how to run. +3. **factory** - An object with properties to call the factory functions defined at CustomError.factory. These functions, when called, will automatically scope the factory call to `this` and will automatically include the **factory** parameter as the third parameter. + +### CustomError.factory + +This object contains predefined factories that you can use to modify errors to some common formats. You can add, remove, or modify the functions on this object to define your own factory store. + +Here are some of the defined factories that are already on the CustomError.factory object: + +#### CustomError.factory.expectReceive + +This factory calls the root factory and then appends to the current message string details about what was expected and what was recieved. In the following example the message and code are defined as defaults when we define the constructor. When the `Error` instance is created we define what was expected and what was received. The result is a nice and descriptive error message. + +```js +var InvalidError = CustomError('InvalidError', { message: 'Invalid value.', code: 'EINVLD' }, CustomError.factory.expectReceive); +var e = new Err({ expected: 'a string', received: 5 }); +console.log(e.toString()); // "InvalidError EINVLD: Invalid value. Expected a string. Received: 5" +``` + +#### CustomError.factory.root + +Note: If a CustomError is being defined without specifying a factory and its parent is `Error` then the default root will be used. The root factory does the following: + +1) Copies properties and their values onto the instance. +2) Generates a stack trace and stores it on the instance. +3) Creates message getter and setter on the instance. +4) Creates code getter and setter on the instance. + +The configuration parameter for the factory takes the following properties: + +- **rootOnly** - Set this to false to allow the root factory to run on CustomErrors that are not at the root (inheriting directly from `Error`). Defaults to `true`. +- **stackLength** - Specify the length of the stack trace for this error instance. Defaults to `10`. + +## Inheritance + +If a constructor is generated with a parent specified then the child constructor will inherit the default properties of the parent and will merge those with any properties that it defines. If the child constructor defines a factory too, then the parent's factory will be run before running the child's factory. + +## Examples + +**Example 1: Common Usage** + +```js +var CustomError = require('custom-error-instance'); +var MyErr = CustomError('MyError', { message: 'Default message' }); + +console.log(new MyError().toString()); // "MyError: Default Message"; +console.log(new MyError('Oops').toString()); // "MyError: Oops"; +console.log(new MyError({ message: 'Oops', code: 'EOOP' }).toString()); // "MyError EOOP: Oops" +``` + +**Example 2: Child Custom Error** + +Child custom errors inherit properties and the factories from their parent custom error. + +```js +var CustomError = require('custom-error-instance'); +var MyErr = CustomError('MyError', { message: 'Parent message' }); +var ChildError = CustomError('ChildError', MyErr, { message: 'Child message'); +var e = new ChildError(); + +console.log(e.message); // "Child message"; +console.log(e instanceof ChildError); // true +console.log(e instanceof MyErr); // true, through inheritance +console.log(e instanceof Error); // true, through inheritance +console.log(e.constructor.name); // "ChildError" +``` + +**Example 3: Default Properties** + +```js +var CustomError = require('custom-error-instance'); +var MyError = CustomError('MyError', { code: 'EMY', foo: 'bar' }); + +var e = new MyError('Oops'); +console.log(e.message); // "Oops" +console.log(e.code); // 'EMY' +console.log(e.foo); // "bar" +``` + +**Example 4: Overwrite Default Properties** + +```js +var CustomError = require('custom-error-instance'); +var MyError = CustomError('MyError', { code: 'EMY', foo: 'bar' }); + +var e = new MyError({ message: 'Oops', code: 'FOO' }); +console.log(e.message); // "Oops" +console.log(e.code); // 'FOO' +console.log(e.foo); // "bar" +``` + +**Example 5: Custom Factory** + +Every factory receives three parameters: 1) the properties object, 2) a configuration that should be used to modify the behavior of the factory, and 3) an object with properties to call the factories defined at CustomError.factory. If a custom error inherits from another custom error then all factories in the inheritance chain are called, starting at the topmost parent. The factory function is called with the scope of the error instance. + +```js +var CustomError = require('custom-error-instance'); +var MyError = CustomError('MyError', function(properties, config, factory) { + factory.root(properties, config); + this.properties = properties; +}); +var e = new MyError('Oops'); +console.log(e.properties.message); // "Oops" +``` \ No newline at end of file diff --git a/node_modules/custom-error-instance/bin/error.js b/node_modules/custom-error-instance/bin/error.js new file mode 100644 index 0000000..fb891ee --- /dev/null +++ b/node_modules/custom-error-instance/bin/error.js @@ -0,0 +1,151 @@ +"use strict"; + +module.exports = CustomError; +CustomError.factory = require('./factories.js'); + +var Err = CustomError('CustomError'); +Err.order = CustomError(Err, { message: 'Arguments out of order.', code: 'EOARG' }); + +/** + * Create a custom error + * @param {string} [name] The name to give the error. Defaults to the name of it's parent. + * @param {function} [parent] The Error or CustomError constructor to inherit from. + * @param {object} [properties] The default properties for the custom error. + * @param {function} [factory] A function to call to modify the custom error instance when it is instantiated. + * @returns {function} that should be used as a constructor. + */ +function CustomError(name, parent, properties, factory) { + var construct; + var isRoot; + + // normalize arguments + parent = findArg(arguments, 1, Error, isParentArg, [isPropertiesArg, isFactoryArg]); + properties = findArg(arguments, 2, {}, isPropertiesArg, [isFactoryArg]); + factory = findArg(arguments, 3, noop, isFactoryArg, []); + name = findArg(arguments, 0, parent === Error ? 'Error' : parent.prototype.CustomError.name, isNameArg, [isParentArg, isPropertiesArg, isFactoryArg]); + + // if this is the root and their is no factory then use the default root factory + isRoot = parent === Error; + if (isRoot && factory === noop) factory = CustomError.factory.root; + + // build the constructor function + construct = function(message, configuration) { + var _this; + var ar; + var factories; + var i; + var item; + var props; + + // force this function to be called with the new keyword + if (!(this instanceof construct)) return new construct(message, configuration); + + // rename the constructor + delete this.constructor.name; + Object.defineProperty(this.constructor, 'name', { + enumerable: false, + configurable: true, + value: name, + writable: false + }); + + // make sure that the message is an object + if (typeof message === 'string') message = { message: message }; + if (!message) message = {}; + + // build the properties object + ar = this.CustomError.chain.slice(0).reverse().map(function(value) { return value.properties }); + ar.push(message); + ar.unshift({}); + props = Object.assign.apply(Object, ar); + + // build the factories caller (forcing scope to this) + _this = this; + factories = {}; + Object.keys(CustomError.factory).forEach(function(key) { + factories[key] = function(props, config) { + CustomError.factory[key].call(_this, props, config, factories); + }; + }); + + // call each factory in the chain, starting at the root + for (i = this.CustomError.chain.length - 1; i >= 0; i--) { + item = this.CustomError.chain[i]; + if (item.factory !== noop) { + item.factory.call(this, props, configuration, factories); + } + } + }; + + // cause the function prototype to inherit from parent's prototype + construct.prototype = Object.create(parent.prototype); + construct.prototype.constructor = construct; + + // update error name + construct.prototype.name = name; + + // add details about the custom error to the prototype + construct.prototype.CustomError = { + chain: isRoot ? [] : parent.prototype.CustomError.chain.slice(0), + factory: factory, + name: name, + parent: parent, + properties: properties + }; + construct.prototype.CustomError.chain.unshift(construct.prototype.CustomError); + + // update the toString method on the prototype to accept a code + construct.prototype.toString = function() { + var result = this.CustomError.chain[this.CustomError.chain.length - 1].name; + if (this.code) result += ' ' + this.code; + if (this.message) result += ': ' + this.message; + return result; + }; + + return construct; +} + + + + +function findArg(args, index, defaultValue, filter, antiFilters) { + var anti = -1; + var found = -1; + var i; + var j; + var len = index < args.length ? index : args.length; + var val; + + for (i = 0; i <= len; i++) { + val = args[i]; + if (anti === -1) { + for (j = 0; j < antiFilters.length; j++) { + if (antiFilters[j](val)) anti = i; + } + } + if (found === -1 && filter(val)) { + found = i; + } + } + + if (found !== -1 && anti !== -1 && anti < found) throw new Err.order(); + return found !== -1 ?args[found] : defaultValue; +} + +function isFactoryArg(value) { + return typeof value === 'function' && value !== Error && !value.prototype.CustomError; +} + +function isNameArg(value) { + return typeof value === 'string'; +} + +function isParentArg(value) { + return typeof value === 'function' && (value === Error || value.prototype.CustomError); +} + +function isPropertiesArg(value) { + return value && typeof value === 'object'; +} + +function noop() {} \ No newline at end of file diff --git a/node_modules/custom-error-instance/bin/factories.js b/node_modules/custom-error-instance/bin/factories.js new file mode 100644 index 0000000..2e69008 --- /dev/null +++ b/node_modules/custom-error-instance/bin/factories.js @@ -0,0 +1,87 @@ +"use strict"; + +exports.expectReceive = function(properties, configuration, factory) { + var message; + factory.root(properties, configuration, factory); + + message = this.message; + if (properties.hasOwnProperty('expected')) message += ' Expected ' + properties.expected + '.'; + if (properties.hasOwnProperty('received')) message += ' Received: ' + properties.received + '.'; + this.message = message; +}; + +exports.root = function(properties, configuration, factories) { + var _this = this; + var code; + var config = { stackLength: Error.stackTraceLimit, rootOnly: true }; + var messageStr = ''; + var originalStackLength = Error.stackTraceLimit; + var stack; + + function updateStack() { + stack[0] = _this.toString(); + _this.stack = stack.join('\n'); + } + + // get configuration options + if (!configuration || typeof configuration !== 'object') configuration = {}; + if (configuration.hasOwnProperty('stackLength') && + typeof configuration.stackLength === 'number' && + !isNaN(configuration.stackLength) && + configuration.stackLength >= 0) config.stackLength = configuration.stackLength; + if (!configuration.hasOwnProperty('rootOnly')) config.rootOnly = configuration.rootOnly; + + // check if this should only be run as root + if (!config.rootOnly || this.CustomError.parent === Error) { + + // copy properties onto this object + Object.keys(properties).forEach(function(key) { + switch(key) { + case 'code': + code = properties.code || void 0; + break; + case 'message': + messageStr = properties.message || ''; + break; + default: + _this[key] = properties[key]; + } + }); + + // generate the stack trace + Error.stackTraceLimit = config.stackLength + 2; + stack = (new Error()).stack.split('\n'); + stack.splice(0, 3); + stack.unshift(''); + Error.stackTraceLimit = originalStackLength; + this.stack = stack.join('\n'); + + Object.defineProperty(this, 'code', { + configurable: true, + enumerable: true, + get: function() { + return code; + }, + set: function(value) { + code = value; + updateStack(); + } + }); + + Object.defineProperty(this, 'message', { + configurable: true, + enumerable: true, + get: function() { + return messageStr; + }, + set: function(value) { + messageStr = value; + updateStack(); + } + }); + + + updateStack(); + + } +}; \ No newline at end of file diff --git a/node_modules/custom-error-instance/examples/about.js b/node_modules/custom-error-instance/examples/about.js new file mode 100644 index 0000000..a34cc51 --- /dev/null +++ b/node_modules/custom-error-instance/examples/about.js @@ -0,0 +1,46 @@ +var CustomError = require('../index'); + +// define a custom error with a default message +var Parent = CustomError('ParentError', { message: 'Parent error' }); + +// define a custom error that inherits from the Parent custom error +var Child = CustomError('ChildError', Parent, { message: 'Child error' }); + +var e; + +// create an error instance that uses defaults +e = Parent(); +console.log(e.toString()); // "ParentError: Parent error" +console.log(e.message); // "Parent error" +console.log(e.name); // "ParentError" +console.log(e.constructor.name); // "ParentError" +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true + +// create an error instance that overwrites the default message +e = Parent('Hello'); +console.log(e.toString()); // "ParentError: Hello" +console.log(e.message); // "Hello" +console.log(e.name); // "ParentError" +console.log(e.constructor.name); // "ParentError" +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true + +// create an error instance that overwrites the default message and defines a code +e = Parent({ message: 'Hello', code: 'XYZ' }); +console.log(e.toString()); // "ParentError XYZ: Hello" +console.log(e.message); // "Hello" +console.log(e.name); // "ParentError" +console.log(e.constructor.name); // "ParentError" +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true + +// create an error instance of the Child custom error +e = Child(); +console.log(e.toString()); // "ParentError: Child error" +console.log(e.message); // "Child error" +console.log(e.name); // "ChildError" +console.log(e.constructor.name); // "ChildError" +console.log(e instanceof Child); // true +console.log(e instanceof Parent); // true +console.log(e instanceof Error); // true \ No newline at end of file diff --git a/node_modules/custom-error-instance/examples/map.js b/node_modules/custom-error-instance/examples/map.js new file mode 100644 index 0000000..d688219 --- /dev/null +++ b/node_modules/custom-error-instance/examples/map.js @@ -0,0 +1,25 @@ +"use strict"; +var CustomError = require('../index'); +var store = {}; + +var Err = CustomError('MapError'); +Err.inuse = CustomError(Err, { message: 'The specified key is already in use.', code: 'INUSE' }); + +function add(key, value) { + if (Math.random() < .3) throw new Err('Random Error'); + if (store.hasOwnProperty(key)) throw new Err.inuse(); + store[key] = value; +} + +try { + add('x', 1); + add('x', 2); +} catch (e) { + if (e instanceof Err.inuse) { + console.error(e.toString()); // "MapError INUSE: The specified key is already in use." + } else if (e instanceof Err) { + console.error('Unexpected ' + e); // "Unexpected MapError: Random Error" + } else { + throw e; + } +} \ No newline at end of file diff --git a/node_modules/custom-error-instance/index.js b/node_modules/custom-error-instance/index.js new file mode 100644 index 0000000..86380fc --- /dev/null +++ b/node_modules/custom-error-instance/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./bin/error'); diff --git a/node_modules/custom-error-instance/package.json b/node_modules/custom-error-instance/package.json new file mode 100644 index 0000000..83e7227 --- /dev/null +++ b/node_modules/custom-error-instance/package.json @@ -0,0 +1,27 @@ +{ + "name": "custom-error-instance", + "version": "2.1.1", + "description": "Create custom JavaScript errors that also match instanceof.", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/Gi60s/custom-error-instance.git" + }, + "keywords": [ + "error", + "custom", + "custom-error", + "instance", + "instanceof" + ], + "author": "James Speirs", + "license": "ISC", + "bugs": { + "url": "https://github.com/Gi60s/custom-error-instance/issues" + }, + "homepage": "https://github.com/Gi60s/custom-error-instance#readme", + "devDependencies": { + "chai": "^3.4.1" + }, + "dependencies": {} +} diff --git a/node_modules/custom-error-instance/test/error.js b/node_modules/custom-error-instance/test/error.js new file mode 100644 index 0000000..726fec2 --- /dev/null +++ b/node_modules/custom-error-instance/test/error.js @@ -0,0 +1,198 @@ +"use strict"; +var expect = require('chai').expect; +var CustomError = require('../index'); + +describe('CustomError', function() { + + describe('define', function() { + + it('returns constructor function', function() { + expect(CustomError('MyError')).to.be.a('function'); + }); + + describe('parameter tests', function() { + + it('no parameters', function() { + var proto = CustomError().prototype.CustomError; + expect(proto.chain).to.be.an('Array'); + expect(proto.factory).to.be.a('function'); + expect(proto.name).to.be.equal('Error'); + expect(proto.parent).to.be.equal(Error); + expect(proto.properties).to.be.deep.equal({}); + }); + + describe('start name', function() { + + it('name only', function() { + expect(CustomError('Foo').prototype.CustomError.name).to.be.equal('Foo'); + }); + + it('name and parent', function() { + var P = CustomError(); + var E = CustomError('Foo', P); + expect(E.prototype.CustomError.name).to.be.equal('Foo'); + expect(E.prototype.CustomError.parent).to.be.equal(P); + }); + + it('name and properties', function() { + var E = CustomError('Foo', { foo: 'bar' }); + expect(E.prototype.CustomError.name).to.be.equal('Foo'); + expect(E.prototype.CustomError.properties).to.be.deep.equal({ foo: 'bar' }); + }); + + it('name and factory', function() { + var fn = function() {}; + var E = CustomError('Foo', fn); + expect(E.prototype.CustomError.name).to.be.equal('Foo'); + expect(E.prototype.CustomError.factory).to.be.equal(fn); + }); + + }); + + describe('start parent', function() { + + it('parent only', function() { + var E = CustomError(); + expect(CustomError(E).prototype.CustomError.parent).to.be.equal(E); + }); + + it('parent and properties', function() { + var P = CustomError(); + var E = CustomError(P, { foo: 'bar' }); + expect(E.prototype.CustomError.parent).to.be.equal(P); + expect(E.prototype.CustomError.properties).to.be.deep.equal({ foo: 'bar' }); + }); + + it('should fail properties then parent', function() { + try { + var P = CustomError(); + var E = CustomError({ foo: 'bar' }, P); + throw new Error('Should have failed'); + } catch (e) { + expect(e.name).to.be.equal('CustomError'); + expect(e.code).to.be.equal('EOARG'); + } + }); + + it('parent and factory', function() { + var fn = function() {}; + var P = CustomError(); + var E = CustomError(P, fn); + expect(E.prototype.CustomError.parent).to.be.equal(P); + expect(E.prototype.CustomError.factory).to.be.equal(fn); + }); + + }); + + describe('start properties', function() { + + it('properties only', function() { + expect(CustomError({ foo: 'bar' }).prototype.CustomError.properties).to.be.deep.equal({ foo: 'bar' }); + }); + + it('properties and factory', function() { + var fn = function() {}; + var E = CustomError({ foo: 'bar' }, fn); + expect(E.prototype.CustomError.properties).to.be.deep.equal({ foo: 'bar' }); + expect(E.prototype.CustomError.factory).to.be.equal(fn); + }); + + }); + + describe('start factory', function() { + + it('factory only', function() { + var fn = function() {}; + expect(CustomError(fn).prototype.CustomError.factory).to.be.equal(fn); + }); + + }); + + }); + + }); + + describe('inherit', function() { + + it('inherits from Error', function() { + var E = CustomError(); + expect(E()).to.be.instanceof(Error); + }); + + it('instance of self custom error constructor', function() { + var E = CustomError(); + expect(E()).to.be.instanceof(E); + }); + + it('inherits from custom error', function() { + var P = CustomError(); + var E = CustomError(P); + var e = E(); + expect(e).to.be.instanceof(Error); + expect(e).to.be.instanceof(P); + expect(e).to.be.instanceof(E); + }); + + }); + + describe('name', function() { + + it('instance has name provided', function() { + var e = CustomError('FooError')(); + expect(e.name).to.be.equal('FooError'); + }); + + it('instance has name inherited', function() { + var P = CustomError('FooError'); + var e = CustomError(P)(); + expect(e.name).to.be.equal('FooError'); + }); + + it('instance has constructor name provided', function() { + var e = CustomError('FooError')(); + expect(e.constructor.name).to.be.equal('FooError'); + }); + + it('instance has constructor name inherited', function() { + var P = CustomError('FooError'); + var e = CustomError(P)(); + expect(e.constructor.name).to.be.equal('FooError'); + }); + + }); + + describe('factory', function() { + + it('default factory', function() { + var E = CustomError(); + var e = E('Hello'); + expect(e.message).to.be.equal('Hello'); + }); + + it('custom factory', function() { + var fn = function(props, config) { this.message = JSON.stringify(props); }; + var e = CustomError(fn)('Hello'); + expect(e.message).to.be.equal('{"message":"Hello"}'); + expect(e.stack).to.be.undefined; + }); + + it('custom factory calling root', function() { + var fn = function(props, config, factory) { + factory.root(props, config); + this.message += ', Bob'; + }; + var e = CustomError(fn)('Hello'); + expect(e.message).to.be.equal('Hello, Bob'); + expect(e.stack).to.not.be.undefined; + }); + + it('custom and inherited factory', function() { + var fn = function(props, config) { this.message += 'ABC'; }; + var P = CustomError(); + var e = CustomError(P, fn)('Hello'); + expect(e.message).to.be.equal('HelloABC'); + }); + + }); + +}); \ No newline at end of file diff --git a/node_modules/decode-uri-component/index.js b/node_modules/decode-uri-component/index.js deleted file mode 100644 index 691499b..0000000 --- a/node_modules/decode-uri-component/index.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; -var token = '%[a-f0-9]{2}'; -var singleMatcher = new RegExp(token, 'gi'); -var multiMatcher = new RegExp('(' + token + ')+', 'gi'); - -function decodeComponents(components, split) { - try { - // Try to decode the entire string first - return decodeURIComponent(components.join('')); - } catch (err) { - // Do nothing - } - - if (components.length === 1) { - return components; - } - - split = split || 1; - - // Split the array in 2 parts - var left = components.slice(0, split); - var right = components.slice(split); - - return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); -} - -function decode(input) { - try { - return decodeURIComponent(input); - } catch (err) { - var tokens = input.match(singleMatcher); - - for (var i = 1; i < tokens.length; i++) { - input = decodeComponents(tokens, i).join(''); - - tokens = input.match(singleMatcher); - } - - return input; - } -} - -function customDecodeURIComponent(input) { - // Keep track of all the replacements and prefill the map with the `BOM` - var replaceMap = { - '%FE%FF': '\uFFFD\uFFFD', - '%FF%FE': '\uFFFD\uFFFD' - }; - - var match = multiMatcher.exec(input); - while (match) { - try { - // Decode as big chunks as possible - replaceMap[match[0]] = decodeURIComponent(match[0]); - } catch (err) { - var result = decode(match[0]); - - if (result !== match[0]) { - replaceMap[match[0]] = result; - } - } - - match = multiMatcher.exec(input); - } - - // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else - replaceMap['%C2'] = '\uFFFD'; - - var entries = Object.keys(replaceMap); - - for (var i = 0; i < entries.length; i++) { - // Replace all decoded components - var key = entries[i]; - input = input.replace(new RegExp(key, 'g'), replaceMap[key]); - } - - return input; -} - -module.exports = function (encodedURI) { - if (typeof encodedURI !== 'string') { - throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); - } - - try { - encodedURI = encodedURI.replace(/\+/g, ' '); - - // Try the built in decoder first - return decodeURIComponent(encodedURI); - } catch (err) { - // Fallback to a more advanced decoder - return customDecodeURIComponent(encodedURI); - } -}; diff --git a/node_modules/decode-uri-component/license b/node_modules/decode-uri-component/license deleted file mode 100644 index 78b0855..0000000 --- a/node_modules/decode-uri-component/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sam Verschueren (github.com/SamVerschueren) - -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/decode-uri-component/package.json b/node_modules/decode-uri-component/package.json deleted file mode 100644 index 183bd7c..0000000 --- a/node_modules/decode-uri-component/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "decode-uri-component", - "version": "0.2.0", - "description": "A better decodeURIComponent", - "license": "MIT", - "repository": "SamVerschueren/decode-uri-component", - "author": { - "name": "Sam Verschueren", - "email": "sam.verschueren@gmail.com", - "url": "github.com/SamVerschueren" - }, - "engines": { - "node": ">=0.10" - }, - "scripts": { - "test": "xo && nyc ava", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "index.js" - ], - "keywords": [ - "decode", - "uri", - "component", - "decodeuricomponent", - "components", - "decoder", - "url" - ], - "devDependencies": { - "ava": "^0.17.0", - "coveralls": "^2.13.1", - "nyc": "^10.3.2", - "xo": "^0.16.0" - } -} diff --git a/node_modules/decode-uri-component/readme.md b/node_modules/decode-uri-component/readme.md deleted file mode 100644 index 795c87f..0000000 --- a/node_modules/decode-uri-component/readme.md +++ /dev/null @@ -1,70 +0,0 @@ -# decode-uri-component - -[![Build Status](https://travis-ci.org/SamVerschueren/decode-uri-component.svg?branch=master)](https://travis-ci.org/SamVerschueren/decode-uri-component) [![Coverage Status](https://coveralls.io/repos/SamVerschueren/decode-uri-component/badge.svg?branch=master&service=github)](https://coveralls.io/github/SamVerschueren/decode-uri-component?branch=master) - -> A better [decodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) - - -## Why? - -- Decodes `+` to a space. -- Converts the [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) to a [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) `�`. -- Does not throw with invalid encoded input. -- Decodes as much of the string as possible. - - -## Install - -``` -$ npm install --save decode-uri-component -``` - - -## Usage - -```js -const decodeUriComponent = require('decode-uri-component'); - -decodeUriComponent('%25'); -//=> '%' - -decodeUriComponent('%'); -//=> '%' - -decodeUriComponent('st%C3%A5le'); -//=> 'ståle' - -decodeUriComponent('%st%C3%A5le%'); -//=> '%ståle%' - -decodeUriComponent('%%7Bst%C3%A5le%7D%'); -//=> '%{ståle}%' - -decodeUriComponent('%7B%ab%%7C%de%%7D'); -//=> '{%ab%|%de%}' - -decodeUriComponent('%FE%FF'); -//=> '\uFFFD\uFFFD' - -decodeUriComponent('%C2'); -//=> '\uFFFD' - -decodeUriComponent('%C2%B5'); -//=> 'µ' -``` - - -## API - -### decodeUriComponent(encodedURI) - -#### encodedURI - -Type: `string` - -An encoded component of a Uniform Resource Identifier. - - -## License - -MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/node_modules/filter-obj/index.js b/node_modules/filter-obj/index.js deleted file mode 100644 index c462e03..0000000 --- a/node_modules/filter-obj/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -module.exports = function (obj, predicate) { - var ret = {}; - var keys = Object.keys(obj); - var isArr = Array.isArray(predicate); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var val = obj[key]; - - if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) { - ret[key] = val; - } - } - - return ret; -}; diff --git a/node_modules/filter-obj/license b/node_modules/filter-obj/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/filter-obj/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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/filter-obj/package.json b/node_modules/filter-obj/package.json deleted file mode 100644 index 0705b90..0000000 --- a/node_modules/filter-obj/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "filter-obj", - "version": "1.1.0", - "description": "Filter object keys and values into a new object", - "license": "MIT", - "repository": "sindresorhus/filter-obj", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "filter", - "obj", - "object", - "key", - "keys", - "value", - "values", - "val", - "iterate", - "iterator" - ], - "devDependencies": { - "ava": "0.0.4", - "xo": "*" - } -} diff --git a/node_modules/filter-obj/readme.md b/node_modules/filter-obj/readme.md deleted file mode 100644 index 6de3c59..0000000 --- a/node_modules/filter-obj/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# filter-obj [![Build Status](https://travis-ci.org/sindresorhus/filter-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/filter-obj) - -> Filter object keys and values into a new object - - -## Install - -``` -$ npm install --save filter-obj -``` - - -## Usage - -```js -var filterObj = require('filter-obj'); - -var obj = { - foo: true, - bar: false -}; - -var newObject = filterObj(obj, function (key, value, object) { - return value === true; -}); -//=> {foo: true} - -var newObject2 = filterObj(obj, ['bar']); -//=> {bar: true} -``` - - -## Related - -- [map-obj](https://github.com/sindresorhus/map-obj) - Map object keys and values into a new object -- [object-assign](https://github.com/sindresorhus/object-assign) - Copy enumerable own properties from one or more source objects to a target object - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/follow-redirects/README.md b/node_modules/follow-redirects/README.md index b16430f..ea618ab 100644 --- a/node_modules/follow-redirects/README.md +++ b/node_modules/follow-redirects/README.md @@ -3,7 +3,7 @@ Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. [![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) -[![Build Status](https://travis-ci.org/follow-redirects/follow-redirects.svg?branch=master)](https://travis-ci.org/follow-redirects/follow-redirects) +[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions) [![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) [![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) [![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh) diff --git a/node_modules/follow-redirects/debug.js b/node_modules/follow-redirects/debug.js index 4c1fa24..f2556d7 100644 --- a/node_modules/follow-redirects/debug.js +++ b/node_modules/follow-redirects/debug.js @@ -1,9 +1,14 @@ var debug; -try { - /* eslint global-require: off */ - debug = require("debug")("follow-redirects"); -} -catch (error) { - debug = function () { /* */ }; -} -module.exports = debug; + +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = require("debug")("follow-redirects"); + } + catch (error) { + debug = function () { /* */ }; + } + } + debug.apply(null, arguments); +}; diff --git a/node_modules/follow-redirects/index.js b/node_modules/follow-redirects/index.js index ae42ba2..8ac500e 100644 --- a/node_modules/follow-redirects/index.js +++ b/node_modules/follow-redirects/index.js @@ -7,8 +7,9 @@ var assert = require("assert"); var debug = require("./debug"); // Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; var eventHandlers = Object.create(null); -["abort", "aborted", "connect", "error", "socket", "timeout"].forEach(function (event) { +events.forEach(function (event) { eventHandlers[event] = function (arg1, arg2, arg3) { this._redirectable.emit(event, arg1, arg2, arg3); }; @@ -61,6 +62,11 @@ function RedirectableRequest(options, responseCallback) { } RedirectableRequest.prototype = Object.create(Writable.prototype); +RedirectableRequest.prototype.abort = function () { + abortRequest(this._currentRequest); + this.emit("abort"); +}; + // Writes buffered data to the current native request RedirectableRequest.prototype.write = function (data, encoding, callback) { // Writing is not allowed if end has been called @@ -140,40 +146,58 @@ RedirectableRequest.prototype.removeHeader = function (name) { // Global timeout for all underlying requests RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; if (callback) { - this.once("timeout", callback); + this.on("timeout", callback); + } + + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); } + // Prevent a timeout from triggering + function clearTimer() { + clearTimeout(this._timeout); + if (callback) { + self.removeListener("timeout", callback); + } + if (!this.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } + + // Start the timer when the socket is opened if (this.socket) { - startTimer(this, msecs); + startTimer(this.socket); } else { - var self = this; - this._currentRequest.once("socket", function () { - startTimer(self, msecs); - }); + this._currentRequest.once("socket", startTimer); } + this.on("socket", destroyOnTimeout); this.once("response", clearTimer); this.once("error", clearTimer); return this; }; -function startTimer(request, msecs) { - clearTimeout(request._timeout); - request._timeout = setTimeout(function () { - request.emit("timeout"); - }, msecs); -} - -function clearTimer() { - clearTimeout(this._timeout); -} - // Proxy all other public ClientRequest methods [ - "abort", "flushHeaders", "getHeader", + "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", ].forEach(function (method) { RedirectableRequest.prototype[method] = function (a, b) { @@ -243,11 +267,8 @@ RedirectableRequest.prototype._performRequest = function () { // Set up event handlers request._redirectable = this; - for (var event in eventHandlers) { - /* istanbul ignore else */ - if (event) { - request.on(event, eventHandlers[event]); - } + for (var e = 0; e < events.length; e++) { + request.on(events[e], eventHandlers[events[e]]); } // End a redirected request @@ -305,9 +326,7 @@ RedirectableRequest.prototype._processResponse = function (response) { if (location && this._options.followRedirects !== false && statusCode >= 300 && statusCode < 400) { // Abort the current request - this._currentRequest.removeAllListeners(); - this._currentRequest.on("error", noop); - this._currentRequest.abort(); + abortRequest(this._currentRequest); // Discard the remainder of the response to avoid waiting for data response.destroy(); @@ -400,7 +419,7 @@ function wrap(protocols) { var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); // Executes a request, following redirects - wrappedProtocol.request = function (input, options, callback) { + function request(input, options, callback) { // Parse parameters if (typeof input === "string") { var urlStr = input; @@ -435,14 +454,20 @@ function wrap(protocols) { assert.equal(options.protocol, protocol, "protocol mismatch"); debug("options", options); return new RedirectableRequest(options, callback); - }; + } // Executes a GET request, following redirects - wrappedProtocol.get = function (input, options, callback) { - var request = wrappedProtocol.request(input, options, callback); - request.end(); - return request; - }; + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); }); return exports; } @@ -493,6 +518,14 @@ function createErrorType(code, defaultMessage) { return CustomError; } +function abortRequest(request) { + for (var e = 0; e < events.length; e++) { + request.removeListener(events[e], eventHandlers[events[e]]); + } + request.on("error", noop); + request.abort(); +} + // Exports module.exports = wrap({ http: http, https: https }); module.exports.wrap = wrap; diff --git a/node_modules/follow-redirects/package.json b/node_modules/follow-redirects/package.json index 14a7efa..73c18fd 100644 --- a/node_modules/follow-redirects/package.json +++ b/node_modules/follow-redirects/package.json @@ -1,6 +1,6 @@ { "name": "follow-redirects", - "version": "1.13.0", + "version": "1.14.1", "description": "HTTP and HTTPS modules that follow redirects.", "license": "MIT", "main": "index.js", @@ -43,6 +43,11 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "peerDependenciesMeta": { + "debug": { + "optional": true + } + }, "devDependencies": { "concat-stream": "^2.0.0", "eslint": "^5.16.0", diff --git a/node_modules/function-bind/.editorconfig b/node_modules/function-bind/.editorconfig deleted file mode 100644 index ac29ade..0000000 --- a/node_modules/function-bind/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 120 - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off diff --git a/node_modules/function-bind/.eslintrc b/node_modules/function-bind/.eslintrc deleted file mode 100644 index 9b33d8e..0000000 --- a/node_modules/function-bind/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "indent": [2, 4], - "max-nested-callbacks": [2, 3], - "max-params": [2, 3], - "max-statements": [2, 20], - "no-new-func": [1], - "strict": [0] - } -} diff --git a/node_modules/function-bind/.jscs.json b/node_modules/function-bind/.jscs.json deleted file mode 100644 index 8c44794..0000000 --- a/node_modules/function-bind/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 8 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/node_modules/function-bind/.npmignore b/node_modules/function-bind/.npmignore deleted file mode 100644 index dbb555f..0000000 --- a/node_modules/function-bind/.npmignore +++ /dev/null @@ -1,22 +0,0 @@ -# gitignore -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -coverage -node_modules - -# Only apps should have lockfiles -npm-shrinkwrap.json -package-lock.json -yarn.lock diff --git a/node_modules/function-bind/.travis.yml b/node_modules/function-bind/.travis.yml deleted file mode 100644 index 85f70d2..0000000 --- a/node_modules/function-bind/.travis.yml +++ /dev/null @@ -1,168 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "8.4" - - "7.10" - - "6.11" - - "5.12" - - "4.8" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "node" - env: PRETEST=true - - node_js: "4" - env: COVERAGE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true diff --git a/node_modules/function-bind/LICENSE b/node_modules/function-bind/LICENSE deleted file mode 100644 index 62d6d23..0000000 --- a/node_modules/function-bind/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013 Raynos. - -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/function-bind/README.md b/node_modules/function-bind/README.md deleted file mode 100644 index 81862a0..0000000 --- a/node_modules/function-bind/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# function-bind - - - - - -Implementation of function.prototype.bind - -## Example - -I mainly do this for unit tests I run on phantomjs. -PhantomJS does not have Function.prototype.bind :( - -```js -Function.prototype.bind = require("function-bind") -``` - -## Installation - -`npm install function-bind` - -## Contributors - - - Raynos - -## MIT Licenced - - [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg - [travis-url]: https://travis-ci.org/Raynos/function-bind - [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg - [npm-url]: https://npmjs.org/package/function-bind - [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png - [6]: https://coveralls.io/r/Raynos/function-bind - [7]: https://gemnasium.com/Raynos/function-bind.png - [8]: https://gemnasium.com/Raynos/function-bind - [deps-svg]: https://david-dm.org/Raynos/function-bind.svg - [deps-url]: https://david-dm.org/Raynos/function-bind - [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg - [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies - [11]: https://ci.testling.com/Raynos/function-bind.png - [12]: https://ci.testling.com/Raynos/function-bind diff --git a/node_modules/function-bind/implementation.js b/node_modules/function-bind/implementation.js deleted file mode 100644 index cc4daec..0000000 --- a/node_modules/function-bind/implementation.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; diff --git a/node_modules/function-bind/index.js b/node_modules/function-bind/index.js deleted file mode 100644 index 3bb6b96..0000000 --- a/node_modules/function-bind/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; diff --git a/node_modules/function-bind/package.json b/node_modules/function-bind/package.json deleted file mode 100644 index 20a1727..0000000 --- a/node_modules/function-bind/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "function-bind", - "version": "1.1.1", - "description": "Implementation of Function.prototype.bind", - "keywords": [ - "function", - "bind", - "shim", - "es5" - ], - "author": "Raynos ", - "repository": "git://github.com/Raynos/function-bind.git", - "main": "index", - "homepage": "https://github.com/Raynos/function-bind", - "contributors": [ - { - "name": "Raynos" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "bugs": { - "url": "https://github.com/Raynos/function-bind/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.5.0", - "jscs": "^3.0.7", - "tape": "^4.8.0" - }, - "license": "MIT", - "scripts": { - "pretest": "npm run lint", - "test": "npm run tests-only", - "posttest": "npm run coverage -- --quiet", - "tests-only": "node test", - "coverage": "covert test/*.js", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/function-bind/test/.eslintrc b/node_modules/function-bind/test/.eslintrc deleted file mode 100644 index 8a56d5b..0000000 --- a/node_modules/function-bind/test/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "rules": { - "array-bracket-newline": 0, - "array-element-newline": 0, - "max-statements-per-line": [2, { "max": 2 }], - "no-invalid-this": 0, - "no-magic-numbers": 0, - } -} diff --git a/node_modules/function-bind/test/index.js b/node_modules/function-bind/test/index.js deleted file mode 100644 index 2edecce..0000000 --- a/node_modules/function-bind/test/index.js +++ /dev/null @@ -1,252 +0,0 @@ -// jscs:disable requireUseStrict - -var test = require('tape'); - -var functionBind = require('../implementation'); -var getCurrentContext = function () { return this; }; - -test('functionBind is a function', function (t) { - t.equal(typeof functionBind, 'function'); - t.end(); -}); - -test('non-functions', function (t) { - var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; - t.plan(nonFunctions.length); - for (var i = 0; i < nonFunctions.length; ++i) { - try { functionBind.call(nonFunctions[i]); } catch (ex) { - t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); - } - } - t.end(); -}); - -test('without a context', function (t) { - t.test('binds properly', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }) - }; - namespace.func(1, 2, 3); - st.deepEqual(args, [1, 2, 3]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('binds properly, and still supplies bound arguments', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, undefined, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.deepEqual(args, [1, 2, 3, 4, 5, 6]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('returns properly', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('called as a constructor', function (st) { - var thunkify = function (value) { - return function () { return value; }; - }; - st.test('returns object value', function (sst) { - var expectedReturnValue = [1, 2, 3]; - var Constructor = functionBind.call(thunkify(expectedReturnValue), null); - var result = new Constructor(); - sst.equal(result, expectedReturnValue); - sst.end(); - }); - - st.test('does not return primitive value', function (sst) { - var Constructor = functionBind.call(thunkify(42), null); - var result = new Constructor(); - sst.notEqual(result, 42); - sst.end(); - }); - - st.test('object from bound constructor is instance of original and bound constructor', function (sst) { - var A = function (x) { - this.name = x || 'A'; - }; - var B = functionBind.call(A, null, 'B'); - - var result = new B(); - sst.ok(result instanceof B, 'result is instance of bound constructor'); - sst.ok(result instanceof A, 'result is instance of original constructor'); - sst.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('with a context', function (t) { - t.test('with no bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext) - }; - namespace.func(1, 2, 3); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); - st.end(); - }); - - t.test('with bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); - st.end(); - }); - - t.test('returns properly', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('passes the correct arguments when called as a constructor', function (st) { - var expected = { name: 'Correct' }; - var namespace = { - Func: functionBind.call(function (arg) { - return arg; - }, { name: 'Incorrect' }) - }; - var returned = new namespace.Func(expected); - st.equal(returned, expected, 'returns the right arg when called as a constructor'); - st.end(); - }); - - t.test('has the new instance\'s context when called as a constructor', function (st) { - var actualContext; - var expectedContext = { foo: 'bar' }; - var namespace = { - Func: functionBind.call(function () { - actualContext = this; - }, expectedContext) - }; - var result = new namespace.Func(); - st.equal(result instanceof namespace.Func, true); - st.notEqual(actualContext, expectedContext); - st.end(); - }); - - t.end(); -}); - -test('bound function length', function (t) { - t.test('sets a correct length without thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); -}); diff --git a/node_modules/get-intrinsic/.eslintignore b/node_modules/get-intrinsic/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/get-intrinsic/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/get-intrinsic/.eslintrc b/node_modules/get-intrinsic/.eslintrc deleted file mode 100644 index d04e483..0000000 --- a/node_modules/get-intrinsic/.eslintrc +++ /dev/null @@ -1,43 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "env": { - "es6": true, - "es2017": true, - "es2020": true, - "es2021": true, - }, - - "globals": { - "AggregateError": false, - }, - - "rules": { - "array-bracket-newline": 0, - "array-element-newline": 0, - "complexity": 0, - "eqeqeq": [2, "allow-null"], - "func-name-matching": 0, - "id-length": 0, - "max-lines-per-function": [2, 80], - "max-params": [2, 4], - "max-statements": 0, - "max-statements-per-line": [2, { "max": 2 }], - "multiline-comment-style": 0, - "no-magic-numbers": 0, - "operator-linebreak": [2, "before"], - "sort-keys": 0, - }, - - "overrides": [ - { - "files": "test/**", - "rules": { - "max-lines-per-function": 0, - "new-cap": 0, - }, - }, - ], -} diff --git a/node_modules/get-intrinsic/.github/FUNDING.yml b/node_modules/get-intrinsic/.github/FUNDING.yml deleted file mode 100644 index 8e8da0d..0000000 --- a/node_modules/get-intrinsic/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/get-intrinsic -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/get-intrinsic/.nycrc b/node_modules/get-intrinsic/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/get-intrinsic/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/get-intrinsic/CHANGELOG.md b/node_modules/get-intrinsic/CHANGELOG.md deleted file mode 100644 index 32502ec..0000000 --- a/node_modules/get-intrinsic/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.1.1](https://github.com/ljharb/get-intrinsic/compare/v1.1.0...v1.1.1) - 2021-02-03 - -### Fixed - -- [meta] export `./package.json` [`#9`](https://github.com/ljharb/get-intrinsic/issues/9) - -### Commits - -- [readme] flesh out the readme; use `evalmd` [`d12f12c`](https://github.com/ljharb/get-intrinsic/commit/d12f12c15345a0a0772cc65a7c64369529abd614) -- [eslint] set up proper globals config [`5a8c098`](https://github.com/ljharb/get-intrinsic/commit/5a8c0984e3319d1ac0e64b102f8ec18b64e79f36) -- [Dev Deps] update `eslint` [`7b9a5c0`](https://github.com/ljharb/get-intrinsic/commit/7b9a5c0d31a90ca1a1234181c74988fb046701cd) - -## [v1.1.0](https://github.com/ljharb/get-intrinsic/compare/v1.0.2...v1.1.0) - 2021-01-25 - -### Fixed - -- [Refactor] delay `Function` eval until syntax-derived values are requested [`#3`](https://github.com/ljharb/get-intrinsic/issues/3) - -### Commits - -- [Tests] migrate tests to Github Actions [`2ab762b`](https://github.com/ljharb/get-intrinsic/commit/2ab762b48164aea8af37a40ba105bbc8246ab8c4) -- [meta] do not publish github action workflow files [`5e7108e`](https://github.com/ljharb/get-intrinsic/commit/5e7108e4768b244d48d9567ba4f8a6cab9c65b8e) -- [Tests] add some coverage [`01ac7a8`](https://github.com/ljharb/get-intrinsic/commit/01ac7a87ac29738567e8524cd8c9e026b1fa8cb3) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `call-bind`, `es-abstract`, `tape`; add `call-bind` [`911b672`](https://github.com/ljharb/get-intrinsic/commit/911b672fbffae433a96924c6ce013585e425f4b7) -- [Refactor] rearrange evalled constructors a bit [`7e7e4bf`](https://github.com/ljharb/get-intrinsic/commit/7e7e4bf583f3799c8ac1c6c5e10d2cb553957347) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`0199968`](https://github.com/ljharb/get-intrinsic/commit/01999687a263ffce0a3cb011dfbcb761754aedbc) - -## [v1.0.2](https://github.com/ljharb/get-intrinsic/compare/v1.0.1...v1.0.2) - 2020-12-17 - -### Commits - -- [Fix] Throw for non‑existent intrinsics [`68f873b`](https://github.com/ljharb/get-intrinsic/commit/68f873b013c732a05ad6f5fc54f697e55515461b) -- [Fix] Throw for non‑existent segments in the intrinsic path [`8325dee`](https://github.com/ljharb/get-intrinsic/commit/8325deee43128f3654d3399aa9591741ebe17b21) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-bigints`, `object-inspect` [`0c227a7`](https://github.com/ljharb/get-intrinsic/commit/0c227a7d8b629166f25715fd242553892e458525) -- [meta] do not lint coverage output [`70d2419`](https://github.com/ljharb/get-intrinsic/commit/70d24199b620043cd9110fc5f426d214ebe21dc9) - -## [v1.0.1](https://github.com/ljharb/get-intrinsic/compare/v1.0.0...v1.0.1) - 2020-10-30 - -### Commits - -- [Tests] gather coverage data on every job [`d1d280d`](https://github.com/ljharb/get-intrinsic/commit/d1d280dec714e3f0519cc877dbcb193057d9cac6) -- [Fix] add missing dependencies [`5031771`](https://github.com/ljharb/get-intrinsic/commit/5031771bb1095b38be88ce7c41d5de88718e432e) -- [Tests] use `es-value-fixtures` [`af48765`](https://github.com/ljharb/get-intrinsic/commit/af48765a23c5323fb0b6b38dbf00eb5099c7bebc) - -## v1.0.0 - 2020-10-29 - -### Commits - -- Implementation [`bbce57c`](https://github.com/ljharb/get-intrinsic/commit/bbce57c6f33d05b2d8d3efa273ceeb3ee01127bb) -- Tests [`17b4f0d`](https://github.com/ljharb/get-intrinsic/commit/17b4f0d56dea6b4059b56fc30ef3ee4d9500ebc2) -- Initial commit [`3153294`](https://github.com/ljharb/get-intrinsic/commit/31532948de363b0a27dd9fd4649e7b7028ec4b44) -- npm init [`fb326c4`](https://github.com/ljharb/get-intrinsic/commit/fb326c4d2817c8419ec31de1295f06bb268a7902) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`48862fb`](https://github.com/ljharb/get-intrinsic/commit/48862fb2508c8f6a57968e6d08b7c883afc9d550) -- [meta] add `auto-changelog` [`5f28ad0`](https://github.com/ljharb/get-intrinsic/commit/5f28ad019e060a353d8028f9f2591a9cc93074a1) -- [meta] add "funding"; create `FUNDING.yml` [`c2bbdde`](https://github.com/ljharb/get-intrinsic/commit/c2bbddeba73a875be61484ee4680b129a6d4e0a1) -- [Tests] add `npm run lint` [`0a84b98`](https://github.com/ljharb/get-intrinsic/commit/0a84b98b22b7cf7a748666f705b0003a493c35fd) -- Only apps should have lockfiles [`9586c75`](https://github.com/ljharb/get-intrinsic/commit/9586c75866c1ee678e4d5d4dbbdef6997e511b05) diff --git a/node_modules/get-intrinsic/LICENSE b/node_modules/get-intrinsic/LICENSE deleted file mode 100644 index 48f05d0..0000000 --- a/node_modules/get-intrinsic/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -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/get-intrinsic/README.md b/node_modules/get-intrinsic/README.md deleted file mode 100644 index 335a3b4..0000000 --- a/node_modules/get-intrinsic/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# get-intrinsic [![Version Badge][npm-version-svg]][package-url] - -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Get and robustly cache all JS language-level intrinsics at first require time. - -See the syntax described [in the JS spec](https://tc39.es/ecma262/#sec-well-known-intrinsic-objects) for reference. - -## Example - -```js -var GetIntrinsic = require('get-intrinsic'); -var assert = require('assert'); - -// static methods -assert.equal(GetIntrinsic('%Math.pow%'), Math.pow); -assert.equal(Math.pow(2, 3), 8); -assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); -delete Math.pow; -assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); - -// instance methods -var arr = [1]; -assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push); -assert.deepEqual(arr, [1]); - -arr.push(2); -assert.deepEqual(arr, [1, 2]); - -GetIntrinsic('%Array.prototype.push%').call(arr, 3); -assert.deepEqual(arr, [1, 2, 3]); - -delete Array.prototype.push; -GetIntrinsic('%Array.prototype.push%').call(arr, 4); -assert.deepEqual(arr, [1, 2, 3, 4]); - -// missing features -delete JSON.parse; // to simulate a real intrinsic that is missing in the environment -assert.throws(() => GetIntrinsic('%JSON.parse%')); -assert.equal(undefined, GetIntrinsic('%JSON.parse%', true)); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -## Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. - -[package-url]: https://npmjs.org/package/get-intrinsic -[npm-version-svg]: http://versionbadg.es/ljharb/get-intrinsic.svg -[deps-svg]: https://david-dm.org/ljharb/get-intrinsic.svg -[deps-url]: https://david-dm.org/ljharb/get-intrinsic -[dev-deps-svg]: https://david-dm.org/ljharb/get-intrinsic/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/get-intrinsic#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/get-intrinsic.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/get-intrinsic.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/get-intrinsic.svg -[downloads-url]: https://npm-stat.com/charts.html?package=get-intrinsic diff --git a/node_modules/get-intrinsic/index.js b/node_modules/get-intrinsic/index.js deleted file mode 100644 index d6c06c2..0000000 --- a/node_modules/get-intrinsic/index.js +++ /dev/null @@ -1,330 +0,0 @@ -'use strict'; - -var undefined; - -var $SyntaxError = SyntaxError; -var $Function = Function; -var $TypeError = TypeError; - -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} -}; - -var $gOPD = Object.getOwnPropertyDescriptor; -if ($gOPD) { - try { - $gOPD({}, ''); - } catch (e) { - $gOPD = null; // this is IE 8, which has a broken gOPD - } -} - -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; - -var hasSymbols = require('has-symbols')(); - -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto - -var needsEval = {}; - -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); - -var INTRINSICS = { - '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, - '%Array%': Array, - '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, - '%JSON%': typeof JSON === 'object' ? JSON : undefined, - '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': Object, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet -}; - -var doEval = function doEval(name) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen) { - value = getProto(gen.prototype); - } - } - - INTRINSICS[name] = value; - - return value; -}; - -var LEGACY_ALIASES = { - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; - -var bind = require('function-bind'); -var hasOwn = require('has'); -var $concat = bind.call(Function.call, Array.prototype.concat); -var $spliceApply = bind.call(Function.apply, Array.prototype.splice); -var $replace = bind.call(Function.call, String.prototype.replace); -var $strSlice = bind.call(Function.call, String.prototype.slice); - -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ - -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } - - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } - - return { - alias: alias, - name: intrinsicName, - value: value - }; - } - - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; - -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; - - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } - - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; - - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; diff --git a/node_modules/get-intrinsic/package.json b/node_modules/get-intrinsic/package.json deleted file mode 100644 index d34894a..0000000 --- a/node_modules/get-intrinsic/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "get-intrinsic", - "version": "1.1.1", - "description": "Get and robustly cache all JS language-level intrinsics at first require time", - "main": "index.js", - "exports": { - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "prelint": "evalmd README.md", - "lint": "eslint --ext=.js,.mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/get-intrinsic.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "intrinsic", - "getintrinsic", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/get-intrinsic/issues" - }, - "homepage": "https://github.com/ljharb/get-intrinsic#readme", - "devDependencies": { - "@ljharb/eslint-config": "^17.5.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "es-value-fixtures": "^1.0.0", - "eslint": "^7.19.0", - "evalmd": "^0.0.19", - "foreach": "^2.0.5", - "has-bigints": "^1.0.1", - "make-async-function": "^1.0.0", - "make-async-generator-function": "^1.0.0", - "make-generator-function": "^2.0.0", - "nyc": "^10.3.2", - "object-inspect": "^1.9.0", - "tape": "^5.1.1" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } -} diff --git a/node_modules/get-intrinsic/test/GetIntrinsic.js b/node_modules/get-intrinsic/test/GetIntrinsic.js deleted file mode 100644 index 695e3ad..0000000 --- a/node_modules/get-intrinsic/test/GetIntrinsic.js +++ /dev/null @@ -1,260 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../'); - -var test = require('tape'); -var forEach = require('foreach'); -var debug = require('object-inspect'); -var generatorFns = require('make-generator-function')(); -var asyncFns = require('make-async-function').list(); -var asyncGenFns = require('make-async-generator-function')(); - -var callBound = require('call-bind/callBound'); -var v = require('es-value-fixtures'); -var $gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor'); -var defineProperty = require('es-abstract/test/helpers/defineProperty'); - -var $isProto = callBound('%Object.prototype.isPrototypeOf%'); - -test('export', function (t) { - t.equal(typeof GetIntrinsic, 'function', 'it is a function'); - t.equal(GetIntrinsic.length, 2, 'function has length of 2'); - - t.end(); -}); - -test('throws', function (t) { - t['throws']( - function () { GetIntrinsic('not an intrinsic'); }, - SyntaxError, - 'nonexistent intrinsic throws a syntax error' - ); - - t['throws']( - function () { GetIntrinsic(''); }, - TypeError, - 'empty string intrinsic throws a type error' - ); - - t['throws']( - function () { GetIntrinsic('.'); }, - SyntaxError, - '"just a dot" intrinsic throws a syntax error' - ); - - t['throws']( - function () { GetIntrinsic('%String'); }, - SyntaxError, - 'Leading % without trailing % throws a syntax error' - ); - - t['throws']( - function () { GetIntrinsic('String%'); }, - SyntaxError, - 'Trailing % without leading % throws a syntax error' - ); - - t['throws']( - function () { GetIntrinsic("String['prototype]"); }, - SyntaxError, - 'Dynamic property access is disallowed for intrinsics (unterminated string)' - ); - - t['throws']( - function () { GetIntrinsic('%Proxy.prototype.undefined%'); }, - TypeError, - "Throws when middle part doesn't exist (%Proxy.prototype.undefined%)" - ); - - forEach(v.nonStrings, function (nonString) { - t['throws']( - function () { GetIntrinsic(nonString); }, - TypeError, - debug(nonString) + ' is not a String' - ); - }); - - forEach(v.nonBooleans, function (nonBoolean) { - t['throws']( - function () { GetIntrinsic('%', nonBoolean); }, - TypeError, - debug(nonBoolean) + ' is not a Boolean' - ); - }); - - forEach([ - 'toString', - 'propertyIsEnumerable', - 'hasOwnProperty' - ], function (objectProtoMember) { - t['throws']( - function () { GetIntrinsic(objectProtoMember); }, - SyntaxError, - debug(objectProtoMember) + ' is not an intrinsic' - ); - }); - - t.end(); -}); - -test('base intrinsics', function (t) { - t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object'); - t.equal(GetIntrinsic('Object'), Object, 'Object yields Object'); - t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array'); - t.equal(GetIntrinsic('Array'), Array, 'Array yields Array'); - - t.end(); -}); - -test('dotted paths', function (t) { - t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString'); - t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString'); - t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push'); - t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push'); - - test('underscore paths are aliases for dotted paths', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) { - var original = GetIntrinsic('%ObjProto_toString%'); - - forEach([ - '%Object.prototype.toString%', - 'Object.prototype.toString', - '%ObjectPrototype.toString%', - 'ObjectPrototype.toString', - '%ObjProto_toString%', - 'ObjProto_toString' - ], function (name) { - defineProperty(Object.prototype, 'toString', { - value: function toString() { - return original.apply(this, arguments); - } - }); - st.equal(GetIntrinsic(name), original, name + ' yields original Object.prototype.toString'); - }); - - defineProperty(Object.prototype, 'toString', { value: original }); - st.end(); - }); - - test('dotted paths cache', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) { - var original = GetIntrinsic('%Object.prototype.propertyIsEnumerable%'); - - forEach([ - '%Object.prototype.propertyIsEnumerable%', - 'Object.prototype.propertyIsEnumerable', - '%ObjectPrototype.propertyIsEnumerable%', - 'ObjectPrototype.propertyIsEnumerable' - ], function (name) { - // eslint-disable-next-line no-extend-native - Object.prototype.propertyIsEnumerable = function propertyIsEnumerable() { - return original.apply(this, arguments); - }; - st.equal(GetIntrinsic(name), original, name + ' yields cached Object.prototype.propertyIsEnumerable'); - }); - - // eslint-disable-next-line no-extend-native - Object.prototype.propertyIsEnumerable = original; - st.end(); - }); - - test('dotted path reports correct error', function (st) { - st['throws'](function () { - GetIntrinsic('%NonExistentIntrinsic.prototype.property%'); - }, /%NonExistentIntrinsic%/, 'The base intrinsic of %NonExistentIntrinsic.prototype.property% is %NonExistentIntrinsic%'); - - st['throws'](function () { - GetIntrinsic('%NonExistentIntrinsicPrototype.property%'); - }, /%NonExistentIntrinsicPrototype%/, 'The base intrinsic of %NonExistentIntrinsicPrototype.property% is %NonExistentIntrinsicPrototype%'); - - st.end(); - }); - - t.end(); -}); - -test('accessors', { skip: !$gOPD || typeof Map !== 'function' }, function (t) { - var actual = $gOPD(Map.prototype, 'size'); - t.ok(actual, 'Map.prototype.size has a descriptor'); - t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function'); - t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it'); - t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it'); - - t.end(); -}); - -test('generator functions', { skip: !generatorFns.length }, function (t) { - var $GeneratorFunction = GetIntrinsic('%GeneratorFunction%'); - var $GeneratorFunctionPrototype = GetIntrinsic('%Generator%'); - var $GeneratorPrototype = GetIntrinsic('%GeneratorPrototype%'); - - forEach(generatorFns, function (genFn) { - var fnName = genFn.name; - fnName = fnName ? "'" + fnName + "'" : 'genFn'; - - t.ok(genFn instanceof $GeneratorFunction, fnName + ' instanceof %GeneratorFunction%'); - t.ok($isProto($GeneratorFunctionPrototype, genFn), '%Generator% is prototype of ' + fnName); - t.ok($isProto($GeneratorPrototype, genFn.prototype), '%GeneratorPrototype% is prototype of ' + fnName + '.prototype'); - }); - - t.end(); -}); - -test('async functions', { skip: !asyncFns.length }, function (t) { - var $AsyncFunction = GetIntrinsic('%AsyncFunction%'); - var $AsyncFunctionPrototype = GetIntrinsic('%AsyncFunctionPrototype%'); - - forEach(asyncFns, function (asyncFn) { - var fnName = asyncFn.name; - fnName = fnName ? "'" + fnName + "'" : 'asyncFn'; - - t.ok(asyncFn instanceof $AsyncFunction, fnName + ' instanceof %AsyncFunction%'); - t.ok($isProto($AsyncFunctionPrototype, asyncFn), '%AsyncFunctionPrototype% is prototype of ' + fnName); - }); - - t.end(); -}); - -test('async generator functions', { skip: asyncGenFns.length === 0 }, function (t) { - var $AsyncGeneratorFunction = GetIntrinsic('%AsyncGeneratorFunction%'); - var $AsyncGeneratorFunctionPrototype = GetIntrinsic('%AsyncGenerator%'); - var $AsyncGeneratorPrototype = GetIntrinsic('%AsyncGeneratorPrototype%'); - - forEach(asyncGenFns, function (asyncGenFn) { - var fnName = asyncGenFn.name; - fnName = fnName ? "'" + fnName + "'" : 'asyncGenFn'; - - t.ok(asyncGenFn instanceof $AsyncGeneratorFunction, fnName + ' instanceof %AsyncGeneratorFunction%'); - t.ok($isProto($AsyncGeneratorFunctionPrototype, asyncGenFn), '%AsyncGenerator% is prototype of ' + fnName); - t.ok($isProto($AsyncGeneratorPrototype, asyncGenFn.prototype), '%AsyncGeneratorPrototype% is prototype of ' + fnName + '.prototype'); - }); - - t.end(); -}); - -test('%ThrowTypeError%', function (t) { - var $ThrowTypeError = GetIntrinsic('%ThrowTypeError%'); - - t.equal(typeof $ThrowTypeError, 'function', 'is a function'); - t['throws']( - $ThrowTypeError, - TypeError, - '%ThrowTypeError% throws a TypeError' - ); - - t.end(); -}); - -test('allowMissing', { skip: asyncGenFns.length > 0 }, function (t) { - t['throws']( - function () { GetIntrinsic('%AsyncGeneratorPrototype%'); }, - TypeError, - 'throws when missing' - ); - - t.equal( - GetIntrinsic('%AsyncGeneratorPrototype%', true), - undefined, - 'does not throw when allowMissing' - ); - - t.end(); -}); diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE new file mode 100644 index 0000000..9d2c803 --- /dev/null +++ b/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/graceful-fs/README.md b/node_modules/graceful-fs/README.md new file mode 100644 index 0000000..82d6e4d --- /dev/null +++ b/node_modules/graceful-fs/README.md @@ -0,0 +1,143 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFile('some-file-or-whatever', (err, data) => { + // Do stuff here. +}) +``` + +## Sync methods + +This module cannot intercept or handle `EMFILE` or `ENFILE` errors from sync +methods. If you use sync methods which open file descriptors then you are +responsible for dealing with any errors. + +This is a known limitation, not a bug. + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/node_modules/graceful-fs/clone.js b/node_modules/graceful-fs/clone.js new file mode 100644 index 0000000..dff3cc8 --- /dev/null +++ b/node_modules/graceful-fs/clone.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..947cd94 --- /dev/null +++ b/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,429 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var clone = require('./clone.js') + +var util = require('util') + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + require('assert').equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readdir(path, options, cb) + + function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + }) + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} diff --git a/node_modules/graceful-fs/legacy-streams.js b/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 0000000..d617b50 --- /dev/null +++ b/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..032c7d0 --- /dev/null +++ b/node_modules/graceful-fs/package.json @@ -0,0 +1,50 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.2.8", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" + }, + "main": "graceful-fs.js", + "directories": { + "test": "test" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "nyc --silent node test.js | tap -c -", + "posttest": "nyc report" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^12.7.0" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ] +} diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..1287da1 --- /dev/null +++ b/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,346 @@ +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} diff --git a/node_modules/has-symbols/.eslintignore b/node_modules/has-symbols/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/has-symbols/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/has-symbols/.eslintrc b/node_modules/has-symbols/.eslintrc deleted file mode 100644 index 2d9a66a..0000000 --- a/node_modules/has-symbols/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "max-statements-per-line": [2, { "max": 2 }], - "no-magic-numbers": 0, - "multiline-comment-style": 0, - } -} diff --git a/node_modules/has-symbols/.github/FUNDING.yml b/node_modules/has-symbols/.github/FUNDING.yml deleted file mode 100644 index 04cf87e..0000000 --- a/node_modules/has-symbols/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/has-symbols -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/has-symbols/.nycrc b/node_modules/has-symbols/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/has-symbols/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/has-symbols/CHANGELOG.md b/node_modules/has-symbols/CHANGELOG.md deleted file mode 100644 index 852ca04..0000000 --- a/node_modules/has-symbols/CHANGELOG.md +++ /dev/null @@ -1,58 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.2](https://github.com/inspect-js/has-symbols/compare/v1.0.1...v1.0.2) - 2021-02-27 - -### Fixed - -- [Fix] use a universal way to get the original Symbol [`#11`](https://github.com/inspect-js/has-symbols/issues/11) - -### Commits - -- [Tests] migrate tests to Github Actions [`90ae798`](https://github.com/inspect-js/has-symbols/commit/90ae79820bdfe7bc703d67f5f3c5e205f98556d3) -- [meta] do not publish github action workflow files [`29e60a1`](https://github.com/inspect-js/has-symbols/commit/29e60a1b7c25c7f1acf7acff4a9320d0d10c49b4) -- [Tests] run `nyc` on all tests [`8476b91`](https://github.com/inspect-js/has-symbols/commit/8476b915650d360915abe2522505abf4b0e8f0ae) -- [readme] fix repo URLs, remove defunct badges [`126288e`](https://github.com/inspect-js/has-symbols/commit/126288ecc1797c0a40247a6b78bcb2e0bc5d7036) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `core-js`, `get-own-property-symbols` [`d84bdfa`](https://github.com/inspect-js/has-symbols/commit/d84bdfa48ac5188abbb4904b42614cd6c030940a) -- [Tests] fix linting errors [`0df3070`](https://github.com/inspect-js/has-symbols/commit/0df3070b981b6c9f2ee530c09189a7f5c6def839) -- [actions] add "Allow Edits" workflow [`1e6bc29`](https://github.com/inspect-js/has-symbols/commit/1e6bc29b188f32b9648657b07eda08504be5aa9c) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`36cea2a`](https://github.com/inspect-js/has-symbols/commit/36cea2addd4e6ec435f35a2656b4e9ef82498e9b) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1278338`](https://github.com/inspect-js/has-symbols/commit/127833801865fbc2cc8979beb9ca869c7bfe8222) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1493254`](https://github.com/inspect-js/has-symbols/commit/1493254eda13db5fb8fc5e4a3e8324b3d196029d) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js` [`b090bf2`](https://github.com/inspect-js/has-symbols/commit/b090bf214d3679a30edc1e2d729d466ab5183e1d) -- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4addb7a`](https://github.com/inspect-js/has-symbols/commit/4addb7ab4dc73f927ae99928d68817554fc21dc0) -- [Dev Deps] update `auto-changelog`, `tape` [`81d0baf`](https://github.com/inspect-js/has-symbols/commit/81d0baf3816096a89a8558e8043895f7a7d10d8b) -- [Dev Deps] update `auto-changelog`; add `aud` [`1a4e561`](https://github.com/inspect-js/has-symbols/commit/1a4e5612c25d91c3a03d509721d02630bc4fe3da) -- [readme] remove unused testling URLs [`3000941`](https://github.com/inspect-js/has-symbols/commit/3000941f958046e923ed8152edb1ef4a599e6fcc) -- [Tests] only audit prod deps [`692e974`](https://github.com/inspect-js/has-symbols/commit/692e9743c912410e9440207631a643a34b4741a1) -- [Dev Deps] update `@ljharb/eslint-config` [`51c946c`](https://github.com/inspect-js/has-symbols/commit/51c946c7f6baa793ec5390bb5a45cdce16b4ba76) - -## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-16 - -### Commits - -- [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229) -- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b) -- [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c) -- [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91) -- [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4) -- Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa) -- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193) -- [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0) -- [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0) - -## v1.0.0 - 2016-09-19 - -### Commits - -- Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d) -- package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a) -- Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c) -- Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb) -- read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c) diff --git a/node_modules/has-symbols/LICENSE b/node_modules/has-symbols/LICENSE deleted file mode 100644 index df31cbf..0000000 --- a/node_modules/has-symbols/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Jordan Harband - -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/has-symbols/README.md b/node_modules/has-symbols/README.md deleted file mode 100644 index 3875d7e..0000000 --- a/node_modules/has-symbols/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# has-symbols [![Version Badge][2]][1] - -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -Determine if the JS environment has Symbol support. Supports spec, or shams. - -## Example - -```js -var hasSymbols = require('has-symbols'); - -hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. - -var hasSymbolsKinda = require('has-symbols/shams'); -hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. -``` - -## Supported Symbol shams - - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) - - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/has-symbols -[2]: https://versionbadg.es/inspect-js/has-symbols.svg -[5]: https://david-dm.org/inspect-js/has-symbols.svg -[6]: https://david-dm.org/inspect-js/has-symbols -[7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg -[8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies -[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/has-symbols.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg -[downloads-url]: https://npm-stat.com/charts.html?package=has-symbols diff --git a/node_modules/has-symbols/index.js b/node_modules/has-symbols/index.js deleted file mode 100644 index 17044fa..0000000 --- a/node_modules/has-symbols/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var origSymbol = typeof Symbol !== 'undefined' && Symbol; -var hasSymbolSham = require('./shams'); - -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } - - return hasSymbolSham(); -}; diff --git a/node_modules/has-symbols/package.json b/node_modules/has-symbols/package.json deleted file mode 100644 index 2c2f572..0000000 --- a/node_modules/has-symbols/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "has-symbols", - "version": "1.0.2", - "author": { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "description": "Determine if the JS environment has Symbol support. Supports spec, or shams.", - "license": "MIT", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run --silent lint", - "test": "npm run tests-only", - "posttest": "aud --production", - "tests-only": "npm run test:stock && npm run test:staging && npm run test:shams", - "test:stock": "nyc node test", - "test:staging": "nyc node --harmony --es-staging test", - "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", - "test:shams:corejs": "nyc node test/shams/core-js.js", - "test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js", - "lint": "eslint --ext=js,mjs .", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git://github.com/inspect-js/has-symbols.git" - }, - "keywords": [ - "Symbol", - "symbols", - "typeof", - "sham", - "polyfill", - "native", - "core-js", - "ES6" - ], - "devDependencies": { - "@ljharb/eslint-config": "^17.5.1", - "aud": "^1.1.4", - "auto-changelog": "^2.2.1", - "core-js": "^2.6.12", - "eslint": "^7.20.0", - "get-own-property-symbols": "^0.9.5", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.2.0" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "greenkeeper": { - "ignore": [ - "core-js" - ] - } -} diff --git a/node_modules/has-symbols/shams.js b/node_modules/has-symbols/shams.js deleted file mode 100644 index 1285210..0000000 --- a/node_modules/has-symbols/shams.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -/* eslint complexity: [2, 18], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } - - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } - - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } - - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - - if (typeof Object.getOwnPropertyDescriptor === 'function') { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } - - return true; -}; diff --git a/node_modules/has-symbols/test/index.js b/node_modules/has-symbols/test/index.js deleted file mode 100644 index 352129c..0000000 --- a/node_modules/has-symbols/test/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var test = require('tape'); -var hasSymbols = require('../'); -var runSymbolTests = require('./tests'); - -test('interface', function (t) { - t.equal(typeof hasSymbols, 'function', 'is a function'); - t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean'); - t.end(); -}); - -test('Symbols are supported', { skip: !hasSymbols() }, function (t) { - runSymbolTests(t); - t.end(); -}); - -test('Symbols are not supported', { skip: hasSymbols() }, function (t) { - t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined'); - t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist'); - t.end(); -}); diff --git a/node_modules/has-symbols/test/shams/core-js.js b/node_modules/has-symbols/test/shams/core-js.js deleted file mode 100644 index df5365c..0000000 --- a/node_modules/has-symbols/test/shams/core-js.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var test = require('tape'); - -if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { - test('has native Symbol support', function (t) { - t.equal(typeof Symbol, 'function'); - t.equal(typeof Symbol(), 'symbol'); - t.end(); - }); - return; -} - -var hasSymbols = require('../../shams'); - -test('polyfilled Symbols', function (t) { - /* eslint-disable global-require */ - t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); - require('core-js/fn/symbol'); - require('core-js/fn/symbol/to-string-tag'); - - require('../tests')(t); - - var hasSymbolsAfter = hasSymbols(); - t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); - /* eslint-enable global-require */ - t.end(); -}); diff --git a/node_modules/has-symbols/test/shams/get-own-property-symbols.js b/node_modules/has-symbols/test/shams/get-own-property-symbols.js deleted file mode 100644 index 9191b24..0000000 --- a/node_modules/has-symbols/test/shams/get-own-property-symbols.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var test = require('tape'); - -if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { - test('has native Symbol support', function (t) { - t.equal(typeof Symbol, 'function'); - t.equal(typeof Symbol(), 'symbol'); - t.end(); - }); - return; -} - -var hasSymbols = require('../../shams'); - -test('polyfilled Symbols', function (t) { - /* eslint-disable global-require */ - t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); - - require('get-own-property-symbols'); - - require('../tests')(t); - - var hasSymbolsAfter = hasSymbols(); - t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); - /* eslint-enable global-require */ - t.end(); -}); diff --git a/node_modules/has-symbols/test/tests.js b/node_modules/has-symbols/test/tests.js deleted file mode 100644 index 89edd12..0000000 --- a/node_modules/has-symbols/test/tests.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -// eslint-disable-next-line consistent-return -module.exports = function runSymbolTests(t) { - t.equal(typeof Symbol, 'function', 'global Symbol is a function'); - - if (typeof Symbol !== 'function') { return false; } - - t.notEqual(Symbol(), Symbol(), 'two symbols are not equal'); - - /* - t.equal( - Symbol.prototype.toString.call(Symbol('foo')), - Symbol.prototype.toString.call(Symbol('foo')), - 'two symbols with the same description stringify the same' - ); - */ - - /* - var foo = Symbol('foo'); - - t.notEqual( - String(foo), - String(Symbol('bar')), - 'two symbols with different descriptions do not stringify the same' - ); - */ - - t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function'); - // t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol'); - - t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function'); - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - t.notEqual(typeof sym, 'string', 'Symbol is not a string'); - t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly'); - t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly'); - - var symVal = 42; - obj[sym] = symVal; - // eslint-disable-next-line no-restricted-syntax - for (sym in obj) { t.fail('symbol property key was found in for..in of object'); } - - t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object'); - t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object'); - t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object'); - t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable'); - t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), { - configurable: true, - enumerable: true, - value: 42, - writable: true - }, 'property descriptor is correct'); -}; diff --git a/node_modules/has/LICENSE-MIT b/node_modules/has/LICENSE-MIT deleted file mode 100644 index ae7014d..0000000 --- a/node_modules/has/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Thiago de Arruda - -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/has/README.md b/node_modules/has/README.md deleted file mode 100644 index 635e3a4..0000000 --- a/node_modules/has/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# has - -> Object.prototype.hasOwnProperty.call shortcut - -## Installation - -```sh -npm install --save has -``` - -## Usage - -```js -var has = require('has'); - -has({}, 'hasOwnProperty'); // false -has(Object.prototype, 'hasOwnProperty'); // true -``` diff --git a/node_modules/has/package.json b/node_modules/has/package.json deleted file mode 100644 index 7c4592f..0000000 --- a/node_modules/has/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "has", - "description": "Object.prototype.hasOwnProperty.call shortcut", - "version": "1.0.3", - "homepage": "https://github.com/tarruda/has", - "author": { - "name": "Thiago de Arruda", - "email": "tpadilha84@gmail.com" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/tarruda/has.git" - }, - "bugs": { - "url": "https://github.com/tarruda/has/issues" - }, - "license": "MIT", - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" - } - ], - "main": "./src", - "dependencies": { - "function-bind": "^1.1.1" - }, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "eslint": "^4.19.1", - "tape": "^4.9.0" - }, - "engines": { - "node": ">= 0.4.0" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "tape test" - } -} diff --git a/node_modules/has/src/index.js b/node_modules/has/src/index.js deleted file mode 100644 index dd92dd9..0000000 --- a/node_modules/has/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/node_modules/has/test/index.js b/node_modules/has/test/index.js deleted file mode 100644 index 43d480b..0000000 --- a/node_modules/has/test/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var test = require('tape'); -var has = require('../'); - -test('has', function (t) { - t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); - t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); - t.end(); -}); diff --git a/node_modules/is-ssh/CONTRIBUTING.md b/node_modules/is-ssh/CONTRIBUTING.md deleted file mode 100755 index 5e6d72e..0000000 --- a/node_modules/is-ssh/CONTRIBUTING.md +++ /dev/null @@ -1,66 +0,0 @@ -# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk: - -So, you want to contribute to this project! That's awesome. However, before -doing so, please read the following simple steps how to contribute. This will -make the life easier and will avoid wasting time on things which are not -requested. :sparkles: - -## Discuss the changes before doing them - - First of all, open an issue in the repository, using the [bug tracker][1], - describing the contribution you would like to make, the bug you found or any - other ideas you have. This will help us to get you started on the right - foot. - - - If it makes sense, add the platform and software information (e.g. operating - system, Node.JS version etc.), screenshots (so we can see what you are - seeing). - - - It is recommended to wait for feedback before continuing to next steps. - However, if the issue is clear (e.g. a typo) and the fix is simple, you can - continue and fix it. - -## Fixing issues - - Fork the project in your account and create a branch with your fix: - `some-great-feature` or `some-issue-fix`. - - - Commit your changes in that branch, writing the code following the - [code style][2]. If the project contains tests (generally, the `test` - directory), you are encouraged to add a test as well. :memo: - - - If the project contains a `package.json` or a `bower.json` file add yourself - in the `contributors` array (or `authors` in the case of `bower.json`; - if the array does not exist, create it): - - ```json - { - "contributors": [ - "Your Name (http://your.website)" - ] - } - ``` - -## Creating a pull request - - - Open a pull request, and reference the initial issue in the pull request - message (e.g. *fixes #*). Write a good description and - title, so everybody will know what is fixed/improved. - - - If it makes sense, add screenshots, gifs etc., so it is easier to see what - is going on. - -## Wait for feedback -Before accepting your contributions, we will review them. You may get feedback -about what should be fixed in your modified code. If so, just keep committing -in your branch and the pull request will be updated automatically. - -## Everyone is happy! -Finally, your contributions will be merged, and everyone will be happy! :smile: -Contributions are more than welcome! - -Thanks! :sweat_smile: - - - -[1]: https://github.com/IonicaBizau/node-is-ssh/issues - -[2]: https://github.com/IonicaBizau/code-style diff --git a/node_modules/is-ssh/DOCUMENTATION.md b/node_modules/is-ssh/DOCUMENTATION.md deleted file mode 100755 index 451b17f..0000000 --- a/node_modules/is-ssh/DOCUMENTATION.md +++ /dev/null @@ -1,14 +0,0 @@ -## Documentation - -You can see below the API reference of this module. - -### `isSsh(input)` -Checks if an input value is a ssh url or not. - -#### Params - -- **String|Array** `input`: The input url or an array of protocols. - -#### Return -- **Boolean** `true` if the input is a ssh url, `false` otherwise. - diff --git a/node_modules/is-ssh/LICENSE b/node_modules/is-ssh/LICENSE deleted file mode 100755 index a49a473..0000000 --- a/node_modules/is-ssh/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-20 Ionică Bizău (http://ionicabizau.net) - -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/is-ssh/README.md b/node_modules/is-ssh/README.md deleted file mode 100755 index 7ed1708..0000000 --- a/node_modules/is-ssh/README.md +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - - - - - - - - - - - - - -# is-ssh - - [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/is-ssh.svg)](https://www.npmjs.com/package/is-ssh) [![Downloads](https://img.shields.io/npm/dt/is-ssh.svg)](https://www.npmjs.com/package/is-ssh) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github) - -Buy Me A Coffee - - - - - - - -> Check if an input value is a ssh url or not. - - - - - - - - - - - - - - - - - -## :cloud: Installation - -```sh -# Using npm -npm install --save is-ssh - -# Using yarn -yarn add is-ssh -``` - - - - - - - - - - - - - -## :clipboard: Example - - - -```js -// Dependencies -const isSsh = require("is-ssh"); - -// Secure Shell Transport Protocol (SSH) -console.log(isSsh("ssh://user@host.xz:port/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz:port/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/~user/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz/~user/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/~/path/to/repo.git")); -// true - -console.log(isSsh("ssh://host.xz/~/path/to/repo.git")); -// true - - -console.log(isSsh("user@host.xz:/path/to/repo.git/")); -// true - -console.log(isSsh("user@host.xz:~user/path/to/repo.git/")); -// true - -console.log(isSsh("user@host.xz:path/to/repo.git")); -// true - - -console.log(isSsh("host.xz:/path/to/repo.git/")); -// true - -console.log(isSsh("host.xz:path/to/repo.git")); -// true - -console.log(isSsh("host.xz:~user/path/to/repo.git/")); -// true - - -console.log(isSsh("rsync://host.xz/path/to/repo.git/")); -// true - - -// Git Transport Protocol -console.log(isSsh("git://host.xz/path/to/repo.git/")); -// false - -console.log(isSsh("git://host.xz/~user/path/to/repo.git/")); -// false - -// HTTP/S Transport Protocol -console.log(isSsh("http://host.xz/path/to/repo.git/")); -// false - -console.log(isSsh("https://host.xz/path/to/repo.git/")); -// false - -// Local (Filesystem) Transport Protocol -console.log(isSsh("/path/to/repo.git/")); -// false - -console.log(isSsh("path/to/repo.git/")); -// false - -console.log(isSsh("~/path/to/repo.git")); -// false - -console.log(isSsh("file:///path/to/repo.git/")); -// false - -console.log(isSsh("file://~/path/to/repo.git/")); -// false -``` - - - - - - - - - - - -## :question: Get Help - -There are few ways to get help: - - - - 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question. - 2. For bug reports and feature requests, open issues. :bug: - 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket: - - - - - -## :memo: Documentation - - -### `isSsh(input)` -Checks if an input value is a ssh url or not. - -#### Params - -- **String|Array** `input`: The input url or an array of protocols. - -#### Return -- **Boolean** `true` if the input is a ssh url, `false` otherwise. - - - - - - - - - - - - - - -## :yum: How to contribute -Have an idea? Found a bug? See [how to contribute][contributing]. - - -## :sparkling_heart: Support my projects -I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, -this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it). - -However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: - - - - Starring and sharing the projects you like :rocket: - - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book: - - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: - - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone). - - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` - - ![](https://i.imgur.com/z6OQI95.png) - - -Thanks! :heart: - - - - - - - - - - - - - - - - -## :dizzy: Where is this library used? -If you are using this library in one of your projects, add it in this list. :sparkles: - - - `parse-url` - - `parse-path` - - `git-up` - - `nodegit-clone` - - `bb-git-up` - - `bb-parse-url` - - `normalize-ssh` - - `xl-git-up` - - `@hawkingnetwork/react-native-tab-view` - - `miguelcostero-ng2-toasty` - - `npm-all-packages` - - `@apardellass/react-native-audio-stream` - - `l2forlerna` - - `react-native-plugpag-wrapper` - - - - - - - - - - - -## :scroll: License - -[MIT][license] © [Ionică Bizău][website] - - - - - - -[license]: /LICENSE -[website]: http://ionicabizau.net -[contributing]: /CONTRIBUTING.md -[docs]: /DOCUMENTATION.md -[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg -[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg -[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg -[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg -[patreon]: https://www.patreon.com/ionicabizau -[amazon]: http://amzn.eu/hRo9sIZ -[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW diff --git a/node_modules/is-ssh/example/index.js b/node_modules/is-ssh/example/index.js deleted file mode 100755 index dd4da32..0000000 --- a/node_modules/is-ssh/example/index.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; - -// Dependencies -var isSsh = require("../lib"); - -// Secure Shell Transport Protocol (SSH) -console.log(isSsh("ssh://user@host.xz:port/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz:port/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/~user/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://host.xz/~user/path/to/repo.git/")); -// true - -console.log(isSsh("ssh://user@host.xz/~/path/to/repo.git")); -// true - -console.log(isSsh("ssh://host.xz/~/path/to/repo.git")); -// true - - -console.log(isSsh("user@host.xz:/path/to/repo.git/")); -// true - -console.log(isSsh("user@host.xz:~user/path/to/repo.git/")); -// true - -console.log(isSsh("user@host.xz:path/to/repo.git")); -// true - - -console.log(isSsh("host.xz:/path/to/repo.git/")); -// true - -console.log(isSsh("host.xz:path/to/repo.git")); -// true - -console.log(isSsh("host.xz:~user/path/to/repo.git/")); -// true - - -console.log(isSsh("rsync://host.xz/path/to/repo.git/")); -// true - - -// Git Transport Protocol -console.log(isSsh("git://host.xz/path/to/repo.git/")); -// false - -console.log(isSsh("git://host.xz/~user/path/to/repo.git/")); -// false - -// HTTP/S Transport Protocol -console.log(isSsh("http://host.xz/path/to/repo.git/")); -// false - -console.log(isSsh("https://host.xz/path/to/repo.git/")); -// false - -// Local (Filesystem) Transport Protocol -console.log(isSsh("/path/to/repo.git/")); -// false - -console.log(isSsh("path/to/repo.git/")); -// false - -console.log(isSsh("~/path/to/repo.git")); -// false - -console.log(isSsh("file:///path/to/repo.git/")); -// false - -console.log(isSsh("file://~/path/to/repo.git/")); -// false \ No newline at end of file diff --git a/node_modules/is-ssh/lib/index.js b/node_modules/is-ssh/lib/index.js deleted file mode 100755 index 978b2c7..0000000 --- a/node_modules/is-ssh/lib/index.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -// Dependencies -var protocols = require("protocols"); - -/** - * isSsh - * Checks if an input value is a ssh url or not. - * - * @name isSsh - * @function - * @param {String|Array} input The input url or an array of protocols. - * @return {Boolean} `true` if the input is a ssh url, `false` otherwise. - */ -function isSsh(input) { - - if (Array.isArray(input)) { - return input.indexOf("ssh") !== -1 || input.indexOf("rsync") !== -1; - } - - if (typeof input !== "string") { - return false; - } - - var prots = protocols(input); - input = input.substring(input.indexOf("://") + 3); - if (isSsh(prots)) { - return true; - } - - // TODO This probably could be improved :) - return input.indexOf("@") < input.indexOf(":"); -} - -module.exports = isSsh; \ No newline at end of file diff --git a/node_modules/is-ssh/package.json b/node_modules/is-ssh/package.json deleted file mode 100755 index b16d50d..0000000 --- a/node_modules/is-ssh/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "is-ssh", - "version": "1.3.2", - "description": "Check if an input value is a ssh url or not.", - "main": "lib/index.js", - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "node test" - }, - "repository": { - "type": "git", - "url": "git@github.com:IonicaBizau/node-is-ssh.git" - }, - "keywords": [ - "ssh", - "url", - "check", - "parser" - ], - "author": "Ionică Bizău (http://ionicabizau.net)", - "license": "MIT", - "bugs": { - "url": "https://github.com/IonicaBizau/node-is-ssh/issues" - }, - "homepage": "https://github.com/IonicaBizau/node-is-ssh", - "dependencies": { - "protocols": "^1.1.0" - }, - "devDependencies": { - "tester": "^1.3.1" - } -} diff --git a/node_modules/is-ssh/test/index.js b/node_modules/is-ssh/test/index.js deleted file mode 100755 index b6e9f8e..0000000 --- a/node_modules/is-ssh/test/index.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -// Dependencies -var isSsh = require("../lib"), - tester = require("tester"); - -// Prepare the input data -var input = [ -// Secure Shell Transport Protocol (SSH) -["ssh://user@host.xz:port/path/to/repo.git/", true], ["ssh://user@host.xz/path/to/repo.git/", true], ["ssh://host.xz:port/path/to/repo.git/", true], ["ssh://host.xz/path/to/repo.git/", true], ["ssh://user@host.xz/path/to/repo.git/", true], ["ssh://host.xz/path/to/repo.git/", true], ["ssh://user@host.xz/~user/path/to/repo.git/", true], ["ssh://host.xz/~user/path/to/repo.git/", true], ["ssh://user@host.xz/~/path/to/repo.git", true], ["ssh://host.xz/~/path/to/repo.git", true], ["user@host.xz:/path/to/repo.git/", true], ["user@host.xz:~user/path/to/repo.git/", true], ["user@host.xz:path/to/repo.git", true], ["host.xz:/path/to/repo.git/", true], ["host.xz:path/to/repo.git", true], ["host.xz:~user/path/to/repo.git/", true], ["rsync://host.xz/path/to/repo.git/", true] - -// Git Transport Protocol -, ["git://host.xz/path/to/repo.git/", false], ["git://host.xz/~user/path/to/repo.git/", false] - -// HTTP/S Transport Protocol -, ["http://host.xz/path/to/repo.git/", false], ["https://host.xz/path/to/repo.git/", false] - -// Local (Filesystem) Transport Protocol -, ["/path/to/repo.git/", false], ["path/to/repo.git/", false], ["~/path/to/repo.git", false], ["file:///path/to/repo.git/", false], ["file://~/path/to/repo.git/", false]]; - -tester.describe("check urls", function (test) { - // Run the tests - input.forEach(function (c) { - test.it(c[0] + " is supposed " + (!c[1] ? "not " : "") + "to be a ssh url", function () { - test.expect(isSsh(c[0])).toBe(c[1]); - }); - }); -}); \ No newline at end of file diff --git a/node_modules/is-stream/index.d.ts b/node_modules/is-stream/index.d.ts new file mode 100644 index 0000000..eee2e83 --- /dev/null +++ b/node_modules/is-stream/index.d.ts @@ -0,0 +1,79 @@ +import * as stream from 'stream'; + +declare const isStream: { + /** + @returns Whether `stream` is a [`Stream`](https://nodejs.org/api/stream.html#stream_stream). + + @example + ``` + import * as fs from 'fs'; + import isStream = require('is-stream'); + + isStream(fs.createReadStream('unicorn.png')); + //=> true + + isStream({}); + //=> false + ``` + */ + (stream: unknown): stream is stream.Stream; + + /** + @returns Whether `stream` is a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable). + + @example + ``` + import * as fs from 'fs'; + import isStream = require('is-stream'); + + isStream.writable(fs.createWriteStrem('unicorn.txt')); + //=> true + ``` + */ + writable(stream: unknown): stream is stream.Writable; + + /** + @returns Whether `stream` is a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable). + + @example + ``` + import * as fs from 'fs'; + import isStream = require('is-stream'); + + isStream.readable(fs.createReadStream('unicorn.png')); + //=> true + ``` + */ + readable(stream: unknown): stream is stream.Readable; + + /** + @returns Whether `stream` is a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex). + + @example + ``` + import {Duplex} from 'stream'; + import isStream = require('is-stream'); + + isStream.duplex(new Duplex()); + //=> true + ``` + */ + duplex(stream: unknown): stream is stream.Duplex; + + /** + @returns Whether `stream` is a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform). + + @example + ``` + import * as fs from 'fs'; + import Stringify = require('streaming-json-stringify'); + import isStream = require('is-stream'); + + isStream.transform(Stringify()); + //=> true + ``` + */ + transform(input: unknown): input is stream.Transform; +}; + +export = isStream; diff --git a/node_modules/is-stream/index.js b/node_modules/is-stream/index.js new file mode 100644 index 0000000..2e43434 --- /dev/null +++ b/node_modules/is-stream/index.js @@ -0,0 +1,28 @@ +'use strict'; + +const isStream = stream => + stream !== null && + typeof stream === 'object' && + typeof stream.pipe === 'function'; + +isStream.writable = stream => + isStream(stream) && + stream.writable !== false && + typeof stream._write === 'function' && + typeof stream._writableState === 'object'; + +isStream.readable = stream => + isStream(stream) && + stream.readable !== false && + typeof stream._read === 'function' && + typeof stream._readableState === 'object'; + +isStream.duplex = stream => + isStream.writable(stream) && + isStream.readable(stream); + +isStream.transform = stream => + isStream.duplex(stream) && + typeof stream._transform === 'function'; + +module.exports = isStream; diff --git a/node_modules/is-stream/license b/node_modules/is-stream/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/is-stream/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +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/is-stream/package.json b/node_modules/is-stream/package.json new file mode 100644 index 0000000..c3b5673 --- /dev/null +++ b/node_modules/is-stream/package.json @@ -0,0 +1,42 @@ +{ + "name": "is-stream", + "version": "2.0.1", + "description": "Check if something is a Node.js stream", + "license": "MIT", + "repository": "sindresorhus/is-stream", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "stream", + "type", + "streams", + "writable", + "readable", + "duplex", + "transform", + "check", + "detect", + "is" + ], + "devDependencies": { + "@types/node": "^11.13.6", + "ava": "^1.4.1", + "tempy": "^0.3.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-stream/readme.md b/node_modules/is-stream/readme.md new file mode 100644 index 0000000..19308e7 --- /dev/null +++ b/node_modules/is-stream/readme.md @@ -0,0 +1,60 @@ +# is-stream + +> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) + +## Install + +``` +$ npm install is-stream +``` + +## Usage + +```js +const fs = require('fs'); +const isStream = require('is-stream'); + +isStream(fs.createReadStream('unicorn.png')); +//=> true + +isStream({}); +//=> false +``` + +## API + +### isStream(stream) + +Returns a `boolean` for whether it's a [`Stream`](https://nodejs.org/api/stream.html#stream_stream). + +#### isStream.writable(stream) + +Returns a `boolean` for whether it's a [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable). + +#### isStream.readable(stream) + +Returns a `boolean` for whether it's a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_class_stream_readable). + +#### isStream.duplex(stream) + +Returns a `boolean` for whether it's a [`stream.Duplex`](https://nodejs.org/api/stream.html#stream_class_stream_duplex). + +#### isStream.transform(stream) + +Returns a `boolean` for whether it's a [`stream.Transform`](https://nodejs.org/api/stream.html#stream_class_stream_transform). + +## Related + +- [is-file-stream](https://github.com/jamestalmage/is-file-stream) - Detect if a stream is a file stream + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/js-base64/LICENSE.md b/node_modules/js-base64/LICENSE.md new file mode 100644 index 0000000..fd579a4 --- /dev/null +++ b/node_modules/js-base64/LICENSE.md @@ -0,0 +1,27 @@ +Copyright (c) 2014, Dan Kogai +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of {{{project}}} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/js-base64/README.md b/node_modules/js-base64/README.md new file mode 100644 index 0000000..4a70bd6 --- /dev/null +++ b/node_modules/js-base64/README.md @@ -0,0 +1,123 @@ +[![build status](https://secure.travis-ci.org/dankogai/js-base64.png)](http://travis-ci.org/dankogai/js-base64) + +# base64.js + +Yet another Base64 transcoder + +## Usage + +### Install + +```javascript +$ npm install --save js-base64 +``` + +If you are using it on ES6 transpilers, you may also need: + +```javascript +$ npm install --save babel-preset-env +``` + +Note `js-base64` itself is stand-alone so its `package.json` has no `dependencies`.  However, it is also tested on ES6 environment so `"babel-preset-env": "^1.7.0"` is on `devDependencies`. + + +### In Browser + +* Locally + +```html + +``` + +* Directly from CDN. In which case you don't even need to install. + +```html + + + + +Or, for the `mime/lite` version: + + + + +## Quick Start + +For the full version (800+ MIME types, 1,000+ extensions): + +```javascript +const mime = require('mime'); + +mime.getType('txt'); // ⇨ 'text/plain' +mime.getExtension('text/plain'); // ⇨ 'txt' +``` + +See [Mime API](#mime-api) below for API details. + +## Lite Version + +There is also a "lite" version of this module that omits vendor-specific +(`*/vnd.*`) and experimental (`*/x-*`) types. It weighs in at ~2.5KB, compared +to 8KB for the full version. To load the lite version: + +```javascript +const mime = require('mime/lite'); +``` + +## Mime .vs. mime-types .vs. mime-db modules + +For those of you wondering about the difference between these [popular] NPM modules, +here's a brief rundown ... + +[`mime-db`](https://github.com/jshttp/mime-db) is "the source of +truth" for MIME type information. It is not an API. Rather, it is a canonical +dataset of mime type definitions pulled from IANA, Apache, NGINX, and custom mappings +submitted by the Node.js community. + +[`mime-types`](https://github.com/jshttp/mime-types) is a thin +wrapper around mime-db that provides an API drop-in compatible(ish) with `mime @ < v1.3.6` API. + +`mime` is, as of v2, a self-contained module bundled with a pre-optimized version +of the `mime-db` dataset. It provides a simplified API with the following characteristics: + +* Intelligently resolved type conflicts (See [mime-score](https://github.com/broofa/mime-score) for details) +* Method naming consistent with industry best-practices +* Compact footprint. E.g. The minified+compressed sizes of the various modules: + +Module | Size +--- | --- +`mime-db` | 18 KB +`mime-types` | same as mime-db +`mime` | 8 KB +`mime/lite` | 2 KB + +## Mime API + +Both `require('mime')` and `require('mime/lite')` return instances of the MIME +class, documented below. + +Note: Inputs to this API are case-insensitive. Outputs (returned values) will +be lowercase. + +### new Mime(typeMap, ... more maps) + +Most users of this module will not need to create Mime instances directly. +However if you would like to create custom mappings, you may do so as follows +... + +```javascript +// Require Mime class +const Mime = require('mime/Mime'); + +// Define mime type -> extensions map +const typeMap = { + 'text/abc': ['abc', 'alpha', 'bet'], + 'text/def': ['leppard'] +}; + +// Create and use Mime instance +const myMime = new Mime(typeMap); +myMime.getType('abc'); // ⇨ 'text/abc' +myMime.getExtension('text/def'); // ⇨ 'leppard' +``` + +If more than one map argument is provided, each map is `define()`ed (see below), in order. + +### mime.getType(pathOrExtension) + +Get mime type for the given path or extension. E.g. + +```javascript +mime.getType('js'); // ⇨ 'application/javascript' +mime.getType('json'); // ⇨ 'application/json' + +mime.getType('txt'); // ⇨ 'text/plain' +mime.getType('dir/text.txt'); // ⇨ 'text/plain' +mime.getType('dir\\text.txt'); // ⇨ 'text/plain' +mime.getType('.text.txt'); // ⇨ 'text/plain' +mime.getType('.txt'); // ⇨ 'text/plain' +``` + +`null` is returned in cases where an extension is not detected or recognized + +```javascript +mime.getType('foo/txt'); // ⇨ null +mime.getType('bogus_type'); // ⇨ null +``` + +### mime.getExtension(type) +Get extension for the given mime type. Charset options (often included in +Content-Type headers) are ignored. + +```javascript +mime.getExtension('text/plain'); // ⇨ 'txt' +mime.getExtension('application/json'); // ⇨ 'json' +mime.getExtension('text/html; charset=utf8'); // ⇨ 'html' +``` + +### mime.define(typeMap[, force = false]) + +Define [more] type mappings. + +`typeMap` is a map of type -> extensions, as documented in `new Mime`, above. + +By default this method will throw an error if you try to map a type to an +extension that is already assigned to another type. Passing `true` for the +`force` argument will suppress this behavior (overriding any previous mapping). + +```javascript +mime.define({'text/x-abc': ['abc', 'abcd']}); + +mime.getType('abcd'); // ⇨ 'text/x-abc' +mime.getExtension('text/x-abc') // ⇨ 'abc' +``` + +## Command Line + + mime [path_or_extension] + +E.g. + + > mime scripts/jquery.js + application/javascript + +---- +Markdown generated from [src/README_js.md](src/README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js new file mode 100755 index 0000000..ab70a49 --- /dev/null +++ b/node_modules/mime/cli.js @@ -0,0 +1,46 @@ +#!/usr/bin/env node + +'use strict'; + +process.title = 'mime'; +let mime = require('.'); +let pkg = require('./package.json'); +let args = process.argv.splice(2); + +if (args.includes('--version') || args.includes('-v') || args.includes('--v')) { + console.log(pkg.version); + process.exit(0); +} else if (args.includes('--name') || args.includes('-n') || args.includes('--n')) { + console.log(pkg.name); + process.exit(0); +} else if (args.includes('--help') || args.includes('-h') || args.includes('--h')) { + console.log(pkg.name + ' - ' + pkg.description + '\n'); + console.log(`Usage: + + mime [flags] [path_or_extension] + + Flags: + --help, -h Show this message + --version, -v Display the version + --name, -n Print the name of the program + + Note: the command will exit after it executes if a command is specified + The path_or_extension is the path to the file or the extension of the file. + + Examples: + mime --help + mime --version + mime --name + mime -v + mime src/log.js + mime new.py + mime foo.sh + `); + process.exit(0); +} + +let file = args[0]; +let type = mime.getType(file); + +process.stdout.write(type + '\n'); + diff --git a/node_modules/mime/index.js b/node_modules/mime/index.js new file mode 100644 index 0000000..fadcf8d --- /dev/null +++ b/node_modules/mime/index.js @@ -0,0 +1,4 @@ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard'), require('./types/other')); diff --git a/node_modules/mime/lite.js b/node_modules/mime/lite.js new file mode 100644 index 0000000..835cffb --- /dev/null +++ b/node_modules/mime/lite.js @@ -0,0 +1,4 @@ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard')); diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json new file mode 100644 index 0000000..8bbee31 --- /dev/null +++ b/node_modules/mime/package.json @@ -0,0 +1,52 @@ +{ + "author": { + "name": "Robert Kieffer", + "url": "http://github.com/broofa", + "email": "robert@broofa.com" + }, + "engines": { + "node": ">=4.0.0" + }, + "bin": { + "mime": "cli.js" + }, + "contributors": [], + "description": "A comprehensive library for mime-type mapping", + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "benchmark": "*", + "chalk": "4.1.0", + "eslint": "7.20.0", + "mime-db": "1.46.0", + "mime-score": "1.2.0", + "mime-types": "2.1.28", + "mocha": "8.3.0", + "runmd": "*", + "standard-version": "9.1.0" + }, + "files": [ + "index.js", + "lite.js", + "Mime.js", + "cli.js", + "/types" + ], + "scripts": { + "prepare": "node src/build.js && runmd --output README.md src/README_js.md", + "release": "standard-version", + "benchmark": "node src/benchmark.js", + "md": "runmd --watch --output README.md src/README_js.md", + "test": "mocha src/test.js" + }, + "keywords": [ + "util", + "mime" + ], + "name": "mime", + "repository": { + "url": "https://github.com/broofa/mime", + "type": "git" + }, + "version": "2.5.2" +} diff --git a/node_modules/mime/types/other.js b/node_modules/mime/types/other.js new file mode 100644 index 0000000..7c831d1 --- /dev/null +++ b/node_modules/mime/types/other.js @@ -0,0 +1 @@ +module.exports = {"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}; \ No newline at end of file diff --git a/node_modules/mime/types/standard.js b/node_modules/mime/types/standard.js new file mode 100644 index 0000000..cf28276 --- /dev/null +++ b/node_modules/mime/types/standard.js @@ -0,0 +1 @@ +module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["*xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; \ No newline at end of file diff --git a/node_modules/node-forge/CHANGELOG.md b/node_modules/node-forge/CHANGELOG.md deleted file mode 100644 index 81176fa..0000000 --- a/node_modules/node-forge/CHANGELOG.md +++ /dev/null @@ -1,265 +0,0 @@ -Forge ChangeLog -=============== - -## 0.10.0 - 2019-09-01 - -### Changed -- **BREAKING**: Node.js 4 no longer supported. The code *may* still work, and - non-invasive patches to keep it working will be considered. However, more - modern tools no longer support old Node.js versions making testing difficult. - -### Removed -- **BREAKING**: Remove `util.getPath`, `util.setPath`, and `util.deletePath`. - `util.setPath` had a potential prototype pollution security issue when used - with unsafe inputs. These functions are not used by `forge` itself. They date - from an early time when `forge` was targeted at providing general helper - functions. The library direction changed to be more focused on cryptography. - Many other excellent libraries are more suitable for general utilities. If - you need a replacement for these functions, consier `get`, `set`, and `unset` - from [lodash](https://lodash.com/). But also consider the potential similar - security issues with those APIs. - -## 0.9.2 - 2019-09-01 - -### Changed -- Added `util.setPath` security note to function docs and to README. - -### Notes -- **SECURITY**: The `util.setPath` function has the potential to cause - prototype pollution if used with unsafe input. - - This function is **not** used internally by `forge`. - - The rest of the library is unaffected by this issue. - - **Do not** use unsafe input with this function. - - Usage with known input should function as expected. (Including input - intentionally using potentially problematic keys.) - - No code changes will be made to address this issue in 0.9.x. The current - behavior *could* be considered a feature rather than a security issue. - 0.10.0 will be released that removes `util.getPath` and `util.setPath`. - Consider `get` and `set` from [lodash](https://lodash.com/) if you need - replacements. But also consider the potential similar security issues with - those APIs. - - https://snyk.io/vuln/SNYK-JS-NODEFORGE-598677 - - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720 - -## 0.9.1 - 2019-09-26 - -### Fixed -- Ensure DES-CBC given IV is long enough for block size. - -## 0.9.0 - 2019-09-04 - -### Added -- Add ed25519.publicKeyFromAsn1 and ed25519.privateKeyFromAsn1 APIs. -- A few OIDs used in EV certs. - -### Fixed -- Improve ed25519 NativeBuffer check. - -## 0.8.5 - 2019-06-18 - -### Fixed -- Remove use of `const`. - -## 0.8.4 - 2019-05-22 - -### Changed -- Replace all instances of Node.js `new Buffer` with `Buffer.from` and `Buffer.alloc`. - -## 0.8.3 - 2019-05-15 - -### Fixed -- Use basic character set for code. - -## 0.8.2 - 2019-03-18 - -### Fixed -- Fix tag calculation when continuing an AES-GCM block. - -### Changed -- Switch to eslint. - -## 0.8.1 - 2019-02-23 - -### Fixed -- Fix off-by-1 bug with kem random generation. - -## 0.8.0 - 2019-01-31 - -### Fixed -- Handle creation of certificates with `notBefore` and `notAfter` dates less - than Jan 1, 1950 or greater than or equal to Jan 1, 2050. - -### Added -- Add OID 2.5.4.13 "description". -- Add OID 2.16.840.1.113730.1.13 "nsComment". - - Also handle extension when creating a certificate. -- `pki.verifyCertificateChain`: - - Add `validityCheckDate` option to allow checking the certificate validity - period against an arbitrary `Date` or `null` for no check at all. The - current date is used by default. -- `tls.createConnection`: - - Add `verifyOptions` option that passes through to - `pki.verifyCertificateChain`. Can be used for the above `validityCheckDate` - option. - -### Changed -- Support WebCrypto API in web workers. -- `rsa.generateKeyPair`: - - Use `crypto.generateKeyPair`/`crypto.generateKeyPairSync` on Node.js if - available (10.12.0+) and not in pure JS mode. - - Use JS fallback in `rsa.generateKeyPair` if `prng` option specified since - this isn't supported by current native APIs. - - Only run key generation comparison tests if keys will be deterministic. -- PhantomJS is deprecated, now using Headless Chrome with Karma. -- **Note**: Using Headless Chrome vs PhantomJS may cause newer JS features to - slip into releases without proper support for older runtimes and browsers. - Please report such issues and they will be addressed. -- `pki.verifyCertificateChain`: - - Signature changed to `(caStore, chain, options)`. Older `(caStore, chain, - verify)` signature is still supported. New style is to to pass in a - `verify` option. - -## 0.7.6 - 2018-08-14 - -### Added -- Test on Node.js 10.x. -- Support for PKCS#7 detached signatures. - -### Changed -- Improve webpack/browser detection. - -## 0.7.5 - 2018-03-30 - -### Fixed -- Remove use of `const`. - -## 0.7.4 - 2018-03-07 - -### Fixed -- Potential regex denial of service in form.js. - -### Added -- Support for ED25519. -- Support for baseN/base58. - -## 0.7.3 - 2018-03-05 - -- Re-publish with npm 5.6.0 due to file timestamp issues. - -## 0.7.2 - 2018-02-27 - -### Added -- Support verification of SHA-384 certificates. -- `1.2.840.10040.4.3'`/`dsa-with-sha1` OID. - -### Fixed -- Support importing PKCS#7 data with no certificates. RFC 2315 sec 9.1 states - certificates are optional. -- `asn1.equals` loop bug. -- Fortuna implementation bugs. - -## 0.7.1 - 2017-03-27 - -### Fixed - -- Fix digestLength for hashes based on SHA-512. - -## 0.7.0 - 2017-02-07 - -### Fixed - -- Fix test looping bugs so all tests are run. -- Improved ASN.1 parsing. Many failure cases eliminated. More sanity checks. - Better behavior in default mode of parsing BIT STRINGs. Better handling of - parsed BIT STRINGs in `toDer()`. More tests. -- Improve X.509 BIT STRING handling by using new capture modes. - -### Changed - -- Major refactor to use CommonJS plus a browser build system. -- Updated tests, examples, docs. -- Updated dependencies. -- Updated flash build system. -- Improve OID mapping code. -- Change test servers from Python to JavaScript. -- Improve PhantomJS support. -- Move Bower/bundle support to - [forge-dist](https://github.com/digitalbazaar/forge-dist). -- **BREAKING**: Require minimal digest algorithm dependencies from individual - modules. -- Enforce currently supported bit param values for byte buffer access. May be - **BREAKING** for code that depended on unspecified and/or incorrect behavior. -- Improve `asn1.prettyPrint()` BIT STRING display. - -### Added - -- webpack bundler support via `npm run build`: - - Builds `.js`, `.min.js`, and basic sourcemaps. - - Basic build: `forge.js`. - - Build with extra utils and networking support: `forge.all.js`. - - Build WebWorker support: `prime.worker.js`. -- Browserify support in package.json. -- Karma browser testing. -- `forge.options` field. -- `forge.options.usePureJavaScript` flag. -- `forge.util.isNodejs` flag (used to select "native" APIs). -- Run PhantomJS tests in Travis-CI. -- Add "Donations" section to README. -- Add IRC to "Contact" section of README. -- Add "Security Considerations" section to README. -- Add pbkdf2 usePureJavaScript test. -- Add rsa.generateKeyPair async and usePureJavaScript tests. -- Add .editorconfig support. -- Add `md.all.js` which includes all digest algorithms. -- Add asn1 `equals()` and `copy()`. -- Add asn1 `validate()` capture options for BIT STRING contents and value. - -### Removed - -- **BREAKING**: Can no longer call `forge({...})` to create new instances. -- Remove a large amount of old cruft. - -### Migration from 0.6.x to 0.7.x - -- (all) If you used the feature to create a new forge instance with new - configuration options you will need to rework your code. That ability has - been removed due to implementation complexity. The main rare use was to set - the option to use pure JavaScript. That is now available as a library global - flag `forge.options.usePureJavaScript`. -- (npm,bower) If you used the default main file there is little to nothing to - change. -- (npm) If you accessed a sub-resource like `forge/js/pki` you should either - switch to just using the main `forge` and access `forge.pki` or update to - `forge/lib/pki`. -- (bower) If you used a sub-resource like `forge/js/pki` you should switch to - just using `forge` and access `forge.pki`. The bower release bundles - everything in one minified file. -- (bower) A configured workerScript like - `/bower_components/forge/js/prime.worker.js` will need to change to - `/bower_components/forge/dist/prime.worker.min.js`. -- (all) If you used the networking support or flash socket support, you will - need to use a custom build and/or adjust where files are loaded from. This - functionality is not included in the bower distribution by default and is - also now in a different directory. -- (all) The library should now directly support building custom bundles with - webpack, browserify, or similar. -- (all) If building a custom bundle ensure the correct dependencies are - included. In particular, note there is now a `md.all.js` file to include all - digest algorithms. Individual files limit what they include by default to - allow smaller custom builds. For instance, `pbdkf2.js` has a `sha1` default - but does not include any algorithm files by default. This allows the - possibility to include only `sha256` without the overhead of `sha1` and - `sha512`. - -### Notes - -- This major update requires updating the version to 0.7.x. The existing - work-in-progress "0.7.x" branch will be painfully rebased on top of this new - 0.7.x and moved forward to 0.8.x or later as needed. -- 0.7.x is a start of simplifying forge based on common issues and what has - appeared to be the most common usage. Please file issues with feedback if the - changes are problematic for your use cases. - -## 0.6.x - 2016 and earlier - -- See Git commit log or https://github.com/digitalbazaar/forge. diff --git a/node_modules/node-forge/LICENSE b/node_modules/node-forge/LICENSE deleted file mode 100644 index 2b48a95..0000000 --- a/node_modules/node-forge/LICENSE +++ /dev/null @@ -1,331 +0,0 @@ -You may use the Forge project under the terms of either the BSD License or the -GNU General Public License (GPL) Version 2. - -The BSD License is recommended for most projects. It is simple and easy to -understand and it places almost no restrictions on what you can do with the -Forge project. - -If the GPL suits your project better you are also free to use Forge under -that license. - -You don't have to do anything special to choose one license or the other and -you don't have to notify anyone which license you are using. You are free to -use this project in commercial projects as long as the copyright header is -left intact. - -If you are a commercial entity and use this set of libraries in your -commercial software then reasonable payment to Digital Bazaar, if you can -afford it, is not required but is expected and would be appreciated. If this -library saves you time, then it's saving you money. The cost of developing -the Forge software was on the order of several hundred hours and tens of -thousands of dollars. We are attempting to strike a balance between helping -the development community while not being taken advantage of by lucrative -commercial entities for our efforts. - -------------------------------------------------------------------------------- -New BSD License (3-clause) -Copyright (c) 2010, Digital Bazaar, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Digital Bazaar, Inc. nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL DIGITAL BAZAAR BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------------------------------------------------------------------------------- - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - diff --git a/node_modules/node-forge/README.md b/node_modules/node-forge/README.md deleted file mode 100644 index 40bf295..0000000 --- a/node_modules/node-forge/README.md +++ /dev/null @@ -1,2099 +0,0 @@ -# Forge - -[![npm package](https://nodei.co/npm/node-forge.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/node-forge/) - -[![Build status](https://img.shields.io/travis/digitalbazaar/forge.svg?branch=master)](https://travis-ci.org/digitalbazaar/forge) - -A native implementation of [TLS][] (and various other cryptographic tools) in -[JavaScript][]. - -Introduction ------------- - -The Forge software is a fully native implementation of the [TLS][] protocol -in JavaScript, a set of cryptography utilities, and a set of tools for -developing Web Apps that utilize many network resources. - -Performance ------------- - -Forge is fast. Benchmarks against other popular JavaScript cryptography -libraries can be found here: - -* http://dominictarr.github.io/crypto-bench/ -* http://cryptojs.altervista.org/test/simulate-threading-speed_test.html - -Documentation -------------- - -* [Introduction](#introduction) -* [Performance](#performance) -* [Installation](#installation) -* [Testing](#testing) -* [Contributing](#contributing) - -### API - -* [Options](#options) - -### Transports - -* [TLS](#tls) -* [HTTP](#http) -* [SSH](#ssh) -* [XHR](#xhr) -* [Sockets](#socket) - -### Ciphers - -* [CIPHER](#cipher) -* [AES](#aes) -* [DES](#des) -* [RC2](#rc2) - -### PKI - -* [ED25519](#ed25519) -* [RSA](#rsa) -* [RSA-KEM](#rsakem) -* [X.509](#x509) -* [PKCS#5](#pkcs5) -* [PKCS#7](#pkcs7) -* [PKCS#8](#pkcs8) -* [PKCS#10](#pkcs10) -* [PKCS#12](#pkcs12) -* [ASN.1](#asn) - -### Message Digests - -* [SHA1](#sha1) -* [SHA256](#sha256) -* [SHA384](#sha384) -* [SHA512](#sha512) -* [MD5](#md5) -* [HMAC](#hmac) - -### Utilities - -* [Prime](#prime) -* [PRNG](#prng) -* [Tasks](#task) -* [Utilities](#util) -* [Logging](#log) -* [Debugging](#debug) -* [Flash Networking Support](#flash) - -### Other - -* [Security Considerations](#security-considerations) -* [Library Background](#library-background) -* [Contact](#contact) -* [Donations](#donations) - ---------------------------------------- - -Installation ------------- - -**Note**: Please see the [Security Considerations](#security-considerations) -section before using packaging systems and pre-built files. - -Forge uses a [CommonJS][] module structure with a build process for browser -bundles. The older [0.6.x][] branch with standalone files is available but will -not be regularly updated. - -### Node.js - -If you want to use forge with [Node.js][], it is available through `npm`: - -https://npmjs.org/package/node-forge - -Installation: - - npm install node-forge - -You can then use forge as a regular module: - -```js -var forge = require('node-forge'); -``` - -The npm package includes pre-built `forge.min.js`, `forge.all.min.js`, and -`prime.worker.min.js` using the [UMD][] format. - -### Bundle / Bower - -Each release is published in a separate repository as pre-built and minimized -basic forge bundles using the [UMD][] format. - -https://github.com/digitalbazaar/forge-dist - -This bundle can be used in many environments. In particular it can be installed -with [Bower][]: - - bower install forge - -### jsDelivr CDN - -To use it via [jsDelivr](https://www.jsdelivr.com/package/npm/node-forge) include this in your html: - -```html - -``` - -### unpkg CDN - -To use it via [unpkg](https://unpkg.com/#/) include this in your html: - -```html - -``` - -### Development Requirements - -The core JavaScript has the following requirements to build and test: - -* Building a browser bundle: - * Node.js - * npm -* Testing - * Node.js - * npm - * Chrome, Firefox, Safari (optional) - -Some special networking features can optionally use a Flash component. See the -[Flash README](./flash/README.md) for details. - -### Building for a web browser - -To create single file bundles for use with browsers run the following: - - npm install - npm run build - -This will create single non-minimized and minimized files that can be -included in the browser: - - dist/forge.js - dist/forge.min.js - -A bundle that adds some utilities and networking support is also available: - - dist/forge.all.js - dist/forge.all.min.js - -Include the file via: - -```html - -``` -or -```html - -``` - -The above bundles will synchronously create a global 'forge' object. - -**Note**: These bundles will not include any WebWorker scripts (eg: -`dist/prime.worker.js`), so these will need to be accessible from the browser -if any WebWorkers are used. - -### Building a custom browser bundle - -The build process uses [webpack][] and the [config](./webpack.config.js) file -can be modified to generate a file or files that only contain the parts of -forge you need. - -[Browserify][] override support is also present in `package.json`. - -Testing -------- - -### Prepare to run tests - - npm install - -### Running automated tests with Node.js - -Forge natively runs in a [Node.js][] environment: - - npm test - -### Running automated tests with Headless Chrome - -Automated testing is done via [Karma][]. By default it will run the tests with -Headless Chrome. - - npm run test-karma - -Is 'mocha' reporter output too verbose? Other reporters are available. Try -'dots', 'progress', or 'tap'. - - npm run test-karma -- --reporters progress - -By default [webpack][] is used. [Browserify][] can also be used. - - BUNDLER=browserify npm run test-karma - -### Running automated tests with one or more browsers - -You can also specify one or more browsers to use. - - npm run test-karma -- --browsers Chrome,Firefox,Safari,ChromeHeadless - -The reporter option and `BUNDLER` environment variable can also be used. - -### Running manual tests in a browser - -Testing in a browser uses [webpack][] to combine forge and all tests and then -loading the result in a browser. A simple web server is provided that will -output the HTTP or HTTPS URLs to load. It also will start a simple Flash Policy -Server. Unit tests and older legacy tests are provided. Custom ports can be -used by running `node tests/server.js` manually. - -To run the unit tests in a browser a special forge build is required: - - npm run test-build - -To run legacy browser based tests the main forge build is required: - - npm run build - -The tests are run with a custom server that prints out the URLs to use: - - npm run test-server - -### Running other tests - -There are some other random tests and benchmarks available in the tests -directory. - -### Coverage testing - -To perform coverage testing of the unit tests, run the following. The results -will be put in the `coverage/` directory. Note that coverage testing can slow -down some tests considerably. - - npm install - npm run coverage - -Contributing ------------- - -Any contributions (eg: PRs) that are accepted will be brought under the same -license used by the rest of the Forge project. This license allows Forge to -be used under the terms of either the BSD License or the GNU General Public -License (GPL) Version 2. - -See: [LICENSE](https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE) - -If a contribution contains 3rd party source code with its own license, it -may retain it, so long as that license is compatible with the Forge license. - -API ---- - - - -### Options - -If at any time you wish to disable the use of native code, where available, -for particular forge features like its secure random number generator, you -may set the ```forge.options.usePureJavaScript``` flag to ```true```. It is -not recommended that you set this flag as native code is typically more -performant and may have stronger security properties. It may be useful to -set this flag to test certain features that you plan to run in environments -that are different from your testing environment. - -To disable native code when including forge in the browser: - -```js -// run this *after* including the forge script -forge.options.usePureJavaScript = true; -``` - -To disable native code when using Node.js: - -```js -var forge = require('node-forge'); -forge.options.usePureJavaScript = true; -``` - -Transports ----------- - - - -### TLS - -Provides a native javascript client and server-side [TLS][] implementation. - -__Examples__ - -```js -// create TLS client -var client = forge.tls.createConnection({ - server: false, - caStore: /* Array of PEM-formatted certs or a CA store object */, - sessionCache: {}, - // supported cipher suites in order of preference - cipherSuites: [ - forge.tls.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA, - forge.tls.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA], - virtualHost: 'example.com', - verify: function(connection, verified, depth, certs) { - if(depth === 0) { - var cn = certs[0].subject.getField('CN').value; - if(cn !== 'example.com') { - verified = { - alert: forge.tls.Alert.Description.bad_certificate, - message: 'Certificate common name does not match hostname.' - }; - } - } - return verified; - }, - connected: function(connection) { - console.log('connected'); - // send message to server - connection.prepare(forge.util.encodeUtf8('Hi server!')); - /* NOTE: experimental, start heartbeat retransmission timer - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000);*/ - }, - /* provide a client-side cert if you want - getCertificate: function(connection, hint) { - return myClientCertificate; - }, - /* the private key for the client-side cert if provided */ - getPrivateKey: function(connection, cert) { - return myClientPrivateKey; - }, - tlsDataReady: function(connection) { - // TLS data (encrypted) is ready to be sent to the server - sendToServerSomehow(connection.tlsData.getBytes()); - // if you were communicating with the server below, you'd do: - // server.process(connection.tlsData.getBytes()); - }, - dataReady: function(connection) { - // clear data from the server is ready - console.log('the server sent: ' + - forge.util.decodeUtf8(connection.data.getBytes())); - // close connection - connection.close(); - }, - /* NOTE: experimental - heartbeatReceived: function(connection, payload) { - // restart retransmission timer, look at payload - clearInterval(myHeartbeatTimer); - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000); - payload.getBytes(); - },*/ - closed: function(connection) { - console.log('disconnected'); - }, - error: function(connection, error) { - console.log('uh oh', error); - } -}); - -// start the handshake process -client.handshake(); - -// when encrypted TLS data is received from the server, process it -client.process(encryptedBytesFromServer); - -// create TLS server -var server = forge.tls.createConnection({ - server: true, - caStore: /* Array of PEM-formatted certs or a CA store object */, - sessionCache: {}, - // supported cipher suites in order of preference - cipherSuites: [ - forge.tls.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA, - forge.tls.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA], - // require a client-side certificate if you want - verifyClient: true, - verify: function(connection, verified, depth, certs) { - if(depth === 0) { - var cn = certs[0].subject.getField('CN').value; - if(cn !== 'the-client') { - verified = { - alert: forge.tls.Alert.Description.bad_certificate, - message: 'Certificate common name does not match expected client.' - }; - } - } - return verified; - }, - connected: function(connection) { - console.log('connected'); - // send message to client - connection.prepare(forge.util.encodeUtf8('Hi client!')); - /* NOTE: experimental, start heartbeat retransmission timer - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000);*/ - }, - getCertificate: function(connection, hint) { - return myServerCertificate; - }, - getPrivateKey: function(connection, cert) { - return myServerPrivateKey; - }, - tlsDataReady: function(connection) { - // TLS data (encrypted) is ready to be sent to the client - sendToClientSomehow(connection.tlsData.getBytes()); - // if you were communicating with the client above you'd do: - // client.process(connection.tlsData.getBytes()); - }, - dataReady: function(connection) { - // clear data from the client is ready - console.log('the client sent: ' + - forge.util.decodeUtf8(connection.data.getBytes())); - // close connection - connection.close(); - }, - /* NOTE: experimental - heartbeatReceived: function(connection, payload) { - // restart retransmission timer, look at payload - clearInterval(myHeartbeatTimer); - myHeartbeatTimer = setInterval(function() { - connection.prepareHeartbeatRequest(forge.util.createBuffer('1234')); - }, 5*60*1000); - payload.getBytes(); - },*/ - closed: function(connection) { - console.log('disconnected'); - }, - error: function(connection, error) { - console.log('uh oh', error); - } -}); - -// when encrypted TLS data is received from the client, process it -server.process(encryptedBytesFromClient); -``` - -Connect to a TLS server using node's net.Socket: - -```js -var socket = new net.Socket(); - -var client = forge.tls.createConnection({ - server: false, - verify: function(connection, verified, depth, certs) { - // skip verification for testing - console.log('[tls] server certificate verified'); - return true; - }, - connected: function(connection) { - console.log('[tls] connected'); - // prepare some data to send (note that the string is interpreted as - // 'binary' encoded, which works for HTTP which only uses ASCII, use - // forge.util.encodeUtf8(str) otherwise - client.prepare('GET / HTTP/1.0\r\n\r\n'); - }, - tlsDataReady: function(connection) { - // encrypted data is ready to be sent to the server - var data = connection.tlsData.getBytes(); - socket.write(data, 'binary'); // encoding should be 'binary' - }, - dataReady: function(connection) { - // clear data from the server is ready - var data = connection.data.getBytes(); - console.log('[tls] data received from the server: ' + data); - }, - closed: function() { - console.log('[tls] disconnected'); - }, - error: function(connection, error) { - console.log('[tls] error', error); - } -}); - -socket.on('connect', function() { - console.log('[socket] connected'); - client.handshake(); -}); -socket.on('data', function(data) { - client.process(data.toString('binary')); // encoding should be 'binary' -}); -socket.on('end', function() { - console.log('[socket] disconnected'); -}); - -// connect to google.com -socket.connect(443, 'google.com'); - -// or connect to gmail's imap server (but don't send the HTTP header above) -//socket.connect(993, 'imap.gmail.com'); -``` - - - -### HTTP - -Provides a native [JavaScript][] mini-implementation of an http client that -uses pooled sockets. - -__Examples__ - -```js -// create an HTTP GET request -var request = forge.http.createRequest({method: 'GET', path: url.path}); - -// send the request somewhere -sendSomehow(request.toString()); - -// receive response -var buffer = forge.util.createBuffer(); -var response = forge.http.createResponse(); -var someAsyncDataHandler = function(bytes) { - if(!response.bodyReceived) { - buffer.putBytes(bytes); - if(!response.headerReceived) { - if(response.readHeader(buffer)) { - console.log('HTTP response header: ' + response.toString()); - } - } - if(response.headerReceived && !response.bodyReceived) { - if(response.readBody(buffer)) { - console.log('HTTP response body: ' + response.body); - } - } - } -}; -``` - - - -### SSH - -Provides some SSH utility functions. - -__Examples__ - -```js -// encodes (and optionally encrypts) a private RSA key as a Putty PPK file -forge.ssh.privateKeyToPutty(privateKey, passphrase, comment); - -// encodes a public RSA key as an OpenSSH file -forge.ssh.publicKeyToOpenSSH(key, comment); - -// encodes a private RSA key as an OpenSSH file -forge.ssh.privateKeyToOpenSSH(privateKey, passphrase); - -// gets the SSH public key fingerprint in a byte buffer -forge.ssh.getPublicKeyFingerprint(key); - -// gets a hex-encoded, colon-delimited SSH public key fingerprint -forge.ssh.getPublicKeyFingerprint(key, {encoding: 'hex', delimiter: ':'}); -``` - - - -### XHR - -Provides an XmlHttpRequest implementation using forge.http as a backend. - -__Examples__ - -```js -// TODO -``` - - - -### Sockets - -Provides an interface to create and use raw sockets provided via Flash. - -__Examples__ - -```js -// TODO -``` - -Ciphers -------- - - - -### CIPHER - -Provides a basic API for block encryption and decryption. There is built-in -support for the ciphers: [AES][], [3DES][], and [DES][], and for the modes -of operation: [ECB][], [CBC][], [CFB][], [OFB][], [CTR][], and [GCM][]. - -These algorithms are currently supported: - -* AES-ECB -* AES-CBC -* AES-CFB -* AES-OFB -* AES-CTR -* AES-GCM -* 3DES-ECB -* 3DES-CBC -* DES-ECB -* DES-CBC - -When using an [AES][] algorithm, the key size will determine whether -AES-128, AES-192, or AES-256 is used (all are supported). When a [DES][] -algorithm is used, the key size will determine whether [3DES][] or regular -[DES][] is used. Use a [3DES][] algorithm to enforce Triple-DES. - -__Examples__ - -```js -// generate a random key and IV -// Note: a key size of 16 bytes will use AES-128, 24 => AES-192, 32 => AES-256 -var key = forge.random.getBytesSync(16); -var iv = forge.random.getBytesSync(16); - -/* alternatively, generate a password-based 16-byte key -var salt = forge.random.getBytesSync(128); -var key = forge.pkcs5.pbkdf2('password', salt, numIterations, 16); -*/ - -// encrypt some bytes using CBC mode -// (other modes include: ECB, CFB, OFB, CTR, and GCM) -// Note: CBC and ECB modes use PKCS#7 padding as default -var cipher = forge.cipher.createCipher('AES-CBC', key); -cipher.start({iv: iv}); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output; -// outputs encrypted hex -console.log(encrypted.toHex()); - -// decrypt some bytes using CBC mode -// (other modes include: CFB, OFB, CTR, and GCM) -var decipher = forge.cipher.createDecipher('AES-CBC', key); -decipher.start({iv: iv}); -decipher.update(encrypted); -var result = decipher.finish(); // check 'result' for true/false -// outputs decrypted hex -console.log(decipher.output.toHex()); - -// decrypt bytes using CBC mode and streaming -// Performance can suffer for large multi-MB inputs due to buffer -// manipulations. Stream processing in chunks can offer significant -// improvement. CPU intensive update() calls could also be performed with -// setImmediate/setTimeout to avoid blocking the main browser UI thread (not -// shown here). Optimal block size depends on the JavaScript VM and other -// factors. Encryption can use a simple technique for increased performance. -var encryptedBytes = encrypted.bytes(); -var decipher = forge.cipher.createDecipher('AES-CBC', key); -decipher.start({iv: iv}); -var length = encryptedBytes.length; -var chunkSize = 1024 * 64; -var index = 0; -var decrypted = ''; -do { - decrypted += decipher.output.getBytes(); - var buf = forge.util.createBuffer(encryptedBytes.substr(index, chunkSize)); - decipher.update(buf); - index += chunkSize; -} while(index < length); -var result = decipher.finish(); -assert(result); -decrypted += decipher.output.getBytes(); -console.log(forge.util.bytesToHex(decrypted)); - -// encrypt some bytes using GCM mode -var cipher = forge.cipher.createCipher('AES-GCM', key); -cipher.start({ - iv: iv, // should be a 12-byte binary-encoded string or byte buffer - additionalData: 'binary-encoded string', // optional - tagLength: 128 // optional, defaults to 128 bits -}); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output; -var tag = cipher.mode.tag; -// outputs encrypted hex -console.log(encrypted.toHex()); -// outputs authentication tag -console.log(tag.toHex()); - -// decrypt some bytes using GCM mode -var decipher = forge.cipher.createDecipher('AES-GCM', key); -decipher.start({ - iv: iv, - additionalData: 'binary-encoded string', // optional - tagLength: 128, // optional, defaults to 128 bits - tag: tag // authentication tag from encryption -}); -decipher.update(encrypted); -var pass = decipher.finish(); -// pass is false if there was a failure (eg: authentication tag didn't match) -if(pass) { - // outputs decrypted hex - console.log(decipher.output.toHex()); -} -``` - -Using forge in Node.js to match openssl's "enc" command line tool (**Note**: OpenSSL "enc" uses a non-standard file format with a custom key derivation function and a fixed iteration count of 1, which some consider less secure than alternatives such as [OpenPGP](https://tools.ietf.org/html/rfc4880)/[GnuPG](https://www.gnupg.org/)): - -```js -var forge = require('node-forge'); -var fs = require('fs'); - -// openssl enc -des3 -in input.txt -out input.enc -function encrypt(password) { - var input = fs.readFileSync('input.txt', {encoding: 'binary'}); - - // 3DES key and IV sizes - var keySize = 24; - var ivSize = 8; - - // get derived bytes - // Notes: - // 1. If using an alternative hash (eg: "-md sha1") pass - // "forge.md.sha1.create()" as the final parameter. - // 2. If using "-nosalt", set salt to null. - var salt = forge.random.getBytesSync(8); - // var md = forge.md.sha1.create(); // "-md sha1" - var derivedBytes = forge.pbe.opensslDeriveBytes( - password, salt, keySize + ivSize/*, md*/); - var buffer = forge.util.createBuffer(derivedBytes); - var key = buffer.getBytes(keySize); - var iv = buffer.getBytes(ivSize); - - var cipher = forge.cipher.createCipher('3DES-CBC', key); - cipher.start({iv: iv}); - cipher.update(forge.util.createBuffer(input, 'binary')); - cipher.finish(); - - var output = forge.util.createBuffer(); - - // if using a salt, prepend this to the output: - if(salt !== null) { - output.putBytes('Salted__'); // (add to match openssl tool output) - output.putBytes(salt); - } - output.putBuffer(cipher.output); - - fs.writeFileSync('input.enc', output.getBytes(), {encoding: 'binary'}); -} - -// openssl enc -d -des3 -in input.enc -out input.dec.txt -function decrypt(password) { - var input = fs.readFileSync('input.enc', {encoding: 'binary'}); - - // parse salt from input - input = forge.util.createBuffer(input, 'binary'); - // skip "Salted__" (if known to be present) - input.getBytes('Salted__'.length); - // read 8-byte salt - var salt = input.getBytes(8); - - // Note: if using "-nosalt", skip above parsing and use - // var salt = null; - - // 3DES key and IV sizes - var keySize = 24; - var ivSize = 8; - - var derivedBytes = forge.pbe.opensslDeriveBytes( - password, salt, keySize + ivSize); - var buffer = forge.util.createBuffer(derivedBytes); - var key = buffer.getBytes(keySize); - var iv = buffer.getBytes(ivSize); - - var decipher = forge.cipher.createDecipher('3DES-CBC', key); - decipher.start({iv: iv}); - decipher.update(input); - var result = decipher.finish(); // check 'result' for true/false - - fs.writeFileSync( - 'input.dec.txt', decipher.output.getBytes(), {encoding: 'binary'}); -} -``` - - - -### AES - -Provides [AES][] encryption and decryption in [CBC][], [CFB][], [OFB][], -[CTR][], and [GCM][] modes. See [CIPHER](#cipher) for examples. - - - -### DES - -Provides [3DES][] and [DES][] encryption and decryption in [ECB][] and -[CBC][] modes. See [CIPHER](#cipher) for examples. - - - -### RC2 - -__Examples__ - -```js -// generate a random key and IV -var key = forge.random.getBytesSync(16); -var iv = forge.random.getBytesSync(8); - -// encrypt some bytes -var cipher = forge.rc2.createEncryptionCipher(key); -cipher.start(iv); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output; -// outputs encrypted hex -console.log(encrypted.toHex()); - -// decrypt some bytes -var cipher = forge.rc2.createDecryptionCipher(key); -cipher.start(iv); -cipher.update(encrypted); -cipher.finish(); -// outputs decrypted hex -console.log(cipher.output.toHex()); -``` - -PKI ---- - -Provides [X.509][] certificate support, ED25519 key generation and -signing/verifying, and RSA public and private key encoding, decoding, -encryption/decryption, and signing/verifying. - - - -### ED25519 - -Special thanks to [TweetNaCl.js][] for providing the bulk of the implementation. - -__Examples__ - -```js -var ed25519 = forge.pki.ed25519; - -// generate a random ED25519 keypair -var keypair = ed25519.generateKeyPair(); -// `keypair.publicKey` is a node.js Buffer or Uint8Array -// `keypair.privateKey` is a node.js Buffer or Uint8Array - -// generate a random ED25519 keypair based on a random 32-byte seed -var seed = forge.random.getBytesSync(32); -var keypair = ed25519.generateKeyPair({seed: seed}); - -// generate a random ED25519 keypair based on a "password" 32-byte seed -var password = 'Mai9ohgh6ahxee0jutheew0pungoozil'; -var seed = new forge.util.ByteBuffer(password, 'utf8'); -var keypair = ed25519.generateKeyPair({seed: seed}); - -// sign a UTF-8 message -var signature = ED25519.sign({ - message: 'test', - // also accepts `binary` if you want to pass a binary string - encoding: 'utf8', - // node.js Buffer, Uint8Array, forge ByteBuffer, binary string - privateKey: privateKey -}); -// `signature` is a node.js Buffer or Uint8Array - -// sign a message passed as a buffer -var signature = ED25519.sign({ - // also accepts a forge ByteBuffer or Uint8Array - message: Buffer.from('test', 'utf8'), - privateKey: privateKey -}); - -// sign a message digest (shorter "message" == better performance) -var md = forge.md.sha256.create(); -md.update('test', 'utf8'); -var signature = ED25519.sign({ - md: md, - privateKey: privateKey -}); - -// verify a signature on a UTF-8 message -var verified = ED25519.verify({ - message: 'test', - encoding: 'utf8', - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - signature: signature, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - publicKey: publicKey -}); -// `verified` is true/false - -// sign a message passed as a buffer -var verified = ED25519.verify({ - // also accepts a forge ByteBuffer or Uint8Array - message: Buffer.from('test', 'utf8'), - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - signature: signature, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - publicKey: publicKey -}); - -// verify a signature on a message digest -var md = forge.md.sha256.create(); -md.update('test', 'utf8'); -var verified = ED25519.verify({ - md: md, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - signature: signature, - // node.js Buffer, Uint8Array, forge ByteBuffer, or binary string - publicKey: publicKey -}); -``` - - - -### RSA - -__Examples__ - -```js -var rsa = forge.pki.rsa; - -// generate an RSA key pair synchronously -// *NOT RECOMMENDED*: Can be significantly slower than async and may block -// JavaScript execution. Will use native Node.js 10.12.0+ API if possible. -var keypair = rsa.generateKeyPair({bits: 2048, e: 0x10001}); - -// generate an RSA key pair asynchronously (uses web workers if available) -// use workers: -1 to run a fast core estimator to optimize # of workers -// *RECOMMENDED*: Can be significantly faster than sync. Will use native -// Node.js 10.12.0+ or WebCrypto API if possible. -rsa.generateKeyPair({bits: 2048, workers: 2}, function(err, keypair) { - // keypair.privateKey, keypair.publicKey -}); - -// generate an RSA key pair in steps that attempt to run for a specified period -// of time on the main JS thread -var state = rsa.createKeyPairGenerationState(2048, 0x10001); -var step = function() { - // run for 100 ms - if(!rsa.stepKeyPairGenerationState(state, 100)) { - setTimeout(step, 1); - } - else { - // done, turn off progress indicator, use state.keys - } -}; -// turn on progress indicator, schedule generation to run -setTimeout(step); - -// sign data with a private key and output DigestInfo DER-encoded bytes -// (defaults to RSASSA PKCS#1 v1.5) -var md = forge.md.sha1.create(); -md.update('sign this', 'utf8'); -var signature = privateKey.sign(md); - -// verify data with a public key -// (defaults to RSASSA PKCS#1 v1.5) -var verified = publicKey.verify(md.digest().bytes(), signature); - -// sign data using RSASSA-PSS where PSS uses a SHA-1 hash, a SHA-1 based -// masking function MGF1, and a 20 byte salt -var md = forge.md.sha1.create(); -md.update('sign this', 'utf8'); -var pss = forge.pss.create({ - md: forge.md.sha1.create(), - mgf: forge.mgf.mgf1.create(forge.md.sha1.create()), - saltLength: 20 - // optionally pass 'prng' with a custom PRNG implementation - // optionalls pass 'salt' with a forge.util.ByteBuffer w/custom salt -}); -var signature = privateKey.sign(md, pss); - -// verify RSASSA-PSS signature -var pss = forge.pss.create({ - md: forge.md.sha1.create(), - mgf: forge.mgf.mgf1.create(forge.md.sha1.create()), - saltLength: 20 - // optionally pass 'prng' with a custom PRNG implementation -}); -var md = forge.md.sha1.create(); -md.update('sign this', 'utf8'); -publicKey.verify(md.digest().getBytes(), signature, pss); - -// encrypt data with a public key (defaults to RSAES PKCS#1 v1.5) -var encrypted = publicKey.encrypt(bytes); - -// decrypt data with a private key (defaults to RSAES PKCS#1 v1.5) -var decrypted = privateKey.decrypt(encrypted); - -// encrypt data with a public key using RSAES PKCS#1 v1.5 -var encrypted = publicKey.encrypt(bytes, 'RSAES-PKCS1-V1_5'); - -// decrypt data with a private key using RSAES PKCS#1 v1.5 -var decrypted = privateKey.decrypt(encrypted, 'RSAES-PKCS1-V1_5'); - -// encrypt data with a public key using RSAES-OAEP -var encrypted = publicKey.encrypt(bytes, 'RSA-OAEP'); - -// decrypt data with a private key using RSAES-OAEP -var decrypted = privateKey.decrypt(encrypted, 'RSA-OAEP'); - -// encrypt data with a public key using RSAES-OAEP/SHA-256 -var encrypted = publicKey.encrypt(bytes, 'RSA-OAEP', { - md: forge.md.sha256.create() -}); - -// decrypt data with a private key using RSAES-OAEP/SHA-256 -var decrypted = privateKey.decrypt(encrypted, 'RSA-OAEP', { - md: forge.md.sha256.create() -}); - -// encrypt data with a public key using RSAES-OAEP/SHA-256/MGF1-SHA-1 -// compatible with Java's RSA/ECB/OAEPWithSHA-256AndMGF1Padding -var encrypted = publicKey.encrypt(bytes, 'RSA-OAEP', { - md: forge.md.sha256.create(), - mgf1: { - md: forge.md.sha1.create() - } -}); - -// decrypt data with a private key using RSAES-OAEP/SHA-256/MGF1-SHA-1 -// compatible with Java's RSA/ECB/OAEPWithSHA-256AndMGF1Padding -var decrypted = privateKey.decrypt(encrypted, 'RSA-OAEP', { - md: forge.md.sha256.create(), - mgf1: { - md: forge.md.sha1.create() - } -}); - -``` - - - -### RSA-KEM - -__Examples__ - -```js -// generate an RSA key pair asynchronously (uses web workers if available) -// use workers: -1 to run a fast core estimator to optimize # of workers -forge.rsa.generateKeyPair({bits: 2048, workers: -1}, function(err, keypair) { - // keypair.privateKey, keypair.publicKey -}); - -// generate and encapsulate a 16-byte secret key -var kdf1 = new forge.kem.kdf1(forge.md.sha1.create()); -var kem = forge.kem.rsa.create(kdf1); -var result = kem.encrypt(keypair.publicKey, 16); -// result has 'encapsulation' and 'key' - -// encrypt some bytes -var iv = forge.random.getBytesSync(12); -var someBytes = 'hello world!'; -var cipher = forge.cipher.createCipher('AES-GCM', result.key); -cipher.start({iv: iv}); -cipher.update(forge.util.createBuffer(someBytes)); -cipher.finish(); -var encrypted = cipher.output.getBytes(); -var tag = cipher.mode.tag.getBytes(); - -// send 'encrypted', 'iv', 'tag', and result.encapsulation to recipient - -// decrypt encapsulated 16-byte secret key -var kdf1 = new forge.kem.kdf1(forge.md.sha1.create()); -var kem = forge.kem.rsa.create(kdf1); -var key = kem.decrypt(keypair.privateKey, result.encapsulation, 16); - -// decrypt some bytes -var decipher = forge.cipher.createDecipher('AES-GCM', key); -decipher.start({iv: iv, tag: tag}); -decipher.update(forge.util.createBuffer(encrypted)); -var pass = decipher.finish(); -// pass is false if there was a failure (eg: authentication tag didn't match) -if(pass) { - // outputs 'hello world!' - console.log(decipher.output.getBytes()); -} - -``` - - - -### X.509 - -__Examples__ - -```js -var pki = forge.pki; - -// convert a PEM-formatted public key to a Forge public key -var publicKey = pki.publicKeyFromPem(pem); - -// convert a Forge public key to PEM-format -var pem = pki.publicKeyToPem(publicKey); - -// convert an ASN.1 SubjectPublicKeyInfo to a Forge public key -var publicKey = pki.publicKeyFromAsn1(subjectPublicKeyInfo); - -// convert a Forge public key to an ASN.1 SubjectPublicKeyInfo -var subjectPublicKeyInfo = pki.publicKeyToAsn1(publicKey); - -// gets a SHA-1 RSAPublicKey fingerprint a byte buffer -pki.getPublicKeyFingerprint(key); - -// gets a SHA-1 SubjectPublicKeyInfo fingerprint a byte buffer -pki.getPublicKeyFingerprint(key, {type: 'SubjectPublicKeyInfo'}); - -// gets a hex-encoded, colon-delimited SHA-1 RSAPublicKey public key fingerprint -pki.getPublicKeyFingerprint(key, {encoding: 'hex', delimiter: ':'}); - -// gets a hex-encoded, colon-delimited SHA-1 SubjectPublicKeyInfo public key fingerprint -pki.getPublicKeyFingerprint(key, { - type: 'SubjectPublicKeyInfo', - encoding: 'hex', - delimiter: ':' -}); - -// gets a hex-encoded, colon-delimited MD5 RSAPublicKey public key fingerprint -pki.getPublicKeyFingerprint(key, { - md: forge.md.md5.create(), - encoding: 'hex', - delimiter: ':' -}); - -// creates a CA store -var caStore = pki.createCaStore([/* PEM-encoded cert */, ...]); - -// add a certificate to the CA store -caStore.addCertificate(certObjectOrPemString); - -// gets the issuer (its certificate) for the given certificate -var issuerCert = caStore.getIssuer(subjectCert); - -// verifies a certificate chain against a CA store -pki.verifyCertificateChain(caStore, chain, customVerifyCallback); - -// signs a certificate using the given private key -cert.sign(privateKey); - -// signs a certificate using SHA-256 instead of SHA-1 -cert.sign(privateKey, forge.md.sha256.create()); - -// verifies an issued certificate using the certificates public key -var verified = issuer.verify(issued); - -// generate a keypair and create an X.509v3 certificate -var keys = pki.rsa.generateKeyPair(2048); -var cert = pki.createCertificate(); -cert.publicKey = keys.publicKey; -// alternatively set public key from a csr -//cert.publicKey = csr.publicKey; -// NOTE: serialNumber is the hex encoded value of an ASN.1 INTEGER. -// Conforming CAs should ensure serialNumber is: -// - no more than 20 octets -// - non-negative (prefix a '00' if your value starts with a '1' bit) -cert.serialNumber = '01'; -cert.validity.notBefore = new Date(); -cert.validity.notAfter = new Date(); -cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 1); -var attrs = [{ - name: 'commonName', - value: 'example.org' -}, { - name: 'countryName', - value: 'US' -}, { - shortName: 'ST', - value: 'Virginia' -}, { - name: 'localityName', - value: 'Blacksburg' -}, { - name: 'organizationName', - value: 'Test' -}, { - shortName: 'OU', - value: 'Test' -}]; -cert.setSubject(attrs); -// alternatively set subject from a csr -//cert.setSubject(csr.subject.attributes); -cert.setIssuer(attrs); -cert.setExtensions([{ - name: 'basicConstraints', - cA: true -}, { - name: 'keyUsage', - keyCertSign: true, - digitalSignature: true, - nonRepudiation: true, - keyEncipherment: true, - dataEncipherment: true -}, { - name: 'extKeyUsage', - serverAuth: true, - clientAuth: true, - codeSigning: true, - emailProtection: true, - timeStamping: true -}, { - name: 'nsCertType', - client: true, - server: true, - email: true, - objsign: true, - sslCA: true, - emailCA: true, - objCA: true -}, { - name: 'subjectAltName', - altNames: [{ - type: 6, // URI - value: 'http://example.org/webid#me' - }, { - type: 7, // IP - ip: '127.0.0.1' - }] -}, { - name: 'subjectKeyIdentifier' -}]); -/* alternatively set extensions from a csr -var extensions = csr.getAttribute({name: 'extensionRequest'}).extensions; -// optionally add more extensions -extensions.push.apply(extensions, [{ - name: 'basicConstraints', - cA: true -}, { - name: 'keyUsage', - keyCertSign: true, - digitalSignature: true, - nonRepudiation: true, - keyEncipherment: true, - dataEncipherment: true -}]); -cert.setExtensions(extensions); -*/ -// self-sign certificate -cert.sign(keys.privateKey); - -// convert a Forge certificate to PEM -var pem = pki.certificateToPem(cert); - -// convert a Forge certificate from PEM -var cert = pki.certificateFromPem(pem); - -// convert an ASN.1 X.509x3 object to a Forge certificate -var cert = pki.certificateFromAsn1(obj); - -// convert a Forge certificate to an ASN.1 X.509v3 object -var asn1Cert = pki.certificateToAsn1(cert); -``` - - - -### PKCS#5 - -Provides the password-based key-derivation function from [PKCS#5][]. - -__Examples__ - -```js -// generate a password-based 16-byte key -// note an optional message digest can be passed as the final parameter -var salt = forge.random.getBytesSync(128); -var derivedKey = forge.pkcs5.pbkdf2('password', salt, numIterations, 16); - -// generate key asynchronously -// note an optional message digest can be passed before the callback -forge.pkcs5.pbkdf2('password', salt, numIterations, 16, function(err, derivedKey) { - // do something w/derivedKey -}); -``` - - - -### PKCS#7 - -Provides cryptographically protected messages from [PKCS#7][]. - -__Examples__ - -```js -// convert a message from PEM -var p7 = forge.pkcs7.messageFromPem(pem); -// look at p7.recipients - -// find a recipient by the issuer of a certificate -var recipient = p7.findRecipient(cert); - -// decrypt -p7.decrypt(p7.recipients[0], privateKey); - -// create a p7 enveloped message -var p7 = forge.pkcs7.createEnvelopedData(); - -// add a recipient -var cert = forge.pki.certificateFromPem(certPem); -p7.addRecipient(cert); - -// set content -p7.content = forge.util.createBuffer('Hello'); - -// encrypt -p7.encrypt(); - -// convert message to PEM -var pem = forge.pkcs7.messageToPem(p7); - -// create a degenerate PKCS#7 certificate container -// (CRLs not currently supported, only certificates) -var p7 = forge.pkcs7.createSignedData(); -p7.addCertificate(certOrCertPem1); -p7.addCertificate(certOrCertPem2); -var pem = forge.pkcs7.messageToPem(p7); - -// create PKCS#7 signed data with authenticatedAttributes -// attributes include: PKCS#9 content-type, message-digest, and signing-time -var p7 = forge.pkcs7.createSignedData(); -p7.content = forge.util.createBuffer('Some content to be signed.', 'utf8'); -p7.addCertificate(certOrCertPem); -p7.addSigner({ - key: privateKeyAssociatedWithCert, - certificate: certOrCertPem, - digestAlgorithm: forge.pki.oids.sha256, - authenticatedAttributes: [{ - type: forge.pki.oids.contentType, - value: forge.pki.oids.data - }, { - type: forge.pki.oids.messageDigest - // value will be auto-populated at signing time - }, { - type: forge.pki.oids.signingTime, - // value can also be auto-populated at signing time - value: new Date() - }] -}); -p7.sign(); -var pem = forge.pkcs7.messageToPem(p7); - -// PKCS#7 Sign in detached mode. -// Includes the signature and certificate without the signed data. -p7.sign({detached: true}); - -``` - - - -### PKCS#8 - -__Examples__ - -```js -var pki = forge.pki; - -// convert a PEM-formatted private key to a Forge private key -var privateKey = pki.privateKeyFromPem(pem); - -// convert a Forge private key to PEM-format -var pem = pki.privateKeyToPem(privateKey); - -// convert an ASN.1 PrivateKeyInfo or RSAPrivateKey to a Forge private key -var privateKey = pki.privateKeyFromAsn1(rsaPrivateKey); - -// convert a Forge private key to an ASN.1 RSAPrivateKey -var rsaPrivateKey = pki.privateKeyToAsn1(privateKey); - -// wrap an RSAPrivateKey ASN.1 object in a PKCS#8 ASN.1 PrivateKeyInfo -var privateKeyInfo = pki.wrapRsaPrivateKey(rsaPrivateKey); - -// convert a PKCS#8 ASN.1 PrivateKeyInfo to PEM -var pem = pki.privateKeyInfoToPem(privateKeyInfo); - -// encrypts a PrivateKeyInfo using a custom password and -// outputs an EncryptedPrivateKeyInfo -var encryptedPrivateKeyInfo = pki.encryptPrivateKeyInfo( - privateKeyInfo, 'myCustomPasswordHere', { - algorithm: 'aes256', // 'aes128', 'aes192', 'aes256', '3des' - }); - -// decrypts an ASN.1 EncryptedPrivateKeyInfo that was encrypted -// with a custom password -var privateKeyInfo = pki.decryptPrivateKeyInfo( - encryptedPrivateKeyInfo, 'myCustomPasswordHere'); - -// converts an EncryptedPrivateKeyInfo to PEM -var pem = pki.encryptedPrivateKeyToPem(encryptedPrivateKeyInfo); - -// converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format -var encryptedPrivateKeyInfo = pki.encryptedPrivateKeyFromPem(pem); - -// wraps and encrypts a Forge private key and outputs it in PEM format -var pem = pki.encryptRsaPrivateKey(privateKey, 'password'); - -// encrypts a Forge private key and outputs it in PEM format using OpenSSL's -// proprietary legacy format + encapsulated PEM headers (DEK-Info) -var pem = pki.encryptRsaPrivateKey(privateKey, 'password', {legacy: true}); - -// decrypts a PEM-formatted, encrypted private key -var privateKey = pki.decryptRsaPrivateKey(pem, 'password'); - -// sets an RSA public key from a private key -var publicKey = pki.setRsaPublicKey(privateKey.n, privateKey.e); -``` - - - -### PKCS#10 - -Provides certification requests or certificate signing requests (CSR) from -[PKCS#10][]. - -__Examples__ - -```js -// generate a key pair -var keys = forge.pki.rsa.generateKeyPair(1024); - -// create a certification request (CSR) -var csr = forge.pki.createCertificationRequest(); -csr.publicKey = keys.publicKey; -csr.setSubject([{ - name: 'commonName', - value: 'example.org' -}, { - name: 'countryName', - value: 'US' -}, { - shortName: 'ST', - value: 'Virginia' -}, { - name: 'localityName', - value: 'Blacksburg' -}, { - name: 'organizationName', - value: 'Test' -}, { - shortName: 'OU', - value: 'Test' -}]); -// set (optional) attributes -csr.setAttributes([{ - name: 'challengePassword', - value: 'password' -}, { - name: 'unstructuredName', - value: 'My Company, Inc.' -}, { - name: 'extensionRequest', - extensions: [{ - name: 'subjectAltName', - altNames: [{ - // 2 is DNS type - type: 2, - value: 'test.domain.com' - }, { - type: 2, - value: 'other.domain.com', - }, { - type: 2, - value: 'www.domain.net' - }] - }] -}]); - -// sign certification request -csr.sign(keys.privateKey); - -// verify certification request -var verified = csr.verify(); - -// convert certification request to PEM-format -var pem = forge.pki.certificationRequestToPem(csr); - -// convert a Forge certification request from PEM-format -var csr = forge.pki.certificationRequestFromPem(pem); - -// get an attribute -csr.getAttribute({name: 'challengePassword'}); - -// get extensions array -csr.getAttribute({name: 'extensionRequest'}).extensions; - -``` - - - -### PKCS#12 - -Provides the cryptographic archive file format from [PKCS#12][]. - -**Note for Chrome/Firefox/iOS/similar users**: If you have trouble importing -a PKCS#12 container, try using the TripleDES algorithm. It can be passed -to `forge.pkcs12.toPkcs12Asn1` using the `{algorithm: '3des'}` option. - -__Examples__ - -```js -// decode p12 from base64 -var p12Der = forge.util.decode64(p12b64); -// get p12 as ASN.1 object -var p12Asn1 = forge.asn1.fromDer(p12Der); -// decrypt p12 using the password 'password' -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, 'password'); -// decrypt p12 using non-strict parsing mode (resolves some ASN.1 parse errors) -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, false, 'password'); -// decrypt p12 using literally no password (eg: Mac OS X/apple push) -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1); -// decrypt p12 using an "empty" password (eg: OpenSSL with no password input) -var p12 = forge.pkcs12.pkcs12FromAsn1(p12Asn1, ''); -// p12.safeContents is an array of safe contents, each of -// which contains an array of safeBags - -// get bags by friendlyName -var bags = p12.getBags({friendlyName: 'test'}); -// bags are key'd by attribute type (here "friendlyName") -// and the key values are an array of matching objects -var cert = bags.friendlyName[0]; - -// get bags by localKeyId -var bags = p12.getBags({localKeyId: buffer}); -// bags are key'd by attribute type (here "localKeyId") -// and the key values are an array of matching objects -var cert = bags.localKeyId[0]; - -// get bags by localKeyId (input in hex) -var bags = p12.getBags({localKeyIdHex: '7b59377ff142d0be4565e9ac3d396c01401cd879'}); -// bags are key'd by attribute type (here "localKeyId", *not* "localKeyIdHex") -// and the key values are an array of matching objects -var cert = bags.localKeyId[0]; - -// get bags by type -var bags = p12.getBags({bagType: forge.pki.oids.certBag}); -// bags are key'd by bagType and each bagType key's value -// is an array of matches (in this case, certificate objects) -var cert = bags[forge.pki.oids.certBag][0]; - -// get bags by friendlyName and filter on bag type -var bags = p12.getBags({ - friendlyName: 'test', - bagType: forge.pki.oids.certBag -}); - -// get key bags -var bags = p12.getBags({bagType: forge.pki.oids.keyBag}); -// get key -var bag = bags[forge.pki.oids.keyBag][0]; -var key = bag.key; -// if the key is in a format unrecognized by forge then -// bag.key will be `null`, use bag.asn1 to get the ASN.1 -// representation of the key -if(bag.key === null) { - var keyAsn1 = bag.asn1; - // can now convert back to DER/PEM/etc for export -} - -// generate a p12 using AES (default) -var p12Asn1 = forge.pkcs12.toPkcs12Asn1( - privateKey, certificateChain, 'password'); - -// generate a p12 that can be imported by Chrome/Firefox/iOS -// (requires the use of Triple DES instead of AES) -var p12Asn1 = forge.pkcs12.toPkcs12Asn1( - privateKey, certificateChain, 'password', - {algorithm: '3des'}); - -// base64-encode p12 -var p12Der = forge.asn1.toDer(p12Asn1).getBytes(); -var p12b64 = forge.util.encode64(p12Der); - -// create download link for p12 -var a = document.createElement('a'); -a.download = 'example.p12'; -a.setAttribute('href', 'data:application/x-pkcs12;base64,' + p12b64); -a.appendChild(document.createTextNode('Download')); -``` - - - -### ASN.1 - -Provides [ASN.1][] DER encoding and decoding. - -__Examples__ - -```js -var asn1 = forge.asn1; - -// create a SubjectPublicKeyInfo -var subjectPublicKeyInfo = - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids['rsaEncryption']).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // subjectPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ - // RSAPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)) - ]) - ]) - ]); - -// serialize an ASN.1 object to DER format -var derBuffer = asn1.toDer(subjectPublicKeyInfo); - -// deserialize to an ASN.1 object from a byte buffer filled with DER data -var object = asn1.fromDer(derBuffer); - -// convert an OID dot-separated string to a byte buffer -var derOidBuffer = asn1.oidToDer('1.2.840.113549.1.1.5'); - -// convert a byte buffer with a DER-encoded OID to a dot-separated string -console.log(asn1.derToOid(derOidBuffer)); -// output: 1.2.840.113549.1.1.5 - -// validates that an ASN.1 object matches a particular ASN.1 structure and -// captures data of interest from that structure for easy access -var publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - }] -}; - -var capture = {}; -var errors = []; -if(!asn1.validate( - publicKeyValidator, subjectPublicKeyInfo, validator, capture, errors)) { - throw 'ASN.1 object is not a SubjectPublicKeyInfo.'; -} -// capture.subjectPublicKeyInfo contains the full ASN.1 object -// capture.rsaPublicKey contains the full ASN.1 object for the RSA public key -// capture.publicKeyOid only contains the value for the OID -var oid = asn1.derToOid(capture.publicKeyOid); -if(oid !== pki.oids['rsaEncryption']) { - throw 'Unsupported OID.'; -} - -// pretty print an ASN.1 object to a string for debugging purposes -asn1.prettyPrint(object); -``` - -Message Digests ----------------- - - - -### SHA1 - -Provides [SHA-1][] message digests. - -__Examples__ - -```js -var md = forge.md.sha1.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 -``` - - - -### SHA256 - -Provides [SHA-256][] message digests. - -__Examples__ - -```js -var md = forge.md.sha256.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 -``` - - - -### SHA384 - -Provides [SHA-384][] message digests. - -__Examples__ - -```js -var md = forge.md.sha384.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1 -``` - - - -### SHA512 - -Provides [SHA-512][] message digests. - -__Examples__ - -```js -// SHA-512 -var md = forge.md.sha512.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6 - -// SHA-512/224 -var md = forge.md.sha512.sha224.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 944cd2847fb54558d4775db0485a50003111c8e5daa63fe722c6aa37 - -// SHA-512/256 -var md = forge.md.sha512.sha256.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: dd9d67b371519c339ed8dbd25af90e976a1eeefd4ad3d889005e532fc5bef04d -``` - - - -### MD5 - -Provides [MD5][] message digests. - -__Examples__ - -```js -var md = forge.md.md5.create(); -md.update('The quick brown fox jumps over the lazy dog'); -console.log(md.digest().toHex()); -// output: 9e107d9d372bb6826bd81d3542a419d6 -``` - - - -### HMAC - -Provides [HMAC][] w/any supported message digest algorithm. - -__Examples__ - -```js -var hmac = forge.hmac.create(); -hmac.start('sha1', 'Jefe'); -hmac.update('what do ya want for nothing?'); -console.log(hmac.digest().toHex()); -// output: effcdf6ae5eb2fa2d27416d5f184df9c259a7c79 -``` - -Utilities ---------- - - - -### Prime - -Provides an API for generating large, random, probable primes. - -__Examples__ - -```js -// generate a random prime on the main JS thread -var bits = 1024; -forge.prime.generateProbablePrime(bits, function(err, num) { - console.log('random prime', num.toString(16)); -}); - -// generate a random prime using Web Workers (if available, otherwise -// falls back to the main thread) -var bits = 1024; -var options = { - algorithm: { - name: 'PRIMEINC', - workers: -1 // auto-optimize # of workers - } -}; -forge.prime.generateProbablePrime(bits, options, function(err, num) { - console.log('random prime', num.toString(16)); -}); -``` - - - -### PRNG - -Provides a [Fortuna][]-based cryptographically-secure pseudo-random number -generator, to be used with a cryptographic function backend, e.g. [AES][]. An -implementation using [AES][] as a backend is provided. An API for collecting -entropy is given, though if window.crypto.getRandomValues is available, it will -be used automatically. - -__Examples__ - -```js -// get some random bytes synchronously -var bytes = forge.random.getBytesSync(32); -console.log(forge.util.bytesToHex(bytes)); - -// get some random bytes asynchronously -forge.random.getBytes(32, function(err, bytes) { - console.log(forge.util.bytesToHex(bytes)); -}); - -// collect some entropy if you'd like -forge.random.collect(someRandomBytes); -jQuery().mousemove(function(e) { - forge.random.collectInt(e.clientX, 16); - forge.random.collectInt(e.clientY, 16); -}); - -// specify a seed file for use with the synchronous API if you'd like -forge.random.seedFileSync = function(needed) { - // get 'needed' number of random bytes from somewhere - return fetchedRandomBytes; -}; - -// specify a seed file for use with the asynchronous API if you'd like -forge.random.seedFile = function(needed, callback) { - // get the 'needed' number of random bytes from somewhere - callback(null, fetchedRandomBytes); -}); - -// register the main thread to send entropy or a Web Worker to receive -// entropy on demand from the main thread -forge.random.registerWorker(self); - -// generate a new instance of a PRNG with no collected entropy -var myPrng = forge.random.createInstance(); -``` - - - -### Tasks - -Provides queuing and synchronizing tasks in a web application. - -__Examples__ - -```js -// TODO -``` - - - -### Utilities - -Provides utility functions, including byte buffer support, base64, -bytes to/from hex, zlib inflate/deflate, etc. - -__Examples__ - -```js -// encode/decode base64 -var encoded = forge.util.encode64(str); -var str = forge.util.decode64(encoded); - -// encode/decode UTF-8 -var encoded = forge.util.encodeUtf8(str); -var str = forge.util.decodeUtf8(encoded); - -// bytes to/from hex -var bytes = forge.util.hexToBytes(hex); -var hex = forge.util.bytesToHex(bytes); - -// create an empty byte buffer -var buffer = forge.util.createBuffer(); -// create a byte buffer from raw binary bytes -var buffer = forge.util.createBuffer(input, 'raw'); -// create a byte buffer from utf8 bytes -var buffer = forge.util.createBuffer(input, 'utf8'); - -// get the length of the buffer in bytes -buffer.length(); -// put bytes into the buffer -buffer.putBytes(bytes); -// put a 32-bit integer into the buffer -buffer.putInt32(10); -// buffer to hex -buffer.toHex(); -// get a copy of the bytes in the buffer -bytes.bytes(/* count */); -// empty this buffer and get its contents -bytes.getBytes(/* count */); - -// convert a forge buffer into a Node.js Buffer -// make sure you specify the encoding as 'binary' -var forgeBuffer = forge.util.createBuffer(); -var nodeBuffer = Buffer.from(forgeBuffer.getBytes(), 'binary'); - -// convert a Node.js Buffer into a forge buffer -// make sure you specify the encoding as 'binary' -var nodeBuffer = Buffer.from('CAFE', 'hex'); -var forgeBuffer = forge.util.createBuffer(nodeBuffer.toString('binary')); - -// parse a URL -var parsed = forge.util.parseUrl('http://example.com/foo?bar=baz'); -// parsed.scheme, parsed.host, parsed.port, parsed.path, parsed.fullHost -``` - - - -### Logging - -Provides logging to a javascript console using various categories and -levels of verbosity. - -__Examples__ - -```js -// TODO -``` - - - -### Debugging - -Provides storage of debugging information normally inaccessible in -closures for viewing/investigation. - -__Examples__ - -```js -// TODO -``` - - - -### Flash Networking Support - -The [flash README](./flash/README.md) provides details on rebuilding the -optional Flash component used for networking. It also provides details on -Policy Server support. - -Security Considerations ------------------------ - -When using this code please keep the following in mind: - -- Cryptography is hard. Please review and test this code before depending on it - for critical functionality. -- The nature of JavaScript is that execution of this code depends on trusting a - very large set of JavaScript tools and systems. Consider runtime variations, - runtime characteristics, runtime optimization, code optimization, code - minimization, code obfuscation, bundling tools, possible bugs, the Forge code - itself, and so on. -- If using pre-built bundles from [Bower][] or similar be aware someone else - ran the tools to create those files. -- Use a secure transport channel such as [TLS][] to load scripts and consider - using additional security mechanisms such as [Subresource Integrity][] script - attributes. -- Use "native" functionality where possible. This can be critical when dealing - with performance and random number generation. Note that the JavaScript - random number algorithms should perform well if given suitable entropy. -- Understand possible attacks against cryptographic systems. For instance side - channel and timing attacks may be possible due to the difficulty in - implementing constant time algorithms in pure JavaScript. -- Certain features in this library are less susceptible to attacks depending on - usage. This primarily includes features that deal with data format - manipulation or those that are not involved in communication. - -Library Background ------------------- - -* https://digitalbazaar.com/2010/07/20/javascript-tls-1/ -* https://digitalbazaar.com/2010/07/20/javascript-tls-2/ - -Contact -------- - -* Code: https://github.com/digitalbazaar/forge -* Bugs: https://github.com/digitalbazaar/forge/issues -* Email: support@digitalbazaar.com -* IRC: [#forgejs][] on [freenode][] - -Donations ---------- - -Financial support is welcome and helps contribute to futher development: - -* For [PayPal][] please send to paypal@digitalbazaar.com. -* Something else? Please contact support@digitalbazaar.com. - -[#forgejs]: https://webchat.freenode.net/?channels=#forgejs -[0.6.x]: https://github.com/digitalbazaar/forge/tree/0.6.x -[3DES]: https://en.wikipedia.org/wiki/Triple_DES -[AES]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard -[ASN.1]: https://en.wikipedia.org/wiki/ASN.1 -[Bower]: https://bower.io/ -[Browserify]: http://browserify.org/ -[CBC]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[CFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[CTR]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[CommonJS]: https://en.wikipedia.org/wiki/CommonJS -[DES]: https://en.wikipedia.org/wiki/Data_Encryption_Standard -[ECB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[Fortuna]: https://en.wikipedia.org/wiki/Fortuna_(PRNG) -[GCM]: https://en.wikipedia.org/wiki/GCM_mode -[HMAC]: https://en.wikipedia.org/wiki/HMAC -[JavaScript]: https://en.wikipedia.org/wiki/JavaScript -[Karma]: https://karma-runner.github.io/ -[MD5]: https://en.wikipedia.org/wiki/MD5 -[Node.js]: https://nodejs.org/ -[OFB]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation -[PKCS#10]: https://en.wikipedia.org/wiki/Certificate_signing_request -[PKCS#12]: https://en.wikipedia.org/wiki/PKCS_%E2%99%AF12 -[PKCS#5]: https://en.wikipedia.org/wiki/PKCS -[PKCS#7]: https://en.wikipedia.org/wiki/Cryptographic_Message_Syntax -[PayPal]: https://www.paypal.com/ -[RC2]: https://en.wikipedia.org/wiki/RC2 -[SHA-1]: https://en.wikipedia.org/wiki/SHA-1 -[SHA-256]: https://en.wikipedia.org/wiki/SHA-256 -[SHA-384]: https://en.wikipedia.org/wiki/SHA-384 -[SHA-512]: https://en.wikipedia.org/wiki/SHA-512 -[Subresource Integrity]: https://www.w3.org/TR/SRI/ -[TLS]: https://en.wikipedia.org/wiki/Transport_Layer_Security -[UMD]: https://github.com/umdjs/umd -[X.509]: https://en.wikipedia.org/wiki/X.509 -[freenode]: https://freenode.net/ -[unpkg]: https://unpkg.com/ -[webpack]: https://webpack.github.io/ -[TweetNaCl.js]: https://github.com/dchest/tweetnacl-js diff --git a/node_modules/node-forge/dist/forge.all.min.js b/node_modules/node-forge/dist/forge.all.min.js deleted file mode 100644 index 340fb12..0000000 --- a/node_modules/node-forge/dist/forge.all.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.forge=t():e.forge=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=36)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){(function(t){var n=r(0),a=r(40),i=e.exports=n.util=n.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(i.isArrayBuffer(e)||i.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&a.setAttribute("a",n=!n))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.globalScope=i.isNodejs?t:"undefined"==typeof self?window:self,i.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},i.ByteBuffer=o,i.ByteStringBuffer=o;i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},i.xorBytes=function(e,t,r){for(var n="",a="",i="",s=0,o=0;r>0;--r,++s)a=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=i,i="",o=0),i+=String.fromCharCode(a),++o;return n+=i},i.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(e,t){for(var r,n,a,i="",s="",o=0;o>2),i+=c.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=c.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":c.charAt(63&a)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,a,i="",s=0;s>4),64!==n&&(i+=String.fromCharCode((15&r)<<4|n>>2),64!==a&&(i+=String.fromCharCode((3&n)<<6|a)));return i},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:a.encode,decode:a.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var a=r=r||0,i=0;i>2),i+=c.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=c.charAt((15&n)<<2|a>>6),i+=isNaN(a)?"=":c.charAt(63&a)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.binary.base64.decode=function(e,t,r){var n,a,i,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c>4,64!==i&&(o[l++]=(15&a)<<4|i>>2,64!==s&&(o[l++]=(3&i)<<6|s));return t?l-r:o.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,l,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,l,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,r){e=i.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var a=r=r||0,s=0;s0?(a=r[n].substring(0,s),i=r[n].substring(s+1)):(a=r[n],i=null),a in t||(t[a]=[]),a in Object.prototype||null===i||t[a].push(unescape(i))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},i.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var a=t.split("/");return a.length>0&&""===a[0]&&a.shift(),{pathString:t,queryString:r,path:a,query:""===r?{}:i.getQueryVariables(r)}},i.makeRequest=function(e){var t=i.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},i.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},i.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},i.format=function(e){for(var t,r,n=/%./g,a=0,i=[],s=0;t=n.exec(e);){(r=e.substring(s,n.lastIndex-2)).length>0&&i.push(r),s=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":a");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},i.formatNumber=function(e,t,r,n){var a=e,i=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===n?".":n,c=a<0?"-":"",u=parseInt(a=Math.abs(+a||0).toFixed(i),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(a-u).toFixed(i).slice(2):"")},i.formatSize=function(e){return e=e>=1073741824?i.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?i.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?i.formatNumber(e/1024,0)+" KiB":i.formatNumber(e,0)+" bytes"},i.bytesFromIP=function(e){return-1!==e.indexOf(".")?i.bytesFromIPv4(e):-1!==e.indexOf(":")?i.bytesFromIPv6(e):null},i.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=i.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},i.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in i&&!e.update)return t(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,t(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,t(null,i.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()o.st&&a.sta.st&&o.stt){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}a.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},a.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},a.create=function(e,t,r,i,s){if(n.util.isArray(i)){for(var o=[],c=0;cr){if(s.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=r,d.requested=h,d}h=r}var y=32==(32&c);if(y)if(p=[],void 0===h)for(;;){if(i(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}o=t.length(),p.push(e(t,r,n+1,s)),r-=o-t.length()}else for(;h>0;)o=t.length(),p.push(e(t,h,n+1,s)),r-=o-t.length(),h-=o-t.length();void 0===p&&u===a.Class.UNIVERSAL&&l===a.Type.BITSTRING&&(f=t.bytes(h));if(void 0===p&&s.decodeBitStrings&&u===a.Class.UNIVERSAL&&l===a.Type.BITSTRING&&h>1){var g=t.read,v=r,m=0;if(l===a.Type.BITSTRING&&(i(t,r,1),m=t.getByte(),r--),0===m)try{o=t.length();var C={verbose:s.verbose,strict:!0,decodeBitStrings:!0},E=e(t,r,n+1,C),S=o-t.length();r-=S,l==a.Type.BITSTRING&&S++;var T=E.tagClass;S!==h||T!==a.Class.UNIVERSAL&&T!==a.Class.CONTEXT_SPECIFIC||(p=[E])}catch(e){}void 0===p&&(t.read=g,r=v)}if(void 0===p){if(void 0===h){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(l===a.Type.BMPSTRING)for(p="";h>0;h-=2)i(t,r,2),p+=String.fromCharCode(t.getInt16()),r-=2;else p=t.getBytes(h)}var b=void 0===f?null:{bitStringContents:f};return a.create(u,l,y,p,b)}(e,e.length(),0,t)},a.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,i=n.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=a.equals(e,e.original))),s)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:i.putByte(0);for(var o=0;o1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(t.putByte(r),i.length()<=127)t.putByte(127&i.length());else{var c=i.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(i),t},a.oidToDer=function(e){var t,r,a,i,s=e.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c>>=7,t||(i|=128),r.push(i),t=!1}while(a>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},a.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var a=0;e.length()>0;)a<<=7,128&(r=e.getByte())?a+=127&r:(t+="."+(a+r),a=0);return t},a.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,a=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,a),t.setUTCHours(i,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},a.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,a=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var p=e.length-5,f=e.charAt(p);"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(p+1,2),10)+parseInt(e.substr(p+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0);return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,a),t.setUTCHours(i,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,n,a),t.setHours(i,s,o,c)),t},a.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},a.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},a.validate=function(e,t,r,i){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)i&&(e.tagClass!==t.tagClass&&i.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&i.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&n.util.isArray(t.value))for(var o=0,c=0;s&&c0&&(i+="\n");for(var o="",c=0;c1?i+="0x"+n.util.bytesToHex(e.value.slice(1)):i+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);1==f?i+=" (1 unused bit shown)":f>1&&(i+=" ("+f+" unused bits shown)")}}else e.type===a.Type.OCTETSTRING?(s.test(e.value)||(i+="("+e.value+") "),i+="0x"+n.util.bytesToHex(e.value)):e.type===a.Type.UTF8?i+=n.util.decodeUtf8(e.value):e.type===a.Type.PRINTABLESTRING||e.type===a.Type.IA5String?i+=e.value:s.test(e.value)?i+="0x"+n.util.bytesToHex(e.value):0===e.value.length?i+="[null]":i+=e.value}return i}},function(e,t,r){var n=r(0);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){var n=r(0);function a(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(14),r(21),r(1),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var a=d({key:e,output:r,decrypt:!1,mode:n});return a.start(t),a},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var a=d({key:e,output:r,decrypt:!0,mode:n});return a.start(t),a},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var a=0;a>>=2;for(a=0;a>8^255&p^99,i[y]=p,s[p]=y,h=(f=e[p])<<24^p<<16^p<<8^p^f,d=((r=e[y])^(n=e[r])^(a=e[n]))<<24^(y^a)<<16^(y^n^a)<<8^y^r^a;for(var v=0;v<4;++v)c[v][y]=h,u[v][p]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^a]]],g^=e[e[g]])}}function f(e,t){for(var r,n=e.slice(0),a=1,s=n.length,c=4*(s+6+1),l=s;l>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^o[a]<<24,a++):s>6&&l%s==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),n[l]=n[l-s]^r;if(t){for(var p,f=u[0],h=u[1],d=u[2],y=u[3],g=n.slice(0),v=(l=0,(c=n.length)-4);l>>24]]^h[i[p>>>16&255]]^d[i[p>>>8&255]]^y[i[255&p]];n=g}return n}function h(e,t,r,n){var a,o,l,p,f,h,d,y,g,v,m,C,E=e.length/4-1;n?(a=u[0],o=u[1],l=u[2],p=u[3],f=s):(a=c[0],o=c[1],l=c[2],p=c[3],f=i),h=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var S=3,T=1;T>>24]^o[d>>>16&255]^l[y>>>8&255]^p[255&g]^e[++S],m=a[d>>>24]^o[y>>>16&255]^l[g>>>8&255]^p[255&h]^e[++S],C=a[y>>>24]^o[g>>>16&255]^l[h>>>8&255]^p[255&d]^e[++S],g=a[g>>>24]^o[h>>>16&255]^l[d>>>8&255]^p[255&y]^e[++S],h=v,d=m,y=C;r[0]=f[h>>>24]<<24^f[d>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^e[++S],r[n?3:1]=f[d>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&h]^e[++S],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[h>>>8&255]<<8^f[255&d]^e[++S],r[n?1:3]=f[g>>>24]<<24^f[h>>>16&255]<<16^f[d>>>8&255]<<8^f[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),a=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,a.call(t,r)},t}},function(e,t,r){var n=r(0);n.pki=n.pki||{};var a=e.exports=n.pki.oids=n.oids=n.oids||{};function i(e,t){a[e]=t,a[t]=e}function s(e,t){a[e]=t}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.5","serialName"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){var n=r(0);r(1);var a=e.exports=n.pem=n.pem||{};function i(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},a=0;a65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),i=a-s-1,s=-1,++a}else" "!==t[a]&&"\t"!==t[a]&&","!==t[a]||(s=a);return t}function s(e){return e.replace(/^\s+/,"")}a.encode=function(e,t){t=t||{};var r,a="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(a+=i(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(a+=i(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),a+=i(r)),e.headers)for(var s=0;st.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),a=n.util.createBuffer(),u=s.length();for(c=0;c>>0,c>>>0];for(var u=a.fullMessageLength.length-1;u>=0;--u)a.fullMessageLength[u]+=c[1],c[1]=c[0]+(a.fullMessageLength[u]/4294967296>>>0),a.fullMessageLength[u]=a.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(i),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var c,u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(i.substr(0,a.blockLength-u));for(var l=8*a.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(f,r,s);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},a};var i=null,s=!1;function o(e,t,r){for(var n,a,i,s,o,c,u,l=r.length();l>=64;){for(a=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(a<<5|a>>>27)+(o^i&(s^o))+c+1518500249+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(a<<5|a>>>27)+(o^i&(s^o))+c+1518500249+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(a<<5|a>>>27)+(i^s^o)+c+1859775393+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(a<<5|a>>>27)+(i^s^o)+c+1859775393+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(a<<5|a>>>27)+(i&s|o&(i^s))+c+2400959708+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(a<<5|a>>>27)+(i^s^o)+c+3395469782+n,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=a,a=n;e.h0=e.h0+a|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,l-=64}}},function(e,t,r){var n=r(0);r(3),r(8),r(15),r(7),r(22),r(2),r(9),r(1);var a=function(e,t,r,a){var i=n.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=n.util.createBuffer(),p=n.hmac.create();r=t+r;var f=Math.ceil(a/16),h=Math.ceil(a/20);p.start("MD5",c);var d=n.util.createBuffer();l.putBytes(r);for(var y=0;y0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var a=null,i=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(a={version:{major:s.getByte(),minor:s.getByte()},random:n.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},i?(a.cipher_suite=s.getBytes(2),a.compression_method=s.getByte()):(a.cipher_suites=o(s,2),a.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)a.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!i)for(var p=0;p0;){if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}}if(e.session.version&&(a.version.major!==e.session.version.major||a.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=u.getCipherSuite(a.cipher_suite);else for(var d=n.util.createBuffer(a.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(a.cipher_suite)});e.session.compressionMethod=i?a.compression_method:u.CompressionMethod.none}return a},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,n=t.random.bytes(),a=r?e.session.sp.client_random:n,i=r?n:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:a,server_random:i}},u.handleServerHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var a=n.session_id.bytes();a.length>0&&a===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.session.id=a,e.process()}},u.handleClientHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){var i=a.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(i))?i="":(s.version.major!==a.version.major||s.version.minor>a.version.minor)&&(s=null,i="")),0===i.length&&(i=n.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=a.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c0;)a=o(c.certificate_list,3),i=n.asn1.fromDer(a),a=n.pki.certificateFromAsn1(i,!0),l.push(a)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var f=e.entity===u.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=f?p:C:(f?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=f?p:C)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=f,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var a=t.fragment,i={enc_pre_master_secret:o(a,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=n.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=n.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment,a={certificate_types:o(n,1),certificate_authorities:o(n,2)};e.session.certificateRequest=a,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment;a.read-=4;var i=a.bytes();a.read+=4;var s={signature:o(a,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var a={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},i=e.verify(e,a.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||n.util.isArray(i)?"number"==typeof i&&(a.alert.description=i):(i.message&&(a.message=i.message),i.alert&&(a.alert.description=i.alert))),e.error(e,a)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var o=t.fragment.getBytes();(i=n.util.createBuffer()).putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?"server finished":"client finished",p=e.session.sp;if((i=a(p.master_secret,l,i.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:b,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,n=t.fragment,a={level:n.getByte(),description:n.getByte()};switch(a.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(a.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:a}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,a=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(i+4);r.read+=4,a in x[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),a!==u.HandshakeType.hello_request&&a!==u.HandshakeType.certificate_verify&&a!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),x[e.entity][e.expect][a](e,t,i)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,a=r.getByte(),i=r.getInt16(),s=r.getBytes(i);if(a===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(a===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(s))}e.process()};var l=1,p=2,f=3,h=4,d=5,y=6,g=7,v=8,m=1,C=2,E=3,S=4,T=5,b=6,I=u.handleUnexpected,A=u.handleChangeCipherSpec,B=u.handleAlert,k=u.handleHandshake,N=u.handleApplicationData,w=u.handleHeartbeat,R=[];R[u.ConnectionEnd.client]=[[I,B,k,I,w],[I,B,k,I,w],[I,B,k,I,w],[I,B,k,I,w],[I,B,k,I,w],[A,B,I,I,w],[I,B,k,I,w],[I,B,k,N,w],[I,B,k,I,w]],R[u.ConnectionEnd.server]=[[I,B,k,I,w],[I,B,k,I,w],[I,B,k,I,w],[I,B,k,I,w],[A,B,I,I,w],[I,B,k,I,w],[I,B,k,N,w],[I,B,k,I,w]];var L=u.handleHelloRequest,_=u.handleServerHello,U=u.handleCertificate,D=u.handleServerKeyExchange,P=u.handleCertificateRequest,O=u.handleServerHelloDone,V=u.handleFinished,x=[];x[u.ConnectionEnd.client]=[[I,I,_,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,U,D,P,O,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,I,D,P,O,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,I,I,P,O,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,I,I,I,O,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,V],[L,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I],[L,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I]];var K=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;x[u.ConnectionEnd.server]=[[I,K,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I],[I,I,I,I,I,I,I,I,I,I,I,U,I,I,I,I,I,I,I,I,I],[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,M,I,I,I,I],[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,F,I,I,I,I,I],[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I],[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,V],[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I],[I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I]],u.generateKeys=function(e,t){var r=a,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,i),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var a=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(a),a.keys=u.generateKeys(e,a),n.read.macKey=t?a.keys.server_write_MAC_key:a.keys.client_write_MAC_key,n.write.macKey=t?a.keys.client_write_MAC_key:a.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,a),a.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:n.read.compressFunction=s,n.write.compressFunction=i;break;default:throw new Error("Unsupported compression algorithm.")}}return n},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+i+1+o+d,v=n.util.createBuffer();return v.putByte(u.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),c(v,1,n.util.createBuffer(y)),c(v,2,t),c(v,1,s),d>0&&c(v,2,l),v},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,a=n.util.createBuffer();return a.putByte(u.HandshakeType.server_hello),a.putInt24(r),a.putByte(e.version.major),a.putByte(e.version.minor),a.putBytes(e.session.sp.server_random),c(a,1,n.util.createBuffer(t)),a.putByte(e.session.cipherSuite.id[0]),a.putByte(e.session.cipherSuite.id[1]),a.putByte(e.session.compressionMethod),a},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,a=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,a=e.getCertificate(e,t));var i=n.util.createBuffer();if(null!==a)try{n.util.isArray(a)||(a=[a]);for(var s=null,o=0;ou.MaxFragment;)a.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(i.slice(0,u.MaxFragment))})),i=i.slice(u.MaxFragment);i.length>0&&a.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(i)}))}for(var s=0;s0&&(a=r.order[0]),null!==a&&a in r.cache)for(var i in t=r.cache[a],delete r.cache[a],r.order)if(r.order[i]===a){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var a=r.order.shift();delete r.cache[a]}a=n.util.bytesToHex(e);r.order.push(a),r.cache[a]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var a in r=[],u.CipherSuites)r.push(u.CipherSuites[a]);var i=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,a=r.length();if(a<5)t=5-a;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();n8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E>>4^T))<<4,S^=t=65535&((T^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(T^=t<<-16)))<<2,S^=t=65535&((T^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(T^=t<<-16)))<<1,S^=t=16711935&((T^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(T^=t<<8)))<<1)<<8|(T^=t)>>>20&240,S=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=t;for(var b=0;b>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27);var I=r[(S&=-15)>>>28]|n[S>>>24&15]|a[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],A=u[(T&=-15)>>>28]|l[T>>>24&15]|p[T>>>20&15]|f[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=65535&(A>>>16^I),v[C++]=I^t,v[C++]=A^t<<16}}return v}(t),this._init=!0}},a("DES-ECB",n.cipher.modes.ecb),a("DES-CBC",n.cipher.modes.cbc),a("DES-CFB",n.cipher.modes.cfb),a("DES-OFB",n.cipher.modes.ofb),a("DES-CTR",n.cipher.modes.ctr),a("3DES-ECB",n.cipher.modes.ecb),a("3DES-CBC",n.cipher.modes.cbc),a("3DES-CFB",n.cipher.modes.cfb),a("3DES-OFB",n.cipher.modes.ofb),a("3DES-CTR",n.cipher.modes.ctr);var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],p=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e,t,r,n){var a,h,d=32===e.length?3:9;a=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(h=252645135&(y>>>4^g))<<4,y^=(h=65535&(y>>>16^(g^=h)))<<16,y^=h=858993459&((g^=h)>>>2^y),y^=h=16711935&((g^=h<<2)>>>8^y),y=(y^=(h=1431655765&(y>>>1^(g^=h<<8)))<<1)<<1|y>>>31,g=(g^=h)<<1|g>>>31;for(var v=0;v>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|f[63&S]|i[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|p[63&T])}h=y,y=g,g=h}g=g>>>1|g<<31,g^=h=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(h=16711935&(g>>>8^(y^=h<<1)))<<8,g^=(h=858993459&(g>>>2^(y^=h)))<<2,g^=h=65535&((y^=h)>>>16^g),g^=h=252645135&((y^=h<<16)>>>4^g),y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),a=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,a.call(t,r)},t}},function(e,t,r){var n=r(0);if(r(3),r(13),r(6),r(27),r(28),r(2),r(1),void 0===a)var a=n.jsbn.BigInteger;var i=n.util.isNodejs?r(17):null,s=n.asn1,o=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var c=n.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},p={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var n=s.oidToDer(t).getBytes(),a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);i.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),i.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return a.value.push(i),a.value.push(o),s.toDer(a).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var i;t.dP||(t.dP=t.d.mod(t.p.subtract(a.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(a.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{i=new a(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(i.compareTo(t.n)>=0||!i.gcd(t.n).equals(a.ONE));for(var s=(e=e.multiply(i.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c=c.multiply(i.modInverse(t.n)).mod(t.n)};function g(e,t,r){var a=n.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=i-11,s}a.putByte(0),a.putByte(r);var o,c=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u0;){var l=0,p=n.random.getBytes(c);for(u=0;u1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var i={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){n.prime.generateProbablePrime(e,i,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var i=e.p;e.p=e.q,e.q=i}if(0!==e.p.subtract(a.ONE).gcd(e.e).compareTo(a.ONE))return e.p=null,void s();if(0!==e.q.subtract(a.ONE).gcd(e.e).compareTo(a.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(a.ONE),e.q1=e.q.subtract(a.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(a.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(i.prng=t.prng),s()}function C(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof i[e]}function T(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function b(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function I(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),a=0;a0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new a(n.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=y(c,t,r).toString(16),l=n.util.createBuffer(),p=s-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(n.util.hexToBytes(u)),!1!==i?v(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var i,s=(r=r||{}).prng||n.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new a(null);r.fromInt(30);for(var n,i=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||lp?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(a.ONE).gcd(e.e).compareTo(a.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(a.ONE),e.q1=e.q.subtract(a.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(a.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-o,o=n}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,a){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(a=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(a=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,a=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(a=r,r=void 0):(a=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(a){if(S("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return a(e);a(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(T("generateKey")&&T("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:I(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){a(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));a(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(b("generateKey")&&b("exportKey")){var u=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:I(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));a(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){a(e)}},void(u.onerror=function(e){a(e)})}}else if(S("generateKeyPairSync")){var l=i.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(l.privateKey),publicKey:c.publicKeyFromPem(l.publicKey)}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!a)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;m(p,r,a)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,a){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,a)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return c.rsa.encrypt(i,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=v(t,r,!0),e===s.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=v(t,r,!0))}});var a=c.rsa.decrypt(t,r,!0,!1);return n.verify(e,a,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,a,i,s,o,u){var l={n:e,e:t,d:r,p:a,q:i,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var a=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:v};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(a,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return c.rsa.encrypt(n,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,i,o,u,f,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,p,y,g)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=g,v}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),i=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrime1).toHex(),u=n.util.createBuffer(y.privateKeyPrime2).toHex(),f=n.util.createBuffer(y.privateKeyExponent1).toHex(),h=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new a(t,16),new a(r,16),new a(i,16),new a(o,16),new a(u,16),new a(f,16),new a(h,16),new a(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var i,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=o,i;e=t.rsaPublicKey}if(r=[],!s.validate(e,f,t,r))throw(i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,i;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new a(u,16),new a(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e))])}},function(e,t,r){var n,a=r(0);e.exports=a.jsbn=a.jsbn||{};function i(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new i(null)}function o(e,t,r,n,a,i){for(var s=16383&t,o=t>>14;--i>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;a=((c=s*c+((16383&l)<<14)+r.data[n]+a)>>28)+(l>>14)+o*u,r.data[n++]=268435455&c}return a}a.jsbn.BigInteger=i,"undefined"==typeof navigator?(i.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,n,a,i){for(var s=32767&t,o=t>>15;--i>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;a=((c=s*c+((32767&l)<<15)+r.data[n]+(1073741823&a))>>>30)+(l>>>15)+o*u+(a>>>30),r.data[n++]=1073741823&c}return a},n=30):"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,n,a,i){for(;--i>=0;){var s=t*this.data[e++]+r.data[n]+a;a=Math.floor(s/67108864),r.data[n++]=67108863&s}return a},n=26):(i.prototype.am=o,n=28),i.prototype.DB=n,i.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function T(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function b(){}function I(e){return e}function A(e){this.r2=s(),this.q3=s(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,a=!1,s=0;--n>=0;){var o=8==r?255&e[n]:f(e,n);o<0?"-"==e.charAt(n)&&(a=!0):(a=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+s+1]=this.data[r]>>a|o,o=(this.data[r]&i)<=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,a=this.DB-n,i=(1<>n;for(var s=r+1;s>n;n>0&&(t.data[this.t-r-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),a=r.t;for(t.t=a+n.t;--a>=0;)t.data[a]=0;for(a=0;a=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var a=this.abs();if(a.t0?(n.lShiftTo(l,o),a.lShiftTo(l,r)):(n.copyTo(o),a.copyTo(r));var p=o.t,f=o.data[p-1];if(0!=f){var h=f*(1<1?o.data[p-2]>>this.F2:0),y=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),i.ONE.dlShiftTo(p,E),E.subTo(o,o);o.t=0;){var S=r.data[--m]==f?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+v)*g);if((r.data[m]+=o.am(0,S,r,C,0,p))0&&r.rShiftTo(l,r),c<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=s(),n=s(),a=t.convert(this),o=d(e)-1;for(a.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,a,r);else{var c=r;r=n,n=c}return t.revert(r)},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(o>o)>0&&(a=!0,i=p(r));s>=0;)o>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(a=!0),a&&(i+=p(r));return a?i:"0"},i.prototype.negate=function(){var e=s();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},i.ZERO=h(0),i.ONE=h(1),b.prototype.convert=I,b.prototype.revert=I,b.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},b.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var B=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/B[B.length-1];i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=h(r),a=s(),i=s(),o="";for(this.divRemTo(n,a,i);a.signum()>0;)o=(r+i.intValue()).toString(e).substr(1)+o,a.divRemTo(n,a,i);return i.intValue().toString(e)+o},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),a=!1,s=0,o=0,c=0;c=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),a&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var n=new Array,a=7&e;n.length=1+(e>>3),t.nextBytes(n),a>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var n,a=Math.min(this.t+e.t,t);for(r.s=0,r.t=a;a>0;)r.data[--a]=0;for(n=r.t-this.t;a=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,a=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t=0);var c=n.modPow(a,this);if(0!=c.compareTo(i.ONE)&&0!=c.compareTo(t)){for(var u=1;u++>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,a=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[a++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==a&&(128&this.s)!=(128&r)&&++a,(a>0||r!=this.s)&&(t[a++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},i.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},i.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,C,t),t},i.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,E,t),t},i.prototype.not=function(){for(var e=s(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var p=s();for(n.sqrTo(o[1],p);c<=l;)o[c]=s(),n.mulTo(p,o[c-2],o[c]),c+=2}var f,v,m=e.t-1,C=!0,E=s();for(a=d(e.data[m])-1;m>=0;){for(a>=u?f=e.data[m]>>a-u&l:(f=(e.data[m]&(1<0&&(f|=e.data[m-1]>>this.DB+a-u)),c=r;0==(1&f);)f>>=1,--c;if((a-=c)<0&&(a+=this.DB,--m),C)o[f].copyTo(i),C=!1;else{for(;c>1;)n.sqrTo(i,E),n.sqrTo(E,i),c-=2;c>0?n.sqrTo(i,E):(v=i,i=E,E=v),n.mulTo(E,o[f],i)}for(;m>=0&&0==(e.data[m]&1<=0?(r.subTo(n,r),t&&a.subTo(o,a),s.subTo(c,s)):(n.subTo(r,n),t&&o.subTo(a,o),c.subTo(s,c))}return 0!=n.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new b)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var a=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(a0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=B[B.length-1]){for(t=0;t>>0,o>>>0];for(var c=a.fullMessageLength.length-1;c>=0;--c)a.fullMessageLength[c]+=o[1],o[1]=o[0]+(a.fullMessageLength[c]/4294967296>>>0),a.fullMessageLength[c]=a.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(i.substr(0,a.blockLength-o));for(var c,u=0,p=a.fullMessageLength.length-1;p>=0;--p)u=(c=8*a.fullMessageLength[p]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(f,r,s);var h=n.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},a};var i=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var n,a,i,u,l,p,f,h=r.length();h>=64;){for(a=e.h0,i=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),n=a+(l^i&(u^l))+c[f]+t[f],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;for(;f<32;++f)n=a+(u^l&(i^u))+c[f]+t[s[f]],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;for(;f<48;++f)n=a+(i^u^l)+c[f]+t[s[f]],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;for(;f<64;++f)n=a+(u^(i|~l))+c[f]+t[s[f]],a=l,l=u,u=i,i+=n<<(p=o[f])|n>>>32-p;e.h0=e.h0+a|0,e.h1=e.h1+i|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,h-=64}}},function(e,t,r){var n=r(0);r(8),r(4),r(1);var a,i=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(a=r(17)),e.exports=n.pbkdf2=i.pbkdf2=function(e,t,r,i,s,o){if("function"==typeof s&&(o=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&a.pbkdf2&&(null===s||"object"!=typeof s)&&(a.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o?4===a.pbkdf2Sync.length?a.pbkdf2(e,t,r,i,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):a.pbkdf2(e,t,r,i,s,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,t,r,i).toString("binary"):a.pbkdf2Sync(e,t,r,i,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var c=s.digestLength;if(i>4294967295*c){var u=new Error("Derived key is too long.");if(o)return o(u);throw u}var l=Math.ceil(i/c),p=i-(l-1)*c,f=n.hmac.create();f.start(s,e);var h,d,y,g="";if(!o){for(var v=1;v<=l;++v){f.start(null,null),f.update(t),f.update(n.util.int32ToBytes(v)),h=y=f.digest().getBytes();for(var m=2;m<=r;++m)f.start(null,null),f.update(y),d=f.digest().getBytes(),h=n.util.xorBytes(h,d,c),y=d;g+=vl)return o(null,g);f.start(null,null),f.update(t),f.update(n.util.int32ToBytes(v)),h=y=f.digest().getBytes(),m=2,E()}function E(){if(m<=r)return f.start(null,null),f.update(y),d=f.digest().getBytes(),h=n.util.xorBytes(h,d,c),y=d,++m,n.util.setImmediate(E);g+=v128)throw new Error('Invalid "nsComment" content.');e.value=a.create(a.Class.UNIVERSAL,a.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(a.create(a.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var g=[a.create(a.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(a.create(a.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var v=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(a.create(a.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if("cRLDistributionPoints"===e.name){e.value=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);l=e.value.value;var m,C=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),E=a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(p.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=p[0],c.validity.notAfter=p[1],c.tbsCertificate=r.tbsCertificate,t){var f;if(c.md=null,c.signatureOid in s)switch(s[c.signatureOid]){case"sha1WithRSAEncryption":c.md=n.md.sha1.create();break;case"md5WithRSAEncryption":c.md=n.md.md5.create();break;case"sha256WithRSAEncryption":c.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=n.md.sha512.create();break;case"RSASSA-PSS":c.md=n.md.sha256.create()}if(null===c.md)throw(f=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=c.signatureOid,f;var y=a.toDer(c.tbsCertificate);c.md.update(y.getBytes())}var v=n.md.sha1.create();c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){g([e]),c.issuer.attributes.push(e)},c.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer,v),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=v.digest().toHex();var m=n.md.sha1.create();return c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){g([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},i.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=c.value.charCodeAt(1),i=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&i)}else if("basicConstraints"===t.name){(c=a.fromDer(t.value)).value.length>0&&c.value[0].type===a.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===a.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=a.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=a.fromDer(t.value),u=0;u1&&(r=c.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var p;t.altNames=[];c=a.fromDer(t.value);for(var f=0;f=E&&e0&&s.value.push(i.certificateExtensionsToAsn1(e.extensions)),s},i.getCertificationRequestInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(e.version).getBytes()),y(e.subject),i.publicKeyToAsn1(e.publicKey),C(e)])},i.distinguishedNameToAsn1=function(e){return y(e)},i.certificateToAsn1=function(e){var t=e.tbsCertificate||i.getTBSCertificate(e);return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[t,a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},i.certificateExtensionsToAsn1=function(e){var t=a.create(a.Class.CONTEXT_SPECIFIC,3,!0,[]),r=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nl.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(p=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(f=!0,p=l),p){var h=p;n.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){p=h.shift();try{d=p.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}null!==c||p&&!f||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(null===c&&p&&!l.isIssuer(p)&&(c={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&gm.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,a):E;if(!0!==S)throw!0===E&&(c={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},function(e,t,r){var n=r(0);r(2),r(1),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,a=e.mgf,i=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=n.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random,c={encode:function(e,c){var u,l,p=c-1,f=Math.ceil(p/8),h=e.digest().getBytes();if(f>8*f-p&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l>8*l-u&255;if(0!=(f.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=a.generate(h,p),g="";for(c=0;c4){var r=e;e=n.util.createBuffer();for(var a=0;a0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},a.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},a.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},a.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},a.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},a.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},a.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0)e.read-=this.blockSize;else for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},a.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0)e.read-=this.blockSize;else for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},a.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},a.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},a.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0)e.read-=this.blockSize;else for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},a.ofb.prototype.decrypt=a.ofb.prototype.encrypt,a.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},a.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},a.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},a.ctr.prototype.decrypt=a.ctr.prototype.encrypt,a.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},a.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var a=r.length();if(12===a)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*a)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=o(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},a.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var a=0;a0&&(i=this.blockSize-i),this._partialOutput.clear();for(a=0;a0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},a.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},a.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,a=this._m[r][n];t[0]^=a[0],t[1]^=a[1],t[2]^=a[2],t[3]^=a[3]}return t},a.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},a.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,a=16*r,i=new Array(a),s=0;s>>1,a=new Array(r);a[n]=e.slice(0);for(var i=n>>>1;i>0;)this.pow(a[2*i],a[i]=[]),i>>=1;for(i=2;i=0;c--)w>>=8,w+=A.at(c)+N.at(c),N.setAt(c,255&w);k.putBuffer(N)}E=k,p.putBuffer(b)}return p.truncate(p.length()-i),p},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(e,t,r){var a,o={},c=[];if(!i.validate(t,u,o,c))throw(a=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,a;if((e=i.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(a=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,a.supportedOids=["pkcs5PBKDF2"],a;if((e=i.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(a=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,a.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],a;var l,p,h=o.kdfSalt,d=n.util.createBuffer(o.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":l=16,p=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,p=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,p=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,p=n.des.createDecryptionCipher;break;case"desCBC":l=8,p=n.des.createDecryptionCipher}var y=f(o.prfOid),g=n.pkcs5.pbkdf2(r,h,d,l,y),v=o.encIv,m=p(g);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var a={},o=[];if(!i.validate(t,l,a,o))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,y;var c,u,p,h=n.util.createBuffer(a.salt),d=n.util.createBuffer(a.iterations);switch(d=d.getInt(d.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,p=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,p=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=f(a.prfOid),v=s.pbe.generatePkcs12Key(r,h,1,d,c,g);return g.start(),p(v,s.pbe.generatePkcs12Key(r,h,2,d,u,g))},s.pbe.opensslDeriveBytes=function(e,t,r,a){if(null==a){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');a=n.md.md5.create()}null===t&&(t="");for(var i=[p(a,e+t)],s=16,o=1;s>>0,o>>>0];for(var u=a.fullMessageLength.length-1;u>=0;--u)a.fullMessageLength[u]+=o[1],o[1]=o[0]+(a.fullMessageLength[u]/4294967296>>>0),a.fullMessageLength[u]=a.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),a},a.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o,u=a.fullMessageLength[a.fullMessageLength.length-1]+a.messageLengthSize&a.blockLength-1;s.putBytes(i.substr(0,a.blockLength-u));for(var l=8*a.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=o>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(f,r,s);var h=n.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},a};var i=null,s=!1,o=null;function c(e,t,r){for(var n,a,i,s,c,u,l,p,f,h,d,y,g,v=r.length();v>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((a=t[c-15])>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[c]=n+t[c-7]+a+t[c-16]|0;for(u=e.h0,l=e.h1,p=e.h2,f=e.h3,h=e.h4,d=e.h5,y=e.h6,g=e.h7,c=0;c<64;++c)i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|p&(u^l),n=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(y^h&(d^y))+o[c]+t[c],g=y,y=d,d=h,h=f+n>>>0,f=p,p=l,l=u,u=n+(a=i+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+p|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,v-=64}}},function(e,t,r){var n=r(0);r(1);var a=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(a=r(17)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,i=new Array(32),s=0;s<32;++s)i[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var a=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(a),t.generated=0}function u(e){var t=null,r=n.util.globalScope,a=r.crypto||r.msCrypto;a&&a.getRandomValues&&(t=function(e){return a.getRandomValues(e)});var i=n.util.createBuffer();if(t)for(;i.length()>16)))<<16,f=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)p=f>>>(c<<3),p^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&p))}return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var a=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=n.util.createBuffer();t.key=null,function l(p){if(p)return r(p);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),c(),e()}))}(l)}));var f=a(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=s(a(t.key,i(t.seed))),t.seed=o(a(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,a=t.plugin.increment,i=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=n.util.createBuffer();c.length()1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=i(r(t.key,a(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},a?(t.seedFile=function(e,t){a.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return a.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,n=0;n>a&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},function(e,t,r){var n=r(0);r(1);var a=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],s=function(e,t){return e<>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,i=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)i.putByte(a[i.at(r-1)+i.at(r-s)&255]);for(i.setAt(128-c,a[i.at(128-c)&u]),r=127-c;r>=0;r--)i.setAt(r,a[i.at(r+1)^i.at(r+c)]);return i};var c=function(e,t,r){var a,c,u,l,p=!1,f=null,h=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(a=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],i[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(a=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],i[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var n=f.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var a=0;a=8;)g([[5,a],[1,c],[6,a],[1,c],[5,a]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(t&&(p=!0,v.update()),!r&&(t=0===f.length()))if(e)t=e(8,h,!r);else{var a=h.length(),i=h.at(a-1);i>a?t=!1:h.truncate(i)}return t}}};n.rc2.startEncrypting=function(e,t,r){var a=n.rc2.createEncryptionCipher(e,128);return a.start(t,r),a},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var a=n.rc2.createDecryptionCipher(e,128);return a.start(t,r),a},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},function(e,t,r){var n=r(0);r(1),r(2),r(9);var a=e.exports=n.pkcs1=n.pkcs1||{};function i(e,t,r){r||(r=n.md.sha1.create());for(var a="",i=Math.ceil(t/r.digestLength),s=0;s>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),a+=r.digest().getBytes()}return a.substring(0,t)}a.encode_rsa_oaep=function(e,t,r){var a,s,o,c;"string"==typeof r?(a=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(a=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;a||(a=""),o.update(a,"raw");for(var p=o.digest(),f="",h=l-t.length,d=0;de&&(s=c(e,t));var h=s.toString(16);a.target.postMessage({hex:h,workLoad:l}),s.dAddOffset(p,0)}}}h()}(e,t,a,i);return o(e,t,a,i)}(e,u,i.options,a);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(e,t,r,i){var s=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(s.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),function e(t,r,i,s,o,u,l){var p=+new Date;do{if(t.bitLength()>r&&(t=c(r,i)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(a[s++%8],0)}while(u<0||+new Date-p=0&&a.push(o):a.push(o))}return a}function h(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(c=a.create(a.Class.UNIVERSAL,a.Type.SET,!0,p));var f=[],h=[];null!==t&&(h=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var C=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,d),E=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(C).getBytes())])]);f.push(E)}var S=null;if(null!==e){var T=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=null===r?a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.keyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[T]),c]):a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(T,r,o)]),c]);var b=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[S]),I=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(b).getBytes())])]);f.push(I)}var A,B=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,f);if(o.useMac){var k=n.md.sha1.create(),N=new n.util.ByteBuffer(n.random.getBytes(o.saltSize)),w=o.count,R=(e=s.generateKey(r,N,3,w,20),n.hmac.create());R.start(k,e),R.update(a.toDer(B).getBytes());var L=R.getMac();A=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.sha1).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,L.getBytes())]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,N.getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(w).getBytes())])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(3).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(i.oids.data).getBytes()),a.create(a.Class.CONTEXT_SPECIFIC,0,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(B).getBytes())])]),A])},s.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(0);r(3),r(1);var a=n.asn1,i=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=i;var s={name:"ContentInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:a.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},i.encryptedDataValidator={name:"EncryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:a.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:a.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:a.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:a.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:a.Class.UNIVERSAL,type:a.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:a.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(0);r(1),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var a=new n.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/4294967296>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return a.putBytes(e),l(r,i,a),(a.read>2048||0===a.length())&&a.compact(),h},h.digest=function(){var t=n.util.createBuffer();t.putBytes(a.bytes());var o,c=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(s.substr(0,h.blockLength-c));for(var u=8*h.fullMessageLength[0],p=0;p>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var f=new Array(r.length);for(p=0;p=128;){for(R=0;R<16;++R)t[R][0]=r.getInt32()>>>0,t[R][1]=r.getInt32()>>>0;for(;R<80;++R)n=(((L=(U=t[R-2])[0])>>>19|(_=U[1])<<13)^(_>>>29|L<<3)^L>>>6)>>>0,a=((L<<13|_>>>19)^(_<<3|L>>>29)^(L<<26|_>>>6))>>>0,i=(((L=(P=t[R-15])[0])>>>1|(_=P[1])<<31)^(L>>>8|_<<24)^L>>>7)>>>0,s=((L<<31|_>>>1)^(L<<24|_>>>8)^(L<<25|_>>>7))>>>0,D=t[R-7],O=t[R-16],_=a+D[1]+s+O[1],t[R][0]=n+D[0]+i+O[0]+(_/4294967296>>>0)>>>0,t[R][1]=_>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],v=e[1][1],m=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],T=e[4][0],b=e[4][1],I=e[5][0],A=e[5][1],B=e[6][0],k=e[6][1],N=e[7][0],w=e[7][1],R=0;R<80;++R)l=((T>>>14|b<<18)^(T>>>18|b<<14)^(b>>>9|T<<23))>>>0,p=(B^T&(I^B))>>>0,o=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,u=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,f=(d&g|m&(d^g))>>>0,h=(y&v|C&(y^v))>>>0,_=w+(((T<<18|b>>>14)^(T<<14|b>>>18)^(b<<23|T>>>9))>>>0)+((k^b&(A^k))>>>0)+c[R][1]+t[R][1],n=N+l+p+c[R][0]+t[R][0]+(_/4294967296>>>0)>>>0,a=_>>>0,i=o+f+((_=u+h)/4294967296>>>0)>>>0,s=_>>>0,N=B,w=k,B=I,k=A,I=T,A=b,T=E+n+((_=S+a)/4294967296>>>0)>>>0,b=_>>>0,E=m,S=C,m=g,C=v,g=d,v=y,d=n+i+((_=a+s)/4294967296>>>0)>>>0,y=_>>>0;_=e[0][1]+y,e[0][0]=e[0][0]+d+(_/4294967296>>>0)>>>0,e[0][1]=_>>>0,_=e[1][1]+v,e[1][0]=e[1][0]+g+(_/4294967296>>>0)>>>0,e[1][1]=_>>>0,_=e[2][1]+C,e[2][0]=e[2][0]+m+(_/4294967296>>>0)>>>0,e[2][1]=_>>>0,_=e[3][1]+S,e[3][0]=e[3][0]+E+(_/4294967296>>>0)>>>0,e[3][1]=_>>>0,_=e[4][1]+b,e[4][0]=e[4][0]+T+(_/4294967296>>>0)>>>0,e[4][1]=_>>>0,_=e[5][1]+A,e[5][0]=e[5][0]+I+(_/4294967296>>>0)>>>0,e[5][1]=_>>>0,_=e[6][1]+k,e[6][0]=e[6][0]+B+(_/4294967296>>>0)>>>0,e[6][1]=_>>>0,_=e[7][1]+w,e[7][0]=e[7][0]+N+(_/4294967296>>>0)>>>0,e[7][1]=_>>>0,V-=128}}},function(e,t,r){var n=r(0);r(1),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var a={},i=[],s=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o0;)(r=e.requests.shift()).request.aborted&&(r=null);null===r?(null!==t.options&&(t.options=null),e.idle.push(t)):(t.retries=1,t.options=r,u(e,t))},p=function(e,t,r){t.options=null,t.connected=function(r){if(null===t.options)l(e,t);else{var n=t.options.request;if(n.connectTime=+new Date-n.connectTime,r.socket=t,t.options.connected(r),n.aborted)t.close();else{var a=n.toString();n.body&&(a+=n.body),n.time=+new Date,t.send(a),n.time=+new Date-n.time,t.options.response.time=+new Date,t.sending=!0}}},t.closed=function(r){if(t.sending)t.sending=!1,t.retries>0?(--t.retries,u(e,t)):t.error({id:t.id,type:"ioError",message:"Connection closed during send. Broken pipe.",bytesAvailable:0});else{var n=t.options.response;n.readBodyUntilClose&&(n.time=+new Date-n.time,n.bodyReceived=!0,t.options.bodyReady({request:t.options.request,response:n,socket:t})),t.options.closed(r),l(e,t)}},t.data=function(r){if(t.sending=!1,t.options.request.aborted)t.close();else{var n=t.options.response,a=t.receive(r.bytesAvailable);if(null!==a)if(t.buffer.putBytes(a),n.headerReceived||(n.readHeader(t.buffer),n.headerReceived&&t.options.headerReady({request:t.options.request,response:n,socket:t})),n.headerReceived&&!n.bodyReceived&&n.readBody(t.buffer),n.bodyReceived)t.options.bodyReady({request:t.options.request,response:n,socket:t}),-1!=(n.getField("Connection")||"").indexOf("close")||"HTTP/1.0"===n.version&&null===n.getField("Keep-Alive")?t.close():l(e,t)}},t.error=function(e){t.options.error({type:e.type,message:e.message,request:t.options.request,response:t.options.response,socket:t}),t.close()},r?((t=n.tls.wrapSocket({sessionId:null,sessionCache:{},caStore:r.caStore,cipherSuites:r.cipherSuites,socket:t,virtualHost:r.virtualHost,verify:r.verify,getCertificate:r.getCertificate,getPrivateKey:r.getPrivateKey,getSignature:r.getSignature,deflate:r.deflate||null,inflate:r.inflate||null})).options=null,t.buffer=n.util.createBuffer(),e.sockets.push(t),r.prime?t.connect({host:e.url.host,port:e.url.port,policyPort:e.policyPort,policyUrl:e.policyUrl}):e.idle.push(t)):(t.buffer=n.util.createBuffer(),e.sockets.push(t),e.idle.push(t))},f=function(e){var t=!1;if(-1!==e.maxAge){var r=y(new Date);e.created+e.maxAge<=r&&(t=!0)}return t};a.createClient=function(e){var t=null;e.caCerts&&(t=n.pki.createCaStore(e.caCerts)),e.url=e.url||window.location.protocol+"//"+window.location.host;var r=a.parseUrl(e.url);if(!r){var i=new Error("Invalid url.");throw i.details={url:e.url},i}e.connections=e.connections||1;var l=e.socketPool,h={url:r,socketPool:l,policyPort:e.policyPort,policyUrl:e.policyUrl,requests:[],sockets:[],idle:[],secure:"https"===r.scheme,cookies:{},persistCookies:void 0===e.persistCookies||e.persistCookies};n.debug&&n.debug.get("forge.http","clients").push(h),o(h);var d=null;h.secure&&(d={caStore:t,cipherSuites:e.cipherSuites||null,virtualHost:e.virtualHost||r.host,verify:e.verify||function(e,t,r,n){if(0===r&&!0===t){var a=n[r].subject.getField("CN");null!==a&&h.url.host===a.value||(t={message:"Certificate common name does not match url host."})}return t},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,prime:e.primeTlsSockets||!1},null!==l.flashApi&&(d.deflate=function(e){return n.util.deflate(l.flashApi,e,!0)},d.inflate=function(e){return n.util.inflate(l.flashApi,e,!0)}));for(var g=0;g100?(t.body=n.util.deflate(t.flashApi,t.body),t.bodyDeflated=!0,t.setField("Content-Encoding","deflate"),t.setField("Content-Length",t.body.length)):null!==t.body&&t.setField("Content-Length",t.body.length);var e=t.method.toUpperCase()+" "+t.path+" "+t.version+"\r\n";for(var r in t.fields)for(var a=t.fields[r],i=0;i=3)){var o=new Error("Invalid http response header.");throw o.details={line:r},o}a.version=n[0],a.code=parseInt(n[1],10),a.message=n.slice(2).join(" ")}else 0===r.length?a.headerReceived=!0:s(r);return a.headerReceived};return a.readBody=function(e){var o=a.getField("Content-Length"),c=a.getField("Transfer-Encoding");if(null!==o&&(o=parseInt(o)),null!==o&&o>=0)a.body=a.body||"",a.body+=e.getBytes(o),a.bodyReceived=a.body.length===o;else if(null!==c){if(-1==c.indexOf("chunked")){var u=new Error("Unknown Transfer-Encoding.");throw u.details={transferEncoding:c},u}a.body=a.body||"",function(e){for(var n="";null!==n&&e.length()>0;)if(t>0){if(t+2>e.length())break;a.body+=e.getBytes(t),e.getBytes(2),t=0}else if(r)for(n=i(e);null!==n;)n.length>0?(s(n),n=i(e)):(a.bodyReceived=!0,n=null);else null!==(n=i(e))&&(t=parseInt(n.split(";",1)[0],16),r=0===t);a.bodyReceived}(e)}else null!==o&&o<0||null===o&&null!==a.getField("Content-Type")?(a.body=a.body||"",a.body+=e.getBytes(),a.readBodyUntilClose=!0):(a.body=null,a.bodyReceived=!0);return a.bodyReceived&&(a.time=+new Date-a.time),null!==a.flashApi&&a.bodyReceived&&null!==a.body&&"deflate"===a.getField("Content-Encoding")&&(a.body=n.util.inflate(a.flashApi,a.body)),a.bodyReceived},a.getCookies=function(){var e=[];if("Set-Cookie"in a.fields)for(var t=a.fields["Set-Cookie"],r=+new Date/1e3,n=/\s*([^=]*)=?([^;]*)(;|$)/g,i=0;i0;)o.push(u%i),u=u/i|0}for(a=0;0===e[a]&&a=0;--a)n+=t[o[a]]}else n=function(e,t){var r=0,n=t.length,a=t.charAt(0),i=[0];for(r=0;r0;)i.push(o%n),o=o/n|0}var c="";for(r=0;0===e.at(r)&&r=0;--r)c+=t[i[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},r.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=n[t];if(!r){r=n[t]=[];for(var a=0;a>=8;for(;l>0;)o.push(255&l),l>>=8}for(var p=0;e[p]===s&&p=a.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),i=!0),i}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function c(e,t,r){var n=!0;if(r){for(var a=t.length(),i=t.last(),s=a-1-i;s=o?(e.fragment=s.output.getBytes(l-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=function(e,t,r){var a=n.hmac.create();return a.start("SHA1",e),a.update(t),t=a.digest().getBytes(),a.start(null,null),a.update(r),r=a.digest().getBytes(),t===r}(t.macKey,u,p)&&i}a.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=a.BulkCipherAlgorithm.aes,e.cipher_type=a.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=a.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},a.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=a.BulkCipherAlgorithm.aes,e.cipher_type=a.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=a.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i}},function(e,t,r){var n=r(0);r(31),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){var n=r(0);r(13),r(2),r(32),r(1);var a=r(44),i=a.publicKeyValidator,s=a.privateKeyValidator;if(void 0===o)var o=n.jsbn.BigInteger;var c=n.util.ByteBuffer,u="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var l=n.ed25519;function p(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new u(t.length()),a=0;a=0;--r)x(n,n),1!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),K(r,r,a),K(r,r,i),K(r,r,i),K(e[0],r,i),x(n,e[0]),K(n,n,i),k(n,a)&&K(e[0],e[0],C);if(x(n,e[0]),K(n,n,i),k(n,a))return-1;w(e[0])===t[31]>>7&&V(e[0],f,e[0]);return K(e[3],e[0],e[1]),0}(o,n))return-1;for(a=0;a=0};var f=P(),h=P([1]),d=P([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=P([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=P([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=P([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=P([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=n.md.sha512.create(),a=new c(e);r.update(a.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=i.charCodeAt(o);return s}function S(e,t){var r,n,a,i;for(n=63;n>=32;--n){for(r=0,a=n-32,i=n-12;a>8,t[a]-=256*r;t[a]+=r,t[n]=0}for(r=0,a=0;a<32;++a)t[a]+=r-(t[31]>>4)*m[a],r=t[a]>>8,t[a]&=255;for(a=0;a<32;++a)t[a]-=r*m[a];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function b(e,t){var r=P(),n=P(),a=P(),i=P(),s=P(),o=P(),c=P(),u=P(),l=P();V(r,e[1],e[0]),V(l,t[1],t[0]),K(r,r,l),O(n,e[0],e[1]),O(l,t[0],t[1]),K(n,n,l),K(a,e[3],t[3]),K(a,a,y),K(i,e[2],t[2]),O(i,i,i),V(s,n,r),V(o,i,a),O(c,i,a),O(u,n,r),K(e[0],s,o),K(e[1],u,c),K(e[2],c,o),K(e[3],s,u)}function I(e,t,r){for(var n=0;n<4;++n)D(e[n],t[n],r)}function A(e,t){var r=P(),n=P(),a=P();!function(e,t){var r,n=P();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)x(n,n),2!==r&&4!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(a,t[2]),K(r,t[0],a),K(n,t[1],a),B(e,n),e[31]^=w(r)<<7}function B(e,t){var r,n,a,i=P(),s=P();for(r=0;r<16;++r)s[r]=t[r];for(U(s),U(s),U(s),n=0;n<2;++n){for(i[0]=s[0]-65517,r=1;r<15;++r)i[r]=s[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),a=i[15]>>16&1,i[14]&=65535,D(s,i,1-a)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function k(e,t){var r=new u(32),n=new u(32);return B(r,e),B(n,t),N(r,0,n,0)}function N(e,t,r,n){return function(e,t,r,n,a){var i,s=0;for(i=0;i>>8)-1}(e,t,r,n,32)}function w(e){var t=new u(32);return B(t,e),1&t[0]}function R(e,t,r){var n,a;for(_(e[0],f),_(e[1],h),_(e[2],h),_(e[3],f),a=255;a>=0;--a)I(e,t,n=r[a/8|0]>>(7&a)&1),b(t,e),b(e,e),I(e,t,n)}function L(e,t){var r=[P(),P(),P(),P()];_(r[0],g),_(r[1],v),_(r[2],h),K(r[3],g,v),R(e,r,t)}function _(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function D(e,t,r){for(var n,a=~(r-1),i=0;i<16;++i)n=a&(e[i]^t[i]),e[i]^=n,t[i]^=n}function P(e){var t,r=new Float64Array(16);if(e)for(t=0;t0&&(s=n.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,i)}},decrypt:function(t,r,n){var a=t.decrypt(r,"NONE");return e.generate(a,n)}};return i},n.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(4),r(15),r(9),r(24),r(32)},function(e,t,r){var n=r(0);r(5),r(3),r(11),r(6),r(7),r(30),r(2),r(1),r(18);var a=n.asn1,i=e.exports=n.pkcs7=n.pkcs7||{};function s(e){var t={},r=[];if(!a.validate(e,i.asn1.recipientInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:a.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function o(e){for(var t,r=[],i=0;i0){for(var r=a.create(a.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i=r&&s0&&s.value[0].value.push(a.create(a.Class.CONTEXT_SPECIFIC,0,!0,t)),i.length>0&&s.value[0].value.push(a.create(a.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(a.create(a.Class.UNIVERSAL,a.Type.SET,!0,e.signerInfos)),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,a=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=n.pki.certificateFromPem(i)),r=i.issuer.attributes,a=i.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=n.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||n.pki.oids.sha1;switch(o){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,p=0;p="8"&&(r="00"+r);var a=n.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r0&&(this.state=g[this.state].block)},v.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==f&&(this.state=u,m(this,0)),this.blocks},v.prototype.sleep=function(e){e=void 0===e?0:e,this.state=g[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=u,m(t,0)}),e)},v.prototype.wait=function(e){e.wait(this)},v.prototype.wakeup=function(){this.state===p&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=u,m(this,0))},v.prototype.cancel=function(){this.state=g[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},v.prototype.fail=function(e){if(this.error=!0,C(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,m(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;C(t,!0)}this.failureCallback&&this.failureCallback(this)}};var m=function(e,t){var r=t>30||+new Date-e.swapTime>20,n=function(t){if(t++,e.state===u)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||m(n,t)}else C(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,m(e.parent,t))};r?setTimeout(n,0):n(t)},C=function(e,t){e.state=f,delete i[e.id],null===e.parent&&(e.type in o?0===o[e.type].length?n.log.error(a,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):o[e.type][0]!==e?n.log.error(a,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(o[e.type].shift(),0===o[e.type].length?delete o[e.type]:o[e.type][0].start()):n.log.error(a,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};e.exports=n.task=n.task||{},n.task.start=function(e){var t=new v({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in o?o[e.type].push(t):(o[t.type]=[t],function(e){e.error=!1,e.state=g[e.state][y],setTimeout((function(){e.state===u&&(e.swapTime=+new Date,e.run(e),m(e,0))}),0)}(t))},n.task.cancel=function(e){e in o&&(o[e]=[o[e][0]])},n.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e}},function(e,t,r){var n,a,i,s=r(0),o=e.exports=s.form=s.form||{};n=jQuery,a=/([^\[]*?)\[(.*?)\]/g,i=function(e,t,r,i){for(var s=[],o=0;o0&&r.push(t[1]),t.length>=2&&r.push(t[2]);return 0===r.length&&r.push(e),r}(t))})),t=s,n.each(t,(function(a,s){if(i&&0!==s.length&&s in i&&(s=i[s]),0===s.length&&(s=e.length),e[s])a==t.length-1?(n.isArray(e[s])||(e[s]=[e[s]]),e[s].push(r)):e=e[s];else if(a==t.length-1)e[s]=r;else{var o=t[a+1];if(0===o.length)e[s]=[];else{var c=o-0==o&&o.length>0;e[s]=c?[]:{}}e=e[s]}}))},o.serialize=function(e,t,r){var a={};return t=t||".",n.each(e.serializeArray(),(function(){i(a,this.name.split(t),this.value||"",r)})),a}},function(e,t,r){var n=r(0);r(10),n.tls.wrapSocket=function(e){var t=e.socket,r={id:t.id,connected:t.connected||function(e){},closed:t.closed||function(e){},data:t.data||function(e){},error:t.error||function(e){}},a=n.tls.createConnection({server:!1,sessionId:e.sessionId||null,caStore:e.caStore||[],sessionCache:e.sessionCache||null,cipherSuites:e.cipherSuites||null,virtualHost:e.virtualHost,verify:e.verify,getCertificate:e.getCertificate,getPrivateKey:e.getPrivateKey,getSignature:e.getSignature,deflate:e.deflate,inflate:e.inflate,connected:function(e){1===e.handshakes&&r.connected({id:t.id,type:"connect",bytesAvailable:e.data.length()})},tlsDataReady:function(e){return t.send(e.tlsData.getBytes())},dataReady:function(e){r.data({id:t.id,type:"socketData",bytesAvailable:e.data.length()})},closed:function(e){t.close()},error:function(e,n){r.error({id:t.id,type:"tlsError",message:n.message,bytesAvailable:0,error:n}),t.close()}});t.connected=function(t){a.handshake(e.sessionId)},t.closed=function(e){a.open&&a.handshaking&&r.error({id:t.id,type:"ioError",message:"Connection closed during handshake.",bytesAvailable:0}),a.close(),r.closed({id:t.id,type:"close",bytesAvailable:0})},t.error=function(e){r.error({id:t.id,type:e.type,message:e.message,bytesAvailable:0}),a.close()};var i=0;return t.data=function(e){if(a.open){if(e.bytesAvailable>=i){var r=Math.max(e.bytesAvailable,i),n=t.receive(r);null!==n&&(i=a.process(n))}}else t.receive(e.bytesAvailable)},r.destroy=function(){t.destroy()},r.setSessionCache=function(e){a.sessionCache=tls.createSessionCache(e)},r.connect=function(e){t.connect(e)},r.close=function(){a.close()},r.isConnected=function(){return a.isConnected&&t.isConnected()},r.send=function(e){return a.prepare(e)},r.receive=function(e){return a.data.getBytes(e)},r.bytesAvailable=function(){return a.data.length()},r}},function(e,t,r){var n=r(0);r(34),r(35);var a,i,s,o,c,u,l,p,f,h,d=e.exports=n.xhr=n.xhr||{};a=jQuery,i="forge.xhr",s=null,o=0,c=null,u=null,l={},p=10,f=n.net,h=n.http,d.init=function(e){n.log.debug(i,"initializing",e),o=e.policyPort||o,c=e.policyUrl||c,p=e.connections||p,s=f.createSocketPool({flashId:e.flashId,policyPort:o,policyUrl:c,msie:e.msie||!1}),u=h.createClient({url:e.url||window.location.protocol+"//"+window.location.host,socketPool:s,policyPort:o,policyUrl:c,connections:e.connections||p,caCerts:e.caCerts,cipherSuites:e.cipherSuites,persistCookies:e.persistCookies||!0,primeTlsSockets:e.primeTlsSockets||!1,verify:e.verify,getCertificate:e.getCertificate,getPrivateKey:e.getPrivateKey,getSignature:e.getSignature}),l[u.url.full]=u,n.log.debug(i,"ready")},d.cleanup=function(){for(var e in l)l[e].destroy();l={},u=null,s.destroy(),s=null},d.setCookie=function(e){if(e.maxAge=e.maxAge||-1,e.domain)for(var t in l){var r=l[t];h.withinCookieDomain(r.url,e)&&r.secure===e.secure&&r.setCookie(e)}else u.setCookie(e)},d.getCookie=function(e,t,r){var a=null;if(r)for(var i in l){var s=l[i];if(h.withinCookieDomain(s.url,r)){var o=s.getCookie(e,t);null!==o&&(null===a?a=o:n.util.isArray(a)?a.push(o):a=[a,o])}}else a=u.getCookie(e,t);return a},d.removeCookie=function(e,t,r){var n=!1;if(r)for(var a in l){var i=l[a];h.withinCookieDomain(i.url,r)&&i.removeCookie(e,t)&&(n=!0)}else n=u.removeCookie(e,t);return n},d.create=function(e){e=a.extend({logWarningOnError:!0,verbose:!1,logError:function(){},logWarning:function(){},logDebug:function(){},logVerbose:function(){},url:null},e||{});var t={client:null,request:null,response:null,asynchronous:!0,sendFlag:!1,errorFlag:!1},r={error:e.logError||n.log.error,warning:e.logWarning||n.log.warning,debug:e.logDebug||n.log.debug,verbose:e.logVerbose||n.log.verbose},f={onreadystatechange:null,readyState:0,responseText:"",responseXML:null,status:0,statusText:""};if(null===e.url)t.client=u;else{var d=h.parseUrl(e.url);d||(new Error("Invalid url.").details={url:e.url}),d.full in l?t.client=l[d.full]:(t.client=h.createClient({url:e.url,socketPool:s,policyPort:e.policyPort||o,policyUrl:e.policyUrl||c,connections:e.connections||p,caCerts:e.caCerts,cipherSuites:e.cipherSuites,persistCookies:e.persistCookies||!0,primeTlsSockets:e.primeTlsSockets||!1,verify:e.verify,getCertificate:e.getCertificate,getPrivateKey:e.getPrivateKey,getSignature:e.getSignature}),l[d.full]=t.client)}return f.open=function(e,r,n,a,i){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"PATCH":case"POST":case"PUT":break;case"CONNECT":case"TRACE":case"TRACK":throw new Error("CONNECT, TRACE and TRACK methods are disallowed");default:throw new Error("Invalid method: "+e)}t.sendFlag=!1,f.responseText="",f.responseXML=null,f.status=0,f.statusText="",t.request=h.createRequest({method:e,path:r}),f.readyState=1,f.onreadystatechange&&f.onreadystatechange()},f.setRequestHeader=function(e,r){if(1!=f.readyState||t.sendFlag)throw new Error("XHR not open or sending");t.request.setField(e,r)},f.send=function(e){if(1!=f.readyState||t.sendFlag)throw new Error("XHR not open or sending");if(e&&"GET"!==t.request.method&&"HEAD"!==t.request.method)if("undefined"!=typeof XMLSerializer)if(e instanceof Document){var n=new XMLSerializer;t.request.body=n.serializeToString(e)}else t.request.body=e;else void 0!==e.xml?t.request.body=e.xml:t.request.body=e;t.errorFlag=!1,t.sendFlag=!0,f.onreadystatechange&&f.onreadystatechange();var a={};a.request=t.request,a.headerReady=function(e){f.cookies=t.client.cookies,f.readyState=2,f.status=e.response.code,f.statusText=e.response.message,t.response=e.response,f.onreadystatechange&&f.onreadystatechange(),t.response.aborted||(f.readyState=3,f.onreadystatechange&&f.onreadystatechange())},a.bodyReady=function(e){f.readyState=4;var n=e.response.getField("Content-Type");if(n&&(0===n.indexOf("text/xml")||0===n.indexOf("application/xml")||-1!==n.indexOf("+xml")))try{var s=new ActiveXObject("MicrosoftXMLDOM");s.async=!1,s.loadXML(e.response.body),f.responseXML=s}catch(e){var o=new DOMParser;f.responseXML=o.parseFromString(e.body,"text/xml")}var c=0;null!==e.response.body&&(f.responseText=e.response.body,c=e.response.body.length);var u=t.request,l=u.method+" "+u.path+" "+f.status+" "+f.statusText+" "+c+"B "+(e.request.connectTime+e.request.time+e.response.time)+"ms";a.verbose?(f.status>=400&&a.logWarningOnError?r.warning:r.verbose)(i,l,e,e.response.body?"\n"+e.response.body:"\nNo content"):(f.status>=400&&a.logWarningOnError?r.warning:r.debug)(i,l),f.onreadystatechange&&f.onreadystatechange()},a.error=function(e){var n=t.request;r.error(i,n.method+" "+n.path,e),f.responseText="",f.responseXML=null,t.errorFlag=!0,f.status=0,f.statusText="",f.readyState=4,f.onreadystatechange&&f.onreadystatechange()},t.client.send(a)},f.abort=function(){t.request.abort(),f.responseText="",f.responseXML=null,t.errorFlag=!0,f.status=0,f.statusText="",t.request=null,t.response=null,4===f.readyState||0===f.readyState||1===f.readyState&&!t.sendFlag||(f.readyState=4,t.sendFlag=!1,f.onreadystatechange&&f.onreadystatechange()),f.readyState=0},f.getAllResponseHeaders=function(){var e="";if(null!==t.response){var r=t.response.fields;a.each(r,(function(t,r){a.each(r,(function(r,n){e+=t+": "+n+"\r\n"}))}))}return e},f.getResponseHeader=function(e){var r=null;return null!==t.response&&e in t.response.fields&&(r=t.response.fields[e],n.util.isArray(r)&&(r=r.join())),r},f}}])})); -//# sourceMappingURL=forge.all.min.js.map \ No newline at end of file diff --git a/node_modules/node-forge/dist/forge.all.min.js.map b/node_modules/node-forge/dist/forge.all.min.js.map deleted file mode 100644 index 225d220..0000000 --- a/node_modules/node-forge/dist/forge.all.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"forge.all.min.js","sources":["webpack://[name]/forge.all.min.js"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file diff --git a/node_modules/node-forge/dist/forge.min.js b/node_modules/node-forge/dist/forge.min.js deleted file mode 100644 index 997e6d7..0000000 --- a/node_modules/node-forge/dist/forge.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.forge=t():e.forge=t()}(window,(function(){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=34)}([function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){(function(t){var a=r(0),n=r(37),i=e.exports=a.util=a.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(i.isArrayBuffer(e)||i.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&n.setAttribute("a",a=!a))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.globalScope=i.isNodejs?t:"undefined"==typeof self?window:self,i.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},i.ByteBuffer=o,i.ByteStringBuffer=o;i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),a=new Uint8Array(this.length()+t);return a.set(r),this.data=new DataView(a.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},i.xorBytes=function(e,t,r){for(var a="",n="",i="",s=0,o=0;r>0;--r,++s)n=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(a+=i,i="",o=0),i+=String.fromCharCode(n),++o;return a+=i},i.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(e,t){for(var r,a,n,i="",s="",o=0;o>2),i+=c.charAt((3&r)<<4|a>>4),isNaN(a)?i+="==":(i+=c.charAt((15&a)<<2|n>>6),i+=isNaN(n)?"=":c.charAt(63&n)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,a,n,i="",s=0;s>4),64!==a&&(i+=String.fromCharCode((15&r)<<4|a>>2),64!==n&&(i+=String.fromCharCode((3&a)<<6|n)));return i},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:n.encode,decode:n.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length));for(var n=r=r||0,i=0;i>2),i+=c.charAt((3&r)<<4|a>>4),isNaN(a)?i+="==":(i+=c.charAt((15&a)<<2|n>>6),i+=isNaN(n)?"=":c.charAt(63&n)),t&&i.length>t&&(s+=i.substr(0,t)+"\r\n",i=i.substr(t));return s+=i},i.binary.base64.decode=function(e,t,r){var a,n,i,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c>4,64!==i&&(o[l++]=(15&n)<<4|i>>2,64!==s&&(o[l++]=(3&i)<<6|s));return t?l-r:o.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,l,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,l,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,r){e=i.encodeUtf8(e);var a=t;a||(a=new Uint8Array(e.length));for(var n=r=r||0,s=0;s0?(n=r[a].substring(0,s),i=r[a].substring(s+1)):(n=r[a],i=null),n in t||(t[n]=[]),n in Object.prototype||null===i||t[n].push(unescape(i))}return t};return void 0===e?(null===v&&(v="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=v):t=r(e),t},i.parseFragment=function(e){var t=e,r="",a=e.indexOf("?");a>0&&(t=e.substring(0,a),r=e.substring(a+1));var n=t.split("/");return n.length>0&&""===n[0]&&n.shift(),{pathString:t,queryString:r,path:n,query:""===r?{}:i.getQueryVariables(r)}},i.makeRequest=function(e){var t=i.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var a;return void 0===e?a=t.query:(a=t.query[e])&&void 0!==r&&(a=a[r]),a},getQueryLast:function(e,t){var a=r.getQuery(e);return a?a[a.length-1]:t}};return r},i.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var a=jQuery.param(t||{});return r=r||"",e+(a.length>0?"?"+a:"")+(r.length>0?"#"+r:"")},i.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},i.format=function(e){for(var t,r,a=/%./g,n=0,i=[],s=0;t=a.exec(e);){(r=e.substring(s,a.lastIndex-2)).length>0&&i.push(r),s=a.lastIndex;var o=t[0][1];switch(o){case"s":case"o":n");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(e.substring(s)),i.join("")},i.formatNumber=function(e,t,r,a){var n=e,i=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===a?".":a,c=n<0?"-":"",u=parseInt(n=Math.abs(+n||0).toFixed(i),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?s+Math.abs(n-u).toFixed(i).slice(2):"")},i.formatSize=function(e){return e=e>=1073741824?i.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?i.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?i.formatNumber(e/1024,0)+" KiB":i.formatNumber(e,0)+" bytes"},i.bytesFromIP=function(e){return-1!==e.indexOf(".")?i.bytesFromIPv4(e):-1!==e.indexOf(":")?i.bytesFromIPv6(e):null},i.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=i.createBuffer(),r=0;rr[a].end-r[a].start&&(a=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[a];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},i.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in i&&!e.update)return t(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,t(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,t(null,i.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()o.st&&n.stn.st&&o.stt){var a=new Error("Too few bytes to parse DER.");throw a.available=e.length(),a.remaining=t,a.requested=r,a}}n.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},n.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},n.create=function(e,t,r,i,s){if(a.util.isArray(i)){for(var o=[],c=0;cr){if(s.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=r,d.requested=h,d}h=r}var y=32==(32&c);if(y)if(p=[],void 0===h)for(;;){if(i(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}o=t.length(),p.push(e(t,r,a+1,s)),r-=o-t.length()}else for(;h>0;)o=t.length(),p.push(e(t,h,a+1,s)),r-=o-t.length(),h-=o-t.length();void 0===p&&u===n.Class.UNIVERSAL&&l===n.Type.BITSTRING&&(f=t.bytes(h));if(void 0===p&&s.decodeBitStrings&&u===n.Class.UNIVERSAL&&l===n.Type.BITSTRING&&h>1){var g=t.read,m=r,v=0;if(l===n.Type.BITSTRING&&(i(t,r,1),v=t.getByte(),r--),0===v)try{o=t.length();var C={verbose:s.verbose,strict:!0,decodeBitStrings:!0},E=e(t,r,a+1,C),S=o-t.length();r-=S,l==n.Type.BITSTRING&&S++;var T=E.tagClass;S!==h||T!==n.Class.UNIVERSAL&&T!==n.Class.CONTEXT_SPECIFIC||(p=[E])}catch(e){}void 0===p&&(t.read=g,r=m)}if(void 0===p){if(void 0===h){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(l===n.Type.BMPSTRING)for(p="";h>0;h-=2)i(t,r,2),p+=String.fromCharCode(t.getInt16()),r-=2;else p=t.getBytes(h)}var I=void 0===f?null:{bitStringContents:f};return n.create(u,l,y,p,I)}(e,e.length(),0,t)},n.toDer=function(e){var t=a.util.createBuffer(),r=e.tagClass|e.type,i=a.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=n.equals(e,e.original))),s)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:i.putByte(0);for(var o=0;o1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(t.putByte(r),i.length()<=127)t.putByte(127&i.length());else{var c=i.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(i),t},n.oidToDer=function(e){var t,r,n,i,s=e.split("."),o=a.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c>>=7,t||(i|=128),r.push(i),t=!1}while(n>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},n.derToOid=function(e){var t;"string"==typeof e&&(e=a.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var n=0;e.length()>0;)n<<=7,128&(r=e.getByte())?n+=127&r:(t+="."+(n+r),n=0);return t},n.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var a=parseInt(e.substr(2,2),10)-1,n=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,a,n),t.setUTCHours(i,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},n.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),a=parseInt(e.substr(4,2),10)-1,n=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var p=e.length-5,f=e.charAt(p);"+"!==f&&"-"!==f||(u=60*parseInt(e.substr(p+1,2),10)+parseInt(e.substr(p+4,2),10),u*=6e4,"+"===f&&(u*=-1),l=!0);return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,a,n),t.setUTCHours(i,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,a,n),t.setHours(i,s,o,c)),t},n.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var a=0;a=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},n.derToInteger=function(e){"string"==typeof e&&(e=a.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},n.validate=function(e,t,r,i){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)i&&(e.tagClass!==t.tagClass&&i.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&i.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&a.util.isArray(t.value))for(var o=0,c=0;s&&c0&&(i+="\n");for(var o="",c=0;c1?i+="0x"+a.util.bytesToHex(e.value.slice(1)):i+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);1==f?i+=" (1 unused bit shown)":f>1&&(i+=" ("+f+" unused bits shown)")}}else e.type===n.Type.OCTETSTRING?(s.test(e.value)||(i+="("+e.value+") "),i+="0x"+a.util.bytesToHex(e.value)):e.type===n.Type.UTF8?i+=a.util.decodeUtf8(e.value):e.type===n.Type.PRINTABLESTRING||e.type===n.Type.IA5String?i+=e.value:s.test(e.value)?i+="0x"+a.util.bytesToHex(e.value):0===e.value.length?i+="[null]":i+=e.value}return i}},function(e,t,r){var a=r(0);e.exports=a.md=a.md||{},a.md.algorithms=a.md.algorithms||{}},function(e,t,r){var a=r(0);function n(e,t){a.cipher.registerAlgorithm(e,(function(){return new a.aes.Algorithm(e,t)}))}r(13),r(19),r(1),e.exports=a.aes=a.aes||{},a.aes.startEncrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!1,mode:a});return n.start(t),n},a.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.aes.startDecrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!0,mode:a});return n.start(t),n},a.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.aes.Algorithm=function(e,t){l||p();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},a.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(a.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=a.util.createBuffer();for(var n=0;n>>=2;for(n=0;n>8^255&p^99,i[y]=p,s[p]=y,h=(f=e[p])<<24^p<<16^p<<8^p^f,d=((r=e[y])^(a=e[r])^(n=e[a]))<<24^(y^n)<<16^(y^a^n)<<8^y^r^n;for(var m=0;m<4;++m)c[m][y]=h,u[m][p]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^n]]],g^=e[e[g]])}}function f(e,t){for(var r,a=e.slice(0),n=1,s=a.length,c=4*(s+6+1),l=s;l>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^o[n]<<24,n++):s>6&&l%s==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),a[l]=a[l-s]^r;if(t){for(var p,f=u[0],h=u[1],d=u[2],y=u[3],g=a.slice(0),m=(l=0,(c=a.length)-4);l>>24]]^h[i[p>>>16&255]]^d[i[p>>>8&255]]^y[i[255&p]];a=g}return a}function h(e,t,r,a){var n,o,l,p,f,h,d,y,g,m,v,C,E=e.length/4-1;a?(n=u[0],o=u[1],l=u[2],p=u[3],f=s):(n=c[0],o=c[1],l=c[2],p=c[3],f=i),h=t[0]^e[0],d=t[a?3:1]^e[1],y=t[2]^e[2],g=t[a?1:3]^e[3];for(var S=3,T=1;T>>24]^o[d>>>16&255]^l[y>>>8&255]^p[255&g]^e[++S],v=n[d>>>24]^o[y>>>16&255]^l[g>>>8&255]^p[255&h]^e[++S],C=n[y>>>24]^o[g>>>16&255]^l[h>>>8&255]^p[255&d]^e[++S],g=n[g>>>24]^o[h>>>16&255]^l[d>>>8&255]^p[255&y]^e[++S],h=m,d=v,y=C;r[0]=f[h>>>24]<<24^f[d>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^e[++S],r[a?3:1]=f[d>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&h]^e[++S],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[h>>>8&255]<<8^f[255&d]^e[++S],r[a?1:3]=f[g>>>24]<<24^f[h>>>16&255]<<16^f[d>>>8&255]<<8^f[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof a.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}},function(e,t,r){var a=r(0);a.pki=a.pki||{};var n=e.exports=a.pki.oids=a.oids=a.oids||{};function i(e,t){n[e]=t,n[t]=e}function s(e,t){n[e]=t}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.5","serialName"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){var a=r(0);r(1);var n=e.exports=a.pem=a.pem||{};function i(e){for(var t=e.name+": ",r=[],a=function(e,t){return" "+t},n=0;n65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),i=n-s-1,s=-1,++n}else" "!==t[n]&&"\t"!==t[n]&&","!==t[n]||(s=n);return t}function s(e){return e.replace(/^\s+/,"")}n.encode=function(e,t){t=t||{};var r,n="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(n+=i(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(n+=i(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),n+=i(r)),e.headers)for(var s=0;st.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=a.util.createBuffer(),n=a.util.createBuffer(),u=s.length();for(c=0;c>>0,c>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=c[1],c[1]=c[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(i),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var c,u=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-u));for(var l=8*n.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=c>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(f,r,s);var h=a.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h},n};var i=null,s=!1;function o(e,t,r){for(var a,n,i,s,o,c,u,l=r.length();l>=64;){for(n=e.h0,i=e.h1,s=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)a=r.getInt32(),t[u]=a,a=(n<<5|n>>>27)+(o^i&(s^o))+c+1518500249+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<20;++u)a=(a=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|a>>>31,t[u]=a,a=(n<<5|n>>>27)+(o^i&(s^o))+c+1518500249+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<32;++u)a=(a=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|a>>>31,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+1859775393+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<40;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+1859775393+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<60;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i&s|o&(i^s))+c+2400959708+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;for(;u<80;++u)a=(a=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|a>>>30,t[u]=a,a=(n<<5|n>>>27)+(i^s^o)+c+3395469782+a,c=o,o=s,s=(i<<30|i>>>2)>>>0,i=n,n=a;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,l-=64}}},function(e,t,r){var a=r(0);function n(e,t){a.cipher.registerAlgorithm(e,(function(){return new a.des.Algorithm(e,t)}))}r(13),r(19),r(1),e.exports=a.des=a.des||{},a.des.startEncrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!1,mode:a||(null===t?"ECB":"CBC")});return n.start(t),n},a.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.des.startDecrypting=function(e,t,r,a){var n=d({key:e,output:r,decrypt:!0,mode:a||(null===t?"ECB":"CBC")});return n.start(t),n},a.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},a.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=a.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],a=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],p=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E>>4^T))<<4,S^=t=65535&((T^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(T^=t<<-16)))<<2,S^=t=65535&((T^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(T^=t<<-16)))<<1,S^=t=16711935&((T^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(T^=t<<8)))<<1)<<8|(T^=t)>>>20&240,S=T<<24|T<<8&16711680|T>>>8&65280|T>>>24&240,T=t;for(var I=0;I>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27);var b=r[(S&=-15)>>>28]|a[S>>>24&15]|n[S>>>20&15]|i[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],A=u[(T&=-15)>>>28]|l[T>>>24&15]|p[T>>>20&15]|f[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=65535&(A>>>16^b),m[C++]=b^t,m[C++]=A^t<<16}}return m}(t),this._init=!0}},n("DES-ECB",a.cipher.modes.ecb),n("DES-CBC",a.cipher.modes.cbc),n("DES-CFB",a.cipher.modes.cfb),n("DES-OFB",a.cipher.modes.ofb),n("DES-CTR",a.cipher.modes.ctr),n("3DES-ECB",a.cipher.modes.ecb),n("3DES-CBC",a.cipher.modes.cbc),n("3DES-CFB",a.cipher.modes.cfb),n("3DES-OFB",a.cipher.modes.ofb),n("3DES-CTR",a.cipher.modes.ctr);var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],p=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e,t,r,a){var n,h,d=32===e.length?3:9;n=3===d?a?[30,-2,-2]:[0,32,2]:a?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(h=252645135&(y>>>4^g))<<4,y^=(h=65535&(y>>>16^(g^=h)))<<16,y^=h=858993459&((g^=h)>>>2^y),y^=h=16711935&((g^=h<<2)>>>8^y),y=(y^=(h=1431655765&(y>>>1^(g^=h<<8)))<<1)<<1|y>>>31,g=(g^=h)<<1|g>>>31;for(var m=0;m>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|f[63&S]|i[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|p[63&T])}h=y,y=g,g=h}g=g>>>1|g<<31,g^=h=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(h=16711935&(g>>>8^(y^=h<<1)))<<8,g^=(h=858993459&(g>>>2^(y^=h)))<<2,g^=h=65535&((y^=h)>>>16^g),g^=h=252645135&((y^=h<<16)>>>4^g),y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),n=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof a.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,n.call(t,r)},t}},function(e,t,r){var a=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===n)var n=a.jsbn.BigInteger;var i=a.util.isNodejs?r(16):null,s=a.asn1,o=a.util;a.pki=a.pki||{},e.exports=a.pki.rsa=a.rsa=a.rsa||{};var c=a.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},p={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var a=s.oidToDer(t).getBytes(),n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);i.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,a)),i.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return n.value.push(i),n.value.push(o),s.toDer(n).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var i;t.dP||(t.dP=t.d.mod(t.p.subtract(n.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(n.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{i=new n(a.util.bytesToHex(a.random.getBytes(t.n.bitLength()/8)),16)}while(i.compareTo(t.n)>=0||!i.gcd(t.n).equals(n.ONE));for(var s=(e=e.multiply(i.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c=c.multiply(i.modInverse(t.n)).mod(t.n)};function g(e,t,r){var n=a.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=i-11,s}n.putByte(0),n.putByte(r);var o,c=i-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u0;){var l=0,p=a.random.getBytes(c);for(u=0;u1;){if(255!==s.getByte()){--s.read;break}++u}else if(2===c)for(u=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++u}if(0!==s.getByte()||u!==i-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function v(e,t,r){"function"==typeof t&&(r=t,t={});var i={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,a){return t?r(t):(e.p=a,null!==e.q?u(t,e.q):void o(e.qBits,u))}))}function o(e,t){a.prime.generateProbablePrime(e,i,t)}function u(t,a){if(t)return r(t);if(e.q=a,e.p.compareTo(e.q)<0){var i=e.p;e.p=e.q,e.q=i}if(0!==e.p.subtract(n.ONE).gcd(e.e).compareTo(n.ONE))return e.p=null,void s();if(0!==e.q.subtract(n.ONE).gcd(e.e).compareTo(n.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(n.ONE),e.q1=e.q.subtract(n.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(n.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(i.prng=t.prng),s()}function C(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=a.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return a.util.isNodejs&&"function"==typeof i[e]}function T(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function I(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function b(e){for(var t=a.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),n=0;n0;)l.putByte(0),--p;return l.putBytes(a.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new n(a.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=y(c,t,r).toString(16),l=a.util.createBuffer(),p=s-Math.ceil(u.length/2);p>0;)l.putByte(0),--p;return l.putBytes(a.util.hexToBytes(u)),!1!==i?m(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var i,s=(r=r||{}).prng||a.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new n(null);r.fromInt(30);for(var a,i=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||lp?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(n.ONE).gcd(e.e).compareTo(n.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(n.ONE),e.q1=e.q.subtract(n.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(n.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(a=+new Date)-o,o=a}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,n){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(n=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(n=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,n=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(n=r,r=void 0):(n=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!a.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(n){if(S("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return n(e);n(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})}));if(T("generateKey")&&T("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:b(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){n(e)})).then((function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(e)));n(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}}));if(I("generateKey")&&I("exportKey")){var u=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:b(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(t)));n(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){n(e)}},void(u.onerror=function(e){n(e)})}}else if(S("generateKeyPairSync")){var l=i.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(l.privateKey),publicKey:c.publicKeyFromPem(l.publicKey)}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!n)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;v(p,r,n)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,n){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return a.pkcs1.encode_rsa_oaep(t,e,n)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return c.rsa.encrypt(i,r,!0)},verify:function(e,t,a){"string"==typeof a?a=a.toUpperCase():void 0===a&&(a="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===a?a={verify:function(e,t){return t=m(t,r,!0),e===s.fromDer(t).value[1].value}}:"NONE"!==a&&"NULL"!==a&&null!==a||(a={verify:function(e,t){return e===(t=m(t,r,!0))}});var n=c.rsa.decrypt(t,r,!0,!1);return a.verify(e,n,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,n,i,s,o,u){var l={n:e,e:t,d:r,p:n,q:i,dP:s,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var n=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return a.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(n,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var a=t.encode(e,l.n.bitLength());return c.rsa.encrypt(a,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,i,o,u,f,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(a.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,p,y,g)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return t=a.util.createBuffer(y.privateKeyModulus).toHex(),r=a.util.createBuffer(y.privateKeyPublicExponent).toHex(),i=a.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=a.util.createBuffer(y.privateKeyPrime1).toHex(),u=a.util.createBuffer(y.privateKeyPrime2).toHex(),f=a.util.createBuffer(y.privateKeyExponent1).toHex(),h=a.util.createBuffer(y.privateKeyExponent2).toHex(),d=a.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new n(t,16),new n(r,16),new n(i,16),new n(o,16),new n(u,16),new n(f,16),new n(h,16),new n(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var i,o=s.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=o,i;e=t.rsaPublicKey}if(r=[],!s.validate(e,f,t,r))throw(i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,i;var u=a.util.createBuffer(t.publicKeyModulus).toHex(),l=a.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new n(u,16),new n(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e))])}},function(e,t,r){var a,n=r(0);e.exports=n.jsbn=n.jsbn||{};function i(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new i(null)}function o(e,t,r,a,n,i){for(var s=16383&t,o=t>>14;--i>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;n=((c=s*c+((16383&l)<<14)+r.data[a]+n)>>28)+(l>>14)+o*u,r.data[a++]=268435455&c}return n}n.jsbn.BigInteger=i,"undefined"==typeof navigator?(i.prototype.am=o,a=28):"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,a,n,i){for(var s=32767&t,o=t>>15;--i>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;n=((c=s*c+((32767&l)<<15)+r.data[a]+(1073741823&n))>>>30)+(l>>>15)+o*u+(n>>>30),r.data[a++]=1073741823&c}return n},a=30):"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,a,n,i){for(;--i>=0;){var s=t*this.data[e++]+r.data[a]+n;n=Math.floor(s/67108864),r.data[a++]=67108863&s}return n},a=26):(i.prototype.am=o,a=28),i.prototype.DB=a,i.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function T(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function I(){}function b(e){return e}function A(e){this.r2=s(),this.q3=s(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,a,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var a=e.length,n=!1,s=0;--a>=0;){var o=8==r?255&e[a]:f(e,a);o<0?"-"==e.charAt(a)&&(n=!0):(n=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<>this.DB-s):this.data[this.t-1]|=o<=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+s+1]=this.data[r]>>n|o,o=(this.data[r]&i)<=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var a=e%this.DB,n=this.DB-a,i=(1<>a;for(var s=r+1;s>a;a>0&&(t.data[this.t-r-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;a+=this.s}else{for(a+=this.s;r>=this.DB;a-=e.s}t.s=a<0?-1:0,a<-1?t.data[r++]=this.DV+a:a>0&&(t.data[r++]=a),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),n=r.t;for(t.t=n+a.t;--n>=0;)t.data[n]=0;for(n=0;n=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var a=e.abs();if(!(a.t<=0)){var n=this.abs();if(n.t0?(a.lShiftTo(l,o),n.lShiftTo(l,r)):(a.copyTo(o),n.copyTo(r));var p=o.t,f=o.data[p-1];if(0!=f){var h=f*(1<1?o.data[p-2]>>this.F2:0),y=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(E,r)),i.ONE.dlShiftTo(p,E),E.subTo(o,o);o.t=0;){var S=r.data[--v]==f?this.DM:Math.floor(r.data[v]*y+(r.data[v-1]+m)*g);if((r.data[v]+=o.am(0,S,r,C,0,p))0&&r.rShiftTo(l,r),c<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=s(),a=s(),n=t.convert(this),o=d(e)-1;for(n.copyTo(r);--o>=0;)if(t.sqrTo(r,a),(e&1<0)t.mulTo(a,n,r);else{var c=r;r=a,a=c}return t.revert(r)},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,a=(1<0)for(o>o)>0&&(n=!0,i=p(r));s>=0;)o>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(n=!0),n&&(i+=p(r));return n?i:"0"},i.prototype.negate=function(){var e=s();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},i.ZERO=h(0),i.ONE=h(1),I.prototype.convert=b,I.prototype.revert=b,I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},I.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var B=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],N=(1<<26)/B[B.length-1];i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),a=h(r),n=s(),i=s(),o="";for(this.divRemTo(a,n,i);n.signum()>0;)o=(r+i.intValue()).toString(e).substr(1)+o,n.divRemTo(a,n,i);return i.intValue().toString(e)+o},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),n=!1,s=0,o=0,c=0;c=r&&(this.dMultiply(a),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),n&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var a=new Array,n=7&e;a.length=1+(e>>3),t.nextBytes(a),n>0?a[0]&=(1<>=this.DB;if(e.t>=this.DB;a+=this.s}else{for(a+=this.s;r>=this.DB;a+=e.s}t.s=a<0?-1:0,a>0?t.data[r++]=a:a<-1&&(t.data[r++]=this.DV+a),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var a,n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;for(a=r.t-this.t;n=0;)r.data[a]=0;for(a=Math.max(t-this.t,0);a0)if(0==t)r=this.data[0]%e;else for(var a=this.t-1;a>=0;--a)r=(t*r+this.data[a])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var a,n=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t=0);var c=a.modPow(n,this);if(0!=c.compareTo(i.ONE)&&0!=c.compareTo(t)){for(var u=1;u++>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,a=this.DB-e*this.DB%8,n=0;if(e-- >0)for(a>a)!=(this.s&this.DM)>>a&&(t[n++]=r|this.s<=0;)a<8?(r=(this.data[e]&(1<>(a+=this.DB-8)):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(t[n++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=s();return this.bitwiseTo(e,m,t),t},i.prototype.or=function(e){var t=s();return this.bitwiseTo(e,v,t),t},i.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,C,t),t},i.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,E,t),t},i.prototype.not=function(){for(var e=s(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var p=s();for(a.sqrTo(o[1],p);c<=l;)o[c]=s(),a.mulTo(p,o[c-2],o[c]),c+=2}var f,m,v=e.t-1,C=!0,E=s();for(n=d(e.data[v])-1;v>=0;){for(n>=u?f=e.data[v]>>n-u&l:(f=(e.data[v]&(1<0&&(f|=e.data[v-1]>>this.DB+n-u)),c=r;0==(1&f);)f>>=1,--c;if((n-=c)<0&&(n+=this.DB,--v),C)o[f].copyTo(i),C=!1;else{for(;c>1;)a.sqrTo(i,E),a.sqrTo(E,i),c-=2;c>0?a.sqrTo(i,E):(m=i,i=E,E=m),a.mulTo(E,o[f],i)}for(;v>=0&&0==(e.data[v]&1<=0?(r.subTo(a,r),t&&n.subTo(o,n),s.subTo(c,s)):(a.subTo(r,a),t&&o.subTo(n,o),c.subTo(s,c))}return 0!=a.compareTo(i.ONE)?i.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},i.prototype.pow=function(e){return this.exp(e,new I)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var a=t;t=r,r=a}var n=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(n0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=B[B.length-1]){for(t=0;t>>0,o>>>0];for(var c=n.fullMessageLength.length-1;c>=0;--c)n.fullMessageLength[c]+=o[1],o[1]=o[0]+(n.fullMessageLength[c]/4294967296>>>0),n.fullMessageLength[c]=n.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-o));for(var c,u=0,p=n.fullMessageLength.length-1;p>=0;--p)u=(c=8*n.fullMessageLength[p]+u)/4294967296>>>0,s.putInt32Le(c>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(f,r,s);var h=a.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var i=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var a,n,i,u,l,p,f,h=r.length();h>=64;){for(n=e.h0,i=e.h1,u=e.h2,l=e.h3,f=0;f<16;++f)t[f]=r.getInt32Le(),a=n+(l^i&(u^l))+c[f]+t[f],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<32;++f)a=n+(u^l&(i^u))+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<48;++f)a=n+(i^u^l)+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;for(;f<64;++f)a=n+(u^(i|~l))+c[f]+t[s[f]],n=l,l=u,u=i,i+=a<<(p=o[f])|a>>>32-p;e.h0=e.h0+n|0,e.h1=e.h1+i|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,h-=64}}},function(e,t,r){var a=r(0);r(8),r(4),r(1);var n,i=a.pkcs5=a.pkcs5||{};a.util.isNodejs&&!a.options.usePureJavaScript&&(n=r(16)),e.exports=a.pbkdf2=i.pbkdf2=function(e,t,r,i,s,o){if("function"==typeof s&&(o=s,s=null),a.util.isNodejs&&!a.options.usePureJavaScript&&n.pbkdf2&&(null===s||"object"!=typeof s)&&(n.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o?4===n.pbkdf2Sync.length?n.pbkdf2(e,t,r,i,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):n.pbkdf2(e,t,r,i,s,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):4===n.pbkdf2Sync.length?n.pbkdf2Sync(e,t,r,i).toString("binary"):n.pbkdf2Sync(e,t,r,i,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in a.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=a.md[s].create()}var c=s.digestLength;if(i>4294967295*c){var u=new Error("Derived key is too long.");if(o)return o(u);throw u}var l=Math.ceil(i/c),p=i-(l-1)*c,f=a.hmac.create();f.start(s,e);var h,d,y,g="";if(!o){for(var m=1;m<=l;++m){f.start(null,null),f.update(t),f.update(a.util.int32ToBytes(m)),h=y=f.digest().getBytes();for(var v=2;v<=r;++v)f.start(null,null),f.update(y),d=f.digest().getBytes(),h=a.util.xorBytes(h,d,c),y=d;g+=ml)return o(null,g);f.start(null,null),f.update(t),f.update(a.util.int32ToBytes(m)),h=y=f.digest().getBytes(),v=2,E()}function E(){if(v<=r)return f.start(null,null),f.update(y),d=f.digest().getBytes(),h=a.util.xorBytes(h,d,c),y=d,++v,a.util.setImmediate(E);g+=m128)throw new Error('Invalid "nsComment" content.');e.value=n.create(n.Class.UNIVERSAL,n.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var g=[n.create(n.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var m=a.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(n.create(n.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);l=e.value.value;var v,C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]),E=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(p.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=p[0],c.validity.notAfter=p[1],c.tbsCertificate=r.tbsCertificate,t){var f;if(c.md=null,c.signatureOid in s)switch(s[c.signatureOid]){case"sha1WithRSAEncryption":c.md=a.md.sha1.create();break;case"md5WithRSAEncryption":c.md=a.md.md5.create();break;case"sha256WithRSAEncryption":c.md=a.md.sha256.create();break;case"sha384WithRSAEncryption":c.md=a.md.sha384.create();break;case"sha512WithRSAEncryption":c.md=a.md.sha512.create();break;case"RSASSA-PSS":c.md=a.md.sha256.create()}if(null===c.md)throw(f=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=c.signatureOid,f;var y=n.toDer(c.tbsCertificate);c.md.update(y.getBytes())}var m=a.md.sha1.create();c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){g([e]),c.issuer.attributes.push(e)},c.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=m.digest().toHex();var v=a.md.sha1.create();return c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){g([e]),c.subject.attributes.push(e)},c.subject.attributes=i.RDNAttributesAsArray(r.certSubject,v),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=v.digest().toHex(),r.certExtensions?c.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},i.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=c.value.charCodeAt(1),i=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&i)}else if("basicConstraints"===t.name){(c=n.fromDer(t.value)).value.length>0&&c.value[0].type===n.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===n.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=n.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=n.fromDer(t.value),u=0;u1&&(r=c.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var p;t.altNames=[];c=n.fromDer(t.value);for(var f=0;f=E&&e0&&s.value.push(i.certificateExtensionsToAsn1(e.extensions)),s},i.getCertificationRequestInfo=function(e){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(e.version).getBytes()),y(e.subject),i.publicKeyToAsn1(e.publicKey),C(e)])},i.distinguishedNameToAsn1=function(e){return y(e)},i.certificateToAsn1=function(e){var t=e.tbsCertificate||i.getTBSCertificate(e);return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[t,n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),n.create(n.Class.UNIVERSAL,n.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},i.certificateExtensionsToAsn1=function(e){var t=n.create(n.Class.CONTEXT_SPECIFIC,3,!0,[]),r=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[]);t.value.push(r);for(var a=0;al.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(p=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(f=!0,p=l),p){var h=p;a.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){p=h.shift();try{d=p.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}null!==c||p&&!f||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(null===c&&p&&!l.isIssuer(p)&&(c={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&gv.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,n):E;if(!0!==S)throw!0===E&&(c={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||a.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},function(e,t,r){var a=r(0);r(2),r(1),(e.exports=a.pss=a.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,n=e.mgf,i=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=a.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||a.random,c={encode:function(e,c){var u,l,p=c-1,f=Math.ceil(p/8),h=e.digest().getBytes();if(f>8*f-p&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l>8*l-u&255;if(0!=(f.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=n.generate(h,p),g="";for(c=0;c4){var r=e;e=a.util.createBuffer();for(var n=0;n0))return!0;for(var a=0;a0))return!0;for(var a=0;a0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},n.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},n.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},n.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var a=0;a0))return!0;for(var a=0;a0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},n.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.cfb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0)e.read-=this.blockSize;else for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.cfb.prototype.decrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0)e.read-=this.blockSize;else for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ofb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0)e.read-=this.blockSize;else for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}},n.ofb.prototype.decrypt=n.ofb.prototype.encrypt,n.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},n.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},n.ctr.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},n.ctr.prototype.decrypt=n.ctr.prototype.encrypt,n.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=3774873600},n.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=a.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?a.util.createBuffer(e.additionalData):a.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=a.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=r.length();if(12===n)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*n)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=a.util.createBuffer(t),this._aDataLength=o(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},n.gcm.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var n=0;n0&&(i=this.blockSize-i),this._partialOutput.clear();for(n=0;n0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},n.gcm.prototype.decrypt=function(e,t,r){var a=e.length();if(a0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var n=0;n0;--a)t[a]=e[a]>>>1|(1&e[a-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},n.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var a=e[r/8|0]>>>4*(7-r%8)&15,n=this._m[r][a];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}return t},n.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},n.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,a=4*r,n=16*r,i=new Array(n),s=0;s>>1,n=new Array(r);n[a]=e.slice(0);for(var i=a>>>1;i>0;)this.pow(n[2*i],n[i]=[]),i>>=1;for(i=2;i>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=a.util.createBuffer(),p=a.hmac.create();r=t+r;var f=Math.ceil(n/16),h=Math.ceil(n/20);p.start("MD5",c);var d=a.util.createBuffer();l.putBytes(r);for(var y=0;y0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var n=null,i=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:a.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},i?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=o(s,2),n.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!i)for(var p=0;p0;){if(0!==h.getByte())break;e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}}if(e.session.version&&(n.version.major!==e.session.version.major||n.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=u.getCipherSuite(n.cipher_suite);else for(var d=a.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(n.cipher_suite)});e.session.compressionMethod=i?n.compression_method:u.CompressionMethod.none}return n},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,a=t.random.bytes(),n=r?e.session.sp.client_random:a,i=r?a:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:n,server_random:i}},u.handleServerHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(a.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=a.version.minor,e.session.version=e.version;var n=a.session_id.bytes();n.length>0&&n===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=a.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,a)),e.session.id=n,e.process()}},u.handleClientHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){var i=n.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(i))?i="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,i="")),0===i.length&&(i=a.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=n.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,c=1;c0;)n=o(c.certificate_list,3),i=a.asn1.fromDer(n),n=a.pki.certificateFromAsn1(i,!0),l.push(n)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var f=e.entity===u.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=f?p:C:(f?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=f?p:C)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=f,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var n=t.fragment,i={enc_pre_master_secret:o(n,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=a.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=s.decrypt(i.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=a.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment,n={certificate_types:o(a,1),certificate_authorities:o(a,2)};e.session.certificateRequest=n,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment;n.read-=4;var i=n.bytes();n.read+=4;var s={signature:o(n,2).getBytes()},c=a.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},i=e.verify(e,n.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=typeof i||a.util.isArray(i)?"number"==typeof i&&(n.alert.description=i):(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert))),e.error(e,n)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=m;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var o=t.fragment.getBytes();(i=a.util.createBuffer()).putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?"server finished":"client finished",p=e.session.sp;if((i=n(p.master_secret,l,i.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:I,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,a=t.fragment,n={level:a.getByte(),description:a.getByte()};switch(n.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(n.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:n}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=a.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(i+4);r.read+=4,n in K[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),n!==u.HandshakeType.hello_request&&n!==u.HandshakeType.certificate_verify&&n!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),K[e.entity][e.expect][n](e,t,i)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,n=r.getByte(),i=r.getInt16(),s=r.getBytes(i);if(n===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(n===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,a.util.createBuffer(s))}e.process()};var l=1,p=2,f=3,h=4,d=5,y=6,g=7,m=8,v=1,C=2,E=3,S=4,T=5,I=6,b=u.handleUnexpected,A=u.handleChangeCipherSpec,B=u.handleAlert,N=u.handleHandshake,k=u.handleApplicationData,w=u.handleHeartbeat,R=[];R[u.ConnectionEnd.client]=[[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[A,B,b,b,w],[b,B,N,b,w],[b,B,N,k,w],[b,B,N,b,w]],R[u.ConnectionEnd.server]=[[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[b,B,N,b,w],[A,B,b,b,w],[b,B,N,b,w],[b,B,N,k,w],[b,B,N,b,w]];var _=u.handleHelloRequest,L=u.handleServerHello,U=u.handleCertificate,D=u.handleServerKeyExchange,P=u.handleCertificateRequest,V=u.handleServerHelloDone,O=u.handleFinished,K=[];K[u.ConnectionEnd.client]=[[b,b,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,U,D,P,V,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,D,P,V,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,P,V,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,V,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,O],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]];var x=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;K[u.ConnectionEnd.server]=[[b,x,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,U,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,M,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,F,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,O],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]],u.generateKeys=function(e,t){var r=n,a=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",a,48).bytes(),t.pre_master_secret=null),a=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;s&&(i+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",a,i),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},a={read:r(),write:r()};if(a.read.update=function(e,t){return a.read.cipherFunction(t,a.read)?a.read.compressFunction(e,t,a.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},a.write.update=function(e,t){return a.write.compressFunction(e,t,a.write)?a.write.cipherFunction(t,a.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var n=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(n),n.keys=u.generateKeys(e,n),a.read.macKey=t?n.keys.server_write_MAC_key:n.keys.client_write_MAC_key,a.write.macKey=t?n.keys.client_write_MAC_key:n.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(a,e,n),n.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:a.read.compressFunction=s,a.write.compressFunction=i;break;default:throw new Error("Unsupported compression algorithm.")}}return a},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=a.util.createBuffer();return r.putInt32(t),r.putBytes(a.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=a.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=a.util.createBuffer(),r=0;r0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+i+1+o+d,m=a.util.createBuffer();return m.putByte(u.HandshakeType.client_hello),m.putInt24(g),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),c(m,1,a.util.createBuffer(y)),c(m,2,t),c(m,1,s),d>0&&c(m,2,l),m},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,n=a.util.createBuffer();return n.putByte(u.HandshakeType.server_hello),n.putInt24(r),n.putByte(e.version.major),n.putByte(e.version.minor),n.putBytes(e.session.sp.server_random),c(n,1,a.util.createBuffer(t)),n.putByte(e.session.cipherSuite.id[0]),n.putByte(e.session.cipherSuite.id[1]),n.putByte(e.session.compressionMethod),n},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,n=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,n=e.getCertificate(e,t));var i=a.util.createBuffer();if(null!==n)try{a.util.isArray(n)||(n=[n]);for(var s=null,o=0;ou.MaxFragment;)n.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(i.slice(0,u.MaxFragment))})),i=i.slice(u.MaxFragment);i.length>0&&n.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(i)}))}for(var s=0;s0&&(n=r.order[0]),null!==n&&n in r.cache)for(var i in t=r.cache[n],delete r.cache[n],r.order)if(r.order[i]===n){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var n=r.order.shift();delete r.cache[n]}n=a.util.bytesToHex(e);r.order.push(n),r.cache[n]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?a.util.isArray(e.caStore)?a.pki.createCaStore(e.caStore):e.caStore:a.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var n in r=[],u.CipherSuites)r.push(u.CipherSuites[n]);var i=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,a){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var a=!1!==r.fatal;a&&(t.fail=!0),e.error(t,r),a&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,n=r.length();if(n<5)t=5-n;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:a.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,a=r.length();a=0;c--)w>>=8,w+=A.at(c)+k.at(c),k.setAt(c,255&w);N.putBuffer(k)}E=N,p.putBuffer(I)}return p.truncate(p.length()-i),p},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var a=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw a.oid=e,a.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],a}},s.pbe.getCipherForPBES2=function(e,t,r){var n,o={},c=[];if(!i.validate(t,u,o,c))throw(n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,n;if((e=i.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,n.supportedOids=["pkcs5PBKDF2"],n;if((e=i.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n;var l,p,h=o.kdfSalt,d=a.util.createBuffer(o.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":l=16,p=a.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,p=a.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,p=a.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,p=a.des.createDecryptionCipher;break;case"desCBC":l=8,p=a.des.createDecryptionCipher}var y=f(o.prfOid),g=a.pkcs5.pbkdf2(r,h,d,l,y),m=o.encIv,v=p(g);return v.start(m),v},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var n={},o=[];if(!i.validate(t,l,n,o))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,y;var c,u,p,h=a.util.createBuffer(n.salt),d=a.util.createBuffer(n.iterations);switch(d=d.getInt(d.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,p=a.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,p=function(e,t){var r=a.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=f(n.prfOid),m=s.pbe.generatePkcs12Key(r,h,1,d,c,g);return g.start(),p(m,s.pbe.generatePkcs12Key(r,h,2,d,u,g))},s.pbe.opensslDeriveBytes=function(e,t,r,n){if(null==n){if(!("md5"in a.md))throw new Error('"md5" hash algorithm unavailable.');n=a.md.md5.create()}null===t&&(t="");for(var i=[p(n,e+t)],s=16,o=1;s>>0,o>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=o[1],o[1]=o[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),n},n.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o,u=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1;s.putBytes(i.substr(0,n.blockLength-u));for(var l=8*n.fullMessageLength[0],p=0;p>>0,s.putInt32(l>>>0),l=o>>>0;s.putInt32(l);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(f,r,s);var h=a.util.createBuffer();return h.putInt32(f.h0),h.putInt32(f.h1),h.putInt32(f.h2),h.putInt32(f.h3),h.putInt32(f.h4),h.putInt32(f.h5),h.putInt32(f.h6),h.putInt32(f.h7),h},n};var i=null,s=!1,o=null;function c(e,t,r){for(var a,n,i,s,c,u,l,p,f,h,d,y,g,m=r.length();m>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)a=((a=t[c-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10,n=((n=t[c-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t[c]=a+t[c-7]+n+t[c-16]|0;for(u=e.h0,l=e.h1,p=e.h2,f=e.h3,h=e.h4,d=e.h5,y=e.h6,g=e.h7,c=0;c<64;++c)i=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),s=u&l|p&(u^l),a=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(y^h&(d^y))+o[c]+t[c],g=y,y=d,d=h,h=f+a>>>0,f=p,p=l,l=u,u=a+(n=i+s)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+p|0,e.h3=e.h3+f|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,m-=64}}},function(e,t,r){var a=r(0);r(1);var n=null;!a.util.isNodejs||a.options.usePureJavaScript||process.versions["node-webkit"]||(n=r(16)),(e.exports=a.prng=a.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,i=new Array(32),s=0;s<32;++s)i[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,a=0;a<32;++a)t.reseeds%r==0&&(e.update(t.pools[a].digest().getBytes()),t.pools[a].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var n=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(n),t.generated=0}function u(e){var t=null,r=a.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var i=a.util.createBuffer();if(t)for(;i.length()>16)))<<16,f=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)p=f>>>(c<<3),p^=Math.floor(256*Math.random()),i.putByte(String.fromCharCode(255&p))}return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,u=a.util.createBuffer();t.key=null,function l(p){if(p)return r(p);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return a.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,a){if(r)return e(r);t.collect(a),c(),e()}))}(l)}));var f=n(t.key,t.seed);t.generated+=f.length,u.putBytes(f),t.key=s(n(t.key,i(t.seed))),t.seed=o(n(t.key,t.seed)),a.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,i=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=a.util.createBuffer();c.length()1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=i(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},n?(t.seedFile=function(e,t){n.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return n.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,a=0;a>n&255);t.collect(a)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var a=r.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",e),t(a.forge.prng.err,a.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var a=r.data;a.forge&&a.forge.prng&&t.seedFile(a.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},function(e,t,r){var a=r(0);r(1);var n=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],s=function(e,t){return e<>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=a.rc2=a.rc2||{},a.rc2.expandKey=function(e,t){"string"==typeof e&&(e=a.util.createBuffer(e)),t=t||128;var r,i=e,s=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=s;r<128;r++)i.putByte(n[i.at(r-1)+i.at(r-s)&255]);for(i.setAt(128-c,n[i.at(128-c)&u]),r=127-c;r>=0;r--)i.setAt(r,n[i.at(r+1)^i.at(r+c)]);return i};var c=function(e,t,r){var n,c,u,l,p=!1,f=null,h=null,d=null,y=[];for(e=a.rc2.expandKey(e,t),u=0;u<64;u++)y.push(e.getInt16Le());r?(n=function(e){for(u=0;u<4;u++)e[u]+=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=s(e[u],i[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=y[63&e[(u+3)%4]]}):(n=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],i[u]),e[u]-=y[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=y[63&e[(u+3)%4]]});var g=function(e){var t=[];for(u=0;u<4;u++){var a=f.getInt16Le();null!==d&&(r?a^=d.getInt16Le():d.putInt16Le(a)),t.push(65535&a)}l=r?0:63;for(var n=0;n=8;)g([[5,n],[1,c],[6,n],[1,c],[5,n]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var a=8===f.length()?8:8-f.length();f.fillWithByte(a,a)}if(t&&(p=!0,m.update()),!r&&(t=0===f.length()))if(e)t=e(8,h,!r);else{var n=h.length(),i=h.at(n-1);i>n?t=!1:h.truncate(i)}return t}}};a.rc2.startEncrypting=function(e,t,r){var n=a.rc2.createEncryptionCipher(e,128);return n.start(t,r),n},a.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},a.rc2.startDecrypting=function(e,t,r){var n=a.rc2.createDecryptionCipher(e,128);return n.start(t,r),n},a.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},function(e,t,r){var a=r(0);r(1),r(2),r(9);var n=e.exports=a.pkcs1=a.pkcs1||{};function i(e,t,r){r||(r=a.md.sha1.create());for(var n="",i=Math.ceil(t/r.digestLength),s=0;s>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),n+=r.digest().getBytes()}return n.substring(0,t)}n.encode_rsa_oaep=function(e,t,r){var n,s,o,c;"string"==typeof r?(n=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(n=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=a.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;n||(n=""),o.update(n,"raw");for(var p=o.digest(),f="",h=l-t.length,d=0;de&&(s=c(e,t));var h=s.toString(16);n.target.postMessage({hex:h,workLoad:l}),s.dAddOffset(p,0)}}}h()}(e,t,n,i);return o(e,t,n,i)}(e,u,i.options,n);throw new Error("Invalid prime generation algorithm: "+i.name)}}function o(e,t,r,i){var s=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(s.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var u=10;"maxBlockTime"in r&&(u=r.maxBlockTime),function e(t,r,i,s,o,u,l){var p=+new Date;do{if(t.bitLength()>r&&(t=c(r,i)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(n[s++%8],0)}while(u<0||+new Date-p=0&&n.push(o):n.push(o))}return n}function h(e){if(e.composed||e.constructed){for(var t=a.util.createBuffer(),r=0;r0&&(c=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,p));var f=[],h=[];null!==t&&(h=a.util.isArray(t)?t:[t]);for(var d=[],y=0;y0){var C=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,d),E=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(C).getBytes())])]);f.push(E)}var S=null;if(null!==e){var T=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=null===r?n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.keyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[T]),c]):n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(T,r,o)]),c]);var I=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[S]),b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(I).getBytes())])]);f.push(b)}var A,B=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,f);if(o.useMac){var N=a.md.sha1.create(),k=new a.util.ByteBuffer(a.random.getBytes(o.saltSize)),w=o.count,R=(e=s.generateKey(r,k,3,w,20),a.hmac.create());R.start(N,e),R.update(n.toDer(B).getBytes());var _=R.getMac();A=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.sha1).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,_.getBytes())]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,k.getBytes()),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(w).getBytes())])}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(3).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(i.oids.data).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,n.toDer(B).getBytes())])]),A])},s.generateKey=a.pbe.generatePkcs12Key},function(e,t,r){var a=r(0);r(3),r(1);var n=a.asn1,i=e.exports=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=a.pkcs7||{},a.pkcs7.asn1=i;var s={name:"ContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},i.encryptedDataValidator={name:"EncryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:n.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:n.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:n.Class.UNIVERSAL,type:n.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:n.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var a=r(0);r(1),a.mgf=a.mgf||{},(e.exports=a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(e){return{generate:function(t,r){for(var n=new a.util.ByteBuffer,i=Math.ceil(r/e.digestLength),s=0;s>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/4294967296>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return n.putBytes(e),l(r,i,n),(n.read>2048||0===n.length())&&n.compact(),h},h.digest=function(){var t=a.util.createBuffer();t.putBytes(n.bytes());var o,c=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(s.substr(0,h.blockLength-c));for(var u=8*h.fullMessageLength[0],p=0;p>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var f=new Array(r.length);for(p=0;p=128;){for(R=0;R<16;++R)t[R][0]=r.getInt32()>>>0,t[R][1]=r.getInt32()>>>0;for(;R<80;++R)a=(((_=(U=t[R-2])[0])>>>19|(L=U[1])<<13)^(L>>>29|_<<3)^_>>>6)>>>0,n=((_<<13|L>>>19)^(L<<3|_>>>29)^(_<<26|L>>>6))>>>0,i=(((_=(P=t[R-15])[0])>>>1|(L=P[1])<<31)^(_>>>8|L<<24)^_>>>7)>>>0,s=((_<<31|L>>>1)^(_<<24|L>>>8)^(_<<25|L>>>7))>>>0,D=t[R-7],V=t[R-16],L=n+D[1]+s+V[1],t[R][0]=a+D[0]+i+V[0]+(L/4294967296>>>0)>>>0,t[R][1]=L>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],m=e[1][1],v=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],T=e[4][0],I=e[4][1],b=e[5][0],A=e[5][1],B=e[6][0],N=e[6][1],k=e[7][0],w=e[7][1],R=0;R<80;++R)l=((T>>>14|I<<18)^(T>>>18|I<<14)^(I>>>9|T<<23))>>>0,p=(B^T&(b^B))>>>0,o=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,u=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,f=(d&g|v&(d^g))>>>0,h=(y&m|C&(y^m))>>>0,L=w+(((T<<18|I>>>14)^(T<<14|I>>>18)^(I<<23|T>>>9))>>>0)+((N^I&(A^N))>>>0)+c[R][1]+t[R][1],a=k+l+p+c[R][0]+t[R][0]+(L/4294967296>>>0)>>>0,n=L>>>0,i=o+f+((L=u+h)/4294967296>>>0)>>>0,s=L>>>0,k=B,w=N,B=b,N=A,b=T,A=I,T=E+a+((L=S+n)/4294967296>>>0)>>>0,I=L>>>0,E=v,S=C,v=g,C=m,g=d,m=y,d=a+i+((L=n+s)/4294967296>>>0)>>>0,y=L>>>0;L=e[0][1]+y,e[0][0]=e[0][0]+d+(L/4294967296>>>0)>>>0,e[0][1]=L>>>0,L=e[1][1]+m,e[1][0]=e[1][0]+g+(L/4294967296>>>0)>>>0,e[1][1]=L>>>0,L=e[2][1]+C,e[2][0]=e[2][0]+v+(L/4294967296>>>0)>>>0,e[2][1]=L>>>0,L=e[3][1]+S,e[3][0]=e[3][0]+E+(L/4294967296>>>0)>>>0,e[3][1]=L>>>0,L=e[4][1]+I,e[4][0]=e[4][0]+T+(L/4294967296>>>0)>>>0,e[4][1]=L>>>0,L=e[5][1]+A,e[5][0]=e[5][0]+b+(L/4294967296>>>0)>>>0,e[5][1]=L>>>0,L=e[6][1]+N,e[6][0]=e[6][0]+B+(L/4294967296>>>0)>>>0,e[6][1]=L>>>0,L=e[7][1]+w,e[7][0]=e[7][0]+k+(L/4294967296>>>0)>>>0,e[7][1]=L>>>0,O-=128}}},function(e,t,r){var a=r(0);r(1),e.exports=a.log=a.log||{},a.log.levels=["none","error","warning","info","debug","verbose","max"];var n={},i=[],s=null;a.log.LEVEL_LOCKED=2,a.log.NO_LEVEL_CHECK=4,a.log.INTERPOLATE=8;for(var o=0;o0;)o.push(u%i),u=u/i|0}for(n=0;0===e[n]&&n=0;--n)a+=t[o[n]]}else a=function(e,t){var r=0,a=t.length,n=t.charAt(0),i=[0];for(r=0;r0;)i.push(o%a),o=o/a|0}var c="";for(r=0;0===e.at(r)&&r=0;--r)c+=t[i[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");a=a.match(l).join("\r\n")}return a},r.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=a[t];if(!r){r=a[t]=[];for(var n=0;n>=8;for(;l>0;)o.push(255&l),l>>=8}for(var p=0;e[p]===s&&p=n.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),i=!0),i}function o(e,t,r){if(!r){var a=e-t.length()%e;t.fillWithByte(a-1,a)}return!0}function c(e,t,r){var a=!0;if(r){for(var n=t.length(),i=t.last(),s=n-1-i;s=o?(e.fragment=s.output.getBytes(l-o),u=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=a.util.createBuffer(e.fragment),e.length=e.fragment.length();var p=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=function(e,t,r){var n=a.hmac.create();return n.start("SHA1",e),n.update(t),t=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),t===r}(t.macKey,u,p)&&i}n.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=n.BulkCipherAlgorithm.aes,e.cipher_type=n.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=n.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},n.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=n.BulkCipherAlgorithm.aes,e.cipher_type=n.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=n.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i}},function(e,t,r){var a=r(0);r(30),e.exports=a.mgf=a.mgf||{},a.mgf.mgf1=a.mgf1},function(e,t,r){var a=r(0);r(12),r(2),r(32),r(1);var n=r(41),i=n.publicKeyValidator,s=n.privateKeyValidator;if(void 0===o)var o=a.jsbn.BigInteger;var c=a.util.ByteBuffer,u="undefined"==typeof Buffer?Uint8Array:Buffer;a.pki=a.pki||{},e.exports=a.pki.ed25519=a.ed25519=a.ed25519||{};var l=a.ed25519;function p(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var a=new u(t.length()),n=0;n=0;--r)K(a,a),1!==r&&x(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(r,r),x(r,r,n),x(r,r,i),x(r,r,i),x(e[0],r,i),K(a,e[0]),x(a,a,i),N(a,n)&&x(e[0],e[0],C);if(K(a,e[0]),x(a,a,i),N(a,n))return-1;w(e[0])===t[31]>>7&&O(e[0],f,e[0]);return x(e[3],e[0],e[1]),0}(o,a))return-1;for(n=0;n=0};var f=P(),h=P([1]),d=P([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=P([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=P([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=P([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=P([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=a.md.sha512.create(),n=new c(e);r.update(n.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=i.charCodeAt(o);return s}function S(e,t){var r,a,n,i;for(a=63;a>=32;--a){for(r=0,n=a-32,i=a-12;n>8,t[n]-=256*r;t[n]+=r,t[a]=0}for(r=0,n=0;n<32;++n)t[n]+=r-(t[31]>>4)*v[n],r=t[n]>>8,t[n]&=255;for(n=0;n<32;++n)t[n]-=r*v[n];for(a=0;a<32;++a)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function I(e,t){var r=P(),a=P(),n=P(),i=P(),s=P(),o=P(),c=P(),u=P(),l=P();O(r,e[1],e[0]),O(l,t[1],t[0]),x(r,r,l),V(a,e[0],e[1]),V(l,t[0],t[1]),x(a,a,l),x(n,e[3],t[3]),x(n,n,y),x(i,e[2],t[2]),V(i,i,i),O(s,a,r),O(o,i,n),V(c,i,n),V(u,a,r),x(e[0],s,o),x(e[1],u,c),x(e[2],c,o),x(e[3],s,u)}function b(e,t,r){for(var a=0;a<4;++a)D(e[a],t[a],r)}function A(e,t){var r=P(),a=P(),n=P();!function(e,t){var r,a=P();for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)K(a,a),2!==r&&4!==r&&x(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(n,t[2]),x(r,t[0],n),x(a,t[1],n),B(e,a),e[31]^=w(r)<<7}function B(e,t){var r,a,n,i=P(),s=P();for(r=0;r<16;++r)s[r]=t[r];for(U(s),U(s),U(s),a=0;a<2;++a){for(i[0]=s[0]-65517,r=1;r<15;++r)i[r]=s[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=s[15]-32767-(i[14]>>16&1),n=i[15]>>16&1,i[14]&=65535,D(s,i,1-n)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function N(e,t){var r=new u(32),a=new u(32);return B(r,e),B(a,t),k(r,0,a,0)}function k(e,t,r,a){return function(e,t,r,a,n){var i,s=0;for(i=0;i>>8)-1}(e,t,r,a,32)}function w(e){var t=new u(32);return B(t,e),1&t[0]}function R(e,t,r){var a,n;for(L(e[0],f),L(e[1],h),L(e[2],h),L(e[3],f),n=255;n>=0;--n)b(e,t,a=r[n/8|0]>>(7&n)&1),I(t,e),I(e,e),b(e,t,a)}function _(e,t){var r=[P(),P(),P(),P()];L(r[0],g),L(r[1],m),L(r[2],h),x(r[3],g,m),R(e,r,t)}function L(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,a=1;for(t=0;t<16;++t)r=e[t]+a+65535,a=Math.floor(r/65536),e[t]=r-65536*a;e[0]+=a-1+37*(a-1)}function D(e,t,r){for(var a,n=~(r-1),i=0;i<16;++i)a=n&(e[i]^t[i]),e[i]^=a,t[i]^=a}function P(e){var t,r=new Float64Array(16);if(e)for(t=0;t0&&(s=a.util.fillString(String.fromCharCode(0),c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,i)}},decrypt:function(t,r,a){var n=t.decrypt(r,"NONE");return e.generate(n,a)}};return i},a.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},a.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)}},function(e,t,r){e.exports=r(4),r(14),r(9),r(23),r(32)},function(e,t,r){var a=r(0);r(5),r(3),r(10),r(6),r(7),r(29),r(2),r(1),r(17);var n=a.asn1,i=e.exports=a.pkcs7=a.pkcs7||{};function s(e){var t={},r=[];if(!n.validate(e,i.asn1.recipientInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(t.issuer),serialNumber:a.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:n.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function o(e){for(var t,r=[],i=0;i0){for(var r=n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i=r&&s0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,t)),i.length>0&&s.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,i)),s.value[0].value.push(n.create(n.Class.UNIVERSAL,n.Type.SET,!0,e.signerInfos)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,n=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=a.pki.certificateFromPem(i)),r=i.issuer.attributes,n=i.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=a.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||a.pki.oids.sha1;switch(o){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,p=0;p="8"&&(r="00"+r);var n=a.util.hexToBytes(r);e.putInt32(n.length),e.putBytes(n)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=a.md.sha1.create(),t=arguments.length,r=0;r0&&(this.state=g[this.state].block)},m.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==f&&(this.state=u,v(this,0)),this.blocks},m.prototype.sleep=function(e){e=void 0===e?0:e,this.state=g[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=u,v(t,0)}),e)},m.prototype.wait=function(e){e.wait(this)},m.prototype.wakeup=function(){this.state===p&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=u,v(this,0))},m.prototype.cancel=function(){this.state=g[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},m.prototype.fail=function(e){if(this.error=!0,C(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,v(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;C(t,!0)}this.failureCallback&&this.failureCallback(this)}};var v=function(e,t){var r=t>30||+new Date-e.swapTime>20,a=function(t){if(t++,e.state===u)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var a=e.subtasks.shift();a.error=e.error,a.swapTime=e.swapTime,a.userData=e.userData,a.run(a),a.error||v(a,t)}else C(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,v(e.parent,t))};r?setTimeout(a,0):a(t)},C=function(e,t){e.state=f,delete i[e.id],null===e.parent&&(e.type in o?0===o[e.type].length?a.log.error(n,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):o[e.type][0]!==e?a.log.error(n,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(o[e.type].shift(),0===o[e.type].length?delete o[e.type]:o[e.type][0].start()):a.log.error(n,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};e.exports=a.task=a.task||{},a.task.start=function(e){var t=new m({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in o?o[e.type].push(t):(o[t.type]=[t],function(e){e.error=!1,e.state=g[e.state][y],setTimeout((function(){e.state===u&&(e.swapTime=+new Date,e.run(e),v(e,0))}),0)}(t))},a.task.cancel=function(e){e in o&&(o[e]=[o[e][0]])},a.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e}}])})); -//# sourceMappingURL=forge.min.js.map \ No newline at end of file diff --git a/node_modules/node-forge/dist/forge.min.js.map b/node_modules/node-forge/dist/forge.min.js.map deleted file mode 100644 index 8e90465..0000000 --- a/node_modules/node-forge/dist/forge.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"forge.min.js","sources":["webpack://[name]/forge.min.js"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file diff --git a/node_modules/node-forge/dist/prime.worker.min.js b/node_modules/node-forge/dist/prime.worker.min.js deleted file mode 100644 index 41433be..0000000 --- a/node_modules/node-forge/dist/prime.worker.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){var i={};function r(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,r),s.l=!0,s.exports}r.m=t,r.c=i,r.d=function(t,i,o){r.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,i){if(1&i&&(t=r(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var s in t)r.d(o,s,function(i){return t[i]}.bind(null,s));return o},r.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(i,"a",i),i},r.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},r.p="",r(r.s=1)}([function(t,i){t.exports={options:{usePureJavaScript:!1}}},function(t,i,r){r(2),t.exports=r(0)},function(t,i,r){var o=r(0);r(3);var s=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],e=(1<<26)/s[s.length-1],a=o.jsbn.BigInteger;new a(null).fromInt(2),self.addEventListener("message",(function(t){var i=function(t){for(var i=new a(t.hex,16),r=0,o=t.workLoad,s=0;s=0);var u=o.modPow(s,t);if(0!==u.compareTo(a.ONE)&&0!==u.compareTo(i)){for(var f=r;--f;){if(0===(u=u.modPowInt(2,t)).compareTo(a.ONE))return!1;if(0===u.compareTo(i))break}if(0===f)return!1}}var p;return!0}(t)}},function(t,i,r){var o,s=r(0);t.exports=s.jsbn=s.jsbn||{};function e(t,i,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,i,r):null==i&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,i))}function a(){return new e(null)}function n(t,i,r,o,s,e){for(var a=16383&i,n=i>>14;--e>=0;){var h=16383&this.data[t],u=this.data[t++]>>14,f=n*h+u*a;s=((h=a*h+((16383&f)<<14)+r.data[o]+s)>>28)+(f>>14)+n*u,r.data[o++]=268435455&h}return s}s.jsbn.BigInteger=e,"undefined"==typeof navigator?(e.prototype.am=n,o=28):"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=function(t,i,r,o,s,e){for(var a=32767&i,n=i>>15;--e>=0;){var h=32767&this.data[t],u=this.data[t++]>>15,f=n*h+u*a;s=((h=a*h+((32767&f)<<15)+r.data[o]+(1073741823&s))>>>30)+(f>>>15)+n*u+(s>>>30),r.data[o++]=1073741823&h}return s},o=30):"Netscape"!=navigator.appName?(e.prototype.am=function(t,i,r,o,s,e){for(;--e>=0;){var a=i*this.data[t++]+r.data[o]+s;s=Math.floor(a/67108864),r.data[o++]=67108863&a}return s},o=26):(e.prototype.am=n,o=28),e.prototype.DB=o,e.prototype.DM=(1<>>16)&&(t=i,r+=16),0!=(i=t>>8)&&(t=i,r+=8),0!=(i=t>>4)&&(t=i,r+=4),0!=(i=t>>2)&&(t=i,r+=2),0!=(i=t>>1)&&(t=i,r+=1),r}function l(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,i+=16),0==(255&t)&&(t>>=8,i+=8),0==(15&t)&&(t>>=4,i+=4),0==(3&t)&&(t>>=2,i+=2),0==(1&t)&&++i,i}function B(t){for(var i=0;0!=t;)t&=t-1,++i;return i}function S(){}function M(t){return t}function w(t){this.r2=a(),this.q3=a(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r),this.reduce(r)},l.prototype.sqrTo=function(t,i){t.squareTo(i),this.reduce(i)},v.prototype.convert=function(t){var i=a();return t.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),t.s<0&&i.compareTo(e.ZERO)>0&&this.m.subTo(i,i),i},v.prototype.revert=function(t){var i=a();return t.copyTo(i),this.reduce(i),i},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var i=0;i>15)*this.mpl&this.um)<<15)&t.DM;for(r=i+this.m.t,t.data[r]+=this.m.am(0,o,t,i,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r),this.reduce(r)},v.prototype.sqrTo=function(t,i){t.squareTo(i),this.reduce(i)},e.prototype.copyTo=function(t){for(var i=this.t-1;i>=0;--i)t.data[i]=this.data[i];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,i){var r;if(16==i)r=4;else if(8==i)r=3;else if(256==i)r=8;else if(2==i)r=1;else if(32==i)r=5;else{if(4!=i)return void this.fromRadix(t,i);r=2}this.t=0,this.s=0;for(var o=t.length,s=!1,a=0;--o>=0;){var n=8==r?255&t[o]:d(t,o);n<0?"-"==t.charAt(o)&&(s=!0):(s=!1,0==a?this.data[this.t++]=n:a+r>this.DB?(this.data[this.t-1]|=(n&(1<>this.DB-a):this.data[this.t-1]|=n<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,i){var r;for(r=this.t-1;r>=0;--r)i.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)i.data[r]=0;i.t=this.t+t,i.s=this.s},e.prototype.drShiftTo=function(t,i){for(var r=t;r=0;--r)i.data[r+a+1]=this.data[r]>>s|n,n=(this.data[r]&e)<=0;--r)i.data[r]=0;i.data[a]=n,i.t=this.t+a+1,i.s=this.s,i.clamp()},e.prototype.rShiftTo=function(t,i){i.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)i.t=0;else{var o=t%this.DB,s=this.DB-o,e=(1<>o;for(var a=r+1;a>o;o>0&&(i.data[this.t-r-1]|=(this.s&e)<>=this.DB;if(t.t>=this.DB;o+=this.s}else{for(o+=this.s;r>=this.DB;o-=t.s}i.s=o<0?-1:0,o<-1?i.data[r++]=this.DV+o:o>0&&(i.data[r++]=o),i.t=r,i.clamp()},e.prototype.multiplyTo=function(t,i){var r=this.abs(),o=t.abs(),s=r.t;for(i.t=s+o.t;--s>=0;)i.data[s]=0;for(s=0;s=0;)t.data[r]=0;for(r=0;r=i.DV&&(t.data[r+i.t]-=i.DV,t.data[r+i.t+1]=1)}t.t>0&&(t.data[t.t-1]+=i.am(r,i.data[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,i,r){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(f,n),s.lShiftTo(f,r)):(o.copyTo(n),s.copyTo(r));var p=n.t,d=n.data[p-1];if(0!=d){var c=d*(1<1?n.data[p-2]>>this.F2:0),l=this.FV/c,v=(1<=0&&(r.data[r.t++]=1,r.subTo(g,r)),e.ONE.dlShiftTo(p,g),g.subTo(n,n);n.t=0;){var D=r.data[--y]==d?this.DM:Math.floor(r.data[y]*l+(r.data[y-1]+T)*v);if((r.data[y]+=n.am(0,D,r,b,0,p))0&&r.rShiftTo(f,r),h<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var i=3&t;return(i=(i=(i=(i=i*(2-(15&t)*i)&15)*(2-(255&t)*i)&255)*(2-((65535&t)*i&65535))&65535)*(2-t*i%this.DV)%this.DV)>0?this.DV-i:-i},e.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},e.prototype.exp=function(t,i){if(t>4294967295||t<1)return e.ONE;var r=a(),o=a(),s=i.convert(this),n=m(t)-1;for(s.copyTo(r);--n>=0;)if(i.sqrTo(r,o),(t&1<0)i.mulTo(o,s,r);else{var h=r;r=o,o=h}return i.revert(r)},e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var i;if(16==t)i=4;else if(8==t)i=3;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return this.toRadix(t);i=2}var r,o=(1<0)for(n>n)>0&&(s=!0,e=p(r));a>=0;)n>(n+=this.DB-i)):(r=this.data[a]>>(n-=i)&o,n<=0&&(n+=this.DB,--a)),r>0&&(s=!0),s&&(e+=p(r));return s?e:"0"},e.prototype.negate=function(){var t=a();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var i=this.s-t.s;if(0!=i)return i;var r=this.t;if(0!=(i=r-t.t))return this.s<0?-i:i;for(;--r>=0;)if(0!=(i=this.data[r]-t.data[r]))return i;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+m(this.data[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var i=a();return this.abs().divRemTo(t,null,i),this.s<0&&i.compareTo(e.ZERO)>0&&t.subTo(i,i),i},e.prototype.modPowInt=function(t,i){var r;return r=t<256||i.isEven()?new l(i):new v(i),this.exp(t,r)},e.ZERO=c(0),e.ONE=c(1),S.prototype.convert=M,S.prototype.revert=M,S.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r)},S.prototype.sqrTo=function(t,i){t.squareTo(i)},w.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var i=a();return t.copyTo(i),this.reduce(i),i},w.prototype.revert=function(t){return t},w.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},w.prototype.mulTo=function(t,i,r){t.multiplyTo(i,r),this.reduce(r)},w.prototype.sqrTo=function(t,i){t.squareTo(i),this.reduce(i)};var E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],O=(1<<26)/E[E.length-1];e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var i=this.chunkSize(t),r=Math.pow(t,i),o=c(r),s=a(),e=a(),n="";for(this.divRemTo(o,s,e);s.signum()>0;)n=(r+e.intValue()).toString(t).substr(1)+n,s.divRemTo(o,s,e);return e.intValue().toString(t)+n},e.prototype.fromRadix=function(t,i){this.fromInt(0),null==i&&(i=10);for(var r=this.chunkSize(i),o=Math.pow(i,r),s=!1,a=0,n=0,h=0;h=r&&(this.dMultiply(o),this.dAddOffset(n,0),a=0,n=0))}a>0&&(this.dMultiply(Math.pow(i,a)),this.dAddOffset(n,0)),s&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,i,r){if("number"==typeof i)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=new Array,s=7&t;o.length=1+(t>>3),i.nextBytes(o),s>0?o[0]&=(1<>=this.DB;if(t.t>=this.DB;o+=this.s}else{for(o+=this.s;r>=this.DB;o+=t.s}i.s=o<0?-1:0,o>0?i.data[r++]=o:o<-1&&(i.data[r++]=this.DV+o),i.t=r,i.clamp()},e.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,i){if(0!=t){for(;this.t<=i;)this.data[this.t++]=0;for(this.data[i]+=t;this.data[i]>=this.DV;)this.data[i]-=this.DV,++i>=this.t&&(this.data[this.t++]=0),++this.data[i]}},e.prototype.multiplyLowerTo=function(t,i,r){var o,s=Math.min(this.t+t.t,i);for(r.s=0,r.t=s;s>0;)r.data[--s]=0;for(o=r.t-this.t;s=0;)r.data[o]=0;for(o=Math.max(i-this.t,0);o0)if(0==i)r=this.data[0]%t;else for(var o=this.t-1;o>=0;--o)r=(i*r+this.data[o])%t;return r},e.prototype.millerRabin=function(t){var i=this.subtract(e.ONE),r=i.getLowestSetBit();if(r<=0)return!1;for(var o,s=i.shiftRight(r),a={nextBytes:function(t){for(var i=0;i=0);var h=o.modPow(s,this);if(0!=h.compareTo(e.ONE)&&0!=h.compareTo(i)){for(var u=1;u++>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,i=new Array;i[0]=this.s;var r,o=this.DB-t*this.DB%8,s=0;if(t-- >0)for(o>o)!=(this.s&this.DM)>>o&&(i[s++]=r|this.s<=0;)o<8?(r=(this.data[t]&(1<>(o+=this.DB-8)):(r=this.data[t]>>(o-=8)&255,o<=0&&(o+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==s&&(128&this.s)!=(128&r)&&++s,(s>0||r!=this.s)&&(i[s++]=r);return i},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var i=a();return this.bitwiseTo(t,T,i),i},e.prototype.or=function(t){var i=a();return this.bitwiseTo(t,y,i),i},e.prototype.xor=function(t){var i=a();return this.bitwiseTo(t,b,i),i},e.prototype.andNot=function(t){var i=a();return this.bitwiseTo(t,g,i),i},e.prototype.not=function(){for(var t=a(),i=0;i=this.t?0!=this.s:0!=(this.data[i]&1<1){var p=a();for(o.sqrTo(n[1],p);h<=f;)n[h]=a(),o.mulTo(p,n[h-2],n[h]),h+=2}var d,T,y=t.t-1,b=!0,g=a();for(s=m(t.data[y])-1;y>=0;){for(s>=u?d=t.data[y]>>s-u&f:(d=(t.data[y]&(1<0&&(d|=t.data[y-1]>>this.DB+s-u)),h=r;0==(1&d);)d>>=1,--h;if((s-=h)<0&&(s+=this.DB,--y),b)n[d].copyTo(e),b=!1;else{for(;h>1;)o.sqrTo(e,g),o.sqrTo(g,e),h-=2;h>0?o.sqrTo(e,g):(T=e,e=g,g=T),o.mulTo(g,n[d],e)}for(;y>=0&&0==(t.data[y]&1<=0?(r.subTo(o,r),i&&s.subTo(n,s),a.subTo(h,a)):(o.subTo(r,o),i&&n.subTo(s,n),h.subTo(a,h))}return 0!=o.compareTo(e.ONE)?e.ZERO:h.compareTo(t)>=0?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},e.prototype.pow=function(t){return this.exp(t,new S)},e.prototype.gcd=function(t){var i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(i.compareTo(r)<0){var o=i;i=r,r=o}var s=i.getLowestSetBit(),e=r.getLowestSetBit();if(e<0)return i;for(s0&&(i.rShiftTo(e,i),r.rShiftTo(e,r));i.signum()>0;)(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),i.compareTo(r)>=0?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r));return e>0&&r.lShiftTo(e,r),r},e.prototype.isProbablePrime=function(t){var i,r=this.abs();if(1==r.t&&r.data[0]<=E[E.length-1]){for(i=0;i', key); - * cipher.start({iv: iv}); - * - * Creates an AES cipher object to encrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as a string of bytes, an array of bytes, - * a byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: false, - mode: mode - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('AES-', key); - * - * Creates an AES cipher object to encrypt data using the given symmetric key. - * - * The key may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: false, - mode: mode - }); -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('AES-', key); - * decipher.start({iv: iv}); - * - * Creates an AES cipher object to decrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as a string of bytes, an array of bytes, - * a byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: true, - mode: mode - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('AES-', key); - * - * Creates an AES cipher object to decrypt data using the given symmetric key. - * - * The key may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param key the symmetric key to use. - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.aes.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: true, - mode: mode - }); -}; - -/** - * Creates a new AES cipher algorithm object. - * - * @param name the name of the algorithm. - * @param mode the mode factory function. - * - * @return the AES algorithm object. - */ -forge.aes.Algorithm = function(name, mode) { - if(!init) { - initialize(); - } - var self = this; - self.name = name; - self.mode = new mode({ - blockSize: 16, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self._w, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self._w, inBlock, outBlock, true); - } - } - }); - self._init = false; -}; - -/** - * Initializes this AES algorithm by expanding its key. - * - * @param options the options to use. - * key the key to use with this algorithm. - * decrypt true if the algorithm should be initialized for decryption, - * false for encryption. - */ -forge.aes.Algorithm.prototype.initialize = function(options) { - if(this._init) { - return; - } - - var key = options.key; - var tmp; - - /* Note: The key may be a string of bytes, an array of bytes, a byte - buffer, or an array of 32-bit integers. If the key is in bytes, then - it must be 16, 24, or 32 bytes in length. If it is in 32-bit - integers, it must be 4, 6, or 8 integers long. */ - - if(typeof key === 'string' && - (key.length === 16 || key.length === 24 || key.length === 32)) { - // convert key string into byte buffer - key = forge.util.createBuffer(key); - } else if(forge.util.isArray(key) && - (key.length === 16 || key.length === 24 || key.length === 32)) { - // convert key integer array into byte buffer - tmp = key; - key = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - - // convert key byte buffer into 32-bit integer array - if(!forge.util.isArray(key)) { - tmp = key; - key = []; - - // key lengths of 16, 24, 32 bytes allowed - var len = tmp.length(); - if(len === 16 || len === 24 || len === 32) { - len = len >>> 2; - for(var i = 0; i < len; ++i) { - key.push(tmp.getInt32()); - } - } - } - - // key must be an array of 32-bit integers by now - if(!forge.util.isArray(key) || - !(key.length === 4 || key.length === 6 || key.length === 8)) { - throw new Error('Invalid key parameter.'); - } - - // encryption operation is always used for these modes - var mode = this.mode.name; - var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1); - - // do key expansion - this._w = _expandKey(key, options.decrypt && !encryptOp); - this._init = true; -}; - -/** - * Expands a key. Typically only used for testing. - * - * @param key the symmetric key to expand, as an array of 32-bit words. - * @param decrypt true to expand for decryption, false for encryption. - * - * @return the expanded key. - */ -forge.aes._expandKey = function(key, decrypt) { - if(!init) { - initialize(); - } - return _expandKey(key, decrypt); -}; - -/** - * Updates a single block. Typically only used for testing. - * - * @param w the expanded key to use. - * @param input an array of block-size 32-bit words. - * @param output an array of block-size 32-bit words. - * @param decrypt true to decrypt, false to encrypt. - */ -forge.aes._updateBlock = _updateBlock; - -/** Register AES algorithms **/ - -registerAlgorithm('AES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('AES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('AES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('AES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('AES-CTR', forge.cipher.modes.ctr); -registerAlgorithm('AES-GCM', forge.cipher.modes.gcm); - -function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.aes.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); -} - -/** AES implementation **/ - -var init = false; // not yet initialized -var Nb = 4; // number of words comprising the state (AES = 4) -var sbox; // non-linear substitution table used in key expansion -var isbox; // inversion of sbox -var rcon; // round constant word array -var mix; // mix-columns table -var imix; // inverse mix-columns table - -/** - * Performs initialization, ie: precomputes tables to optimize for speed. - * - * One way to understand how AES works is to imagine that 'addition' and - * 'multiplication' are interfaces that require certain mathematical - * properties to hold true (ie: they are associative) but they might have - * different implementations and produce different kinds of results ... - * provided that their mathematical properties remain true. AES defines - * its own methods of addition and multiplication but keeps some important - * properties the same, ie: associativity and distributivity. The - * explanation below tries to shed some light on how AES defines addition - * and multiplication of bytes and 32-bit words in order to perform its - * encryption and decryption algorithms. - * - * The basics: - * - * The AES algorithm views bytes as binary representations of polynomials - * that have either 1 or 0 as the coefficients. It defines the addition - * or subtraction of two bytes as the XOR operation. It also defines the - * multiplication of two bytes as a finite field referred to as GF(2^8) - * (Note: 'GF' means "Galois Field" which is a field that contains a finite - * number of elements so GF(2^8) has 256 elements). - * - * This means that any two bytes can be represented as binary polynomials; - * when they multiplied together and modularly reduced by an irreducible - * polynomial of the 8th degree, the results are the field GF(2^8). The - * specific irreducible polynomial that AES uses in hexadecimal is 0x11b. - * This multiplication is associative with 0x01 as the identity: - * - * (b * 0x01 = GF(b, 0x01) = b). - * - * The operation GF(b, 0x02) can be performed at the byte level by left - * shifting b once and then XOR'ing it (to perform the modular reduction) - * with 0x11b if b is >= 128. Repeated application of the multiplication - * of 0x02 can be used to implement the multiplication of any two bytes. - * - * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can - * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these - * factors can each be multiplied by 0x57 and then added together. To do - * the multiplication, values for 0x57 multiplied by each of these 3 factors - * can be precomputed and stored in a table. To add them, the values from - * the table are XOR'd together. - * - * AES also defines addition and multiplication of words, that is 4-byte - * numbers represented as polynomials of 3 degrees where the coefficients - * are the values of the bytes. - * - * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0. - * - * Addition is performed by XOR'ing like powers of x. Multiplication - * is performed in two steps, the first is an algebriac expansion as - * you would do normally (where addition is XOR). But the result is - * a polynomial larger than 3 degrees and thus it cannot fit in a word. So - * next the result is modularly reduced by an AES-specific polynomial of - * degree 4 which will always produce a polynomial of less than 4 degrees - * such that it will fit in a word. In AES, this polynomial is x^4 + 1. - * - * The modular product of two polynomials 'a' and 'b' is thus: - * - * d(x) = d3x^3 + d2x^2 + d1x + d0 - * with - * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3) - * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3) - * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3) - * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3) - * - * As a matrix: - * - * [d0] = [a0 a3 a2 a1][b0] - * [d1] [a1 a0 a3 a2][b1] - * [d2] [a2 a1 a0 a3][b2] - * [d3] [a3 a2 a1 a0][b3] - * - * Special polynomials defined by AES (0x02 == {02}): - * a(x) = {03}x^3 + {01}x^2 + {01}x + {02} - * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}. - * - * These polynomials are used in the MixColumns() and InverseMixColumns() - * operations, respectively, to cause each element in the state to affect - * the output (referred to as diffusing). - * - * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the - * polynomial x3. - * - * The ShiftRows() method modifies the last 3 rows in the state (where - * the state is 4 words with 4 bytes per word) by shifting bytes cyclically. - * The 1st byte in the second row is moved to the end of the row. The 1st - * and 2nd bytes in the third row are moved to the end of the row. The 1st, - * 2nd, and 3rd bytes are moved in the fourth row. - * - * More details on how AES arithmetic works: - * - * In the polynomial representation of binary numbers, XOR performs addition - * and subtraction and multiplication in GF(2^8) denoted as GF(a, b) - * corresponds with the multiplication of polynomials modulo an irreducible - * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply - * polynomial 'a' with polynomial 'b' and then do a modular reduction by - * an AES-specific irreducible polynomial of degree 8. - * - * A polynomial is irreducible if its only divisors are one and itself. For - * the AES algorithm, this irreducible polynomial is: - * - * m(x) = x^8 + x^4 + x^3 + x + 1, - * - * or {01}{1b} in hexadecimal notation, where each coefficient is a bit: - * 100011011 = 283 = 0x11b. - * - * For example, GF(0x57, 0x83) = 0xc1 because - * - * 0x57 = 87 = 01010111 = x^6 + x^4 + x^2 + x + 1 - * 0x85 = 131 = 10000101 = x^7 + x + 1 - * - * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1) - * = x^13 + x^11 + x^9 + x^8 + x^7 + - * x^7 + x^5 + x^3 + x^2 + x + - * x^6 + x^4 + x^2 + x + 1 - * = x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y - * y modulo (x^8 + x^4 + x^3 + x + 1) - * = x^7 + x^6 + 1. - * - * The modular reduction by m(x) guarantees the result will be a binary - * polynomial of less than degree 8, so that it can fit in a byte. - * - * The operation to multiply a binary polynomial b with x (the polynomial - * x in binary representation is 00000010) is: - * - * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1 - * - * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the - * most significant bit is 0 in b) then the result is already reduced. If - * it is 1, then we can reduce it by subtracting m(x) via an XOR. - * - * It follows that multiplication by x (00000010 or 0x02) can be implemented - * by performing a left shift followed by a conditional bitwise XOR with - * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by - * higher powers of x can be implemented by repeated application of xtime(). - * - * By adding intermediate results, multiplication by any constant can be - * implemented. For instance: - * - * GF(0x57, 0x13) = 0xfe because: - * - * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1) - * - * Note: We XOR with 0x11b instead of 0x1b because in javascript our - * datatype for b can be larger than 1 byte, so a left shift will not - * automatically eliminate bits that overflow a byte ... by XOR'ing the - * overflow bit with 1 (the extra one from 0x11b) we zero it out. - * - * GF(0x57, 0x02) = xtime(0x57) = 0xae - * GF(0x57, 0x04) = xtime(0xae) = 0x47 - * GF(0x57, 0x08) = xtime(0x47) = 0x8e - * GF(0x57, 0x10) = xtime(0x8e) = 0x07 - * - * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10)) - * - * And by the distributive property (since XOR is addition and GF() is - * multiplication): - * - * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10) - * = 0x57 ^ 0xae ^ 0x07 - * = 0xfe. - */ -function initialize() { - init = true; - - /* Populate the Rcon table. These are the values given by - [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02) - in the field of GF(2^8), where i starts at 1. - - rcon[0] = [0x00, 0x00, 0x00, 0x00] - rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1 - rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2 - ... - rcon[9] = [0x1B, 0x00, 0x00, 0x00] 2^(9-1) = 2^8 = 0x1B - rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36 - - We only store the first byte because it is the only one used. - */ - rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36]; - - // compute xtime table which maps i onto GF(i, 0x02) - var xtime = new Array(256); - for(var i = 0; i < 128; ++i) { - xtime[i] = i << 1; - xtime[i + 128] = (i + 128) << 1 ^ 0x11B; - } - - // compute all other tables - sbox = new Array(256); - isbox = new Array(256); - mix = new Array(4); - imix = new Array(4); - for(var i = 0; i < 4; ++i) { - mix[i] = new Array(256); - imix[i] = new Array(256); - } - var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime; - for(var i = 0; i < 256; ++i) { - /* We need to generate the SubBytes() sbox and isbox tables so that - we can perform byte substitutions. This requires us to traverse - all of the elements in GF, find their multiplicative inverses, - and apply to each the following affine transformation: - - bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^ - b(i + 7) mod 8 ^ ci - for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the - ith bit of a byte c with the value {63} or {01100011}. - - It is possible to traverse every possible value in a Galois field - using what is referred to as a 'generator'. There are many - generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully - traverse GF we iterate 255 times, multiplying by our generator - each time. - - On each iteration we can determine the multiplicative inverse for - the current element. - - Suppose there is an element in GF 'e'. For a given generator 'g', - e = g^x. The multiplicative inverse of e is g^(255 - x). It turns - out that if use the inverse of a generator as another generator - it will produce all of the corresponding multiplicative inverses - at the same time. For this reason, we choose 5 as our inverse - generator because it only requires 2 multiplies and 1 add and its - inverse, 82, requires relatively few operations as well. - - In order to apply the affine transformation, the multiplicative - inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a - bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and - 'x'. Then 's' is left shifted and the high bit of 's' is made the - low bit. The resulting value is stored in 's'. Then 'x' is XOR'd - with 's' and stored in 'x'. On each subsequent iteration the same - operation is performed. When 4 iterations are complete, 'x' is - XOR'd with 'c' (0x63) and the transformed value is stored in 'x'. - For example: - - s = 01000001 - x = 01000001 - - iteration 1: s = 10000010, x ^= s - iteration 2: s = 00000101, x ^= s - iteration 3: s = 00001010, x ^= s - iteration 4: s = 00010100, x ^= s - x ^= 0x63 - - This can be done with a loop where s = (s << 1) | (s >> 7). However, - it can also be done by using a single 16-bit (in this case 32-bit) - number 'sx'. Since XOR is an associative operation, we can set 'sx' - to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times. - The most significant bits will flow into the high 8 bit positions - and be correctly XOR'd with one another. All that remains will be - to cycle the high 8 bits by XOR'ing them all with the lower 8 bits - afterwards. - - At the same time we're populating sbox and isbox we can precompute - the multiplication we'll need to do to do MixColumns() later. - */ - - // apply affine transformation - sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4); - sx = (sx >> 8) ^ (sx & 255) ^ 0x63; - - // update tables - sbox[e] = sx; - isbox[sx] = e; - - /* Mixing columns is done using matrix multiplication. The columns - that are to be mixed are each a single word in the current state. - The state has Nb columns (4 columns). Therefore each column is a - 4 byte word. So to mix the columns in a single column 'c' where - its rows are r0, r1, r2, and r3, we use the following matrix - multiplication: - - [2 3 1 1]*[r0,c]=[r'0,c] - [1 2 3 1] [r1,c] [r'1,c] - [1 1 2 3] [r2,c] [r'2,c] - [3 1 1 2] [r3,c] [r'3,c] - - r0, r1, r2, and r3 are each 1 byte of one of the words in the - state (a column). To do matrix multiplication for each mixed - column c' we multiply the corresponding row from the left matrix - with the corresponding column from the right matrix. In total, we - get 4 equations: - - r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c - r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c - r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c - r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c - - As usual, the multiplication is as previously defined and the - addition is XOR. In order to optimize mixing columns we can store - the multiplication results in tables. If you think of the whole - column as a word (it might help to visualize by mentally rotating - the equations above by counterclockwise 90 degrees) then you can - see that it would be useful to map the multiplications performed on - each byte (r0, r1, r2, r3) onto a word as well. For instance, we - could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the - highest 8 bits and 3*r0 in the lowest 8 bits (with the other two - respectively in the middle). This means that a table can be - constructed that uses r0 as an index to the word. We can do the - same with r1, r2, and r3, creating a total of 4 tables. - - To construct a full c', we can just look up each byte of c in - their respective tables and XOR the results together. - - Also, to build each table we only have to calculate the word - for 2,1,1,3 for every byte ... which we can do on each iteration - of this loop since we will iterate over every byte. After we have - calculated 2,1,1,3 we can get the results for the other tables - by cycling the byte at the end to the beginning. For instance - we can take the result of table 2,1,1,3 and produce table 3,2,1,1 - by moving the right most byte to the left most position just like - how you can imagine the 3 moved out of 2,1,1,3 and to the front - to produce 3,2,1,1. - - There is another optimization in that the same multiples of - the current element we need in order to advance our generator - to the next iteration can be reused in performing the 2,1,1,3 - calculation. We also calculate the inverse mix column tables, - with e,9,d,b being the inverse of 2,1,1,3. - - When we're done, and we need to actually mix columns, the first - byte of each state word should be put through mix[0] (2,1,1,3), - the second through mix[1] (3,2,1,1) and so forth. Then they should - be XOR'd together to produce the fully mixed column. - */ - - // calculate mix and imix table values - sx2 = xtime[sx]; - e2 = xtime[e]; - e4 = xtime[e2]; - e8 = xtime[e4]; - me = - (sx2 << 24) ^ // 2 - (sx << 16) ^ // 1 - (sx << 8) ^ // 1 - (sx ^ sx2); // 3 - ime = - (e2 ^ e4 ^ e8) << 24 ^ // E (14) - (e ^ e8) << 16 ^ // 9 - (e ^ e4 ^ e8) << 8 ^ // D (13) - (e ^ e2 ^ e8); // B (11) - // produce each of the mix tables by rotating the 2,1,1,3 value - for(var n = 0; n < 4; ++n) { - mix[n][e] = me; - imix[n][sx] = ime; - // cycle the right most byte to the left most position - // ie: 2,1,1,3 becomes 3,2,1,1 - me = me << 24 | me >>> 8; - ime = ime << 24 | ime >>> 8; - } - - // get next element and inverse - if(e === 0) { - // 1 is the inverse of 1 - e = ei = 1; - } else { - // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator) - // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator) - e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; - ei ^= xtime[xtime[ei]]; - } - } -} - -/** - * Generates a key schedule using the AES key expansion algorithm. - * - * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion - * routine to generate a key schedule. The Key Expansion generates a total - * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words, - * and each of the Nr rounds requires Nb words of key data. The resulting - * key schedule consists of a linear array of 4-byte words, denoted [wi ], - * with i in the range 0 <= i < Nb(Nr + 1). - * - * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk) - * AES-128 (Nb=4, Nk=4, Nr=10) - * AES-192 (Nb=4, Nk=6, Nr=12) - * AES-256 (Nb=4, Nk=8, Nr=14) - * Note: Nr=Nk+6. - * - * Nb is the number of columns (32-bit words) comprising the State (or - * number of bytes in a block). For AES, Nb=4. - * - * @param key the key to schedule (as an array of 32-bit words). - * @param decrypt true to modify the key schedule to decrypt, false not to. - * - * @return the generated key schedule. - */ -function _expandKey(key, decrypt) { - // copy the key's words to initialize the key schedule - var w = key.slice(0); - - /* RotWord() will rotate a word, moving the first byte to the last - byte's position (shifting the other bytes left). - - We will be getting the value of Rcon at i / Nk. 'i' will iterate - from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in - a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from - 4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will - increase by 1. We use a counter iNk to keep track of this. - */ - - // go through the rounds expanding the key - var temp, iNk = 1; - var Nk = w.length; - var Nr1 = Nk + 6 + 1; - var end = Nb * Nr1; - for(var i = Nk; i < end; ++i) { - temp = w[i - 1]; - if(i % Nk === 0) { - // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk] - temp = - sbox[temp >>> 16 & 255] << 24 ^ - sbox[temp >>> 8 & 255] << 16 ^ - sbox[temp & 255] << 8 ^ - sbox[temp >>> 24] ^ (rcon[iNk] << 24); - iNk++; - } else if(Nk > 6 && (i % Nk === 4)) { - // temp = SubWord(temp) - temp = - sbox[temp >>> 24] << 24 ^ - sbox[temp >>> 16 & 255] << 16 ^ - sbox[temp >>> 8 & 255] << 8 ^ - sbox[temp & 255]; - } - w[i] = w[i - Nk] ^ temp; - } - - /* When we are updating a cipher block we always use the code path for - encryption whether we are decrypting or not (to shorten code and - simplify the generation of look up tables). However, because there - are differences in the decryption algorithm, other than just swapping - in different look up tables, we must transform our key schedule to - account for these changes: - - 1. The decryption algorithm gets its key rounds in reverse order. - 2. The decryption algorithm adds the round key before mixing columns - instead of afterwards. - - We don't need to modify our key schedule to handle the first case, - we can just traverse the key schedule in reverse order when decrypting. - - The second case requires a little work. - - The tables we built for performing rounds will take an input and then - perform SubBytes() and MixColumns() or, for the decrypt version, - InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires - us to AddRoundKey() before InvMixColumns(). This means we'll need to - apply some transformations to the round key to inverse-mix its columns - so they'll be correct for moving AddRoundKey() to after the state has - had its columns inverse-mixed. - - To inverse-mix the columns of the state when we're decrypting we use a - lookup table that will apply InvSubBytes() and InvMixColumns() at the - same time. However, the round key's bytes are not inverse-substituted - in the decryption algorithm. To get around this problem, we can first - substitute the bytes in the round key so that when we apply the - transformation via the InvSubBytes()+InvMixColumns() table, it will - undo our substitution leaving us with the original value that we - want -- and then inverse-mix that value. - - This change will correctly alter our key schedule so that we can XOR - each round key with our already transformed decryption state. This - allows us to use the same code path as the encryption algorithm. - - We make one more change to the decryption key. Since the decryption - algorithm runs in reverse from the encryption algorithm, we reverse - the order of the round keys to avoid having to iterate over the key - schedule backwards when running the encryption algorithm later in - decryption mode. In addition to reversing the order of the round keys, - we also swap each round key's 2nd and 4th rows. See the comments - section where rounds are performed for more details about why this is - done. These changes are done inline with the other substitution - described above. - */ - if(decrypt) { - var tmp; - var m0 = imix[0]; - var m1 = imix[1]; - var m2 = imix[2]; - var m3 = imix[3]; - var wnew = w.slice(0); - end = w.length; - for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) { - // do not sub the first or last round key (round keys are Nb - // words) as no column mixing is performed before they are added, - // but do change the key order - if(i === 0 || i === (end - Nb)) { - wnew[i] = w[wi]; - wnew[i + 1] = w[wi + 3]; - wnew[i + 2] = w[wi + 2]; - wnew[i + 3] = w[wi + 1]; - } else { - // substitute each round key byte because the inverse-mix - // table will inverse-substitute it (effectively cancel the - // substitution because round key bytes aren't sub'd in - // decryption mode) and swap indexes 3 and 1 - for(var n = 0; n < Nb; ++n) { - tmp = w[wi + n]; - wnew[i + (3&-n)] = - m0[sbox[tmp >>> 24]] ^ - m1[sbox[tmp >>> 16 & 255]] ^ - m2[sbox[tmp >>> 8 & 255]] ^ - m3[sbox[tmp & 255]]; - } - } - } - w = wnew; - } - - return w; -} - -/** - * Updates a single block (16 bytes) using AES. The update will either - * encrypt or decrypt the block. - * - * @param w the key schedule. - * @param input the input block (an array of 32-bit words). - * @param output the updated output block. - * @param decrypt true to decrypt the block, false to encrypt it. - */ -function _updateBlock(w, input, output, decrypt) { - /* - Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) - begin - byte state[4,Nb] - state = in - AddRoundKey(state, w[0, Nb-1]) - for round = 1 step 1 to Nr-1 - SubBytes(state) - ShiftRows(state) - MixColumns(state) - AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - end for - SubBytes(state) - ShiftRows(state) - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - out = state - end - - InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)]) - begin - byte state[4,Nb] - state = in - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - for round = Nr-1 step -1 downto 1 - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[round*Nb, (round+1)*Nb-1]) - InvMixColumns(state) - end for - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[0, Nb-1]) - out = state - end - */ - - // Encrypt: AddRoundKey(state, w[0, Nb-1]) - // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - var Nr = w.length / 4 - 1; - var m0, m1, m2, m3, sub; - if(decrypt) { - m0 = imix[0]; - m1 = imix[1]; - m2 = imix[2]; - m3 = imix[3]; - sub = isbox; - } else { - m0 = mix[0]; - m1 = mix[1]; - m2 = mix[2]; - m3 = mix[3]; - sub = sbox; - } - var a, b, c, d, a2, b2, c2; - a = input[0] ^ w[0]; - b = input[decrypt ? 3 : 1] ^ w[1]; - c = input[2] ^ w[2]; - d = input[decrypt ? 1 : 3] ^ w[3]; - var i = 3; - - /* In order to share code we follow the encryption algorithm when both - encrypting and decrypting. To account for the changes required in the - decryption algorithm, we use different lookup tables when decrypting - and use a modified key schedule to account for the difference in the - order of transformations applied when performing rounds. We also get - key rounds in reverse order (relative to encryption). */ - for(var round = 1; round < Nr; ++round) { - /* As described above, we'll be using table lookups to perform the - column mixing. Each column is stored as a word in the state (the - array 'input' has one column as a word at each index). In order to - mix a column, we perform these transformations on each row in c, - which is 1 byte in each word. The new column for c0 is c'0: - - m0 m1 m2 m3 - r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0 - r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0 - r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0 - r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0 - - So using mix tables where c0 is a word with r0 being its upper - 8 bits and r3 being its lower 8 bits: - - m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0] - ... - m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3] - - Therefore to mix the columns in each word in the state we - do the following (& 255 omitted for brevity): - c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3] - - However, before mixing, the algorithm requires us to perform - ShiftRows(). The ShiftRows() transformation cyclically shifts the - last 3 rows of the state over different offsets. The first row - (r = 0) is not shifted. - - s'_r,c = s_r,(c + shift(r, Nb) mod Nb - for 0 < r < 4 and 0 <= c < Nb and - shift(1, 4) = 1 - shift(2, 4) = 2 - shift(3, 4) = 3. - - This causes the first byte in r = 1 to be moved to the end of - the row, the first 2 bytes in r = 2 to be moved to the end of - the row, the first 3 bytes in r = 3 to be moved to the end of - the row: - - r1: [c0 c1 c2 c3] => [c1 c2 c3 c0] - r2: [c0 c1 c2 c3] [c2 c3 c0 c1] - r3: [c0 c1 c2 c3] [c3 c0 c1 c2] - - We can make these substitutions inline with our column mixing to - generate an updated set of equations to produce each word in the - state (note the columns have changed positions): - - c0 c1 c2 c3 => c0 c1 c2 c3 - c0 c1 c2 c3 c1 c2 c3 c0 (cycled 1 byte) - c0 c1 c2 c3 c2 c3 c0 c1 (cycled 2 bytes) - c0 c1 c2 c3 c3 c0 c1 c2 (cycled 3 bytes) - - Therefore: - - c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3 - c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3 - c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3 - c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3 - - c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0 - c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0 - c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0 - c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0 - - ... and so forth for c'2 and c'3. The important distinction is - that the columns are cycling, with c0 being used with the m0 - map when calculating c0, but c1 being used with the m0 map when - calculating c1 ... and so forth. - - When performing the inverse we transform the mirror image and - skip the bottom row, instead of the top one, and move upwards: - - c3 c2 c1 c0 => c0 c3 c2 c1 (cycled 3 bytes) *same as encryption - c3 c2 c1 c0 c1 c0 c3 c2 (cycled 2 bytes) - c3 c2 c1 c0 c2 c1 c0 c3 (cycled 1 byte) *same as encryption - c3 c2 c1 c0 c3 c2 c1 c0 - - If you compare the resulting matrices for ShiftRows()+MixColumns() - and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are - different (in encrypt mode vs. decrypt mode). So in order to use - the same code to handle both encryption and decryption, we will - need to do some mapping. - - If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r be - a row number in the state, then the resulting matrix in encryption - mode for applying the above transformations would be: - - r1: a b c d - r2: b c d a - r3: c d a b - r4: d a b c - - If we did the same in decryption mode we would get: - - r1: a d c b - r2: b a d c - r3: c b a d - r4: d c b a - - If instead we swap d and b (set b=c3 and d=c1), then we get: - - r1: a b c d - r2: d a b c - r3: c d a b - r4: b c d a - - Now the 1st and 3rd rows are the same as the encryption matrix. All - we need to do then to make the mapping exactly the same is to swap - the 2nd and 4th rows when in decryption mode. To do this without - having to do it on each iteration, we swapped the 2nd and 4th rows - in the decryption key schedule. We also have to do the swap above - when we first pull in the input and when we set the final output. */ - a2 = - m0[a >>> 24] ^ - m1[b >>> 16 & 255] ^ - m2[c >>> 8 & 255] ^ - m3[d & 255] ^ w[++i]; - b2 = - m0[b >>> 24] ^ - m1[c >>> 16 & 255] ^ - m2[d >>> 8 & 255] ^ - m3[a & 255] ^ w[++i]; - c2 = - m0[c >>> 24] ^ - m1[d >>> 16 & 255] ^ - m2[a >>> 8 & 255] ^ - m3[b & 255] ^ w[++i]; - d = - m0[d >>> 24] ^ - m1[a >>> 16 & 255] ^ - m2[b >>> 8 & 255] ^ - m3[c & 255] ^ w[++i]; - a = a2; - b = b2; - c = c2; - } - - /* - Encrypt: - SubBytes(state) - ShiftRows(state) - AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1]) - - Decrypt: - InvShiftRows(state) - InvSubBytes(state) - AddRoundKey(state, w[0, Nb-1]) - */ - // Note: rows are shifted inline - output[0] = - (sub[a >>> 24] << 24) ^ - (sub[b >>> 16 & 255] << 16) ^ - (sub[c >>> 8 & 255] << 8) ^ - (sub[d & 255]) ^ w[++i]; - output[decrypt ? 3 : 1] = - (sub[b >>> 24] << 24) ^ - (sub[c >>> 16 & 255] << 16) ^ - (sub[d >>> 8 & 255] << 8) ^ - (sub[a & 255]) ^ w[++i]; - output[2] = - (sub[c >>> 24] << 24) ^ - (sub[d >>> 16 & 255] << 16) ^ - (sub[a >>> 8 & 255] << 8) ^ - (sub[b & 255]) ^ w[++i]; - output[decrypt ? 1 : 3] = - (sub[d >>> 24] << 24) ^ - (sub[a >>> 16 & 255] << 16) ^ - (sub[b >>> 8 & 255] << 8) ^ - (sub[c & 255]) ^ w[++i]; -} - -/** - * Deprecated. Instead, use: - * - * forge.cipher.createCipher('AES-', key); - * forge.cipher.createDecipher('AES-', key); - * - * Creates a deprecated AES cipher object. This object's mode will default to - * CBC (cipher-block-chaining). - * - * The key and iv may be given as a string of bytes, an array of bytes, a - * byte buffer, or an array of 32-bit words. - * - * @param options the options to use. - * key the symmetric key to use. - * output the buffer to write to. - * decrypt true for decryption, false for encryption. - * mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -function _createCipher(options) { - options = options || {}; - var mode = (options.mode || 'CBC').toUpperCase(); - var algorithm = 'AES-' + mode; - - var cipher; - if(options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - - // backwards compatible start API - var start = cipher.start; - cipher.start = function(iv, options) { - // backwards compatibility: support second arg as output buffer - var output = null; - if(options instanceof forge.util.ByteBuffer) { - output = options; - options = {}; - } - options = options || {}; - options.output = output; - options.iv = iv; - start.call(cipher, options); - }; - - return cipher; -} diff --git a/node_modules/node-forge/lib/aesCipherSuites.js b/node_modules/node-forge/lib/aesCipherSuites.js deleted file mode 100644 index fed60f3..0000000 --- a/node_modules/node-forge/lib/aesCipherSuites.js +++ /dev/null @@ -1,282 +0,0 @@ -/** - * A Javascript implementation of AES Cipher Suites for TLS. - * - * @author Dave Longley - * - * Copyright (c) 2009-2015 Digital Bazaar, Inc. - * - */ -var forge = require('./forge'); -require('./aes'); -require('./tls'); - -var tls = module.exports = forge.tls; - -/** - * Supported cipher suites. - */ -tls.CipherSuites['TLS_RSA_WITH_AES_128_CBC_SHA'] = { - id: [0x00, 0x2f], - name: 'TLS_RSA_WITH_AES_128_CBC_SHA', - initSecurityParameters: function(sp) { - sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; - sp.cipher_type = tls.CipherType.block; - sp.enc_key_length = 16; - sp.block_length = 16; - sp.fixed_iv_length = 16; - sp.record_iv_length = 16; - sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; - sp.mac_length = 20; - sp.mac_key_length = 20; - }, - initConnectionState: initConnectionState -}; -tls.CipherSuites['TLS_RSA_WITH_AES_256_CBC_SHA'] = { - id: [0x00, 0x35], - name: 'TLS_RSA_WITH_AES_256_CBC_SHA', - initSecurityParameters: function(sp) { - sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes; - sp.cipher_type = tls.CipherType.block; - sp.enc_key_length = 32; - sp.block_length = 16; - sp.fixed_iv_length = 16; - sp.record_iv_length = 16; - sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1; - sp.mac_length = 20; - sp.mac_key_length = 20; - }, - initConnectionState: initConnectionState -}; - -function initConnectionState(state, c, sp) { - var client = (c.entity === forge.tls.ConnectionEnd.client); - - // cipher setup - state.read.cipherState = { - init: false, - cipher: forge.cipher.createDecipher('AES-CBC', client ? - sp.keys.server_write_key : sp.keys.client_write_key), - iv: client ? sp.keys.server_write_IV : sp.keys.client_write_IV - }; - state.write.cipherState = { - init: false, - cipher: forge.cipher.createCipher('AES-CBC', client ? - sp.keys.client_write_key : sp.keys.server_write_key), - iv: client ? sp.keys.client_write_IV : sp.keys.server_write_IV - }; - state.read.cipherFunction = decrypt_aes_cbc_sha1; - state.write.cipherFunction = encrypt_aes_cbc_sha1; - - // MAC setup - state.read.macLength = state.write.macLength = sp.mac_length; - state.read.macFunction = state.write.macFunction = tls.hmac_sha1; -} - -/** - * Encrypts the TLSCompressed record into a TLSCipherText record using AES - * in CBC mode. - * - * @param record the TLSCompressed record to encrypt. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -function encrypt_aes_cbc_sha1(record, s) { - var rval = false; - - // append MAC to fragment, update sequence number - var mac = s.macFunction(s.macKey, s.sequenceNumber, record); - record.fragment.putBytes(mac); - s.updateSequenceNumber(); - - // TLS 1.1+ use an explicit IV every time to protect against CBC attacks - var iv; - if(record.version.minor === tls.Versions.TLS_1_0.minor) { - // use the pre-generated IV when initializing for TLS 1.0, otherwise use - // the residue from the previous encryption - iv = s.cipherState.init ? null : s.cipherState.iv; - } else { - iv = forge.random.getBytesSync(16); - } - - s.cipherState.init = true; - - // start cipher - var cipher = s.cipherState.cipher; - cipher.start({iv: iv}); - - // TLS 1.1+ write IV into output - if(record.version.minor >= tls.Versions.TLS_1_1.minor) { - cipher.output.putBytes(iv); - } - - // do encryption (default padding is appropriate) - cipher.update(record.fragment); - if(cipher.finish(encrypt_aes_cbc_sha1_padding)) { - // set record fragment to encrypted output - record.fragment = cipher.output; - record.length = record.fragment.length(); - rval = true; - } - - return rval; -} - -/** - * Handles padding for aes_cbc_sha1 in encrypt mode. - * - * @param blockSize the block size. - * @param input the input buffer. - * @param decrypt true in decrypt mode, false in encrypt mode. - * - * @return true on success, false on failure. - */ -function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) { - /* The encrypted data length (TLSCiphertext.length) is one more than the sum - of SecurityParameters.block_length, TLSCompressed.length, - SecurityParameters.mac_length, and padding_length. - - The padding may be any length up to 255 bytes long, as long as it results in - the TLSCiphertext.length being an integral multiple of the block length. - Lengths longer than necessary might be desirable to frustrate attacks on a - protocol based on analysis of the lengths of exchanged messages. Each uint8 - in the padding data vector must be filled with the padding length value. - - The padding length should be such that the total size of the - GenericBlockCipher structure is a multiple of the cipher's block length. - Legal values range from zero to 255, inclusive. This length specifies the - length of the padding field exclusive of the padding_length field itself. - - This is slightly different from PKCS#7 because the padding value is 1 - less than the actual number of padding bytes if you include the - padding_length uint8 itself as a padding byte. */ - if(!decrypt) { - // get the number of padding bytes required to reach the blockSize and - // subtract 1 for the padding value (to make room for the padding_length - // uint8) - var padding = blockSize - (input.length() % blockSize); - input.fillWithByte(padding - 1, padding); - } - return true; -} - -/** - * Handles padding for aes_cbc_sha1 in decrypt mode. - * - * @param blockSize the block size. - * @param output the output buffer. - * @param decrypt true in decrypt mode, false in encrypt mode. - * - * @return true on success, false on failure. - */ -function decrypt_aes_cbc_sha1_padding(blockSize, output, decrypt) { - var rval = true; - if(decrypt) { - /* The last byte in the output specifies the number of padding bytes not - including itself. Each of the padding bytes has the same value as that - last byte (known as the padding_length). Here we check all padding - bytes to ensure they have the value of padding_length even if one of - them is bad in order to ward-off timing attacks. */ - var len = output.length(); - var paddingLength = output.last(); - for(var i = len - 1 - paddingLength; i < len - 1; ++i) { - rval = rval && (output.at(i) == paddingLength); - } - if(rval) { - // trim off padding bytes and last padding length byte - output.truncate(paddingLength + 1); - } - } - return rval; -} - -/** - * Decrypts a TLSCipherText record into a TLSCompressed record using - * AES in CBC mode. - * - * @param record the TLSCipherText record to decrypt. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -function decrypt_aes_cbc_sha1(record, s) { - var rval = false; - - var iv; - if(record.version.minor === tls.Versions.TLS_1_0.minor) { - // use pre-generated IV when initializing for TLS 1.0, otherwise use the - // residue from the previous decryption - iv = s.cipherState.init ? null : s.cipherState.iv; - } else { - // TLS 1.1+ use an explicit IV every time to protect against CBC attacks - // that is appended to the record fragment - iv = record.fragment.getBytes(16); - } - - s.cipherState.init = true; - - // start cipher - var cipher = s.cipherState.cipher; - cipher.start({iv: iv}); - - // do decryption - cipher.update(record.fragment); - rval = cipher.finish(decrypt_aes_cbc_sha1_padding); - - // even if decryption fails, keep going to minimize timing attacks - - // decrypted data: - // first (len - 20) bytes = application data - // last 20 bytes = MAC - var macLen = s.macLength; - - // create a random MAC to check against should the mac length check fail - // Note: do this regardless of the failure to keep timing consistent - var mac = forge.random.getBytesSync(macLen); - - // get fragment and mac - var len = cipher.output.length(); - if(len >= macLen) { - record.fragment = cipher.output.getBytes(len - macLen); - mac = cipher.output.getBytes(macLen); - } else { - // bad data, but get bytes anyway to try to keep timing consistent - record.fragment = cipher.output.getBytes(); - } - record.fragment = forge.util.createBuffer(record.fragment); - record.length = record.fragment.length(); - - // see if data integrity checks out, update sequence number - var mac2 = s.macFunction(s.macKey, s.sequenceNumber, record); - s.updateSequenceNumber(); - rval = compareMacs(s.macKey, mac, mac2) && rval; - return rval; -} - -/** - * Safely compare two MACs. This function will compare two MACs in a way - * that protects against timing attacks. - * - * TODO: Expose elsewhere as a utility API. - * - * See: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/ - * - * @param key the MAC key to use. - * @param mac1 as a binary-encoded string of bytes. - * @param mac2 as a binary-encoded string of bytes. - * - * @return true if the MACs are the same, false if not. - */ -function compareMacs(key, mac1, mac2) { - var hmac = forge.hmac.create(); - - hmac.start('SHA1', key); - hmac.update(mac1); - mac1 = hmac.digest().getBytes(); - - hmac.start(null, null); - hmac.update(mac2); - mac2 = hmac.digest().getBytes(); - - return mac1 === mac2; -} diff --git a/node_modules/node-forge/lib/asn1-validator.js b/node_modules/node-forge/lib/asn1-validator.js deleted file mode 100644 index 2be3285..0000000 --- a/node_modules/node-forge/lib/asn1-validator.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2019 Digital Bazaar, Inc. - */ - -var forge = require('./forge'); -require('./asn1'); -var asn1 = forge.asn1; - -exports.privateKeyValidator = { - // PrivateKeyInfo - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'PrivateKeyInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // privateKeyAlgorithm - name: 'PrivateKeyInfo.privateKeyAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'privateKeyOid' - }] - }, { - // PrivateKey - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'privateKey' - }] -}; - -exports.publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, - // capture group for ed25519PublicKey - { - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - composed: true, - captureBitStringValue: 'ed25519PublicKey' - } - // FIXME: this is capture group for rsaPublicKey, use it in this API or - // discard? - /* { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - } */ - ] -}; diff --git a/node_modules/node-forge/lib/asn1.js b/node_modules/node-forge/lib/asn1.js deleted file mode 100644 index e0fea0e..0000000 --- a/node_modules/node-forge/lib/asn1.js +++ /dev/null @@ -1,1408 +0,0 @@ -/** - * Javascript implementation of Abstract Syntax Notation Number One. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - * - * An API for storing data using the Abstract Syntax Notation Number One - * format using DER (Distinguished Encoding Rules) encoding. This encoding is - * commonly used to store data for PKI, i.e. X.509 Certificates, and this - * implementation exists for that purpose. - * - * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract - * syntax of information without restricting the way the information is encoded - * for transmission. It provides a standard that allows for open systems - * communication. ASN.1 defines the syntax of information data and a number of - * simple data types as well as a notation for describing them and specifying - * values for them. - * - * The RSA algorithm creates public and private keys that are often stored in - * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This - * class provides the most basic functionality required to store and load DSA - * keys that are encoded according to ASN.1. - * - * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules) - * and DER (Distinguished Encoding Rules). DER is just a subset of BER that - * has stricter requirements for how data must be encoded. - * - * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type) - * and a byte array for the value of this ASN1 structure which may be data or a - * list of ASN.1 structures. - * - * Each ASN.1 structure using BER is (Tag-Length-Value): - * - * | byte 0 | bytes X | bytes Y | - * |--------|---------|---------- - * | tag | length | value | - * - * ASN.1 allows for tags to be of "High-tag-number form" which allows a tag to - * be two or more octets, but that is not supported by this class. A tag is - * only 1 byte. Bits 1-5 give the tag number (ie the data type within a - * particular 'class'), 6 indicates whether or not the ASN.1 value is - * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If - * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set, - * then the class is APPLICATION. If only bit 8 is set, then the class is - * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE. - * The tag numbers for the data types for the class UNIVERSAL are listed below: - * - * UNIVERSAL 0 Reserved for use by the encoding rules - * UNIVERSAL 1 Boolean type - * UNIVERSAL 2 Integer type - * UNIVERSAL 3 Bitstring type - * UNIVERSAL 4 Octetstring type - * UNIVERSAL 5 Null type - * UNIVERSAL 6 Object identifier type - * UNIVERSAL 7 Object descriptor type - * UNIVERSAL 8 External type and Instance-of type - * UNIVERSAL 9 Real type - * UNIVERSAL 10 Enumerated type - * UNIVERSAL 11 Embedded-pdv type - * UNIVERSAL 12 UTF8String type - * UNIVERSAL 13 Relative object identifier type - * UNIVERSAL 14-15 Reserved for future editions - * UNIVERSAL 16 Sequence and Sequence-of types - * UNIVERSAL 17 Set and Set-of types - * UNIVERSAL 18-22, 25-30 Character string types - * UNIVERSAL 23-24 Time types - * - * The length of an ASN.1 structure is specified after the tag identifier. - * There is a definite form and an indefinite form. The indefinite form may - * be used if the encoding is constructed and not all immediately available. - * The indefinite form is encoded using a length byte with only the 8th bit - * set. The end of the constructed object is marked using end-of-contents - * octets (two zero bytes). - * - * The definite form looks like this: - * - * The length may take up 1 or more bytes, it depends on the length of the - * value of the ASN.1 structure. DER encoding requires that if the ASN.1 - * structure has a value that has a length greater than 127, more than 1 byte - * will be used to store its length, otherwise just one byte will be used. - * This is strict. - * - * In the case that the length of the ASN.1 value is less than 127, 1 octet - * (byte) is used to store the "short form" length. The 8th bit has a value of - * 0 indicating the length is "short form" and not "long form" and bits 7-1 - * give the length of the data. (The 8th bit is the left-most, most significant - * bit: also known as big endian or network format). - * - * In the case that the length of the ASN.1 value is greater than 127, 2 to - * 127 octets (bytes) are used to store the "long form" length. The first - * byte's 8th bit is set to 1 to indicate the length is "long form." Bits 7-1 - * give the number of additional octets. All following octets are in base 256 - * with the most significant digit first (typical big-endian binary unsigned - * integer storage). So, for instance, if the length of a value was 257, the - * first byte would be set to: - * - * 10000010 = 130 = 0x82. - * - * This indicates there are 2 octets (base 256) for the length. The second and - * third bytes (the octets just mentioned) would store the length in base 256: - * - * octet 2: 00000001 = 1 * 256^1 = 256 - * octet 3: 00000001 = 1 * 256^0 = 1 - * total = 257 - * - * The algorithm for converting a js integer value of 257 to base-256 is: - * - * var value = 257; - * var bytes = []; - * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first - * bytes[1] = value & 0xFF; // least significant byte last - * - * On the ASN.1 UNIVERSAL Object Identifier (OID) type: - * - * An OID can be written like: "value1.value2.value3...valueN" - * - * The DER encoding rules: - * - * The first byte has the value 40 * value1 + value2. - * The following bytes, if any, encode the remaining values. Each value is - * encoded in base 128, most significant digit first (big endian), with as - * few digits as possible, and the most significant bit of each byte set - * to 1 except the last in each value's encoding. For example: Given the - * OID "1.2.840.113549", its DER encoding is (remember each byte except the - * last one in each encoding is OR'd with 0x80): - * - * byte 1: 40 * 1 + 2 = 42 = 0x2A. - * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648 - * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D - * - * The final value is: 0x2A864886F70D. - * The full OID (including ASN.1 tag and length of 6 bytes) is: - * 0x06062A864886F70D - */ -var forge = require('./forge'); -require('./util'); -require('./oids'); - -/* ASN.1 API */ -var asn1 = module.exports = forge.asn1 = forge.asn1 || {}; - -/** - * ASN.1 classes. - */ -asn1.Class = { - UNIVERSAL: 0x00, - APPLICATION: 0x40, - CONTEXT_SPECIFIC: 0x80, - PRIVATE: 0xC0 -}; - -/** - * ASN.1 types. Not all types are supported by this implementation, only - * those necessary to implement a simple PKI are implemented. - */ -asn1.Type = { - NONE: 0, - BOOLEAN: 1, - INTEGER: 2, - BITSTRING: 3, - OCTETSTRING: 4, - NULL: 5, - OID: 6, - ODESC: 7, - EXTERNAL: 8, - REAL: 9, - ENUMERATED: 10, - EMBEDDED: 11, - UTF8: 12, - ROID: 13, - SEQUENCE: 16, - SET: 17, - PRINTABLESTRING: 19, - IA5STRING: 22, - UTCTIME: 23, - GENERALIZEDTIME: 24, - BMPSTRING: 30 -}; - -/** - * Creates a new asn1 object. - * - * @param tagClass the tag class for the object. - * @param type the data type (tag number) for the object. - * @param constructed true if the asn1 object is in constructed form. - * @param value the value for the object, if it is not constructed. - * @param [options] the options to use: - * [bitStringContents] the plain BIT STRING content including padding - * byte. - * - * @return the asn1 object. - */ -asn1.create = function(tagClass, type, constructed, value, options) { - /* An asn1 object has a tagClass, a type, a constructed flag, and a - value. The value's type depends on the constructed flag. If - constructed, it will contain a list of other asn1 objects. If not, - it will contain the ASN.1 value as an array of bytes formatted - according to the ASN.1 data type. */ - - // remove undefined values - if(forge.util.isArray(value)) { - var tmp = []; - for(var i = 0; i < value.length; ++i) { - if(value[i] !== undefined) { - tmp.push(value[i]); - } - } - value = tmp; - } - - var obj = { - tagClass: tagClass, - type: type, - constructed: constructed, - composed: constructed || forge.util.isArray(value), - value: value - }; - if(options && 'bitStringContents' in options) { - // TODO: copy byte buffer if it's a buffer not a string - obj.bitStringContents = options.bitStringContents; - // TODO: add readonly flag to avoid this overhead - // save copy to detect changes - obj.original = asn1.copy(obj); - } - return obj; -}; - -/** - * Copies an asn1 object. - * - * @param obj the asn1 object. - * @param [options] copy options: - * [excludeBitStringContents] true to not copy bitStringContents - * - * @return the a copy of the asn1 object. - */ -asn1.copy = function(obj, options) { - var copy; - - if(forge.util.isArray(obj)) { - copy = []; - for(var i = 0; i < obj.length; ++i) { - copy.push(asn1.copy(obj[i], options)); - } - return copy; - } - - if(typeof obj === 'string') { - // TODO: copy byte buffer if it's a buffer not a string - return obj; - } - - copy = { - tagClass: obj.tagClass, - type: obj.type, - constructed: obj.constructed, - composed: obj.composed, - value: asn1.copy(obj.value, options) - }; - if(options && !options.excludeBitStringContents) { - // TODO: copy byte buffer if it's a buffer not a string - copy.bitStringContents = obj.bitStringContents; - } - return copy; -}; - -/** - * Compares asn1 objects for equality. - * - * Note this function does not run in constant time. - * - * @param obj1 the first asn1 object. - * @param obj2 the second asn1 object. - * @param [options] compare options: - * [includeBitStringContents] true to compare bitStringContents - * - * @return true if the asn1 objects are equal. - */ -asn1.equals = function(obj1, obj2, options) { - if(forge.util.isArray(obj1)) { - if(!forge.util.isArray(obj2)) { - return false; - } - if(obj1.length !== obj2.length) { - return false; - } - for(var i = 0; i < obj1.length; ++i) { - if(!asn1.equals(obj1[i], obj2[i])) { - return false; - } - } - return true; - } - - if(typeof obj1 !== typeof obj2) { - return false; - } - - if(typeof obj1 === 'string') { - return obj1 === obj2; - } - - var equal = obj1.tagClass === obj2.tagClass && - obj1.type === obj2.type && - obj1.constructed === obj2.constructed && - obj1.composed === obj2.composed && - asn1.equals(obj1.value, obj2.value); - if(options && options.includeBitStringContents) { - equal = equal && (obj1.bitStringContents === obj2.bitStringContents); - } - - return equal; -}; - -/** - * Gets the length of a BER-encoded ASN.1 value. - * - * In case the length is not specified, undefined is returned. - * - * @param b the BER-encoded ASN.1 byte buffer, starting with the first - * length byte. - * - * @return the length of the BER-encoded ASN.1 value or undefined. - */ -asn1.getBerValueLength = function(b) { - // TODO: move this function and related DER/BER functions to a der.js - // file; better abstract ASN.1 away from der/ber. - var b2 = b.getByte(); - if(b2 === 0x80) { - return undefined; - } - - // see if the length is "short form" or "long form" (bit 8 set) - var length; - var longForm = b2 & 0x80; - if(!longForm) { - // length is just the first byte - length = b2; - } else { - // the number of bytes the length is specified in bits 7 through 1 - // and each length byte is in big-endian base-256 - length = b.getInt((b2 & 0x7F) << 3); - } - return length; -}; - -/** - * Check if the byte buffer has enough bytes. Throws an Error if not. - * - * @param bytes the byte buffer to parse from. - * @param remaining the bytes remaining in the current parsing state. - * @param n the number of bytes the buffer must have. - */ -function _checkBufferLength(bytes, remaining, n) { - if(n > remaining) { - var error = new Error('Too few bytes to parse DER.'); - error.available = bytes.length(); - error.remaining = remaining; - error.requested = n; - throw error; - } -} - -/** - * Gets the length of a BER-encoded ASN.1 value. - * - * In case the length is not specified, undefined is returned. - * - * @param bytes the byte buffer to parse from. - * @param remaining the bytes remaining in the current parsing state. - * - * @return the length of the BER-encoded ASN.1 value or undefined. - */ -var _getValueLength = function(bytes, remaining) { - // TODO: move this function and related DER/BER functions to a der.js - // file; better abstract ASN.1 away from der/ber. - // fromDer already checked that this byte exists - var b2 = bytes.getByte(); - remaining--; - if(b2 === 0x80) { - return undefined; - } - - // see if the length is "short form" or "long form" (bit 8 set) - var length; - var longForm = b2 & 0x80; - if(!longForm) { - // length is just the first byte - length = b2; - } else { - // the number of bytes the length is specified in bits 7 through 1 - // and each length byte is in big-endian base-256 - var longFormBytes = b2 & 0x7F; - _checkBufferLength(bytes, remaining, longFormBytes); - length = bytes.getInt(longFormBytes << 3); - } - // FIXME: this will only happen for 32 bit getInt with high bit set - if(length < 0) { - throw new Error('Negative length: ' + length); - } - return length; -}; - -/** - * Parses an asn1 object from a byte buffer in DER format. - * - * @param bytes the byte buffer to parse from. - * @param [strict] true to be strict when checking value lengths, false to - * allow truncated values (default: true). - * @param [options] object with options or boolean strict flag - * [strict] true to be strict when checking value lengths, false to - * allow truncated values (default: true). - * [decodeBitStrings] true to attempt to decode the content of - * BIT STRINGs (not OCTET STRINGs) using strict mode. Note that - * without schema support to understand the data context this can - * erroneously decode values that happen to be valid ASN.1. This - * flag will be deprecated or removed as soon as schema support is - * available. (default: true) - * - * @return the parsed asn1 object. - */ -asn1.fromDer = function(bytes, options) { - if(options === undefined) { - options = { - strict: true, - decodeBitStrings: true - }; - } - if(typeof options === 'boolean') { - options = { - strict: options, - decodeBitStrings: true - }; - } - if(!('strict' in options)) { - options.strict = true; - } - if(!('decodeBitStrings' in options)) { - options.decodeBitStrings = true; - } - - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - return _fromDer(bytes, bytes.length(), 0, options); -}; - -/** - * Internal function to parse an asn1 object from a byte buffer in DER format. - * - * @param bytes the byte buffer to parse from. - * @param remaining the number of bytes remaining for this chunk. - * @param depth the current parsing depth. - * @param options object with same options as fromDer(). - * - * @return the parsed asn1 object. - */ -function _fromDer(bytes, remaining, depth, options) { - // temporary storage for consumption calculations - var start; - - // minimum length for ASN.1 DER structure is 2 - _checkBufferLength(bytes, remaining, 2); - - // get the first byte - var b1 = bytes.getByte(); - // consumed one byte - remaining--; - - // get the tag class - var tagClass = (b1 & 0xC0); - - // get the type (bits 1-5) - var type = b1 & 0x1F; - - // get the variable value length and adjust remaining bytes - start = bytes.length(); - var length = _getValueLength(bytes, remaining); - remaining -= start - bytes.length(); - - // ensure there are enough bytes to get the value - if(length !== undefined && length > remaining) { - if(options.strict) { - var error = new Error('Too few bytes to read ASN.1 value.'); - error.available = bytes.length(); - error.remaining = remaining; - error.requested = length; - throw error; - } - // Note: be lenient with truncated values and use remaining state bytes - length = remaining; - } - - // value storage - var value; - // possible BIT STRING contents storage - var bitStringContents; - - // constructed flag is bit 6 (32 = 0x20) of the first byte - var constructed = ((b1 & 0x20) === 0x20); - if(constructed) { - // parse child asn1 objects from the value - value = []; - if(length === undefined) { - // asn1 object of indefinite length, read until end tag - for(;;) { - _checkBufferLength(bytes, remaining, 2); - if(bytes.bytes(2) === String.fromCharCode(0, 0)) { - bytes.getBytes(2); - remaining -= 2; - break; - } - start = bytes.length(); - value.push(_fromDer(bytes, remaining, depth + 1, options)); - remaining -= start - bytes.length(); - } - } else { - // parsing asn1 object of definite length - while(length > 0) { - start = bytes.length(); - value.push(_fromDer(bytes, length, depth + 1, options)); - remaining -= start - bytes.length(); - length -= start - bytes.length(); - } - } - } - - // if a BIT STRING, save the contents including padding - if(value === undefined && tagClass === asn1.Class.UNIVERSAL && - type === asn1.Type.BITSTRING) { - bitStringContents = bytes.bytes(length); - } - - // determine if a non-constructed value should be decoded as a composed - // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs) - // can be used this way. - if(value === undefined && options.decodeBitStrings && - tagClass === asn1.Class.UNIVERSAL && - // FIXME: OCTET STRINGs not yet supported here - // .. other parts of forge expect to decode OCTET STRINGs manually - (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) && - length > 1) { - // save read position - var savedRead = bytes.read; - var savedRemaining = remaining; - var unused = 0; - if(type === asn1.Type.BITSTRING) { - /* The first octet gives the number of bits by which the length of the - bit string is less than the next multiple of eight (this is called - the "number of unused bits"). - - The second and following octets give the value of the bit string - converted to an octet string. */ - _checkBufferLength(bytes, remaining, 1); - unused = bytes.getByte(); - remaining--; - } - // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs - if(unused === 0) { - try { - // attempt to parse child asn1 object from the value - // (stored in array to signal composed value) - start = bytes.length(); - var subOptions = { - // enforce strict mode to avoid parsing ASN.1 from plain data - verbose: options.verbose, - strict: true, - decodeBitStrings: true - }; - var composed = _fromDer(bytes, remaining, depth + 1, subOptions); - var used = start - bytes.length(); - remaining -= used; - if(type == asn1.Type.BITSTRING) { - used++; - } - - // if the data all decoded and the class indicates UNIVERSAL or - // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object - var tc = composed.tagClass; - if(used === length && - (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { - value = [composed]; - } - } catch(ex) { - } - } - if(value === undefined) { - // restore read position - bytes.read = savedRead; - remaining = savedRemaining; - } - } - - if(value === undefined) { - // asn1 not constructed or composed, get raw value - // TODO: do DER to OID conversion and vice-versa in .toDer? - - if(length === undefined) { - if(options.strict) { - throw new Error('Non-constructed ASN.1 object of indefinite length.'); - } - // be lenient and use remaining state bytes - length = remaining; - } - - if(type === asn1.Type.BMPSTRING) { - value = ''; - for(; length > 0; length -= 2) { - _checkBufferLength(bytes, remaining, 2); - value += String.fromCharCode(bytes.getInt16()); - remaining -= 2; - } - } else { - value = bytes.getBytes(length); - } - } - - // add BIT STRING contents if available - var asn1Options = bitStringContents === undefined ? null : { - bitStringContents: bitStringContents - }; - - // create and return asn1 object - return asn1.create(tagClass, type, constructed, value, asn1Options); -} - -/** - * Converts the given asn1 object to a buffer of bytes in DER format. - * - * @param asn1 the asn1 object to convert to bytes. - * - * @return the buffer of bytes. - */ -asn1.toDer = function(obj) { - var bytes = forge.util.createBuffer(); - - // build the first byte - var b1 = obj.tagClass | obj.type; - - // for storing the ASN.1 value - var value = forge.util.createBuffer(); - - // use BIT STRING contents if available and data not changed - var useBitStringContents = false; - if('bitStringContents' in obj) { - useBitStringContents = true; - if(obj.original) { - useBitStringContents = asn1.equals(obj, obj.original); - } - } - - if(useBitStringContents) { - value.putBytes(obj.bitStringContents); - } else if(obj.composed) { - // if composed, use each child asn1 object's DER bytes as value - // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed - // from other asn1 objects - if(obj.constructed) { - b1 |= 0x20; - } else { - // type is a bit string, add unused bits of 0x00 - value.putByte(0x00); - } - - // add all of the child DER bytes together - for(var i = 0; i < obj.value.length; ++i) { - if(obj.value[i] !== undefined) { - value.putBuffer(asn1.toDer(obj.value[i])); - } - } - } else { - // use asn1.value directly - if(obj.type === asn1.Type.BMPSTRING) { - for(var i = 0; i < obj.value.length; ++i) { - value.putInt16(obj.value.charCodeAt(i)); - } - } else { - // ensure integer is minimally-encoded - // TODO: should all leading bytes be stripped vs just one? - // .. ex '00 00 01' => '01'? - if(obj.type === asn1.Type.INTEGER && - obj.value.length > 1 && - // leading 0x00 for positive integer - ((obj.value.charCodeAt(0) === 0 && - (obj.value.charCodeAt(1) & 0x80) === 0) || - // leading 0xFF for negative integer - (obj.value.charCodeAt(0) === 0xFF && - (obj.value.charCodeAt(1) & 0x80) === 0x80))) { - value.putBytes(obj.value.substr(1)); - } else { - value.putBytes(obj.value); - } - } - } - - // add tag byte - bytes.putByte(b1); - - // use "short form" encoding - if(value.length() <= 127) { - // one byte describes the length - // bit 8 = 0 and bits 7-1 = length - bytes.putByte(value.length() & 0x7F); - } else { - // use "long form" encoding - // 2 to 127 bytes describe the length - // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes - // other bytes: length in base 256, big-endian - var len = value.length(); - var lenBytes = ''; - do { - lenBytes += String.fromCharCode(len & 0xFF); - len = len >>> 8; - } while(len > 0); - - // set first byte to # bytes used to store the length and turn on - // bit 8 to indicate long-form length is used - bytes.putByte(lenBytes.length | 0x80); - - // concatenate length bytes in reverse since they were generated - // little endian and we need big endian - for(var i = lenBytes.length - 1; i >= 0; --i) { - bytes.putByte(lenBytes.charCodeAt(i)); - } - } - - // concatenate value bytes - bytes.putBuffer(value); - return bytes; -}; - -/** - * Converts an OID dot-separated string to a byte buffer. The byte buffer - * contains only the DER-encoded value, not any tag or length bytes. - * - * @param oid the OID dot-separated string. - * - * @return the byte buffer. - */ -asn1.oidToDer = function(oid) { - // split OID into individual values - var values = oid.split('.'); - var bytes = forge.util.createBuffer(); - - // first byte is 40 * value1 + value2 - bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10)); - // other bytes are each value in base 128 with 8th bit set except for - // the last byte for each value - var last, valueBytes, value, b; - for(var i = 2; i < values.length; ++i) { - // produce value bytes in reverse because we don't know how many - // bytes it will take to store the value - last = true; - valueBytes = []; - value = parseInt(values[i], 10); - do { - b = value & 0x7F; - value = value >>> 7; - // if value is not last, then turn on 8th bit - if(!last) { - b |= 0x80; - } - valueBytes.push(b); - last = false; - } while(value > 0); - - // add value bytes in reverse (needs to be in big endian) - for(var n = valueBytes.length - 1; n >= 0; --n) { - bytes.putByte(valueBytes[n]); - } - } - - return bytes; -}; - -/** - * Converts a DER-encoded byte buffer to an OID dot-separated string. The - * byte buffer should contain only the DER-encoded value, not any tag or - * length bytes. - * - * @param bytes the byte buffer. - * - * @return the OID dot-separated string. - */ -asn1.derToOid = function(bytes) { - var oid; - - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - // first byte is 40 * value1 + value2 - var b = bytes.getByte(); - oid = Math.floor(b / 40) + '.' + (b % 40); - - // other bytes are each value in base 128 with 8th bit set except for - // the last byte for each value - var value = 0; - while(bytes.length() > 0) { - b = bytes.getByte(); - value = value << 7; - // not the last byte for the value - if(b & 0x80) { - value += b & 0x7F; - } else { - // last byte - oid += '.' + (value + b); - value = 0; - } - } - - return oid; -}; - -/** - * Converts a UTCTime value to a date. - * - * Note: GeneralizedTime has 4 digits for the year and is used for X.509 - * dates past 2049. Parsing that structure hasn't been implemented yet. - * - * @param utc the UTCTime value to convert. - * - * @return the date. - */ -asn1.utcTimeToDate = function(utc) { - /* The following formats can be used: - - YYMMDDhhmmZ - YYMMDDhhmm+hh'mm' - YYMMDDhhmm-hh'mm' - YYMMDDhhmmssZ - YYMMDDhhmmss+hh'mm' - YYMMDDhhmmss-hh'mm' - - Where: - - YY is the least significant two digits of the year - MM is the month (01 to 12) - DD is the day (01 to 31) - hh is the hour (00 to 23) - mm are the minutes (00 to 59) - ss are the seconds (00 to 59) - Z indicates that local time is GMT, + indicates that local time is - later than GMT, and - indicates that local time is earlier than GMT - hh' is the absolute value of the offset from GMT in hours - mm' is the absolute value of the offset from GMT in minutes */ - var date = new Date(); - - // if YY >= 50 use 19xx, if YY < 50 use 20xx - var year = parseInt(utc.substr(0, 2), 10); - year = (year >= 50) ? 1900 + year : 2000 + year; - var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month - var DD = parseInt(utc.substr(4, 2), 10); - var hh = parseInt(utc.substr(6, 2), 10); - var mm = parseInt(utc.substr(8, 2), 10); - var ss = 0; - - // not just YYMMDDhhmmZ - if(utc.length > 11) { - // get character after minutes - var c = utc.charAt(10); - var end = 10; - - // see if seconds are present - if(c !== '+' && c !== '-') { - // get seconds - ss = parseInt(utc.substr(10, 2), 10); - end += 2; - } - } - - // update date - date.setUTCFullYear(year, MM, DD); - date.setUTCHours(hh, mm, ss, 0); - - if(end) { - // get +/- after end of time - c = utc.charAt(end); - if(c === '+' || c === '-') { - // get hours+minutes offset - var hhoffset = parseInt(utc.substr(end + 1, 2), 10); - var mmoffset = parseInt(utc.substr(end + 4, 2), 10); - - // calculate offset in milliseconds - var offset = hhoffset * 60 + mmoffset; - offset *= 60000; - - // apply offset - if(c === '+') { - date.setTime(+date - offset); - } else { - date.setTime(+date + offset); - } - } - } - - return date; -}; - -/** - * Converts a GeneralizedTime value to a date. - * - * @param gentime the GeneralizedTime value to convert. - * - * @return the date. - */ -asn1.generalizedTimeToDate = function(gentime) { - /* The following formats can be used: - - YYYYMMDDHHMMSS - YYYYMMDDHHMMSS.fff - YYYYMMDDHHMMSSZ - YYYYMMDDHHMMSS.fffZ - YYYYMMDDHHMMSS+hh'mm' - YYYYMMDDHHMMSS.fff+hh'mm' - YYYYMMDDHHMMSS-hh'mm' - YYYYMMDDHHMMSS.fff-hh'mm' - - Where: - - YYYY is the year - MM is the month (01 to 12) - DD is the day (01 to 31) - hh is the hour (00 to 23) - mm are the minutes (00 to 59) - ss are the seconds (00 to 59) - .fff is the second fraction, accurate to three decimal places - Z indicates that local time is GMT, + indicates that local time is - later than GMT, and - indicates that local time is earlier than GMT - hh' is the absolute value of the offset from GMT in hours - mm' is the absolute value of the offset from GMT in minutes */ - var date = new Date(); - - var YYYY = parseInt(gentime.substr(0, 4), 10); - var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month - var DD = parseInt(gentime.substr(6, 2), 10); - var hh = parseInt(gentime.substr(8, 2), 10); - var mm = parseInt(gentime.substr(10, 2), 10); - var ss = parseInt(gentime.substr(12, 2), 10); - var fff = 0; - var offset = 0; - var isUTC = false; - - if(gentime.charAt(gentime.length - 1) === 'Z') { - isUTC = true; - } - - var end = gentime.length - 5, c = gentime.charAt(end); - if(c === '+' || c === '-') { - // get hours+minutes offset - var hhoffset = parseInt(gentime.substr(end + 1, 2), 10); - var mmoffset = parseInt(gentime.substr(end + 4, 2), 10); - - // calculate offset in milliseconds - offset = hhoffset * 60 + mmoffset; - offset *= 60000; - - // apply offset - if(c === '+') { - offset *= -1; - } - - isUTC = true; - } - - // check for second fraction - if(gentime.charAt(14) === '.') { - fff = parseFloat(gentime.substr(14), 10) * 1000; - } - - if(isUTC) { - date.setUTCFullYear(YYYY, MM, DD); - date.setUTCHours(hh, mm, ss, fff); - - // apply offset - date.setTime(+date + offset); - } else { - date.setFullYear(YYYY, MM, DD); - date.setHours(hh, mm, ss, fff); - } - - return date; -}; - -/** - * Converts a date to a UTCTime value. - * - * Note: GeneralizedTime has 4 digits for the year and is used for X.509 - * dates past 2049. Converting to a GeneralizedTime hasn't been - * implemented yet. - * - * @param date the date to convert. - * - * @return the UTCTime value. - */ -asn1.dateToUtcTime = function(date) { - // TODO: validate; currently assumes proper format - if(typeof date === 'string') { - return date; - } - - var rval = ''; - - // create format YYMMDDhhmmssZ - var format = []; - format.push(('' + date.getUTCFullYear()).substr(2)); - format.push('' + (date.getUTCMonth() + 1)); - format.push('' + date.getUTCDate()); - format.push('' + date.getUTCHours()); - format.push('' + date.getUTCMinutes()); - format.push('' + date.getUTCSeconds()); - - // ensure 2 digits are used for each format entry - for(var i = 0; i < format.length; ++i) { - if(format[i].length < 2) { - rval += '0'; - } - rval += format[i]; - } - rval += 'Z'; - - return rval; -}; - -/** - * Converts a date to a GeneralizedTime value. - * - * @param date the date to convert. - * - * @return the GeneralizedTime value as a string. - */ -asn1.dateToGeneralizedTime = function(date) { - // TODO: validate; currently assumes proper format - if(typeof date === 'string') { - return date; - } - - var rval = ''; - - // create format YYYYMMDDHHMMSSZ - var format = []; - format.push('' + date.getUTCFullYear()); - format.push('' + (date.getUTCMonth() + 1)); - format.push('' + date.getUTCDate()); - format.push('' + date.getUTCHours()); - format.push('' + date.getUTCMinutes()); - format.push('' + date.getUTCSeconds()); - - // ensure 2 digits are used for each format entry - for(var i = 0; i < format.length; ++i) { - if(format[i].length < 2) { - rval += '0'; - } - rval += format[i]; - } - rval += 'Z'; - - return rval; -}; - -/** - * Converts a javascript integer to a DER-encoded byte buffer to be used - * as the value for an INTEGER type. - * - * @param x the integer. - * - * @return the byte buffer. - */ -asn1.integerToDer = function(x) { - var rval = forge.util.createBuffer(); - if(x >= -0x80 && x < 0x80) { - return rval.putSignedInt(x, 8); - } - if(x >= -0x8000 && x < 0x8000) { - return rval.putSignedInt(x, 16); - } - if(x >= -0x800000 && x < 0x800000) { - return rval.putSignedInt(x, 24); - } - if(x >= -0x80000000 && x < 0x80000000) { - return rval.putSignedInt(x, 32); - } - var error = new Error('Integer too large; max is 32-bits.'); - error.integer = x; - throw error; -}; - -/** - * Converts a DER-encoded byte buffer to a javascript integer. This is - * typically used to decode the value of an INTEGER type. - * - * @param bytes the byte buffer. - * - * @return the integer. - */ -asn1.derToInteger = function(bytes) { - // wrap in buffer if needed - if(typeof bytes === 'string') { - bytes = forge.util.createBuffer(bytes); - } - - var n = bytes.length() * 8; - if(n > 32) { - throw new Error('Integer too large; max is 32-bits.'); - } - return bytes.getSignedInt(n); -}; - -/** - * Validates that the given ASN.1 object is at least a super set of the - * given ASN.1 structure. Only tag classes and types are checked. An - * optional map may also be provided to capture ASN.1 values while the - * structure is checked. - * - * To capture an ASN.1 value, set an object in the validator's 'capture' - * parameter to the key to use in the capture map. To capture the full - * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including - * the leading unused bits counter byte, specify 'captureBitStringContents'. - * To capture BIT STRING bytes, without the leading unused bits counter byte, - * specify 'captureBitStringValue'. - * - * Objects in the validator may set a field 'optional' to true to indicate - * that it isn't necessary to pass validation. - * - * @param obj the ASN.1 object to validate. - * @param v the ASN.1 structure validator. - * @param capture an optional map to capture values in. - * @param errors an optional array for storing validation errors. - * - * @return true on success, false on failure. - */ -asn1.validate = function(obj, v, capture, errors) { - var rval = false; - - // ensure tag class and type are the same if specified - if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') && - (obj.type === v.type || typeof(v.type) === 'undefined')) { - // ensure constructed flag is the same if specified - if(obj.constructed === v.constructed || - typeof(v.constructed) === 'undefined') { - rval = true; - - // handle sub values - if(v.value && forge.util.isArray(v.value)) { - var j = 0; - for(var i = 0; rval && i < v.value.length; ++i) { - rval = v.value[i].optional || false; - if(obj.value[j]) { - rval = asn1.validate(obj.value[j], v.value[i], capture, errors); - if(rval) { - ++j; - } else if(v.value[i].optional) { - rval = true; - } - } - if(!rval && errors) { - errors.push( - '[' + v.name + '] ' + - 'Tag class "' + v.tagClass + '", type "' + - v.type + '" expected value length "' + - v.value.length + '", got "' + - obj.value.length + '"'); - } - } - } - - if(rval && capture) { - if(v.capture) { - capture[v.capture] = obj.value; - } - if(v.captureAsn1) { - capture[v.captureAsn1] = obj; - } - if(v.captureBitStringContents && 'bitStringContents' in obj) { - capture[v.captureBitStringContents] = obj.bitStringContents; - } - if(v.captureBitStringValue && 'bitStringContents' in obj) { - var value; - if(obj.bitStringContents.length < 2) { - capture[v.captureBitStringValue] = ''; - } else { - // FIXME: support unused bits with data shifting - var unused = obj.bitStringContents.charCodeAt(0); - if(unused !== 0) { - throw new Error( - 'captureBitStringValue only supported for zero unused bits'); - } - capture[v.captureBitStringValue] = obj.bitStringContents.slice(1); - } - } - } - } else if(errors) { - errors.push( - '[' + v.name + '] ' + - 'Expected constructed "' + v.constructed + '", got "' + - obj.constructed + '"'); - } - } else if(errors) { - if(obj.tagClass !== v.tagClass) { - errors.push( - '[' + v.name + '] ' + - 'Expected tag class "' + v.tagClass + '", got "' + - obj.tagClass + '"'); - } - if(obj.type !== v.type) { - errors.push( - '[' + v.name + '] ' + - 'Expected type "' + v.type + '", got "' + obj.type + '"'); - } - } - return rval; -}; - -// regex for testing for non-latin characters -var _nonLatinRegex = /[^\\u0000-\\u00ff]/; - -/** - * Pretty prints an ASN.1 object to a string. - * - * @param obj the object to write out. - * @param level the level in the tree. - * @param indentation the indentation to use. - * - * @return the string. - */ -asn1.prettyPrint = function(obj, level, indentation) { - var rval = ''; - - // set default level and indentation - level = level || 0; - indentation = indentation || 2; - - // start new line for deep levels - if(level > 0) { - rval += '\n'; - } - - // create indent - var indent = ''; - for(var i = 0; i < level * indentation; ++i) { - indent += ' '; - } - - // print class:type - rval += indent + 'Tag: '; - switch(obj.tagClass) { - case asn1.Class.UNIVERSAL: - rval += 'Universal:'; - break; - case asn1.Class.APPLICATION: - rval += 'Application:'; - break; - case asn1.Class.CONTEXT_SPECIFIC: - rval += 'Context-Specific:'; - break; - case asn1.Class.PRIVATE: - rval += 'Private:'; - break; - } - - if(obj.tagClass === asn1.Class.UNIVERSAL) { - rval += obj.type; - - // known types - switch(obj.type) { - case asn1.Type.NONE: - rval += ' (None)'; - break; - case asn1.Type.BOOLEAN: - rval += ' (Boolean)'; - break; - case asn1.Type.INTEGER: - rval += ' (Integer)'; - break; - case asn1.Type.BITSTRING: - rval += ' (Bit string)'; - break; - case asn1.Type.OCTETSTRING: - rval += ' (Octet string)'; - break; - case asn1.Type.NULL: - rval += ' (Null)'; - break; - case asn1.Type.OID: - rval += ' (Object Identifier)'; - break; - case asn1.Type.ODESC: - rval += ' (Object Descriptor)'; - break; - case asn1.Type.EXTERNAL: - rval += ' (External or Instance of)'; - break; - case asn1.Type.REAL: - rval += ' (Real)'; - break; - case asn1.Type.ENUMERATED: - rval += ' (Enumerated)'; - break; - case asn1.Type.EMBEDDED: - rval += ' (Embedded PDV)'; - break; - case asn1.Type.UTF8: - rval += ' (UTF8)'; - break; - case asn1.Type.ROID: - rval += ' (Relative Object Identifier)'; - break; - case asn1.Type.SEQUENCE: - rval += ' (Sequence)'; - break; - case asn1.Type.SET: - rval += ' (Set)'; - break; - case asn1.Type.PRINTABLESTRING: - rval += ' (Printable String)'; - break; - case asn1.Type.IA5String: - rval += ' (IA5String (ASCII))'; - break; - case asn1.Type.UTCTIME: - rval += ' (UTC time)'; - break; - case asn1.Type.GENERALIZEDTIME: - rval += ' (Generalized time)'; - break; - case asn1.Type.BMPSTRING: - rval += ' (BMP String)'; - break; - } - } else { - rval += obj.type; - } - - rval += '\n'; - rval += indent + 'Constructed: ' + obj.constructed + '\n'; - - if(obj.composed) { - var subvalues = 0; - var sub = ''; - for(var i = 0; i < obj.value.length; ++i) { - if(obj.value[i] !== undefined) { - subvalues += 1; - sub += asn1.prettyPrint(obj.value[i], level + 1, indentation); - if((i + 1) < obj.value.length) { - sub += ','; - } - } - } - rval += indent + 'Sub values: ' + subvalues + sub; - } else { - rval += indent + 'Value: '; - if(obj.type === asn1.Type.OID) { - var oid = asn1.derToOid(obj.value); - rval += oid; - if(forge.pki && forge.pki.oids) { - if(oid in forge.pki.oids) { - rval += ' (' + forge.pki.oids[oid] + ') '; - } - } - } - if(obj.type === asn1.Type.INTEGER) { - try { - rval += asn1.derToInteger(obj.value); - } catch(ex) { - rval += '0x' + forge.util.bytesToHex(obj.value); - } - } else if(obj.type === asn1.Type.BITSTRING) { - // TODO: shift bits as needed to display without padding - if(obj.value.length > 1) { - // remove unused bits field - rval += '0x' + forge.util.bytesToHex(obj.value.slice(1)); - } else { - rval += '(none)'; - } - // show unused bit count - if(obj.value.length > 0) { - var unused = obj.value.charCodeAt(0); - if(unused == 1) { - rval += ' (1 unused bit shown)'; - } else if(unused > 1) { - rval += ' (' + unused + ' unused bits shown)'; - } - } - } else if(obj.type === asn1.Type.OCTETSTRING) { - if(!_nonLatinRegex.test(obj.value)) { - rval += '(' + obj.value + ') '; - } - rval += '0x' + forge.util.bytesToHex(obj.value); - } else if(obj.type === asn1.Type.UTF8) { - rval += forge.util.decodeUtf8(obj.value); - } else if(obj.type === asn1.Type.PRINTABLESTRING || - obj.type === asn1.Type.IA5String) { - rval += obj.value; - } else if(_nonLatinRegex.test(obj.value)) { - rval += '0x' + forge.util.bytesToHex(obj.value); - } else if(obj.value.length === 0) { - rval += '[null]'; - } else { - rval += obj.value; - } - } - - return rval; -}; diff --git a/node_modules/node-forge/lib/baseN.js b/node_modules/node-forge/lib/baseN.js deleted file mode 100644 index 824fa36..0000000 --- a/node_modules/node-forge/lib/baseN.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * Base-N/Base-X encoding/decoding functions. - * - * Original implementation from base-x: - * https://github.com/cryptocoinjs/base-x - * - * Which is MIT licensed: - * - * The MIT License (MIT) - * - * Copyright base-x contributors (c) 2016 - * - * 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. - */ -var api = {}; -module.exports = api; - -// baseN alphabet indexes -var _reverseAlphabets = {}; - -/** - * BaseN-encodes a Uint8Array using the given alphabet. - * - * @param input the Uint8Array to encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the baseN-encoded output string. - */ -api.encode = function(input, alphabet, maxline) { - if(typeof alphabet !== 'string') { - throw new TypeError('"alphabet" must be a string.'); - } - if(maxline !== undefined && typeof maxline !== 'number') { - throw new TypeError('"maxline" must be a number.'); - } - - var output = ''; - - if(!(input instanceof Uint8Array)) { - // assume forge byte buffer - output = _encodeWithByteBuffer(input, alphabet); - } else { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for(i = 0; i < input.length; ++i) { - for(var j = 0, carry = input[i]; j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = (carry / base) | 0; - } - - while(carry > 0) { - digits.push(carry % base); - carry = (carry / base) | 0; - } - } - - // deal with leading zeros - for(i = 0; input[i] === 0 && i < input.length - 1; ++i) { - output += first; - } - // convert digits to a string - for(i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - } - - if(maxline) { - var regex = new RegExp('.{1,' + maxline + '}', 'g'); - output = output.match(regex).join('\r\n'); - } - - return output; -}; - -/** - * Decodes a baseN-encoded (using the given alphabet) string to a - * Uint8Array. - * - * @param input the baseN-encoded input string. - * - * @return the Uint8Array. - */ -api.decode = function(input, alphabet) { - if(typeof input !== 'string') { - throw new TypeError('"input" must be a string.'); - } - if(typeof alphabet !== 'string') { - throw new TypeError('"alphabet" must be a string.'); - } - - var table = _reverseAlphabets[alphabet]; - if(!table) { - // compute reverse alphabet - table = _reverseAlphabets[alphabet] = []; - for(var i = 0; i < alphabet.length; ++i) { - table[alphabet.charCodeAt(i)] = i; - } - } - - // remove whitespace characters - input = input.replace(/\s/g, ''); - - var base = alphabet.length; - var first = alphabet.charAt(0); - var bytes = [0]; - for(var i = 0; i < input.length; i++) { - var value = table[input.charCodeAt(i)]; - if(value === undefined) { - return; - } - - for(var j = 0, carry = value; j < bytes.length; ++j) { - carry += bytes[j] * base; - bytes[j] = carry & 0xff; - carry >>= 8; - } - - while(carry > 0) { - bytes.push(carry & 0xff); - carry >>= 8; - } - } - - // deal with leading zeros - for(var k = 0; input[k] === first && k < input.length - 1; ++k) { - bytes.push(0); - } - - if(typeof Buffer !== 'undefined') { - return Buffer.from(bytes.reverse()); - } - - return new Uint8Array(bytes.reverse()); -}; - -function _encodeWithByteBuffer(input, alphabet) { - var i = 0; - var base = alphabet.length; - var first = alphabet.charAt(0); - var digits = [0]; - for(i = 0; i < input.length(); ++i) { - for(var j = 0, carry = input.at(i); j < digits.length; ++j) { - carry += digits[j] << 8; - digits[j] = carry % base; - carry = (carry / base) | 0; - } - - while(carry > 0) { - digits.push(carry % base); - carry = (carry / base) | 0; - } - } - - var output = ''; - - // deal with leading zeros - for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { - output += first; - } - // convert digits to a string - for(i = digits.length - 1; i >= 0; --i) { - output += alphabet[digits[i]]; - } - - return output; -} diff --git a/node_modules/node-forge/lib/cipher.js b/node_modules/node-forge/lib/cipher.js deleted file mode 100644 index f2c36e6..0000000 --- a/node_modules/node-forge/lib/cipher.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * Cipher base API. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -module.exports = forge.cipher = forge.cipher || {}; - -// registered algorithms -forge.cipher.algorithms = forge.cipher.algorithms || {}; - -/** - * Creates a cipher object that can be used to encrypt data using the given - * algorithm and key. The algorithm may be provided as a string value for a - * previously registered algorithm or it may be given as a cipher algorithm - * API object. - * - * @param algorithm the algorithm to use, either a string or an algorithm API - * object. - * @param key the key to use, as a binary-encoded string of bytes or a - * byte buffer. - * - * @return the cipher. - */ -forge.cipher.createCipher = function(algorithm, key) { - var api = algorithm; - if(typeof api === 'string') { - api = forge.cipher.getAlgorithm(api); - if(api) { - api = api(); - } - } - if(!api) { - throw new Error('Unsupported algorithm: ' + algorithm); - } - - // assume block cipher - return new forge.cipher.BlockCipher({ - algorithm: api, - key: key, - decrypt: false - }); -}; - -/** - * Creates a decipher object that can be used to decrypt data using the given - * algorithm and key. The algorithm may be provided as a string value for a - * previously registered algorithm or it may be given as a cipher algorithm - * API object. - * - * @param algorithm the algorithm to use, either a string or an algorithm API - * object. - * @param key the key to use, as a binary-encoded string of bytes or a - * byte buffer. - * - * @return the cipher. - */ -forge.cipher.createDecipher = function(algorithm, key) { - var api = algorithm; - if(typeof api === 'string') { - api = forge.cipher.getAlgorithm(api); - if(api) { - api = api(); - } - } - if(!api) { - throw new Error('Unsupported algorithm: ' + algorithm); - } - - // assume block cipher - return new forge.cipher.BlockCipher({ - algorithm: api, - key: key, - decrypt: true - }); -}; - -/** - * Registers an algorithm by name. If the name was already registered, the - * algorithm API object will be overwritten. - * - * @param name the name of the algorithm. - * @param algorithm the algorithm API object. - */ -forge.cipher.registerAlgorithm = function(name, algorithm) { - name = name.toUpperCase(); - forge.cipher.algorithms[name] = algorithm; -}; - -/** - * Gets a registered algorithm by name. - * - * @param name the name of the algorithm. - * - * @return the algorithm, if found, null if not. - */ -forge.cipher.getAlgorithm = function(name) { - name = name.toUpperCase(); - if(name in forge.cipher.algorithms) { - return forge.cipher.algorithms[name]; - } - return null; -}; - -var BlockCipher = forge.cipher.BlockCipher = function(options) { - this.algorithm = options.algorithm; - this.mode = this.algorithm.mode; - this.blockSize = this.mode.blockSize; - this._finish = false; - this._input = null; - this.output = null; - this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt; - this._decrypt = options.decrypt; - this.algorithm.initialize(options); -}; - -/** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array - * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in - * bytes, then it must be Nb (16) bytes in length. If the IV is given in as - * 32-bit integers, then it must be 4 integers long. - * - * Note: an IV is not required or used in ECB mode. - * - * For GCM-mode, the IV must be given as a binary-encoded string of bytes or - * a byte buffer. The number of bytes should be 12 (96 bits) as recommended - * by NIST SP-800-38D but another length may be given. - * - * @param options the options to use: - * iv the initialization vector to use as a binary-encoded string of - * bytes, null to reuse the last ciphered block from a previous - * update() (this "residue" method is for legacy support only). - * additionalData additional authentication data as a binary-encoded - * string of bytes, for 'GCM' mode, (default: none). - * tagLength desired length of authentication tag, in bits, for - * 'GCM' mode (0-128, default: 128). - * tag the authentication tag to check if decrypting, as a - * binary-encoded string of bytes. - * output the output the buffer to write to, null to create one. - */ -BlockCipher.prototype.start = function(options) { - options = options || {}; - var opts = {}; - for(var key in options) { - opts[key] = options[key]; - } - opts.decrypt = this._decrypt; - this._finish = false; - this._input = forge.util.createBuffer(); - this.output = options.output || forge.util.createBuffer(); - this.mode.start(opts); -}; - -/** - * Updates the next block according to the cipher mode. - * - * @param input the buffer to read from. - */ -BlockCipher.prototype.update = function(input) { - if(input) { - // input given, so empty it into the input buffer - this._input.putBuffer(input); - } - - // do cipher operation until it needs more input and not finished - while(!this._op.call(this.mode, this._input, this.output, this._finish) && - !this._finish) {} - - // free consumed memory from input buffer - this._input.compact(); -}; - -/** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use in CBC mode, null for default, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. - */ -BlockCipher.prototype.finish = function(pad) { - // backwards-compatibility w/deprecated padding API - // Note: will overwrite padding functions even after another start() call - if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) { - this.mode.pad = function(input) { - return pad(this.blockSize, input, false); - }; - this.mode.unpad = function(output) { - return pad(this.blockSize, output, true); - }; - } - - // build options for padding and afterFinish functions - var options = {}; - options.decrypt = this._decrypt; - - // get # of bytes that won't fill a block - options.overflow = this._input.length() % this.blockSize; - - if(!this._decrypt && this.mode.pad) { - if(!this.mode.pad(this._input, options)) { - return false; - } - } - - // do final update - this._finish = true; - this.update(); - - if(this._decrypt && this.mode.unpad) { - if(!this.mode.unpad(this.output, options)) { - return false; - } - } - - if(this.mode.afterFinish) { - if(!this.mode.afterFinish(this.output, options)) { - return false; - } - } - - return true; -}; diff --git a/node_modules/node-forge/lib/cipherModes.js b/node_modules/node-forge/lib/cipherModes.js deleted file mode 100644 index 339915c..0000000 --- a/node_modules/node-forge/lib/cipherModes.js +++ /dev/null @@ -1,999 +0,0 @@ -/** - * Supported cipher modes. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -forge.cipher = forge.cipher || {}; - -// supported cipher modes -var modes = module.exports = forge.cipher.modes = forge.cipher.modes || {}; - -/** Electronic codebook (ECB) (Don't use this; it's not secure) **/ - -modes.ecb = function(options) { - options = options || {}; - this.name = 'ECB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); -}; - -modes.ecb.prototype.start = function(options) {}; - -modes.ecb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // write output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } -}; - -modes.ecb.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - - // decrypt block - this.cipher.decrypt(this._inBlock, this._outBlock); - - // write output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } -}; - -modes.ecb.prototype.pad = function(input, options) { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (input.length() === this.blockSize ? - this.blockSize : (this.blockSize - input.length())); - input.fillWithByte(padding, padding); - return true; -}; - -modes.ecb.prototype.unpad = function(output, options) { - // check for error: input data not a multiple of blockSize - if(options.overflow > 0) { - return false; - } - - // ensure padding byte count is valid - var len = output.length(); - var count = output.at(len - 1); - if(count > (this.blockSize << 2)) { - return false; - } - - // trim off padding bytes - output.truncate(count); - return true; -}; - -/** Cipher-block Chaining (CBC) **/ - -modes.cbc = function(options) { - options = options || {}; - this.name = 'CBC'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); -}; - -modes.cbc.prototype.start = function(options) { - // Note: legacy support for using IV residue (has security flaws) - // if IV is null, reuse block from previous processing - if(options.iv === null) { - // must have a previous block - if(!this._prev) { - throw new Error('Invalid IV parameter.'); - } - this._iv = this._prev.slice(0); - } else if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } else { - // save IV as "previous" block - this._iv = transformIV(options.iv, this.blockSize); - this._prev = this._iv.slice(0); - } -}; - -modes.cbc.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - // CBC XOR's IV (or previous block) with plaintext - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._prev[i] ^ input.getInt32(); - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // write output, save previous block - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i]); - } - this._prev = this._outBlock; -}; - -modes.cbc.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - if(input.length() < this.blockSize && !(finish && input.length() > 0)) { - return true; - } - - // get next block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - } - - // decrypt block - this.cipher.decrypt(this._inBlock, this._outBlock); - - // write output, save previous ciphered block - // CBC XOR's IV (or previous block) with ciphertext - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._prev[i] ^ this._outBlock[i]); - } - this._prev = this._inBlock.slice(0); -}; - -modes.cbc.prototype.pad = function(input, options) { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (input.length() === this.blockSize ? - this.blockSize : (this.blockSize - input.length())); - input.fillWithByte(padding, padding); - return true; -}; - -modes.cbc.prototype.unpad = function(output, options) { - // check for error: input data not a multiple of blockSize - if(options.overflow > 0) { - return false; - } - - // ensure padding byte count is valid - var len = output.length(); - var count = output.at(len - 1); - if(count > (this.blockSize << 2)) { - return false; - } - - // trim off padding bytes - output.truncate(count); - return true; -}; - -/** Cipher feedback (CFB) **/ - -modes.cfb = function(options) { - options = options || {}; - this.name = 'CFB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.cfb.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.cfb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output, write input as output - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32() ^ this._outBlock[i]; - output.putInt32(this._inBlock[i]); - } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output, write input as partial output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32() ^ this._outBlock[i]; - this._partialOutput.putInt32(this._partialBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; - } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -modes.cfb.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block (CFB always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output, write input as output - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = input.getInt32(); - output.putInt32(this._inBlock[i] ^ this._outBlock[i]); - } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output, write input as partial output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialBlock[i] = input.getInt32(); - this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; - } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -/** Output feedback (OFB) **/ - -modes.ofb = function(options) { - options = options || {}; - this.name = 'OFB'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.ofb.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.ofb.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(input.length() === 0) { - return true; - } - - // encrypt block (OFB always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output and update next input - for(var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - this._inBlock[i] = this._outBlock[i]; - } - return; - } - - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } else { - // block complete, update input block - for(var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._outBlock[i]; - } - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; -}; - -modes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt; - -/** Counter (CTR) **/ - -modes.ctr = function(options) { - options = options || {}; - this.name = 'CTR'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = null; - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; -}; - -modes.ctr.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // use IV as first input - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; -}; - -modes.ctr.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block (CTR always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(input.getInt32() ^ this._outBlock[i]); - } - } else { - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - - if(partialBytes > 0) { - // block still incomplete, restore input buffer - input.read -= this.blockSize; - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; - } - - // block complete, increment counter (input block) - inc32(this._inBlock); -}; - -modes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt; - -/** Galois/Counter Mode (GCM) **/ - -modes.gcm = function(options) { - options = options || {}; - this.name = 'GCM'; - this.cipher = options.cipher; - this.blockSize = options.blockSize || 16; - this._ints = this.blockSize / 4; - this._inBlock = new Array(this._ints); - this._outBlock = new Array(this._ints); - this._partialOutput = forge.util.createBuffer(); - this._partialBytes = 0; - - // R is actually this value concatenated with 120 more zero bits, but - // we only XOR against R so the other zeros have no effect -- we just - // apply this value to the first integer in a block - this._R = 0xE1000000; -}; - -modes.gcm.prototype.start = function(options) { - if(!('iv' in options)) { - throw new Error('Invalid IV parameter.'); - } - // ensure IV is a byte buffer - var iv = forge.util.createBuffer(options.iv); - - // no ciphered data processed yet - this._cipherLength = 0; - - // default additional data is none - var additionalData; - if('additionalData' in options) { - additionalData = forge.util.createBuffer(options.additionalData); - } else { - additionalData = forge.util.createBuffer(); - } - - // default tag length is 128 bits - if('tagLength' in options) { - this._tagLength = options.tagLength; - } else { - this._tagLength = 128; - } - - // if tag is given, ensure tag matches tag length - this._tag = null; - if(options.decrypt) { - // save tag to check later - this._tag = forge.util.createBuffer(options.tag).getBytes(); - if(this._tag.length !== (this._tagLength / 8)) { - throw new Error('Authentication tag does not match tag length.'); - } - } - - // create tmp storage for hash calculation - this._hashBlock = new Array(this._ints); - - // no tag generated yet - this.tag = null; - - // generate hash subkey - // (apply block cipher to "zero" block) - this._hashSubkey = new Array(this._ints); - this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey); - - // generate table M - // use 4-bit tables (32 component decomposition of a 16 byte value) - // 8-bit tables take more space and are known to have security - // vulnerabilities (in native implementations) - this.componentBits = 4; - this._m = this.generateHashTable(this._hashSubkey, this.componentBits); - - // Note: support IV length different from 96 bits? (only supporting - // 96 bits is recommended by NIST SP-800-38D) - // generate J_0 - var ivLength = iv.length(); - if(ivLength === 12) { - // 96-bit IV - this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1]; - } else { - // IV is NOT 96-bits - this._j0 = [0, 0, 0, 0]; - while(iv.length() > 0) { - this._j0 = this.ghash( - this._hashSubkey, this._j0, - [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]); - } - this._j0 = this.ghash( - this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8))); - } - - // generate ICB (initial counter block) - this._inBlock = this._j0.slice(0); - inc32(this._inBlock); - this._partialBytes = 0; - - // consume authentication data - additionalData = forge.util.createBuffer(additionalData); - // save additional data length as a BE 64-bit number - this._aDataLength = from64To32(additionalData.length() * 8); - // pad additional data to 128 bit (16 byte) block size - var overflow = additionalData.length() % this.blockSize; - if(overflow) { - additionalData.fillWithByte(0, this.blockSize - overflow); - } - this._s = [0, 0, 0, 0]; - while(additionalData.length() > 0) { - this._s = this.ghash(this._hashSubkey, this._s, [ - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32(), - additionalData.getInt32() - ]); - } -}; - -modes.gcm.prototype.encrypt = function(input, output, finish) { - // not enough input to encrypt - var inputLength = input.length(); - if(inputLength === 0) { - return true; - } - - // encrypt block - this.cipher.encrypt(this._inBlock, this._outBlock); - - // handle full block - if(this._partialBytes === 0 && inputLength >= this.blockSize) { - // XOR input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^= input.getInt32()); - } - this._cipherLength += this.blockSize; - } else { - // handle partial block - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if(partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; - } - - // XOR input with output - this._partialOutput.clear(); - for(var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); - } - - if(partialBytes <= 0 || finish) { - // handle overflow prior to hashing - if(finish) { - // get block overflow - var overflow = inputLength % this.blockSize; - this._cipherLength += overflow; - // truncate for hash function - this._partialOutput.truncate(this.blockSize - overflow); - } else { - this._cipherLength += this.blockSize; - } - - // get output block for hashing - for(var i = 0; i < this._ints; ++i) { - this._outBlock[i] = this._partialOutput.getInt32(); - } - this._partialOutput.read -= this.blockSize; - } - - // skip any previous partial bytes - if(this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); - } - - if(partialBytes > 0 && !finish) { - // block still incomplete, restore input buffer, get partial output, - // and return early - input.read -= this.blockSize; - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes)); - this._partialBytes = partialBytes; - return true; - } - - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes)); - this._partialBytes = 0; - } - - // update hash block S - this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); - - // increment counter (input block) - inc32(this._inBlock); -}; - -modes.gcm.prototype.decrypt = function(input, output, finish) { - // not enough input to decrypt - var inputLength = input.length(); - if(inputLength < this.blockSize && !(finish && inputLength > 0)) { - return true; - } - - // encrypt block (GCM always uses encryption mode) - this.cipher.encrypt(this._inBlock, this._outBlock); - - // increment counter (input block) - inc32(this._inBlock); - - // update hash block S - this._hashBlock[0] = input.getInt32(); - this._hashBlock[1] = input.getInt32(); - this._hashBlock[2] = input.getInt32(); - this._hashBlock[3] = input.getInt32(); - this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock); - - // XOR hash input with output - for(var i = 0; i < this._ints; ++i) { - output.putInt32(this._outBlock[i] ^ this._hashBlock[i]); - } - - // increment cipher data length - if(inputLength < this.blockSize) { - this._cipherLength += inputLength % this.blockSize; - } else { - this._cipherLength += this.blockSize; - } -}; - -modes.gcm.prototype.afterFinish = function(output, options) { - var rval = true; - - // handle overflow - if(options.decrypt && options.overflow) { - output.truncate(this.blockSize - options.overflow); - } - - // handle authentication tag - this.tag = forge.util.createBuffer(); - - // concatenate additional data length with cipher length - var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8)); - - // include lengths in hash - this._s = this.ghash(this._hashSubkey, this._s, lengths); - - // do GCTR(J_0, S) - var tag = []; - this.cipher.encrypt(this._j0, tag); - for(var i = 0; i < this._ints; ++i) { - this.tag.putInt32(this._s[i] ^ tag[i]); - } - - // trim tag to length - this.tag.truncate(this.tag.length() % (this._tagLength / 8)); - - // check authentication tag - if(options.decrypt && this.tag.bytes() !== this._tag) { - rval = false; - } - - return rval; -}; - -/** - * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois - * field multiplication. The field, GF(2^128), is defined by the polynomial: - * - * x^128 + x^7 + x^2 + x + 1 - * - * Which is represented in little-endian binary form as: 11100001 (0xe1). When - * the value of a coefficient is 1, a bit is set. The value R, is the - * concatenation of this value and 120 zero bits, yielding a 128-bit value - * which matches the block size. - * - * This function will multiply two elements (vectors of bytes), X and Y, in - * the field GF(2^128). The result is initialized to zero. For each bit of - * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd) - * by the current value of Y. For each bit, the value of Y will be raised by - * a power of x (multiplied by the polynomial x). This can be achieved by - * shifting Y once to the right. If the current value of Y, prior to being - * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial. - * Otherwise, we must divide by R after shifting to find the remainder. - * - * @param x the first block to multiply by the second. - * @param y the second block to multiply by the first. - * - * @return the block result of the multiplication. - */ -modes.gcm.prototype.multiply = function(x, y) { - var z_i = [0, 0, 0, 0]; - var v_i = y.slice(0); - - // calculate Z_128 (block has 128 bits) - for(var i = 0; i < 128; ++i) { - // if x_i is 0, Z_{i+1} = Z_i (unchanged) - // else Z_{i+1} = Z_i ^ V_i - // get x_i by finding 32-bit int position, then left shift 1 by remainder - var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32)); - if(x_i) { - z_i[0] ^= v_i[0]; - z_i[1] ^= v_i[1]; - z_i[2] ^= v_i[2]; - z_i[3] ^= v_i[3]; - } - - // if LSB(V_i) is 1, V_i = V_i >> 1 - // else V_i = (V_i >> 1) ^ R - this.pow(v_i, v_i); - } - - return z_i; -}; - -modes.gcm.prototype.pow = function(x, out) { - // if LSB(x) is 1, x = x >>> 1 - // else x = (x >>> 1) ^ R - var lsb = x[3] & 1; - - // always do x >>> 1: - // starting with the rightmost integer, shift each integer to the right - // one bit, pulling in the bit from the integer to the left as its top - // most bit (do this for the last 3 integers) - for(var i = 3; i > 0; --i) { - out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31); - } - // shift the first integer normally - out[0] = x[0] >>> 1; - - // if lsb was not set, then polynomial had a degree of 127 and doesn't - // need to divided; otherwise, XOR with R to find the remainder; we only - // need to XOR the first integer since R technically ends w/120 zero bits - if(lsb) { - out[0] ^= this._R; - } -}; - -modes.gcm.prototype.tableMultiply = function(x) { - // assumes 4-bit tables are used - var z = [0, 0, 0, 0]; - for(var i = 0; i < 32; ++i) { - var idx = (i / 8) | 0; - var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF; - var ah = this._m[i][x_i]; - z[0] ^= ah[0]; - z[1] ^= ah[1]; - z[2] ^= ah[2]; - z[3] ^= ah[3]; - } - return z; -}; - -/** - * A continuing version of the GHASH algorithm that operates on a single - * block. The hash block, last hash value (Ym) and the new block to hash - * are given. - * - * @param h the hash block. - * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash. - * @param x the block to hash. - * - * @return the hashed value (Ym). - */ -modes.gcm.prototype.ghash = function(h, y, x) { - y[0] ^= x[0]; - y[1] ^= x[1]; - y[2] ^= x[2]; - y[3] ^= x[3]; - return this.tableMultiply(y); - //return this.multiply(y, h); -}; - -/** - * Precomputes a table for multiplying against the hash subkey. This - * mechanism provides a substantial speed increase over multiplication - * performed without a table. The table-based multiplication this table is - * for solves X * H by multiplying each component of X by H and then - * composing the results together using XOR. - * - * This function can be used to generate tables with different bit sizes - * for the components, however, this implementation assumes there are - * 32 components of X (which is a 16 byte vector), therefore each component - * takes 4-bits (so the table is constructed with bits=4). - * - * @param h the hash subkey. - * @param bits the bit size for a component. - */ -modes.gcm.prototype.generateHashTable = function(h, bits) { - // TODO: There are further optimizations that would use only the - // first table M_0 (or some variant) along with a remainder table; - // this can be explored in the future - var multiplier = 8 / bits; - var perInt = 4 * multiplier; - var size = 16 * multiplier; - var m = new Array(size); - for(var i = 0; i < size; ++i) { - var tmp = [0, 0, 0, 0]; - var idx = (i / perInt) | 0; - var shft = ((perInt - 1 - (i % perInt)) * bits); - tmp[idx] = (1 << (bits - 1)) << shft; - m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits); - } - return m; -}; - -/** - * Generates a table for multiplying against the hash subkey for one - * particular component (out of all possible component values). - * - * @param mid the pre-multiplied value for the middle key of the table. - * @param bits the bit size for a component. - */ -modes.gcm.prototype.generateSubHashTable = function(mid, bits) { - // compute the table quickly by minimizing the number of - // POW operations -- they only need to be performed for powers of 2, - // all other entries can be composed from those powers using XOR - var size = 1 << bits; - var half = size >>> 1; - var m = new Array(size); - m[half] = mid.slice(0); - var i = half >>> 1; - while(i > 0) { - // raise m0[2 * i] and store in m0[i] - this.pow(m[2 * i], m[i] = []); - i >>= 1; - } - i = 2; - while(i < half) { - for(var j = 1; j < i; ++j) { - var m_i = m[i]; - var m_j = m[j]; - m[i + j] = [ - m_i[0] ^ m_j[0], - m_i[1] ^ m_j[1], - m_i[2] ^ m_j[2], - m_i[3] ^ m_j[3] - ]; - } - i *= 2; - } - m[0] = [0, 0, 0, 0]; - /* Note: We could avoid storing these by doing composition during multiply - calculate top half using composition by speed is preferred. */ - for(i = half + 1; i < size; ++i) { - var c = m[i ^ half]; - m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]]; - } - return m; -}; - -/** Utility functions */ - -function transformIV(iv, blockSize) { - if(typeof iv === 'string') { - // convert iv string into byte buffer - iv = forge.util.createBuffer(iv); - } - - if(forge.util.isArray(iv) && iv.length > 4) { - // convert iv byte array into byte buffer - var tmp = iv; - iv = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - iv.putByte(tmp[i]); - } - } - - if(iv.length() < blockSize) { - throw new Error( - 'Invalid IV length; got ' + iv.length() + - ' bytes and expected ' + blockSize + ' bytes.'); - } - - if(!forge.util.isArray(iv)) { - // convert iv byte buffer into 32-bit integer array - var ints = []; - var blocks = blockSize / 4; - for(var i = 0; i < blocks; ++i) { - ints.push(iv.getInt32()); - } - iv = ints; - } - - return iv; -} - -function inc32(block) { - // increment last 32 bits of block only - block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF; -} - -function from64To32(num) { - // convert 64-bit number to two BE Int32s - return [(num / 0x100000000) | 0, num & 0xFFFFFFFF]; -} diff --git a/node_modules/node-forge/lib/debug.js b/node_modules/node-forge/lib/debug.js deleted file mode 100644 index 2675635..0000000 --- a/node_modules/node-forge/lib/debug.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Debugging support for web applications. - * - * @author David I. Lehn - * - * Copyright 2008-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); - -/* DEBUG API */ -module.exports = forge.debug = forge.debug || {}; - -// Private storage for debugging. -// Useful to expose data that is otherwise unviewable behind closures. -// NOTE: remember that this can hold references to data and cause leaks! -// format is "forge._debug.. = data" -// Example: -// (function() { -// var cat = 'forge.test.Test'; // debugging category -// var sState = {...}; // local state -// forge.debug.set(cat, 'sState', sState); -// })(); -forge.debug.storage = {}; - -/** - * Gets debug data. Omit name for all cat data Omit name and cat for - * all data. - * - * @param cat name of debugging category. - * @param name name of data to get (optional). - * @return object with requested debug data or undefined. - */ -forge.debug.get = function(cat, name) { - var rval; - if(typeof(cat) === 'undefined') { - rval = forge.debug.storage; - } else if(cat in forge.debug.storage) { - if(typeof(name) === 'undefined') { - rval = forge.debug.storage[cat]; - } else { - rval = forge.debug.storage[cat][name]; - } - } - return rval; -}; - -/** - * Sets debug data. - * - * @param cat name of debugging category. - * @param name name of data to set. - * @param data data to set. - */ -forge.debug.set = function(cat, name, data) { - if(!(cat in forge.debug.storage)) { - forge.debug.storage[cat] = {}; - } - forge.debug.storage[cat][name] = data; -}; - -/** - * Clears debug data. Omit name for all cat data. Omit name and cat for - * all data. - * - * @param cat name of debugging category. - * @param name name of data to clear or omit to clear entire category. - */ -forge.debug.clear = function(cat, name) { - if(typeof(cat) === 'undefined') { - forge.debug.storage = {}; - } else if(cat in forge.debug.storage) { - if(typeof(name) === 'undefined') { - delete forge.debug.storage[cat]; - } else { - delete forge.debug.storage[cat][name]; - } - } -}; diff --git a/node_modules/node-forge/lib/des.js b/node_modules/node-forge/lib/des.js deleted file mode 100644 index ed8239a..0000000 --- a/node_modules/node-forge/lib/des.js +++ /dev/null @@ -1,496 +0,0 @@ -/** - * DES (Data Encryption Standard) implementation. - * - * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode. - * It is based on the BSD-licensed implementation by Paul Tero: - * - * Paul Tero, July 2001 - * http://www.tero.co.uk/des/ - * - * Optimised for performance with large blocks by - * Michael Hayworth, November 2001 - * http://www.netdealing.com - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2012-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./cipher'); -require('./cipherModes'); -require('./util'); - -/* DES API */ -module.exports = forge.des = forge.des || {}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('DES-', key); - * cipher.start({iv: iv}); - * - * Creates an DES cipher object to encrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as binary-encoded strings of bytes or - * byte buffers. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC' if IV is - * given, 'ECB' if null). - * - * @return the cipher. - */ -forge.des.startEncrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: false, - mode: mode || (iv === null ? 'ECB' : 'CBC') - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var cipher = forge.cipher.createCipher('DES-', key); - * - * Creates an DES cipher object to encrypt data using the given symmetric key. - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.des.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: false, - mode: mode - }); -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('DES-', key); - * decipher.start({iv: iv}); - * - * Creates an DES cipher object to decrypt data using the given symmetric key. - * The output will be stored in the 'output' member of the returned cipher. - * - * The key and iv may be given as binary-encoded strings of bytes or - * byte buffers. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * @param mode the cipher mode to use (default: 'CBC' if IV is - * given, 'ECB' if null). - * - * @return the cipher. - */ -forge.des.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key: key, - output: output, - decrypt: true, - mode: mode || (iv === null ? 'ECB' : 'CBC') - }); - cipher.start(iv); - return cipher; -}; - -/** - * Deprecated. Instead, use: - * - * var decipher = forge.cipher.createDecipher('DES-', key); - * - * Creates an DES cipher object to decrypt data using the given symmetric key. - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param key the symmetric key to use (64 or 192 bits). - * @param mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -forge.des.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key: key, - output: null, - decrypt: true, - mode: mode - }); -}; - -/** - * Creates a new DES cipher algorithm object. - * - * @param name the name of the algorithm. - * @param mode the mode factory function. - * - * @return the DES algorithm object. - */ -forge.des.Algorithm = function(name, mode) { - var self = this; - self.name = name; - self.mode = new mode({ - blockSize: 8, - cipher: { - encrypt: function(inBlock, outBlock) { - return _updateBlock(self._keys, inBlock, outBlock, false); - }, - decrypt: function(inBlock, outBlock) { - return _updateBlock(self._keys, inBlock, outBlock, true); - } - } - }); - self._init = false; -}; - -/** - * Initializes this DES algorithm by expanding its key. - * - * @param options the options to use. - * key the key to use with this algorithm. - * decrypt true if the algorithm should be initialized for decryption, - * false for encryption. - */ -forge.des.Algorithm.prototype.initialize = function(options) { - if(this._init) { - return; - } - - var key = forge.util.createBuffer(options.key); - if(this.name.indexOf('3DES') === 0) { - if(key.length() !== 24) { - throw new Error('Invalid Triple-DES key size: ' + key.length() * 8); - } - } - - // do key expansion to 16 or 48 subkeys (single or triple DES) - this._keys = _createKeys(key); - this._init = true; -}; - -/** Register DES algorithms **/ - -registerAlgorithm('DES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('DES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('DES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('DES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('DES-CTR', forge.cipher.modes.ctr); - -registerAlgorithm('3DES-ECB', forge.cipher.modes.ecb); -registerAlgorithm('3DES-CBC', forge.cipher.modes.cbc); -registerAlgorithm('3DES-CFB', forge.cipher.modes.cfb); -registerAlgorithm('3DES-OFB', forge.cipher.modes.ofb); -registerAlgorithm('3DES-CTR', forge.cipher.modes.ctr); - -function registerAlgorithm(name, mode) { - var factory = function() { - return new forge.des.Algorithm(name, mode); - }; - forge.cipher.registerAlgorithm(name, factory); -} - -/** DES implementation **/ - -var spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004]; -var spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000]; -var spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200]; -var spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080]; -var spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100]; -var spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010]; -var spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002]; -var spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000]; - -/** - * Create necessary sub keys. - * - * @param key the 64-bit or 192-bit key. - * - * @return the expanded keys. - */ -function _createKeys(key) { - var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204], - pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101], - pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808], - pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000], - pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010], - pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420], - pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002], - pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800], - pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002], - pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408], - pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020], - pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200], - pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010], - pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105]; - - // how many iterations (1 for des, 3 for triple des) - // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys - var iterations = key.length() > 8 ? 3 : 1; - - // stores the return keys - var keys = []; - - // now define the left shifts which need to be done - var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0]; - - var n = 0, tmp; - for(var j = 0; j < iterations; j++) { - var left = key.getInt32(); - var right = key.getInt32(); - - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - - tmp = ((right >>> -16) ^ left) & 0x0000ffff; - left ^= tmp; - right ^= (tmp << -16); - - tmp = ((left >>> 2) ^ right) & 0x33333333; - right ^= tmp; - left ^= (tmp << 2); - - tmp = ((right >>> -16) ^ left) & 0x0000ffff; - left ^= tmp; - right ^= (tmp << -16); - - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - // right needs to be shifted and OR'd with last four bits of left - tmp = (left << 8) | ((right >>> 20) & 0x000000f0); - - // left needs to be put upside down - left = ((right << 24) | ((right << 8) & 0xff0000) | - ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0)); - right = tmp; - - // now go through and perform these shifts on the left and right keys - for(var i = 0; i < shifts.length; ++i) { - //shift the keys either one or two bits to the left - if(shifts[i]) { - left = (left << 2) | (left >>> 26); - right = (right << 2) | (right >>> 26); - } else { - left = (left << 1) | (left >>> 27); - right = (right << 1) | (right >>> 27); - } - left &= -0xf; - right &= -0xf; - - // now apply PC-2, in such a way that E is easier when encrypting or - // decrypting this conversion will look like PC-2 except only the last 6 - // bits of each byte are used rather than 48 consecutive bits and the - // order of lines will be according to how the S selection functions will - // be applied: S2, S4, S6, S8, S1, S3, S5, S7 - var lefttmp = ( - pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] | - pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] | - pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] | - pc2bytes6[(left >>> 4) & 0xf]); - var righttmp = ( - pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] | - pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] | - pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] | - pc2bytes13[(right >>> 4) & 0xf]); - tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff; - keys[n++] = lefttmp ^ tmp; - keys[n++] = righttmp ^ (tmp << 16); - } - } - - return keys; -} - -/** - * Updates a single block (1 byte) using DES. The update will either - * encrypt or decrypt the block. - * - * @param keys the expanded keys. - * @param input the input block (an array of 32-bit words). - * @param output the updated output block. - * @param decrypt true to decrypt the block, false to encrypt it. - */ -function _updateBlock(keys, input, output, decrypt) { - // set up loops for single or triple DES - var iterations = keys.length === 32 ? 3 : 9; - var looping; - if(iterations === 3) { - looping = decrypt ? [30, -2, -2] : [0, 32, 2]; - } else { - looping = (decrypt ? - [94, 62, -2, 32, 64, 2, 30, -2, -2] : - [0, 32, 2, 62, 30, -2, 64, 96, 2]); - } - - var tmp; - - var left = input[0]; - var right = input[1]; - - // first each 64 bit chunk of the message must be permuted according to IP - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - - tmp = ((left >>> 16) ^ right) & 0x0000ffff; - right ^= tmp; - left ^= (tmp << 16); - - tmp = ((right >>> 2) ^ left) & 0x33333333; - left ^= tmp; - right ^= (tmp << 2); - - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - // rotate left 1 bit - left = ((left << 1) | (left >>> 31)); - right = ((right << 1) | (right >>> 31)); - - for(var j = 0; j < iterations; j += 3) { - var endloop = looping[j + 1]; - var loopinc = looping[j + 2]; - - // now go through and perform the encryption or decryption - for(var i = looping[j]; i != endloop; i += loopinc) { - var right1 = right ^ keys[i]; - var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1]; - - // passing these bytes through the S selection functions - tmp = left; - left = right; - right = tmp ^ ( - spfunction2[(right1 >>> 24) & 0x3f] | - spfunction4[(right1 >>> 16) & 0x3f] | - spfunction6[(right1 >>> 8) & 0x3f] | - spfunction8[right1 & 0x3f] | - spfunction1[(right2 >>> 24) & 0x3f] | - spfunction3[(right2 >>> 16) & 0x3f] | - spfunction5[(right2 >>> 8) & 0x3f] | - spfunction7[right2 & 0x3f]); - } - // unreverse left and right - tmp = left; - left = right; - right = tmp; - } - - // rotate right 1 bit - left = ((left >>> 1) | (left << 31)); - right = ((right >>> 1) | (right << 31)); - - // now perform IP-1, which is IP in the opposite direction - tmp = ((left >>> 1) ^ right) & 0x55555555; - right ^= tmp; - left ^= (tmp << 1); - - tmp = ((right >>> 8) ^ left) & 0x00ff00ff; - left ^= tmp; - right ^= (tmp << 8); - - tmp = ((right >>> 2) ^ left) & 0x33333333; - left ^= tmp; - right ^= (tmp << 2); - - tmp = ((left >>> 16) ^ right) & 0x0000ffff; - right ^= tmp; - left ^= (tmp << 16); - - tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f; - right ^= tmp; - left ^= (tmp << 4); - - output[0] = left; - output[1] = right; -} - -/** - * Deprecated. Instead, use: - * - * forge.cipher.createCipher('DES-', key); - * forge.cipher.createDecipher('DES-', key); - * - * Creates a deprecated DES cipher object. This object's mode will default to - * CBC (cipher-block-chaining). - * - * The key may be given as a binary-encoded string of bytes or a byte buffer. - * - * @param options the options to use. - * key the symmetric key to use (64 or 192 bits). - * output the buffer to write to. - * decrypt true for decryption, false for encryption. - * mode the cipher mode to use (default: 'CBC'). - * - * @return the cipher. - */ -function _createCipher(options) { - options = options || {}; - var mode = (options.mode || 'CBC').toUpperCase(); - var algorithm = 'DES-' + mode; - - var cipher; - if(options.decrypt) { - cipher = forge.cipher.createDecipher(algorithm, options.key); - } else { - cipher = forge.cipher.createCipher(algorithm, options.key); - } - - // backwards compatible start API - var start = cipher.start; - cipher.start = function(iv, options) { - // backwards compatibility: support second arg as output buffer - var output = null; - if(options instanceof forge.util.ByteBuffer) { - output = options; - options = {}; - } - options = options || {}; - options.output = output; - options.iv = iv; - start.call(cipher, options); - }; - - return cipher; -} diff --git a/node_modules/node-forge/lib/ed25519.js b/node_modules/node-forge/lib/ed25519.js deleted file mode 100644 index f3e6faa..0000000 --- a/node_modules/node-forge/lib/ed25519.js +++ /dev/null @@ -1,1072 +0,0 @@ -/** - * JavaScript implementation of Ed25519. - * - * Copyright (c) 2017-2019 Digital Bazaar, Inc. - * - * This implementation is based on the most excellent TweetNaCl which is - * in the public domain. Many thanks to its contributors: - * - * https://github.com/dchest/tweetnacl-js - */ -var forge = require('./forge'); -require('./jsbn'); -require('./random'); -require('./sha512'); -require('./util'); -var asn1Validator = require('./asn1-validator'); -var publicKeyValidator = asn1Validator.publicKeyValidator; -var privateKeyValidator = asn1Validator.privateKeyValidator; - -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} - -var ByteBuffer = forge.util.ByteBuffer; -var NativeBuffer = typeof Buffer === 'undefined' ? Uint8Array : Buffer; - -/* - * Ed25519 algorithms, see RFC 8032: - * https://tools.ietf.org/html/rfc8032 - */ -forge.pki = forge.pki || {}; -module.exports = forge.pki.ed25519 = forge.ed25519 = forge.ed25519 || {}; -var ed25519 = forge.ed25519; - -ed25519.constants = {}; -ed25519.constants.PUBLIC_KEY_BYTE_LENGTH = 32; -ed25519.constants.PRIVATE_KEY_BYTE_LENGTH = 64; -ed25519.constants.SEED_BYTE_LENGTH = 32; -ed25519.constants.SIGN_BYTE_LENGTH = 64; -ed25519.constants.HASH_BYTE_LENGTH = 64; - -ed25519.generateKeyPair = function(options) { - options = options || {}; - var seed = options.seed; - if(seed === undefined) { - // generate seed - seed = forge.random.getBytesSync(ed25519.constants.SEED_BYTE_LENGTH); - } else if(typeof seed === 'string') { - if(seed.length !== ed25519.constants.SEED_BYTE_LENGTH) { - throw new TypeError( - '"seed" must be ' + ed25519.constants.SEED_BYTE_LENGTH + - ' bytes in length.'); - } - } else if(!(seed instanceof Uint8Array)) { - throw new TypeError( - '"seed" must be a node.js Buffer, Uint8Array, or a binary string.'); - } - - seed = messageToNativeBuffer({message: seed, encoding: 'binary'}); - - var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - var sk = new NativeBuffer(ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - for(var i = 0; i < 32; ++i) { - sk[i] = seed[i]; - } - crypto_sign_keypair(pk, sk); - return {publicKey: pk, privateKey: sk}; -}; - -/** - * Converts a private key from a RFC8410 ASN.1 encoding. - * - * @param obj - The asn1 representation of a private key. - * - * @returns {Object} keyInfo - The key information. - * @returns {Buffer|Uint8Array} keyInfo.privateKeyBytes - 32 private key bytes. - */ -ed25519.privateKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - var valid = forge.asn1.validate(obj, privateKeyValidator, capture, errors); - if(!valid) { - var error = new Error('Invalid Key.'); - error.errors = errors; - throw error; - } - var oid = forge.asn1.derToOid(capture.privateKeyOid); - var ed25519Oid = forge.oids.EdDSA25519; - if(oid !== ed25519Oid) { - throw new Error('Invalid OID "' + oid + '"; OID must be "' + - ed25519Oid + '".'); - } - var privateKey = capture.privateKey; - // manually extract the private key bytes from nested octet string, see FIXME: - // https://github.com/digitalbazaar/forge/blob/master/lib/asn1.js#L542 - var privateKeyBytes = messageToNativeBuffer({ - message: forge.asn1.fromDer(privateKey).value, - encoding: 'binary' - }); - // TODO: RFC8410 specifies a format for encoding the public key bytes along - // with the private key bytes. `publicKeyBytes` can be returned in the - // future. https://tools.ietf.org/html/rfc8410#section-10.3 - return {privateKeyBytes: privateKeyBytes}; -}; - -/** - * Converts a public key from a RFC8410 ASN.1 encoding. - * - * @param obj - The asn1 representation of a public key. - * - * @return {Buffer|Uint8Array} - 32 public key bytes. - */ -ed25519.publicKeyFromAsn1 = function(obj) { - // get SubjectPublicKeyInfo - var capture = {}; - var errors = []; - var valid = forge.asn1.validate(obj, publicKeyValidator, capture, errors); - if(!valid) { - var error = new Error('Invalid Key.'); - error.errors = errors; - throw error; - } - var oid = forge.asn1.derToOid(capture.publicKeyOid); - var ed25519Oid = forge.oids.EdDSA25519; - if(oid !== ed25519Oid) { - throw new Error('Invalid OID "' + oid + '"; OID must be "' + - ed25519Oid + '".'); - } - var publicKeyBytes = capture.ed25519PublicKey; - if(publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { - throw new Error('Key length is invalid.'); - } - return messageToNativeBuffer({ - message: publicKeyBytes, - encoding: 'binary' - }); -}; - -ed25519.publicKeyFromPrivateKey = function(options) { - options = options || {}; - var privateKey = messageToNativeBuffer({ - message: options.privateKey, encoding: 'binary' - }); - if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.privateKey" must have a byte length of ' + - ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - } - - var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - for(var i = 0; i < pk.length; ++i) { - pk[i] = privateKey[32 + i]; - } - return pk; -}; - -ed25519.sign = function(options) { - options = options || {}; - var msg = messageToNativeBuffer(options); - var privateKey = messageToNativeBuffer({ - message: options.privateKey, - encoding: 'binary' - }); - if(privateKey.length === ed25519.constants.SEED_BYTE_LENGTH) { - var keyPair = ed25519.generateKeyPair({seed: privateKey}); - privateKey = keyPair.privateKey; - } else if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.privateKey" must have a byte length of ' + - ed25519.constants.SEED_BYTE_LENGTH + ' or ' + - ed25519.constants.PRIVATE_KEY_BYTE_LENGTH); - } - - var signedMsg = new NativeBuffer( - ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - crypto_sign(signedMsg, msg, msg.length, privateKey); - - var sig = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH); - for(var i = 0; i < sig.length; ++i) { - sig[i] = signedMsg[i]; - } - return sig; -}; - -ed25519.verify = function(options) { - options = options || {}; - var msg = messageToNativeBuffer(options); - if(options.signature === undefined) { - throw new TypeError( - '"options.signature" must be a node.js Buffer, a Uint8Array, a forge ' + - 'ByteBuffer, or a binary string.'); - } - var sig = messageToNativeBuffer({ - message: options.signature, - encoding: 'binary' - }); - if(sig.length !== ed25519.constants.SIGN_BYTE_LENGTH) { - throw new TypeError( - '"options.signature" must have a byte length of ' + - ed25519.constants.SIGN_BYTE_LENGTH); - } - var publicKey = messageToNativeBuffer({ - message: options.publicKey, - encoding: 'binary' - }); - if(publicKey.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) { - throw new TypeError( - '"options.publicKey" must have a byte length of ' + - ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); - } - - var sm = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - var m = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length); - var i; - for(i = 0; i < ed25519.constants.SIGN_BYTE_LENGTH; ++i) { - sm[i] = sig[i]; - } - for(i = 0; i < msg.length; ++i) { - sm[i + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i]; - } - return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); -}; - -function messageToNativeBuffer(options) { - var message = options.message; - if(message instanceof Uint8Array || message instanceof NativeBuffer) { - return message; - } - - var encoding = options.encoding; - if(message === undefined) { - if(options.md) { - // TODO: more rigorous validation that `md` is a MessageDigest - message = options.md.digest().getBytes(); - encoding = 'binary'; - } else { - throw new TypeError('"options.message" or "options.md" not specified.'); - } - } - - if(typeof message === 'string' && !encoding) { - throw new TypeError('"options.encoding" must be "binary" or "utf8".'); - } - - if(typeof message === 'string') { - if(typeof Buffer !== 'undefined') { - return Buffer.from(message, encoding); - } - message = new ByteBuffer(message, encoding); - } else if(!(message instanceof ByteBuffer)) { - throw new TypeError( - '"options.message" must be a node.js Buffer, a Uint8Array, a forge ' + - 'ByteBuffer, or a string with "options.encoding" specifying its ' + - 'encoding.'); - } - - // convert to native buffer - var buffer = new NativeBuffer(message.length()); - for(var i = 0; i < buffer.length; ++i) { - buffer[i] = message.at(i); - } - return buffer; -} - -var gf0 = gf(); -var gf1 = gf([1]); -var D = gf([ - 0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, - 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]); -var D2 = gf([ - 0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, - 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]); -var X = gf([ - 0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, - 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]); -var Y = gf([ - 0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, - 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]); -var L = new Float64Array([ - 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); -var I = gf([ - 0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, - 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); - -// TODO: update forge buffer implementation to use `Buffer` or `Uint8Array`, -// whichever is available, to improve performance -function sha512(msg, msgLen) { - // Note: `out` and `msg` are NativeBuffer - var md = forge.md.sha512.create(); - var buffer = new ByteBuffer(msg); - md.update(buffer.getBytes(msgLen), 'binary'); - var hash = md.digest().getBytes(); - if(typeof Buffer !== 'undefined') { - return Buffer.from(hash, 'binary'); - } - var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); - for(var i = 0; i < 64; ++i) { - out[i] = hash.charCodeAt(i); - } - return out; -} - -function crypto_sign_keypair(pk, sk) { - var p = [gf(), gf(), gf(), gf()]; - var i; - - var d = sha512(sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - - scalarbase(p, d); - pack(pk, p); - - for(i = 0; i < 32; ++i) { - sk[i + 32] = pk[i]; - } - return 0; -} - -// Note: difference from C - smlen returned, not passed as argument. -function crypto_sign(sm, m, n, sk) { - var i, j, x = new Float64Array(64); - var p = [gf(), gf(), gf(), gf()]; - - var d = sha512(sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - - var smlen = n + 64; - for(i = 0; i < n; ++i) { - sm[64 + i] = m[i]; - } - for(i = 0; i < 32; ++i) { - sm[32 + i] = d[32 + i]; - } - - var r = sha512(sm.subarray(32), n + 32); - reduce(r); - scalarbase(p, r); - pack(sm, p); - - for(i = 32; i < 64; ++i) { - sm[i] = sk[i]; - } - var h = sha512(sm, n + 64); - reduce(h); - - for(i = 32; i < 64; ++i) { - x[i] = 0; - } - for(i = 0; i < 32; ++i) { - x[i] = r[i]; - } - for(i = 0; i < 32; ++i) { - for(j = 0; j < 32; j++) { - x[i + j] += h[i] * d[j]; - } - } - - modL(sm.subarray(32), x); - return smlen; -} - -function crypto_sign_open(m, sm, n, pk) { - var i, mlen; - var t = new NativeBuffer(32); - var p = [gf(), gf(), gf(), gf()], - q = [gf(), gf(), gf(), gf()]; - - mlen = -1; - if(n < 64) { - return -1; - } - - if(unpackneg(q, pk)) { - return -1; - } - - for(i = 0; i < n; ++i) { - m[i] = sm[i]; - } - for(i = 0; i < 32; ++i) { - m[i + 32] = pk[i]; - } - var h = sha512(m, n); - reduce(h); - scalarmult(p, q, h); - - scalarbase(q, sm.subarray(32)); - add(p, q); - pack(t, p); - - n -= 64; - if(crypto_verify_32(sm, 0, t, 0)) { - for(i = 0; i < n; ++i) { - m[i] = 0; - } - return -1; - } - - for(i = 0; i < n; ++i) { - m[i] = sm[i + 64]; - } - mlen = n; - return mlen; -} - -function modL(r, x) { - var carry, i, j, k; - for(i = 63; i >= 32; --i) { - carry = 0; - for(j = i - 32, k = i - 12; j < k; ++j) { - x[j] += carry - 16 * x[i] * L[j - (i - 32)]; - carry = (x[j] + 128) >> 8; - x[j] -= carry * 256; - } - x[j] += carry; - x[i] = 0; - } - carry = 0; - for(j = 0; j < 32; ++j) { - x[j] += carry - (x[31] >> 4) * L[j]; - carry = x[j] >> 8; - x[j] &= 255; - } - for(j = 0; j < 32; ++j) { - x[j] -= carry * L[j]; - } - for(i = 0; i < 32; ++i) { - x[i + 1] += x[i] >> 8; - r[i] = x[i] & 255; - } -} - -function reduce(r) { - var x = new Float64Array(64); - for(var i = 0; i < 64; ++i) { - x[i] = r[i]; - r[i] = 0; - } - modL(r, x); -} - -function add(p, q) { - var a = gf(), b = gf(), c = gf(), - d = gf(), e = gf(), f = gf(), - g = gf(), h = gf(), t = gf(); - - Z(a, p[1], p[0]); - Z(t, q[1], q[0]); - M(a, a, t); - A(b, p[0], p[1]); - A(t, q[0], q[1]); - M(b, b, t); - M(c, p[3], q[3]); - M(c, c, D2); - M(d, p[2], q[2]); - A(d, d, d); - Z(e, b, a); - Z(f, d, c); - A(g, d, c); - A(h, b, a); - - M(p[0], e, f); - M(p[1], h, g); - M(p[2], g, f); - M(p[3], e, h); -} - -function cswap(p, q, b) { - for(var i = 0; i < 4; ++i) { - sel25519(p[i], q[i], b); - } -} - -function pack(r, p) { - var tx = gf(), ty = gf(), zi = gf(); - inv25519(zi, p[2]); - M(tx, p[0], zi); - M(ty, p[1], zi); - pack25519(r, ty); - r[31] ^= par25519(tx) << 7; -} - -function pack25519(o, n) { - var i, j, b; - var m = gf(), t = gf(); - for(i = 0; i < 16; ++i) { - t[i] = n[i]; - } - car25519(t); - car25519(t); - car25519(t); - for(j = 0; j < 2; ++j) { - m[0] = t[0] - 0xffed; - for(i = 1; i < 15; ++i) { - m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1); - m[i-1] &= 0xffff; - } - m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1); - b = (m[15] >> 16) & 1; - m[14] &= 0xffff; - sel25519(t, m, 1 - b); - } - for (i = 0; i < 16; i++) { - o[2 * i] = t[i] & 0xff; - o[2 * i + 1] = t[i] >> 8; - } -} - -function unpackneg(r, p) { - var t = gf(), chk = gf(), num = gf(), - den = gf(), den2 = gf(), den4 = gf(), - den6 = gf(); - - set25519(r[2], gf1); - unpack25519(r[1], p); - S(num, r[1]); - M(den, num, D); - Z(num, num, r[2]); - A(den, r[2], den); - - S(den2, den); - S(den4, den2); - M(den6, den4, den2); - M(t, den6, num); - M(t, t, den); - - pow2523(t, t); - M(t, t, num); - M(t, t, den); - M(t, t, den); - M(r[0], t, den); - - S(chk, r[0]); - M(chk, chk, den); - if(neq25519(chk, num)) { - M(r[0], r[0], I); - } - - S(chk, r[0]); - M(chk, chk, den); - if(neq25519(chk, num)) { - return -1; - } - - if(par25519(r[0]) === (p[31] >> 7)) { - Z(r[0], gf0, r[0]); - } - - M(r[3], r[0], r[1]); - return 0; -} - -function unpack25519(o, n) { - var i; - for(i = 0; i < 16; ++i) { - o[i] = n[2 * i] + (n[2 * i + 1] << 8); - } - o[15] &= 0x7fff; -} - -function pow2523(o, i) { - var c = gf(); - var a; - for(a = 0; a < 16; ++a) { - c[a] = i[a]; - } - for(a = 250; a >= 0; --a) { - S(c, c); - if(a !== 1) { - M(c, c, i); - } - } - for(a = 0; a < 16; ++a) { - o[a] = c[a]; - } -} - -function neq25519(a, b) { - var c = new NativeBuffer(32); - var d = new NativeBuffer(32); - pack25519(c, a); - pack25519(d, b); - return crypto_verify_32(c, 0, d, 0); -} - -function crypto_verify_32(x, xi, y, yi) { - return vn(x, xi, y, yi, 32); -} - -function vn(x, xi, y, yi, n) { - var i, d = 0; - for(i = 0; i < n; ++i) { - d |= x[xi + i] ^ y[yi + i]; - } - return (1 & ((d - 1) >>> 8)) - 1; -} - -function par25519(a) { - var d = new NativeBuffer(32); - pack25519(d, a); - return d[0] & 1; -} - -function scalarmult(p, q, s) { - var b, i; - set25519(p[0], gf0); - set25519(p[1], gf1); - set25519(p[2], gf1); - set25519(p[3], gf0); - for(i = 255; i >= 0; --i) { - b = (s[(i / 8)|0] >> (i & 7)) & 1; - cswap(p, q, b); - add(q, p); - add(p, p); - cswap(p, q, b); - } -} - -function scalarbase(p, s) { - var q = [gf(), gf(), gf(), gf()]; - set25519(q[0], X); - set25519(q[1], Y); - set25519(q[2], gf1); - M(q[3], X, Y); - scalarmult(p, q, s); -} - -function set25519(r, a) { - var i; - for(i = 0; i < 16; i++) { - r[i] = a[i] | 0; - } -} - -function inv25519(o, i) { - var c = gf(); - var a; - for(a = 0; a < 16; ++a) { - c[a] = i[a]; - } - for(a = 253; a >= 0; --a) { - S(c, c); - if(a !== 2 && a !== 4) { - M(c, c, i); - } - } - for(a = 0; a < 16; ++a) { - o[a] = c[a]; - } -} - -function car25519(o) { - var i, v, c = 1; - for(i = 0; i < 16; ++i) { - v = o[i] + c + 65535; - c = Math.floor(v / 65536); - o[i] = v - c * 65536; - } - o[0] += c - 1 + 37 * (c - 1); -} - -function sel25519(p, q, b) { - var t, c = ~(b - 1); - for(var i = 0; i < 16; ++i) { - t = c & (p[i] ^ q[i]); - p[i] ^= t; - q[i] ^= t; - } -} - -function gf(init) { - var i, r = new Float64Array(16); - if(init) { - for(i = 0; i < init.length; ++i) { - r[i] = init[i]; - } - } - return r; -} - -function A(o, a, b) { - for(var i = 0; i < 16; ++i) { - o[i] = a[i] + b[i]; - } -} - -function Z(o, a, b) { - for(var i = 0; i < 16; ++i) { - o[i] = a[i] - b[i]; - } -} - -function S(o, a) { - M(o, a, a); -} - -function M(o, a, b) { - var v, c, - t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, - t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, - t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, - t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, - b0 = b[0], - b1 = b[1], - b2 = b[2], - b3 = b[3], - b4 = b[4], - b5 = b[5], - b6 = b[6], - b7 = b[7], - b8 = b[8], - b9 = b[9], - b10 = b[10], - b11 = b[11], - b12 = b[12], - b13 = b[13], - b14 = b[14], - b15 = b[15]; - - v = a[0]; - t0 += v * b0; - t1 += v * b1; - t2 += v * b2; - t3 += v * b3; - t4 += v * b4; - t5 += v * b5; - t6 += v * b6; - t7 += v * b7; - t8 += v * b8; - t9 += v * b9; - t10 += v * b10; - t11 += v * b11; - t12 += v * b12; - t13 += v * b13; - t14 += v * b14; - t15 += v * b15; - v = a[1]; - t1 += v * b0; - t2 += v * b1; - t3 += v * b2; - t4 += v * b3; - t5 += v * b4; - t6 += v * b5; - t7 += v * b6; - t8 += v * b7; - t9 += v * b8; - t10 += v * b9; - t11 += v * b10; - t12 += v * b11; - t13 += v * b12; - t14 += v * b13; - t15 += v * b14; - t16 += v * b15; - v = a[2]; - t2 += v * b0; - t3 += v * b1; - t4 += v * b2; - t5 += v * b3; - t6 += v * b4; - t7 += v * b5; - t8 += v * b6; - t9 += v * b7; - t10 += v * b8; - t11 += v * b9; - t12 += v * b10; - t13 += v * b11; - t14 += v * b12; - t15 += v * b13; - t16 += v * b14; - t17 += v * b15; - v = a[3]; - t3 += v * b0; - t4 += v * b1; - t5 += v * b2; - t6 += v * b3; - t7 += v * b4; - t8 += v * b5; - t9 += v * b6; - t10 += v * b7; - t11 += v * b8; - t12 += v * b9; - t13 += v * b10; - t14 += v * b11; - t15 += v * b12; - t16 += v * b13; - t17 += v * b14; - t18 += v * b15; - v = a[4]; - t4 += v * b0; - t5 += v * b1; - t6 += v * b2; - t7 += v * b3; - t8 += v * b4; - t9 += v * b5; - t10 += v * b6; - t11 += v * b7; - t12 += v * b8; - t13 += v * b9; - t14 += v * b10; - t15 += v * b11; - t16 += v * b12; - t17 += v * b13; - t18 += v * b14; - t19 += v * b15; - v = a[5]; - t5 += v * b0; - t6 += v * b1; - t7 += v * b2; - t8 += v * b3; - t9 += v * b4; - t10 += v * b5; - t11 += v * b6; - t12 += v * b7; - t13 += v * b8; - t14 += v * b9; - t15 += v * b10; - t16 += v * b11; - t17 += v * b12; - t18 += v * b13; - t19 += v * b14; - t20 += v * b15; - v = a[6]; - t6 += v * b0; - t7 += v * b1; - t8 += v * b2; - t9 += v * b3; - t10 += v * b4; - t11 += v * b5; - t12 += v * b6; - t13 += v * b7; - t14 += v * b8; - t15 += v * b9; - t16 += v * b10; - t17 += v * b11; - t18 += v * b12; - t19 += v * b13; - t20 += v * b14; - t21 += v * b15; - v = a[7]; - t7 += v * b0; - t8 += v * b1; - t9 += v * b2; - t10 += v * b3; - t11 += v * b4; - t12 += v * b5; - t13 += v * b6; - t14 += v * b7; - t15 += v * b8; - t16 += v * b9; - t17 += v * b10; - t18 += v * b11; - t19 += v * b12; - t20 += v * b13; - t21 += v * b14; - t22 += v * b15; - v = a[8]; - t8 += v * b0; - t9 += v * b1; - t10 += v * b2; - t11 += v * b3; - t12 += v * b4; - t13 += v * b5; - t14 += v * b6; - t15 += v * b7; - t16 += v * b8; - t17 += v * b9; - t18 += v * b10; - t19 += v * b11; - t20 += v * b12; - t21 += v * b13; - t22 += v * b14; - t23 += v * b15; - v = a[9]; - t9 += v * b0; - t10 += v * b1; - t11 += v * b2; - t12 += v * b3; - t13 += v * b4; - t14 += v * b5; - t15 += v * b6; - t16 += v * b7; - t17 += v * b8; - t18 += v * b9; - t19 += v * b10; - t20 += v * b11; - t21 += v * b12; - t22 += v * b13; - t23 += v * b14; - t24 += v * b15; - v = a[10]; - t10 += v * b0; - t11 += v * b1; - t12 += v * b2; - t13 += v * b3; - t14 += v * b4; - t15 += v * b5; - t16 += v * b6; - t17 += v * b7; - t18 += v * b8; - t19 += v * b9; - t20 += v * b10; - t21 += v * b11; - t22 += v * b12; - t23 += v * b13; - t24 += v * b14; - t25 += v * b15; - v = a[11]; - t11 += v * b0; - t12 += v * b1; - t13 += v * b2; - t14 += v * b3; - t15 += v * b4; - t16 += v * b5; - t17 += v * b6; - t18 += v * b7; - t19 += v * b8; - t20 += v * b9; - t21 += v * b10; - t22 += v * b11; - t23 += v * b12; - t24 += v * b13; - t25 += v * b14; - t26 += v * b15; - v = a[12]; - t12 += v * b0; - t13 += v * b1; - t14 += v * b2; - t15 += v * b3; - t16 += v * b4; - t17 += v * b5; - t18 += v * b6; - t19 += v * b7; - t20 += v * b8; - t21 += v * b9; - t22 += v * b10; - t23 += v * b11; - t24 += v * b12; - t25 += v * b13; - t26 += v * b14; - t27 += v * b15; - v = a[13]; - t13 += v * b0; - t14 += v * b1; - t15 += v * b2; - t16 += v * b3; - t17 += v * b4; - t18 += v * b5; - t19 += v * b6; - t20 += v * b7; - t21 += v * b8; - t22 += v * b9; - t23 += v * b10; - t24 += v * b11; - t25 += v * b12; - t26 += v * b13; - t27 += v * b14; - t28 += v * b15; - v = a[14]; - t14 += v * b0; - t15 += v * b1; - t16 += v * b2; - t17 += v * b3; - t18 += v * b4; - t19 += v * b5; - t20 += v * b6; - t21 += v * b7; - t22 += v * b8; - t23 += v * b9; - t24 += v * b10; - t25 += v * b11; - t26 += v * b12; - t27 += v * b13; - t28 += v * b14; - t29 += v * b15; - v = a[15]; - t15 += v * b0; - t16 += v * b1; - t17 += v * b2; - t18 += v * b3; - t19 += v * b4; - t20 += v * b5; - t21 += v * b6; - t22 += v * b7; - t23 += v * b8; - t24 += v * b9; - t25 += v * b10; - t26 += v * b11; - t27 += v * b12; - t28 += v * b13; - t29 += v * b14; - t30 += v * b15; - - t0 += 38 * t16; - t1 += 38 * t17; - t2 += 38 * t18; - t3 += 38 * t19; - t4 += 38 * t20; - t5 += 38 * t21; - t6 += 38 * t22; - t7 += 38 * t23; - t8 += 38 * t24; - t9 += 38 * t25; - t10 += 38 * t26; - t11 += 38 * t27; - t12 += 38 * t28; - t13 += 38 * t29; - t14 += 38 * t30; - // t15 left as is - - // first car - c = 1; - v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; - v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; - v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; - v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; - v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; - v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; - v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; - v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; - v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; - v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; - v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; - v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; - v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; - v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; - v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; - v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; - t0 += c-1 + 37 * (c-1); - - // second car - c = 1; - v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; - v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; - v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; - v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; - v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; - v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; - v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; - v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; - v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; - v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; - v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; - v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; - v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; - v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; - v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; - v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; - t0 += c-1 + 37 * (c-1); - - o[ 0] = t0; - o[ 1] = t1; - o[ 2] = t2; - o[ 3] = t3; - o[ 4] = t4; - o[ 5] = t5; - o[ 6] = t6; - o[ 7] = t7; - o[ 8] = t8; - o[ 9] = t9; - o[10] = t10; - o[11] = t11; - o[12] = t12; - o[13] = t13; - o[14] = t14; - o[15] = t15; -} diff --git a/node_modules/node-forge/lib/forge.js b/node_modules/node-forge/lib/forge.js deleted file mode 100644 index 2e243a9..0000000 --- a/node_modules/node-forge/lib/forge.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Node.js module for Forge. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = { - // default options - options: { - usePureJavaScript: false - } -}; diff --git a/node_modules/node-forge/lib/form.js b/node_modules/node-forge/lib/form.js deleted file mode 100644 index 4d7843a..0000000 --- a/node_modules/node-forge/lib/form.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Functions for manipulating web forms. - * - * @author David I. Lehn - * @author Dave Longley - * @author Mike Johnson - * - * Copyright (c) 2011-2014 Digital Bazaar, Inc. All rights reserved. - */ -var forge = require('./forge'); - -/* Form API */ -var form = module.exports = forge.form = forge.form || {}; - -(function($) { - -/** - * Regex for parsing a single name property (handles array brackets). - */ -var _regex = /([^\[]*?)\[(.*?)\]/g; - -/** - * Parses a single name property into an array with the name and any - * array indices. - * - * @param name the name to parse. - * - * @return the array of the name and its array indices in order. - */ -var _parseName = function(name) { - var rval = []; - - var matches; - while(!!(matches = _regex.exec(name))) { - if(matches[1].length > 0) { - rval.push(matches[1]); - } - if(matches.length >= 2) { - rval.push(matches[2]); - } - } - if(rval.length === 0) { - rval.push(name); - } - - return rval; -}; - -/** - * Adds a field from the given form to the given object. - * - * @param obj the object. - * @param names the field as an array of object property names. - * @param value the value of the field. - * @param dict a dictionary of names to replace. - */ -var _addField = function(obj, names, value, dict) { - // combine array names that fall within square brackets - var tmp = []; - for(var i = 0; i < names.length; ++i) { - // check name for starting square bracket but no ending one - var name = names[i]; - if(name.indexOf('[') !== -1 && name.indexOf(']') === -1 && - i < names.length - 1) { - do { - name += '.' + names[++i]; - } while(i < names.length - 1 && names[i].indexOf(']') === -1); - } - tmp.push(name); - } - names = tmp; - - // split out array indexes - var tmp = []; - $.each(names, function(n, name) { - tmp = tmp.concat(_parseName(name)); - }); - names = tmp; - - // iterate over object property names until value is set - $.each(names, function(n, name) { - // do dictionary name replacement - if(dict && name.length !== 0 && name in dict) { - name = dict[name]; - } - - // blank name indicates appending to an array, set name to - // new last index of array - if(name.length === 0) { - name = obj.length; - } - - // value already exists, append value - if(obj[name]) { - // last name in the field - if(n == names.length - 1) { - // more than one value, so convert into an array - if(!$.isArray(obj[name])) { - obj[name] = [obj[name]]; - } - obj[name].push(value); - } else { - // not last name, go deeper into object - obj = obj[name]; - } - } else if(n == names.length - 1) { - // new value, last name in the field, set value - obj[name] = value; - } else { - // new value, not last name, go deeper - // get next name - var next = names[n + 1]; - - // blank next value indicates array-appending, so create array - if(next.length === 0) { - obj[name] = []; - } else { - // if next name is a number create an array, otherwise a map - var isNum = ((next - 0) == next && next.length > 0); - obj[name] = isNum ? [] : {}; - } - obj = obj[name]; - } - }); -}; - -/** - * Serializes a form to a JSON object. Object properties will be separated - * using the given separator (defaults to '.') and by square brackets. - * - * @param input the jquery form to serialize. - * @param sep the object-property separator (defaults to '.'). - * @param dict a dictionary of names to replace (name=replace). - * - * @return the JSON-serialized form. - */ -form.serialize = function(input, sep, dict) { - var rval = {}; - - // add all fields in the form to the object - sep = sep || '.'; - $.each(input.serializeArray(), function() { - _addField(rval, this.name.split(sep), this.value || '', dict); - }); - - return rval; -}; - -})(jQuery); diff --git a/node_modules/node-forge/lib/hmac.js b/node_modules/node-forge/lib/hmac.js deleted file mode 100644 index b155f24..0000000 --- a/node_modules/node-forge/lib/hmac.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Hash-based Message Authentication Code implementation. Requires a message - * digest object that can be obtained, for example, from forge.md.sha1 or - * forge.md.md5. - * - * @author Dave Longley - * - * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -/* HMAC API */ -var hmac = module.exports = forge.hmac = forge.hmac || {}; - -/** - * Creates an HMAC object that uses the given message digest object. - * - * @return an HMAC object. - */ -hmac.create = function() { - // the hmac key to use - var _key = null; - - // the message digest to use - var _md = null; - - // the inner padding - var _ipadding = null; - - // the outer padding - var _opadding = null; - - // hmac context - var ctx = {}; - - /** - * Starts or restarts the HMAC with the given key and message digest. - * - * @param md the message digest to use, null to reuse the previous one, - * a string to use builtin 'sha1', 'md5', 'sha256'. - * @param key the key to use as a string, array of bytes, byte buffer, - * or null to reuse the previous key. - */ - ctx.start = function(md, key) { - if(md !== null) { - if(typeof md === 'string') { - // create builtin message digest - md = md.toLowerCase(); - if(md in forge.md.algorithms) { - _md = forge.md.algorithms[md].create(); - } else { - throw new Error('Unknown hash algorithm "' + md + '"'); - } - } else { - // store message digest - _md = md; - } - } - - if(key === null) { - // reuse previous key - key = _key; - } else { - if(typeof key === 'string') { - // convert string into byte buffer - key = forge.util.createBuffer(key); - } else if(forge.util.isArray(key)) { - // convert byte array into byte buffer - var tmp = key; - key = forge.util.createBuffer(); - for(var i = 0; i < tmp.length; ++i) { - key.putByte(tmp[i]); - } - } - - // if key is longer than blocksize, hash it - var keylen = key.length(); - if(keylen > _md.blockLength) { - _md.start(); - _md.update(key.bytes()); - key = _md.digest(); - } - - // mix key into inner and outer padding - // ipadding = [0x36 * blocksize] ^ key - // opadding = [0x5C * blocksize] ^ key - _ipadding = forge.util.createBuffer(); - _opadding = forge.util.createBuffer(); - keylen = key.length(); - for(var i = 0; i < keylen; ++i) { - var tmp = key.at(i); - _ipadding.putByte(0x36 ^ tmp); - _opadding.putByte(0x5C ^ tmp); - } - - // if key is shorter than blocksize, add additional padding - if(keylen < _md.blockLength) { - var tmp = _md.blockLength - keylen; - for(var i = 0; i < tmp; ++i) { - _ipadding.putByte(0x36); - _opadding.putByte(0x5C); - } - } - _key = key; - _ipadding = _ipadding.bytes(); - _opadding = _opadding.bytes(); - } - - // digest is done like so: hash(opadding | hash(ipadding | message)) - - // prepare to do inner hash - // hash(ipadding | message) - _md.start(); - _md.update(_ipadding); - }; - - /** - * Updates the HMAC with the given message bytes. - * - * @param bytes the bytes to update with. - */ - ctx.update = function(bytes) { - _md.update(bytes); - }; - - /** - * Produces the Message Authentication Code (MAC). - * - * @return a byte buffer containing the digest value. - */ - ctx.getMac = function() { - // digest is done like so: hash(opadding | hash(ipadding | message)) - // here we do the outer hashing - var inner = _md.digest().bytes(); - _md.start(); - _md.update(_opadding); - _md.update(inner); - return _md.digest(); - }; - // alias for getMac - ctx.digest = ctx.getMac; - - return ctx; -}; diff --git a/node_modules/node-forge/lib/http.js b/node_modules/node-forge/lib/http.js deleted file mode 100644 index 1dcb0a6..0000000 --- a/node_modules/node-forge/lib/http.js +++ /dev/null @@ -1,1364 +0,0 @@ -/** - * HTTP client-side implementation that uses forge.net sockets. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. All rights reserved. - */ -var forge = require('./forge'); -require('./debug'); -require('./tls'); -require('./util'); - -// define http namespace -var http = module.exports = forge.http = forge.http || {}; - -// logging category -var cat = 'forge.http'; - -// add array of clients to debug storage -if(forge.debug) { - forge.debug.set('forge.http', 'clients', []); -} - -// normalizes an http header field name -var _normalize = function(name) { - return name.toLowerCase().replace(/(^.)|(-.)/g, - function(a) {return a.toUpperCase();}); -}; - -/** - * Gets the local storage ID for the given client. - * - * @param client the client to get the local storage ID for. - * - * @return the local storage ID to use. - */ -var _getStorageId = function(client) { - // TODO: include browser in ID to avoid sharing cookies between - // browsers (if this is undesirable) - // navigator.userAgent - return 'forge.http.' + - client.url.scheme + '.' + - client.url.host + '.' + - client.url.port; -}; - -/** - * Loads persistent cookies from disk for the given client. - * - * @param client the client. - */ -var _loadCookies = function(client) { - if(client.persistCookies) { - try { - var cookies = forge.util.getItem( - client.socketPool.flashApi, - _getStorageId(client), 'cookies'); - client.cookies = cookies || {}; - } catch(ex) { - // no flash storage available, just silently fail - // TODO: i assume we want this logged somewhere or - // should it actually generate an error - //forge.log.error(cat, ex); - } - } -}; - -/** - * Saves persistent cookies on disk for the given client. - * - * @param client the client. - */ -var _saveCookies = function(client) { - if(client.persistCookies) { - try { - forge.util.setItem( - client.socketPool.flashApi, - _getStorageId(client), 'cookies', client.cookies); - } catch(ex) { - // no flash storage available, just silently fail - // TODO: i assume we want this logged somewhere or - // should it actually generate an error - //forge.log.error(cat, ex); - } - } - - // FIXME: remove me - _loadCookies(client); -}; - -/** - * Clears persistent cookies on disk for the given client. - * - * @param client the client. - */ -var _clearCookies = function(client) { - if(client.persistCookies) { - try { - // only thing stored is 'cookies', so clear whole storage - forge.util.clearItems( - client.socketPool.flashApi, - _getStorageId(client)); - } catch(ex) { - // no flash storage available, just silently fail - // TODO: i assume we want this logged somewhere or - // should it actually generate an error - //forge.log.error(cat, ex); - } - } -}; - -/** - * Connects and sends a request. - * - * @param client the http client. - * @param socket the socket to use. - */ -var _doRequest = function(client, socket) { - if(socket.isConnected()) { - // already connected - socket.options.request.connectTime = +new Date(); - socket.connected({ - type: 'connect', - id: socket.id - }); - } else { - // connect - socket.options.request.connectTime = +new Date(); - socket.connect({ - host: client.url.host, - port: client.url.port, - policyPort: client.policyPort, - policyUrl: client.policyUrl - }); - } -}; - -/** - * Handles the next request or marks a socket as idle. - * - * @param client the http client. - * @param socket the socket. - */ -var _handleNextRequest = function(client, socket) { - // clear buffer - socket.buffer.clear(); - - // get pending request - var pending = null; - while(pending === null && client.requests.length > 0) { - pending = client.requests.shift(); - if(pending.request.aborted) { - pending = null; - } - } - - // mark socket idle if no pending requests - if(pending === null) { - if(socket.options !== null) { - socket.options = null; - } - client.idle.push(socket); - } else { - // handle pending request, allow 1 retry - socket.retries = 1; - socket.options = pending; - _doRequest(client, socket); - } -}; - -/** - * Sets up a socket for use with an http client. - * - * @param client the parent http client. - * @param socket the socket to set up. - * @param tlsOptions if the socket must use TLS, the TLS options. - */ -var _initSocket = function(client, socket, tlsOptions) { - // no socket options yet - socket.options = null; - - // set up handlers - socket.connected = function(e) { - // socket primed by caching TLS session, handle next request - if(socket.options === null) { - _handleNextRequest(client, socket); - } else { - // socket in use - var request = socket.options.request; - request.connectTime = +new Date() - request.connectTime; - e.socket = socket; - socket.options.connected(e); - if(request.aborted) { - socket.close(); - } else { - var out = request.toString(); - if(request.body) { - out += request.body; - } - request.time = +new Date(); - socket.send(out); - request.time = +new Date() - request.time; - socket.options.response.time = +new Date(); - socket.sending = true; - } - } - }; - socket.closed = function(e) { - if(socket.sending) { - socket.sending = false; - if(socket.retries > 0) { - --socket.retries; - _doRequest(client, socket); - } else { - // error, closed during send - socket.error({ - id: socket.id, - type: 'ioError', - message: 'Connection closed during send. Broken pipe.', - bytesAvailable: 0 - }); - } - } else { - // handle unspecified content-length transfer - var response = socket.options.response; - if(response.readBodyUntilClose) { - response.time = +new Date() - response.time; - response.bodyReceived = true; - socket.options.bodyReady({ - request: socket.options.request, - response: response, - socket: socket - }); - } - socket.options.closed(e); - _handleNextRequest(client, socket); - } - }; - socket.data = function(e) { - socket.sending = false; - var request = socket.options.request; - if(request.aborted) { - socket.close(); - } else { - // receive all bytes available - var response = socket.options.response; - var bytes = socket.receive(e.bytesAvailable); - if(bytes !== null) { - // receive header and then body - socket.buffer.putBytes(bytes); - if(!response.headerReceived) { - response.readHeader(socket.buffer); - if(response.headerReceived) { - socket.options.headerReady({ - request: socket.options.request, - response: response, - socket: socket - }); - } - } - if(response.headerReceived && !response.bodyReceived) { - response.readBody(socket.buffer); - } - if(response.bodyReceived) { - socket.options.bodyReady({ - request: socket.options.request, - response: response, - socket: socket - }); - // close connection if requested or by default on http/1.0 - var value = response.getField('Connection') || ''; - if(value.indexOf('close') != -1 || - (response.version === 'HTTP/1.0' && - response.getField('Keep-Alive') === null)) { - socket.close(); - } else { - _handleNextRequest(client, socket); - } - } - } - } - }; - socket.error = function(e) { - // do error callback, include request - socket.options.error({ - type: e.type, - message: e.message, - request: socket.options.request, - response: socket.options.response, - socket: socket - }); - socket.close(); - }; - - // wrap socket for TLS - if(tlsOptions) { - socket = forge.tls.wrapSocket({ - sessionId: null, - sessionCache: {}, - caStore: tlsOptions.caStore, - cipherSuites: tlsOptions.cipherSuites, - socket: socket, - virtualHost: tlsOptions.virtualHost, - verify: tlsOptions.verify, - getCertificate: tlsOptions.getCertificate, - getPrivateKey: tlsOptions.getPrivateKey, - getSignature: tlsOptions.getSignature, - deflate: tlsOptions.deflate || null, - inflate: tlsOptions.inflate || null - }); - - socket.options = null; - socket.buffer = forge.util.createBuffer(); - client.sockets.push(socket); - if(tlsOptions.prime) { - // prime socket by connecting and caching TLS session, will do - // next request from there - socket.connect({ - host: client.url.host, - port: client.url.port, - policyPort: client.policyPort, - policyUrl: client.policyUrl - }); - } else { - // do not prime socket, just add as idle - client.idle.push(socket); - } - } else { - // no need to prime non-TLS sockets - socket.buffer = forge.util.createBuffer(); - client.sockets.push(socket); - client.idle.push(socket); - } -}; - -/** - * Checks to see if the given cookie has expired. If the cookie's max-age - * plus its created time is less than the time now, it has expired, unless - * its max-age is set to -1 which indicates it will never expire. - * - * @param cookie the cookie to check. - * - * @return true if it has expired, false if not. - */ -var _hasCookieExpired = function(cookie) { - var rval = false; - - if(cookie.maxAge !== -1) { - var now = _getUtcTime(new Date()); - var expires = cookie.created + cookie.maxAge; - if(expires <= now) { - rval = true; - } - } - - return rval; -}; - -/** - * Adds cookies in the given client to the given request. - * - * @param client the client. - * @param request the request. - */ -var _writeCookies = function(client, request) { - var expired = []; - var url = client.url; - var cookies = client.cookies; - for(var name in cookies) { - // get cookie paths - var paths = cookies[name]; - for(var p in paths) { - var cookie = paths[p]; - if(_hasCookieExpired(cookie)) { - // store for clean up - expired.push(cookie); - } else if(request.path.indexOf(cookie.path) === 0) { - // path or path's ancestor must match cookie.path - request.addCookie(cookie); - } - } - } - - // clean up expired cookies - for(var i = 0; i < expired.length; ++i) { - var cookie = expired[i]; - client.removeCookie(cookie.name, cookie.path); - } -}; - -/** - * Gets cookies from the given response and adds the to the given client. - * - * @param client the client. - * @param response the response. - */ -var _readCookies = function(client, response) { - var cookies = response.getCookies(); - for(var i = 0; i < cookies.length; ++i) { - try { - client.setCookie(cookies[i]); - } catch(ex) { - // ignore failure to add other-domain, etc. cookies - } - } -}; - -/** - * Creates an http client that uses forge.net sockets as a backend and - * forge.tls for security. - * - * @param options: - * url: the url to connect to (scheme://host:port). - * socketPool: the flash socket pool to use. - * policyPort: the flash policy port to use (if other than the - * socket pool default), use 0 for flash default. - * policyUrl: the flash policy file URL to use (if provided will - * be used instead of a policy port). - * connections: number of connections to use to handle requests. - * caCerts: an array of certificates to trust for TLS, certs may - * be PEM-formatted or cert objects produced via forge.pki. - * cipherSuites: an optional array of cipher suites to use, - * see forge.tls.CipherSuites. - * virtualHost: the virtual server name to use in a TLS SNI - * extension, if not provided the url host will be used. - * verify: a custom TLS certificate verify callback to use. - * getCertificate: an optional callback used to get a client-side - * certificate (see forge.tls for details). - * getPrivateKey: an optional callback used to get a client-side - * private key (see forge.tls for details). - * getSignature: an optional callback used to get a client-side - * signature (see forge.tls for details). - * persistCookies: true to use persistent cookies via flash local - * storage, false to only keep cookies in javascript. - * primeTlsSockets: true to immediately connect TLS sockets on - * their creation so that they will cache TLS sessions for reuse. - * - * @return the client. - */ -http.createClient = function(options) { - // create CA store to share with all TLS connections - var caStore = null; - if(options.caCerts) { - caStore = forge.pki.createCaStore(options.caCerts); - } - - // get scheme, host, and port from url - options.url = (options.url || - window.location.protocol + '//' + window.location.host); - var url = http.parseUrl(options.url); - if(!url) { - var error = new Error('Invalid url.'); - error.details = {url: options.url}; - throw error; - } - - // default to 1 connection - options.connections = options.connections || 1; - - // create client - var sp = options.socketPool; - var client = { - // url - url: url, - // socket pool - socketPool: sp, - // the policy port to use - policyPort: options.policyPort, - // policy url to use - policyUrl: options.policyUrl, - // queue of requests to service - requests: [], - // all sockets - sockets: [], - // idle sockets - idle: [], - // whether or not the connections are secure - secure: (url.scheme === 'https'), - // cookie jar (key'd off of name and then path, there is only 1 domain - // and one setting for secure per client so name+path is unique) - cookies: {}, - // default to flash storage of cookies - persistCookies: (typeof(options.persistCookies) === 'undefined') ? - true : options.persistCookies - }; - - // add client to debug storage - if(forge.debug) { - forge.debug.get('forge.http', 'clients').push(client); - } - - // load cookies from disk - _loadCookies(client); - - /** - * A default certificate verify function that checks a certificate common - * name against the client's URL host. - * - * @param c the TLS connection. - * @param verified true if cert is verified, otherwise alert number. - * @param depth the chain depth. - * @param certs the cert chain. - * - * @return true if verified and the common name matches the host, error - * otherwise. - */ - var _defaultCertificateVerify = function(c, verified, depth, certs) { - if(depth === 0 && verified === true) { - // compare common name to url host - var cn = certs[depth].subject.getField('CN'); - if(cn === null || client.url.host !== cn.value) { - verified = { - message: 'Certificate common name does not match url host.' - }; - } - } - return verified; - }; - - // determine if TLS is used - var tlsOptions = null; - if(client.secure) { - tlsOptions = { - caStore: caStore, - cipherSuites: options.cipherSuites || null, - virtualHost: options.virtualHost || url.host, - verify: options.verify || _defaultCertificateVerify, - getCertificate: options.getCertificate || null, - getPrivateKey: options.getPrivateKey || null, - getSignature: options.getSignature || null, - prime: options.primeTlsSockets || false - }; - - // if socket pool uses a flash api, then add deflate support to TLS - if(sp.flashApi !== null) { - tlsOptions.deflate = function(bytes) { - // strip 2 byte zlib header and 4 byte trailer - return forge.util.deflate(sp.flashApi, bytes, true); - }; - tlsOptions.inflate = function(bytes) { - return forge.util.inflate(sp.flashApi, bytes, true); - }; - } - } - - // create and initialize sockets - for(var i = 0; i < options.connections; ++i) { - _initSocket(client, sp.createSocket(), tlsOptions); - } - - /** - * Sends a request. A method 'abort' will be set on the request that - * can be called to attempt to abort the request. - * - * @param options: - * request: the request to send. - * connected: a callback for when the connection is open. - * closed: a callback for when the connection is closed. - * headerReady: a callback for when the response header arrives. - * bodyReady: a callback for when the response body arrives. - * error: a callback for if an error occurs. - */ - client.send = function(options) { - // add host header if not set - if(options.request.getField('Host') === null) { - options.request.setField('Host', client.url.fullHost); - } - - // set default dummy handlers - var opts = {}; - opts.request = options.request; - opts.connected = options.connected || function() {}; - opts.closed = options.close || function() {}; - opts.headerReady = function(e) { - // read cookies - _readCookies(client, e.response); - if(options.headerReady) { - options.headerReady(e); - } - }; - opts.bodyReady = options.bodyReady || function() {}; - opts.error = options.error || function() {}; - - // create response - opts.response = http.createResponse(); - opts.response.time = 0; - opts.response.flashApi = client.socketPool.flashApi; - opts.request.flashApi = client.socketPool.flashApi; - - // create abort function - opts.request.abort = function() { - // set aborted, clear handlers - opts.request.aborted = true; - opts.connected = function() {}; - opts.closed = function() {}; - opts.headerReady = function() {}; - opts.bodyReady = function() {}; - opts.error = function() {}; - }; - - // add cookies to request - _writeCookies(client, opts.request); - - // queue request options if there are no idle sockets - if(client.idle.length === 0) { - client.requests.push(opts); - } else { - // use an idle socket, prefer an idle *connected* socket first - var socket = null; - var len = client.idle.length; - for(var i = 0; socket === null && i < len; ++i) { - socket = client.idle[i]; - if(socket.isConnected()) { - client.idle.splice(i, 1); - } else { - socket = null; - } - } - // no connected socket available, get unconnected socket - if(socket === null) { - socket = client.idle.pop(); - } - socket.options = opts; - _doRequest(client, socket); - } - }; - - /** - * Destroys this client. - */ - client.destroy = function() { - // clear pending requests, close and destroy sockets - client.requests = []; - for(var i = 0; i < client.sockets.length; ++i) { - client.sockets[i].close(); - client.sockets[i].destroy(); - } - client.socketPool = null; - client.sockets = []; - client.idle = []; - }; - - /** - * Sets a cookie for use with all connections made by this client. Any - * cookie with the same name will be replaced. If the cookie's value - * is undefined, null, or the blank string, the cookie will be removed. - * - * If the cookie's domain doesn't match this client's url host or the - * cookie's secure flag doesn't match this client's url scheme, then - * setting the cookie will fail with an exception. - * - * @param cookie the cookie with parameters: - * name: the name of the cookie. - * value: the value of the cookie. - * comment: an optional comment string. - * maxAge: the age of the cookie in seconds relative to created time. - * secure: true if the cookie must be sent over a secure protocol. - * httpOnly: true to restrict access to the cookie from javascript - * (inaffective since the cookies are stored in javascript). - * path: the path for the cookie. - * domain: optional domain the cookie belongs to (must start with dot). - * version: optional version of the cookie. - * created: creation time, in UTC seconds, of the cookie. - */ - client.setCookie = function(cookie) { - var rval; - if(typeof(cookie.name) !== 'undefined') { - if(cookie.value === null || typeof(cookie.value) === 'undefined' || - cookie.value === '') { - // remove cookie - rval = client.removeCookie(cookie.name, cookie.path); - } else { - // set cookie defaults - cookie.comment = cookie.comment || ''; - cookie.maxAge = cookie.maxAge || 0; - cookie.secure = (typeof(cookie.secure) === 'undefined') ? - true : cookie.secure; - cookie.httpOnly = cookie.httpOnly || true; - cookie.path = cookie.path || '/'; - cookie.domain = cookie.domain || null; - cookie.version = cookie.version || null; - cookie.created = _getUtcTime(new Date()); - - // do secure check - if(cookie.secure !== client.secure) { - var error = new Error('Http client url scheme is incompatible ' + - 'with cookie secure flag.'); - error.url = client.url; - error.cookie = cookie; - throw error; - } - // make sure url host is within cookie.domain - if(!http.withinCookieDomain(client.url, cookie)) { - var error = new Error('Http client url scheme is incompatible ' + - 'with cookie secure flag.'); - error.url = client.url; - error.cookie = cookie; - throw error; - } - - // add new cookie - if(!(cookie.name in client.cookies)) { - client.cookies[cookie.name] = {}; - } - client.cookies[cookie.name][cookie.path] = cookie; - rval = true; - - // save cookies - _saveCookies(client); - } - } - - return rval; - }; - - /** - * Gets a cookie by its name. - * - * @param name the name of the cookie to retrieve. - * @param path an optional path for the cookie (if there are multiple - * cookies with the same name but different paths). - * - * @return the cookie or null if not found. - */ - client.getCookie = function(name, path) { - var rval = null; - if(name in client.cookies) { - var paths = client.cookies[name]; - - // get path-specific cookie - if(path) { - if(path in paths) { - rval = paths[path]; - } - } else { - // get first cookie - for(var p in paths) { - rval = paths[p]; - break; - } - } - } - return rval; - }; - - /** - * Removes a cookie. - * - * @param name the name of the cookie to remove. - * @param path an optional path for the cookie (if there are multiple - * cookies with the same name but different paths). - * - * @return true if a cookie was removed, false if not. - */ - client.removeCookie = function(name, path) { - var rval = false; - if(name in client.cookies) { - // delete the specific path - if(path) { - var paths = client.cookies[name]; - if(path in paths) { - rval = true; - delete client.cookies[name][path]; - // clean up entry if empty - var empty = true; - for(var i in client.cookies[name]) { - empty = false; - break; - } - if(empty) { - delete client.cookies[name]; - } - } - } else { - // delete all cookies with the given name - rval = true; - delete client.cookies[name]; - } - } - if(rval) { - // save cookies - _saveCookies(client); - } - return rval; - }; - - /** - * Clears all cookies stored in this client. - */ - client.clearCookies = function() { - client.cookies = {}; - _clearCookies(client); - }; - - if(forge.log) { - forge.log.debug('forge.http', 'created client', options); - } - - return client; -}; - -/** - * Trims the whitespace off of the beginning and end of a string. - * - * @param str the string to trim. - * - * @return the trimmed string. - */ -var _trimString = function(str) { - return str.replace(/^\s*/, '').replace(/\s*$/, ''); -}; - -/** - * Creates an http header object. - * - * @return the http header object. - */ -var _createHeader = function() { - var header = { - fields: {}, - setField: function(name, value) { - // normalize field name, trim value - header.fields[_normalize(name)] = [_trimString('' + value)]; - }, - appendField: function(name, value) { - name = _normalize(name); - if(!(name in header.fields)) { - header.fields[name] = []; - } - header.fields[name].push(_trimString('' + value)); - }, - getField: function(name, index) { - var rval = null; - name = _normalize(name); - if(name in header.fields) { - index = index || 0; - rval = header.fields[name][index]; - } - return rval; - } - }; - return header; -}; - -/** - * Gets the time in utc seconds given a date. - * - * @param d the date to use. - * - * @return the time in utc seconds. - */ -var _getUtcTime = function(d) { - var utc = +d + d.getTimezoneOffset() * 60000; - return Math.floor(+new Date() / 1000); -}; - -/** - * Creates an http request. - * - * @param options: - * version: the version. - * method: the method. - * path: the path. - * body: the body. - * headers: custom header fields to add, - * eg: [{'Content-Length': 0}]. - * - * @return the http request. - */ -http.createRequest = function(options) { - options = options || {}; - var request = _createHeader(); - request.version = options.version || 'HTTP/1.1'; - request.method = options.method || null; - request.path = options.path || null; - request.body = options.body || null; - request.bodyDeflated = false; - request.flashApi = null; - - // add custom headers - var headers = options.headers || []; - if(!forge.util.isArray(headers)) { - headers = [headers]; - } - for(var i = 0; i < headers.length; ++i) { - for(var name in headers[i]) { - request.appendField(name, headers[i][name]); - } - } - - /** - * Adds a cookie to the request 'Cookie' header. - * - * @param cookie a cookie to add. - */ - request.addCookie = function(cookie) { - var value = ''; - var field = request.getField('Cookie'); - if(field !== null) { - // separate cookies by semi-colons - value = field + '; '; - } - - // get current time in utc seconds - var now = _getUtcTime(new Date()); - - // output cookie name and value - value += cookie.name + '=' + cookie.value; - request.setField('Cookie', value); - }; - - /** - * Converts an http request into a string that can be sent as an - * HTTP request. Does not include any data. - * - * @return the string representation of the request. - */ - request.toString = function() { - /* Sample request header: - GET /some/path/?query HTTP/1.1 - Host: www.someurl.com - Connection: close - Accept-Encoding: deflate - Accept: image/gif, text/html - User-Agent: Mozilla 4.0 - */ - - // set default headers - if(request.getField('User-Agent') === null) { - request.setField('User-Agent', 'forge.http 1.0'); - } - if(request.getField('Accept') === null) { - request.setField('Accept', '*/*'); - } - if(request.getField('Connection') === null) { - request.setField('Connection', 'keep-alive'); - request.setField('Keep-Alive', '115'); - } - - // add Accept-Encoding if not specified - if(request.flashApi !== null && - request.getField('Accept-Encoding') === null) { - request.setField('Accept-Encoding', 'deflate'); - } - - // if the body isn't null, deflate it if its larger than 100 bytes - if(request.flashApi !== null && request.body !== null && - request.getField('Content-Encoding') === null && - !request.bodyDeflated && request.body.length > 100) { - // use flash to compress data - request.body = forge.util.deflate(request.flashApi, request.body); - request.bodyDeflated = true; - request.setField('Content-Encoding', 'deflate'); - request.setField('Content-Length', request.body.length); - } else if(request.body !== null) { - // set content length for body - request.setField('Content-Length', request.body.length); - } - - // build start line - var rval = - request.method.toUpperCase() + ' ' + request.path + ' ' + - request.version + '\r\n'; - - // add each header - for(var name in request.fields) { - var fields = request.fields[name]; - for(var i = 0; i < fields.length; ++i) { - rval += name + ': ' + fields[i] + '\r\n'; - } - } - // final terminating CRLF - rval += '\r\n'; - - return rval; - }; - - return request; -}; - -/** - * Creates an empty http response header. - * - * @return the empty http response header. - */ -http.createResponse = function() { - // private vars - var _first = true; - var _chunkSize = 0; - var _chunksFinished = false; - - // create response - var response = _createHeader(); - response.version = null; - response.code = 0; - response.message = null; - response.body = null; - response.headerReceived = false; - response.bodyReceived = false; - response.flashApi = null; - - /** - * Reads a line that ends in CRLF from a byte buffer. - * - * @param b the byte buffer. - * - * @return the line or null if none was found. - */ - var _readCrlf = function(b) { - var line = null; - var i = b.data.indexOf('\r\n', b.read); - if(i != -1) { - // read line, skip CRLF - line = b.getBytes(i - b.read); - b.getBytes(2); - } - return line; - }; - - /** - * Parses a header field and appends it to the response. - * - * @param line the header field line. - */ - var _parseHeader = function(line) { - var tmp = line.indexOf(':'); - var name = line.substring(0, tmp++); - response.appendField( - name, (tmp < line.length) ? line.substring(tmp) : ''); - }; - - /** - * Reads an http response header from a buffer of bytes. - * - * @param b the byte buffer to parse the header from. - * - * @return true if the whole header was read, false if not. - */ - response.readHeader = function(b) { - // read header lines (each ends in CRLF) - var line = ''; - while(!response.headerReceived && line !== null) { - line = _readCrlf(b); - if(line !== null) { - // parse first line - if(_first) { - _first = false; - var tmp = line.split(' '); - if(tmp.length >= 3) { - response.version = tmp[0]; - response.code = parseInt(tmp[1], 10); - response.message = tmp.slice(2).join(' '); - } else { - // invalid header - var error = new Error('Invalid http response header.'); - error.details = {'line': line}; - throw error; - } - } else if(line.length === 0) { - // handle final line, end of header - response.headerReceived = true; - } else { - _parseHeader(line); - } - } - } - - return response.headerReceived; - }; - - /** - * Reads some chunked http response entity-body from the given buffer of - * bytes. - * - * @param b the byte buffer to read from. - * - * @return true if the whole body was read, false if not. - */ - var _readChunkedBody = function(b) { - /* Chunked transfer-encoding sends data in a series of chunks, - followed by a set of 0-N http trailers. - The format is as follows: - - chunk-size (in hex) CRLF - chunk data (with "chunk-size" many bytes) CRLF - ... (N many chunks) - chunk-size (of 0 indicating the last chunk) CRLF - N many http trailers followed by CRLF - blank line + CRLF (terminates the trailers) - - If there are no http trailers, then after the chunk-size of 0, - there is still a single CRLF (indicating the blank line + CRLF - that terminates the trailers). In other words, you always terminate - the trailers with blank line + CRLF, regardless of 0-N trailers. */ - - /* From RFC-2616, section 3.6.1, here is the pseudo-code for - implementing chunked transfer-encoding: - - length := 0 - read chunk-size, chunk-extension (if any) and CRLF - while (chunk-size > 0) { - read chunk-data and CRLF - append chunk-data to entity-body - length := length + chunk-size - read chunk-size and CRLF - } - read entity-header - while (entity-header not empty) { - append entity-header to existing header fields - read entity-header - } - Content-Length := length - Remove "chunked" from Transfer-Encoding - */ - - var line = ''; - while(line !== null && b.length() > 0) { - // if in the process of reading a chunk - if(_chunkSize > 0) { - // if there are not enough bytes to read chunk and its - // trailing CRLF, we must wait for more data to be received - if(_chunkSize + 2 > b.length()) { - break; - } - - // read chunk data, skip CRLF - response.body += b.getBytes(_chunkSize); - b.getBytes(2); - _chunkSize = 0; - } else if(!_chunksFinished) { - // more chunks, read next chunk-size line - line = _readCrlf(b); - if(line !== null) { - // parse chunk-size (ignore any chunk extension) - _chunkSize = parseInt(line.split(';', 1)[0], 16); - _chunksFinished = (_chunkSize === 0); - } - } else { - // chunks finished, read next trailer - line = _readCrlf(b); - while(line !== null) { - if(line.length > 0) { - // parse trailer - _parseHeader(line); - // read next trailer - line = _readCrlf(b); - } else { - // body received - response.bodyReceived = true; - line = null; - } - } - } - } - - return response.bodyReceived; - }; - - /** - * Reads an http response body from a buffer of bytes. - * - * @param b the byte buffer to read from. - * - * @return true if the whole body was read, false if not. - */ - response.readBody = function(b) { - var contentLength = response.getField('Content-Length'); - var transferEncoding = response.getField('Transfer-Encoding'); - if(contentLength !== null) { - contentLength = parseInt(contentLength); - } - - // read specified length - if(contentLength !== null && contentLength >= 0) { - response.body = response.body || ''; - response.body += b.getBytes(contentLength); - response.bodyReceived = (response.body.length === contentLength); - } else if(transferEncoding !== null) { - // read chunked encoding - if(transferEncoding.indexOf('chunked') != -1) { - response.body = response.body || ''; - _readChunkedBody(b); - } else { - var error = new Error('Unknown Transfer-Encoding.'); - error.details = {'transferEncoding': transferEncoding}; - throw error; - } - } else if((contentLength !== null && contentLength < 0) || - (contentLength === null && - response.getField('Content-Type') !== null)) { - // read all data in the buffer - response.body = response.body || ''; - response.body += b.getBytes(); - response.readBodyUntilClose = true; - } else { - // no body - response.body = null; - response.bodyReceived = true; - } - - if(response.bodyReceived) { - response.time = +new Date() - response.time; - } - - if(response.flashApi !== null && - response.bodyReceived && response.body !== null && - response.getField('Content-Encoding') === 'deflate') { - // inflate using flash api - response.body = forge.util.inflate( - response.flashApi, response.body); - } - - return response.bodyReceived; - }; - - /** - * Parses an array of cookies from the 'Set-Cookie' field, if present. - * - * @return the array of cookies. - */ - response.getCookies = function() { - var rval = []; - - // get Set-Cookie field - if('Set-Cookie' in response.fields) { - var field = response.fields['Set-Cookie']; - - // get current local time in seconds - var now = +new Date() / 1000; - - // regex for parsing 'name1=value1; name2=value2; name3' - var regex = /\s*([^=]*)=?([^;]*)(;|$)/g; - - // examples: - // Set-Cookie: cookie1_name=cookie1_value; max-age=0; path=/ - // Set-Cookie: c2=v2; expires=Thu, 21-Aug-2008 23:47:25 GMT; path=/ - for(var i = 0; i < field.length; ++i) { - var fv = field[i]; - var m; - regex.lastIndex = 0; - var first = true; - var cookie = {}; - do { - m = regex.exec(fv); - if(m !== null) { - var name = _trimString(m[1]); - var value = _trimString(m[2]); - - // cookie_name=value - if(first) { - cookie.name = name; - cookie.value = value; - first = false; - } else { - // property_name=value - name = name.toLowerCase(); - switch(name) { - case 'expires': - // replace hyphens w/spaces so date will parse - value = value.replace(/-/g, ' '); - var secs = Date.parse(value) / 1000; - cookie.maxAge = Math.max(0, secs - now); - break; - case 'max-age': - cookie.maxAge = parseInt(value, 10); - break; - case 'secure': - cookie.secure = true; - break; - case 'httponly': - cookie.httpOnly = true; - break; - default: - if(name !== '') { - cookie[name] = value; - } - } - } - } - } while(m !== null && m[0] !== ''); - rval.push(cookie); - } - } - - return rval; - }; - - /** - * Converts an http response into a string that can be sent as an - * HTTP response. Does not include any data. - * - * @return the string representation of the response. - */ - response.toString = function() { - /* Sample response header: - HTTP/1.0 200 OK - Host: www.someurl.com - Connection: close - */ - - // build start line - var rval = - response.version + ' ' + response.code + ' ' + response.message + '\r\n'; - - // add each header - for(var name in response.fields) { - var fields = response.fields[name]; - for(var i = 0; i < fields.length; ++i) { - rval += name + ': ' + fields[i] + '\r\n'; - } - } - // final terminating CRLF - rval += '\r\n'; - - return rval; - }; - - return response; -}; - -/** - * Parses the scheme, host, and port from an http(s) url. - * - * @param str the url string. - * - * @return the parsed url object or null if the url is invalid. - */ -http.parseUrl = forge.util.parseUrl; - -/** - * Returns true if the given url is within the given cookie's domain. - * - * @param url the url to check. - * @param cookie the cookie or cookie domain to check. - */ -http.withinCookieDomain = function(url, cookie) { - var rval = false; - - // cookie may be null, a cookie object, or a domain string - var domain = (cookie === null || typeof cookie === 'string') ? - cookie : cookie.domain; - - // any domain will do - if(domain === null) { - rval = true; - } else if(domain.charAt(0) === '.') { - // ensure domain starts with a '.' - // parse URL as necessary - if(typeof url === 'string') { - url = http.parseUrl(url); - } - - // add '.' to front of URL host to match against domain - var host = '.' + url.host; - - // if the host ends with domain then it falls within it - var idx = host.lastIndexOf(domain); - if(idx !== -1 && (idx + domain.length === host.length)) { - rval = true; - } - } - - return rval; -}; diff --git a/node_modules/node-forge/lib/index.all.js b/node_modules/node-forge/lib/index.all.js deleted file mode 100644 index 22ba72b..0000000 --- a/node_modules/node-forge/lib/index.all.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Node.js module for Forge with extra utils and networking. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = require('./forge'); -// require core forge -require('./index'); -// additional utils and networking support -require('./form'); -require('./socket'); -require('./tlssocket'); -require('./http'); -require('./xhr'); diff --git a/node_modules/node-forge/lib/index.js b/node_modules/node-forge/lib/index.js deleted file mode 100644 index ea8c14c..0000000 --- a/node_modules/node-forge/lib/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Node.js module for Forge. - * - * @author Dave Longley - * - * Copyright 2011-2016 Digital Bazaar, Inc. - */ -module.exports = require('./forge'); -require('./aes'); -require('./aesCipherSuites'); -require('./asn1'); -require('./cipher'); -require('./debug'); -require('./des'); -require('./ed25519'); -require('./hmac'); -require('./kem'); -require('./log'); -require('./md.all'); -require('./mgf1'); -require('./pbkdf2'); -require('./pem'); -require('./pkcs1'); -require('./pkcs12'); -require('./pkcs7'); -require('./pki'); -require('./prime'); -require('./prng'); -require('./pss'); -require('./random'); -require('./rc2'); -require('./ssh'); -require('./task'); -require('./tls'); -require('./util'); diff --git a/node_modules/node-forge/lib/jsbn.js b/node_modules/node-forge/lib/jsbn.js deleted file mode 100644 index 11f965c..0000000 --- a/node_modules/node-forge/lib/jsbn.js +++ /dev/null @@ -1,1264 +0,0 @@ -// Copyright (c) 2005 Tom Wu -// All Rights Reserved. -// See "LICENSE" for details. - -// Basic JavaScript BN library - subset useful for RSA encryption. - -/* -Licensing (LICENSE) -------------------- - -This software is covered under the following copyright: -*/ -/* - * Copyright (c) 2003-2005 Tom Wu - * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - * - * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF - * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT - * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * In addition, the following condition applies: - * - * All redistributions must retain an intact copy of this copyright notice - * and disclaimer. - */ -/* -Address all questions regarding this license to: - - Tom Wu - tjw@cs.Stanford.EDU -*/ -var forge = require('./forge'); - -module.exports = forge.jsbn = forge.jsbn || {}; - -// Bits per digit -var dbits; - -// JavaScript engine analysis -var canary = 0xdeadbeefcafe; -var j_lm = ((canary&0xffffff)==0xefcafe); - -// (public) Constructor -function BigInteger(a,b,c) { - this.data = []; - if(a != null) - if("number" == typeof a) this.fromNumber(a,b,c); - else if(b == null && "string" != typeof a) this.fromString(a,256); - else this.fromString(a,b); -} -forge.jsbn.BigInteger = BigInteger; - -// return new, unset BigInteger -function nbi() { return new BigInteger(null); } - -// am: Compute w_j += (x*this_i), propagate carries, -// c is initial carry, returns final carry. -// c < 3*dvalue, x < 2*dvalue, this_i < dvalue -// We need to select the fastest one that works in this environment. - -// am1: use a single mult and divide to get the high bits, -// max digit bits should be 26 because -// max internal value = 2*dvalue^2-2*dvalue (< 2^53) -function am1(i,x,w,j,c,n) { - while(--n >= 0) { - var v = x*this.data[i++]+w.data[j]+c; - c = Math.floor(v/0x4000000); - w.data[j++] = v&0x3ffffff; - } - return c; -} -// am2 avoids a big mult-and-extract completely. -// Max digit bits should be <= 30 because we do bitwise ops -// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) -function am2(i,x,w,j,c,n) { - var xl = x&0x7fff, xh = x>>15; - while(--n >= 0) { - var l = this.data[i]&0x7fff; - var h = this.data[i++]>>15; - var m = xh*l+h*xl; - l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff); - c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); - w.data[j++] = l&0x3fffffff; - } - return c; -} -// Alternately, set max digit bits to 28 since some -// browsers slow down when dealing with 32-bit numbers. -function am3(i,x,w,j,c,n) { - var xl = x&0x3fff, xh = x>>14; - while(--n >= 0) { - var l = this.data[i]&0x3fff; - var h = this.data[i++]>>14; - var m = xh*l+h*xl; - l = xl*l+((m&0x3fff)<<14)+w.data[j]+c; - c = (l>>28)+(m>>14)+xh*h; - w.data[j++] = l&0xfffffff; - } - return c; -} - -// node.js (no browser) -if(typeof(navigator) === 'undefined') -{ - BigInteger.prototype.am = am3; - dbits = 28; -} else if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { - BigInteger.prototype.am = am2; - dbits = 30; -} else if(j_lm && (navigator.appName != "Netscape")) { - BigInteger.prototype.am = am1; - dbits = 26; -} else { // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; -} - -BigInteger.prototype.DB = dbits; -BigInteger.prototype.DM = ((1<= 0; --i) r.data[i] = this.data[i]; - r.t = this.t; - r.s = this.s; -} - -// (protected) set from integer value x, -DV <= x < DV -function bnpFromInt(x) { - this.t = 1; - this.s = (x<0)?-1:0; - if(x > 0) this.data[0] = x; - else if(x < -1) this.data[0] = x+this.DV; - else this.t = 0; -} - -// return bigint initialized to value -function nbv(i) { var r = nbi(); r.fromInt(i); return r; } - -// (protected) set from string and radix -function bnpFromString(s,b) { - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 256) k = 8; // byte array - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else { this.fromRadix(s,b); return; } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while(--i >= 0) { - var x = (k==8)?s[i]&0xff:intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if(sh == 0) - this.data[this.t++] = x; - else if(sh+k > this.DB) { - this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); - } else - this.data[this.t-1] |= x<= this.DB) sh -= this.DB; - } - if(k == 8 && (s[0]&0x80) != 0) { - this.s = -1; - if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this.data[this.t-1] == c) --this.t; -} - -// (public) return string representation in given radix -function bnToString(b) { - if(this.s < 0) return "-"+this.negate().toString(b); - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else return this.toRadix(b); - var km = (1< 0) { - if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); } - while(i >= 0) { - if(p < k) { - d = (this.data[i]&((1<>(p+=this.DB-k); - } else { - d = (this.data[i]>>(p-=k))&km; - if(p <= 0) { p += this.DB; --i; } - } - if(d > 0) m = true; - if(m) r += int2char(d); - } - } - return m?r:"0"; -} - -// (public) -this -function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - -// (public) |this| -function bnAbs() { return (this.s<0)?this.negate():this; } - -// (public) return + if this > a, - if this < a, 0 if equal -function bnCompareTo(a) { - var r = this.s-a.s; - if(r != 0) return r; - var i = this.t; - r = i-a.t; - if(r != 0) return (this.s<0)?-r:r; - while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r; - return 0; -} - -// returns bit length of the integer x -function nbits(x) { - var r = 1, t; - if((t=x>>>16) != 0) { x = t; r += 16; } - if((t=x>>8) != 0) { x = t; r += 8; } - if((t=x>>4) != 0) { x = t; r += 4; } - if((t=x>>2) != 0) { x = t; r += 2; } - if((t=x>>1) != 0) { x = t; r += 1; } - return r; -} - -// (public) return the number of bits in "this" -function bnBitLength() { - if(this.t <= 0) return 0; - return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM)); -} - -// (protected) r = this << n*DB -function bnpDLShiftTo(n,r) { - var i; - for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i]; - for(i = n-1; i >= 0; --i) r.data[i] = 0; - r.t = this.t+n; - r.s = this.s; -} - -// (protected) r = this >> n*DB -function bnpDRShiftTo(n,r) { - for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i]; - r.t = Math.max(this.t-n,0); - r.s = this.s; -} - -// (protected) r = this << n -function bnpLShiftTo(n,r) { - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<= 0; --i) { - r.data[i+ds+1] = (this.data[i]>>cbs)|c; - c = (this.data[i]&bm)<= 0; --i) r.data[i] = 0; - r.data[ds] = c; - r.t = this.t+ds+1; - r.s = this.s; - r.clamp(); -} - -// (protected) r = this >> n -function bnpRShiftTo(n,r) { - r.s = this.s; - var ds = Math.floor(n/this.DB); - if(ds >= this.t) { r.t = 0; return; } - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<>bs; - for(var i = ds+1; i < this.t; ++i) { - r.data[i-ds-1] |= (this.data[i]&bm)<>bs; - } - if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<>= this.DB; - } - if(a.t < this.t) { - c -= a.s; - while(i < this.t) { - c += this.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; - } else { - c += this.s; - while(i < a.t) { - c -= a.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = (c<0)?-1:0; - if(c < -1) r.data[i++] = this.DV+c; - else if(c > 0) r.data[i++] = c; - r.t = i; - r.clamp(); -} - -// (protected) r = this * a, r != this,a (HAC 14.12) -// "this" should be the larger one if appropriate. -function bnpMultiplyTo(a,r) { - var x = this.abs(), y = a.abs(); - var i = x.t; - r.t = i+y.t; - while(--i >= 0) r.data[i] = 0; - for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t); - r.s = 0; - r.clamp(); - if(this.s != a.s) BigInteger.ZERO.subTo(r,r); -} - -// (protected) r = this^2, r != this (HAC 14.16) -function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2*x.t; - while(--i >= 0) r.data[i] = 0; - for(i = 0; i < x.t-1; ++i) { - var c = x.am(i,x.data[i],r,2*i,0,1); - if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { - r.data[i+x.t] -= x.DV; - r.data[i+x.t+1] = 1; - } - } - if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1); - r.s = 0; - r.clamp(); -} - -// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) -// r != q, this != m. q or r may be null. -function bnpDivRemTo(m,q,r) { - var pm = m.abs(); - if(pm.t <= 0) return; - var pt = this.abs(); - if(pt.t < pm.t) { - if(q != null) q.fromInt(0); - if(r != null) this.copyTo(r); - return; - } - if(r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var nsh = this.DB-nbits(pm.data[pm.t-1]); // normalize modulus - if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } - var ys = y.t; - var y0 = y.data[ys-1]; - if(y0 == 0) return; - var yt = y0*(1<1)?y.data[ys-2]>>this.F2:0); - var d1 = this.FV/yt, d2 = (1<= 0) { - r.data[r.t++] = 1; - r.subTo(t,r); - } - BigInteger.ONE.dlShiftTo(ys,t); - t.subTo(y,y); // "negative" y so we can replace sub with am later - while(y.t < ys) y.data[y.t++] = 0; - while(--j >= 0) { - // Estimate quotient digit - var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2); - if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out - y.dlShiftTo(j,t); - r.subTo(t,r); - while(r.data[i] < --qd) r.subTo(t,r); - } - } - if(q != null) { - r.drShiftTo(ys,q); - if(ts != ms) BigInteger.ZERO.subTo(q,q); - } - r.t = ys; - r.clamp(); - if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder - if(ts < 0) BigInteger.ZERO.subTo(r,r); -} - -// (public) this mod a -function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a,null,r); - if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); - return r; -} - -// Modular reduction using "classic" algorithm -function Classic(m) { this.m = m; } -function cConvert(x) { - if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; -} -function cRevert(x) { return x; } -function cReduce(x) { x.divRemTo(this.m,null,x); } -function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } -function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -Classic.prototype.convert = cConvert; -Classic.prototype.revert = cRevert; -Classic.prototype.reduce = cReduce; -Classic.prototype.mulTo = cMulTo; -Classic.prototype.sqrTo = cSqrTo; - -// (protected) return "-1/this % 2^DB"; useful for Mont. reduction -// justification: -// xy == 1 (mod m) -// xy = 1+km -// xy(2-xy) = (1+km)(1-km) -// x[y(2-xy)] = 1-k^2m^2 -// x[y(2-xy)] == 1 (mod m^2) -// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 -// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. -// JS multiply "overflows" differently from C/C++, so care is needed here. -function bnpInvDigit() { - if(this.t < 1) return 0; - var x = this.data[0]; - if((x&1) == 0) return 0; - var y = x&3; // y == 1/x mod 2^2 - y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 - y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 - y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y>0)?this.DV-y:-y; -} - -// Montgomery reduction -function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp&0x7fff; - this.mph = this.mp>>15; - this.um = (1<<(m.DB-15))-1; - this.mt2 = 2*m.t; -} - -// xR mod m -function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t,r); - r.divRemTo(this.m,null,r); - if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); - return r; -} - -// x/R mod m -function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; -} - -// x = x/R mod m (HAC 14.32) -function montReduce(x) { - while(x.t <= this.mt2) // pad x so am has enough room later - x.data[x.t++] = 0; - for(var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x.data[i]*mp mod DV - var j = x.data[i]&0x7fff; - var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM; - // use am to combine the multiply-shift-add into one call - j = i+this.m.t; - x.data[j] += this.m.am(0,u0,x,i,0,this.m.t); - // propagate carry - while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; } - } - x.clamp(); - x.drShiftTo(this.m.t,x); - if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -// r = "x^2/R mod m"; x != r -function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -// r = "xy/R mod m"; x,y != r -function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Montgomery.prototype.convert = montConvert; -Montgomery.prototype.revert = montRevert; -Montgomery.prototype.reduce = montReduce; -Montgomery.prototype.mulTo = montMulTo; -Montgomery.prototype.sqrTo = montSqrTo; - -// (protected) true iff this is even -function bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; } - -// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) -function bnpExp(e,z) { - if(e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; - g.copyTo(r); - while(--i >= 0) { - z.sqrTo(r,r2); - if((e&(1< 0) z.mulTo(r2,g,r); - else { var t = r; r = r2; r2 = t; } - } - return z.revert(r); -} - -// (public) this^e % m, 0 <= e < 2^32 -function bnModPowInt(e,m) { - var z; - if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); - return this.exp(e,z); -} - -// protected -BigInteger.prototype.copyTo = bnpCopyTo; -BigInteger.prototype.fromInt = bnpFromInt; -BigInteger.prototype.fromString = bnpFromString; -BigInteger.prototype.clamp = bnpClamp; -BigInteger.prototype.dlShiftTo = bnpDLShiftTo; -BigInteger.prototype.drShiftTo = bnpDRShiftTo; -BigInteger.prototype.lShiftTo = bnpLShiftTo; -BigInteger.prototype.rShiftTo = bnpRShiftTo; -BigInteger.prototype.subTo = bnpSubTo; -BigInteger.prototype.multiplyTo = bnpMultiplyTo; -BigInteger.prototype.squareTo = bnpSquareTo; -BigInteger.prototype.divRemTo = bnpDivRemTo; -BigInteger.prototype.invDigit = bnpInvDigit; -BigInteger.prototype.isEven = bnpIsEven; -BigInteger.prototype.exp = bnpExp; - -// public -BigInteger.prototype.toString = bnToString; -BigInteger.prototype.negate = bnNegate; -BigInteger.prototype.abs = bnAbs; -BigInteger.prototype.compareTo = bnCompareTo; -BigInteger.prototype.bitLength = bnBitLength; -BigInteger.prototype.mod = bnMod; -BigInteger.prototype.modPowInt = bnModPowInt; - -// "constants" -BigInteger.ZERO = nbv(0); -BigInteger.ONE = nbv(1); - -// jsbn2 lib - -//Copyright (c) 2005-2009 Tom Wu -//All Rights Reserved. -//See "LICENSE" for details (See jsbn.js for LICENSE). - -//Extended JavaScript BN functions, required for RSA private ops. - -//Version 1.1: new BigInteger("0", 10) returns "proper" zero - -//(public) -function bnClone() { var r = nbi(); this.copyTo(r); return r; } - -//(public) return value as integer -function bnIntValue() { -if(this.s < 0) { - if(this.t == 1) return this.data[0]-this.DV; - else if(this.t == 0) return -1; -} else if(this.t == 1) return this.data[0]; -else if(this.t == 0) return 0; -// assumes 16 < DB < 32 -return ((this.data[1]&((1<<(32-this.DB))-1))<>24; } - -//(public) return value as short (assumes DB>=16) -function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; } - -//(protected) return x s.t. r^x < DV -function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } - -//(public) 0 if this == 0, 1 if this > 0 -function bnSigNum() { -if(this.s < 0) return -1; -else if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0; -else return 1; -} - -//(protected) convert to radix string -function bnpToRadix(b) { -if(b == null) b = 10; -if(this.signum() == 0 || b < 2 || b > 36) return "0"; -var cs = this.chunkSize(b); -var a = Math.pow(b,cs); -var d = nbv(a), y = nbi(), z = nbi(), r = ""; -this.divRemTo(d,y,z); -while(y.signum() > 0) { - r = (a+z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d,y,z); -} -return z.intValue().toString(b) + r; -} - -//(protected) convert from radix string -function bnpFromRadix(s,b) { -this.fromInt(0); -if(b == null) b = 10; -var cs = this.chunkSize(b); -var d = Math.pow(b,cs), mi = false, j = 0, w = 0; -for(var i = 0; i < s.length; ++i) { - var x = intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b*w+x; - if(++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w,0); - j = 0; - w = 0; - } -} -if(j > 0) { - this.dMultiply(Math.pow(b,j)); - this.dAddOffset(w,0); -} -if(mi) BigInteger.ZERO.subTo(this,this); -} - -//(protected) alternate constructor -function bnpFromNumber(a,b,c) { -if("number" == typeof b) { - // new BigInteger(int,int,RNG) - if(a < 2) this.fromInt(1); - else { - this.fromNumber(a,c); - if(!this.testBit(a-1)) // force MSB set - this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); - if(this.isEven()) this.dAddOffset(1,0); // force odd - while(!this.isProbablePrime(b)) { - this.dAddOffset(2,0); - if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); - } - } -} else { - // new BigInteger(int,RNG) - var x = new Array(), t = a&7; - x.length = (a>>3)+1; - b.nextBytes(x); - if(t > 0) x[0] &= ((1< 0) { - if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p) - r[k++] = d|(this.s<<(this.DB-p)); - while(i >= 0) { - if(p < 8) { - d = (this.data[i]&((1<>(p+=this.DB-8); - } else { - d = (this.data[i]>>(p-=8))&0xff; - if(p <= 0) { p += this.DB; --i; } - } - if((d&0x80) != 0) d |= -256; - if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; - if(k > 0 || d != this.s) r[k++] = d; - } -} -return r; -} - -function bnEquals(a) { return(this.compareTo(a)==0); } -function bnMin(a) { return(this.compareTo(a)<0)?this:a; } -function bnMax(a) { return(this.compareTo(a)>0)?this:a; } - -//(protected) r = this op a (bitwise) -function bnpBitwiseTo(a,op,r) { -var i, f, m = Math.min(a.t,this.t); -for(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]); -if(a.t < this.t) { - f = a.s&this.DM; - for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f); - r.t = this.t; -} else { - f = this.s&this.DM; - for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]); - r.t = a.t; -} -r.s = op(this.s,a.s); -r.clamp(); -} - -//(public) this & a -function op_and(x,y) { return x&y; } -function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } - -//(public) this | a -function op_or(x,y) { return x|y; } -function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } - -//(public) this ^ a -function op_xor(x,y) { return x^y; } -function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } - -//(public) this & ~a -function op_andnot(x,y) { return x&~y; } -function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } - -//(public) ~this -function bnNot() { -var r = nbi(); -for(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i]; -r.t = this.t; -r.s = ~this.s; -return r; -} - -//(public) this << n -function bnShiftLeft(n) { -var r = nbi(); -if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); -return r; -} - -//(public) this >> n -function bnShiftRight(n) { -var r = nbi(); -if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); -return r; -} - -//return index of lowest 1-bit in x, x < 2^31 -function lbit(x) { -if(x == 0) return -1; -var r = 0; -if((x&0xffff) == 0) { x >>= 16; r += 16; } -if((x&0xff) == 0) { x >>= 8; r += 8; } -if((x&0xf) == 0) { x >>= 4; r += 4; } -if((x&3) == 0) { x >>= 2; r += 2; } -if((x&1) == 0) ++r; -return r; -} - -//(public) returns index of lowest 1-bit (or -1 if none) -function bnGetLowestSetBit() { -for(var i = 0; i < this.t; ++i) - if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]); -if(this.s < 0) return this.t*this.DB; -return -1; -} - -//return number of 1 bits in x -function cbit(x) { -var r = 0; -while(x != 0) { x &= x-1; ++r; } -return r; -} - -//(public) return number of set bits -function bnBitCount() { -var r = 0, x = this.s&this.DM; -for(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x); -return r; -} - -//(public) true iff nth bit is set -function bnTestBit(n) { -var j = Math.floor(n/this.DB); -if(j >= this.t) return(this.s!=0); -return((this.data[j]&(1<<(n%this.DB)))!=0); -} - -//(protected) this op (1<>= this.DB; -} -if(a.t < this.t) { - c += a.s; - while(i < this.t) { - c += this.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; -} else { - c += this.s; - while(i < a.t) { - c += a.data[i]; - r.data[i++] = c&this.DM; - c >>= this.DB; - } - c += a.s; -} -r.s = (c<0)?-1:0; -if(c > 0) r.data[i++] = c; -else if(c < -1) r.data[i++] = this.DV+c; -r.t = i; -r.clamp(); -} - -//(public) this + a -function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } - -//(public) this - a -function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } - -//(public) this * a -function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } - -//(public) this / a -function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } - -//(public) this % a -function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } - -//(public) [this/a,this%a] -function bnDivideAndRemainder(a) { -var q = nbi(), r = nbi(); -this.divRemTo(a,q,r); -return new Array(q,r); -} - -//(protected) this *= n, this >= 0, 1 < n < DV -function bnpDMultiply(n) { -this.data[this.t] = this.am(0,n-1,this,0,0,this.t); -++this.t; -this.clamp(); -} - -//(protected) this += n << w words, this >= 0 -function bnpDAddOffset(n,w) { -if(n == 0) return; -while(this.t <= w) this.data[this.t++] = 0; -this.data[w] += n; -while(this.data[w] >= this.DV) { - this.data[w] -= this.DV; - if(++w >= this.t) this.data[this.t++] = 0; - ++this.data[w]; -} -} - -//A "null" reducer -function NullExp() {} -function nNop(x) { return x; } -function nMulTo(x,y,r) { x.multiplyTo(y,r); } -function nSqrTo(x,r) { x.squareTo(r); } - -NullExp.prototype.convert = nNop; -NullExp.prototype.revert = nNop; -NullExp.prototype.mulTo = nMulTo; -NullExp.prototype.sqrTo = nSqrTo; - -//(public) this^e -function bnPow(e) { return this.exp(e,new NullExp()); } - -//(protected) r = lower n words of "this * a", a.t <= n -//"this" should be the larger one if appropriate. -function bnpMultiplyLowerTo(a,n,r) { -var i = Math.min(this.t+a.t,n); -r.s = 0; // assumes a,this >= 0 -r.t = i; -while(i > 0) r.data[--i] = 0; -var j; -for(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t); -for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i); -r.clamp(); -} - -//(protected) r = "this * a" without lower n words, n > 0 -//"this" should be the larger one if appropriate. -function bnpMultiplyUpperTo(a,n,r) { ---n; -var i = r.t = this.t+a.t-n; -r.s = 0; // assumes a,this >= 0 -while(--i >= 0) r.data[i] = 0; -for(i = Math.max(n-this.t,0); i < a.t; ++i) - r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n); -r.clamp(); -r.drShiftTo(1,r); -} - -//Barrett modular reduction -function Barrett(m) { -// setup Barrett -this.r2 = nbi(); -this.q3 = nbi(); -BigInteger.ONE.dlShiftTo(2*m.t,this.r2); -this.mu = this.r2.divide(m); -this.m = m; -} - -function barrettConvert(x) { -if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); -else if(x.compareTo(this.m) < 0) return x; -else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } -} - -function barrettRevert(x) { return x; } - -//x = x mod m (HAC 14.42) -function barrettReduce(x) { -x.drShiftTo(this.m.t-1,this.r2); -if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } -this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); -this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); -while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); -x.subTo(this.r2,x); -while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); -} - -//r = x^2 mod m; x != r -function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - -//r = x*y mod m; x,y != r -function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - -Barrett.prototype.convert = barrettConvert; -Barrett.prototype.revert = barrettRevert; -Barrett.prototype.reduce = barrettReduce; -Barrett.prototype.mulTo = barrettMulTo; -Barrett.prototype.sqrTo = barrettSqrTo; - -//(public) this^e % m (HAC 14.85) -function bnModPow(e,m) { -var i = e.bitLength(), k, r = nbv(1), z; -if(i <= 0) return r; -else if(i < 18) k = 1; -else if(i < 48) k = 3; -else if(i < 144) k = 4; -else if(i < 768) k = 5; -else k = 6; -if(i < 8) - z = new Classic(m); -else if(m.isEven()) - z = new Barrett(m); -else - z = new Montgomery(m); - -// precomputation -var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { - var g2 = nbi(); - z.sqrTo(g[1],g2); - while(n <= km) { - g[n] = nbi(); - z.mulTo(g2,g[n-2],g[n]); - n += 2; - } -} - -var j = e.t-1, w, is1 = true, r2 = nbi(), t; -i = nbits(e.data[j])-1; -while(j >= 0) { - if(i >= k1) w = (e.data[j]>>(i-k1))&km; - else { - w = (e.data[j]&((1<<(i+1))-1))<<(k1-i); - if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1); - } - - n = k; - while((w&1) == 0) { w >>= 1; --n; } - if((i -= n) < 0) { i += this.DB; --j; } - if(is1) { // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } else { - while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } - if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } - z.mulTo(r2,g[w],r); - } - - while(j >= 0 && (e.data[j]&(1< 0) { - x.rShiftTo(g,x); - y.rShiftTo(g,y); -} -while(x.signum() > 0) { - if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); - if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); - if(x.compareTo(y) >= 0) { - x.subTo(y,x); - x.rShiftTo(1,x); - } else { - y.subTo(x,y); - y.rShiftTo(1,y); - } -} -if(g > 0) y.lShiftTo(g,y); -return y; -} - -//(protected) this % n, n < 2^26 -function bnpModInt(n) { -if(n <= 0) return 0; -var d = this.DV%n, r = (this.s<0)?n-1:0; -if(this.t > 0) - if(d == 0) r = this.data[0]%n; - else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n; -return r; -} - -//(public) 1/this % m (HAC 14.61) -function bnModInverse(m) { -var ac = m.isEven(); -if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; -var u = m.clone(), v = this.clone(); -var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); -while(u.signum() != 0) { - while(u.isEven()) { - u.rShiftTo(1,u); - if(ac) { - if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } - a.rShiftTo(1,a); - } else if(!b.isEven()) b.subTo(m,b); - b.rShiftTo(1,b); - } - while(v.isEven()) { - v.rShiftTo(1,v); - if(ac) { - if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } - c.rShiftTo(1,c); - } else if(!d.isEven()) d.subTo(m,d); - d.rShiftTo(1,d); - } - if(u.compareTo(v) >= 0) { - u.subTo(v,u); - if(ac) a.subTo(c,a); - b.subTo(d,b); - } else { - v.subTo(u,v); - if(ac) c.subTo(a,c); - d.subTo(b,d); - } -} -if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; -if(d.compareTo(m) >= 0) return d.subtract(m); -if(d.signum() < 0) d.addTo(m,d); else return d; -if(d.signum() < 0) return d.add(m); else return d; -} - -var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; -var lplim = (1<<26)/lowprimes[lowprimes.length-1]; - -//(public) test primality with certainty >= 1-.5^t -function bnIsProbablePrime(t) { -var i, x = this.abs(); -if(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) { - for(i = 0; i < lowprimes.length; ++i) - if(x.data[0] == lowprimes[i]) return true; - return false; -} -if(x.isEven()) return false; -i = 1; -while(i < lowprimes.length) { - var m = lowprimes[i], j = i+1; - while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while(i < j) if(m%lowprimes[i++] == 0) return false; -} -return x.millerRabin(t); -} - -//(protected) true if probably prime (HAC 4.24, Miller-Rabin) -function bnpMillerRabin(t) { -var n1 = this.subtract(BigInteger.ONE); -var k = n1.getLowestSetBit(); -if(k <= 0) return false; -var r = n1.shiftRight(k); -var prng = bnGetPrng(); -var a; -for(var i = 0; i < t; ++i) { - // select witness 'a' at random from between 1 and n1 - do { - a = new BigInteger(this.bitLength(), prng); - } - while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); - var y = a.modPow(r,this); - if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while(j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2,this); - if(y.compareTo(BigInteger.ONE) == 0) return false; - } - if(y.compareTo(n1) != 0) return false; - } -} -return true; -} - -// get pseudo random number generator -function bnGetPrng() { - // create prng with api that matches BigInteger secure random - return { - // x is an array to fill with bytes - nextBytes: function(x) { - for(var i = 0; i < x.length; ++i) { - x[i] = Math.floor(Math.random() * 0x0100); - } - } - }; -} - -//protected -BigInteger.prototype.chunkSize = bnpChunkSize; -BigInteger.prototype.toRadix = bnpToRadix; -BigInteger.prototype.fromRadix = bnpFromRadix; -BigInteger.prototype.fromNumber = bnpFromNumber; -BigInteger.prototype.bitwiseTo = bnpBitwiseTo; -BigInteger.prototype.changeBit = bnpChangeBit; -BigInteger.prototype.addTo = bnpAddTo; -BigInteger.prototype.dMultiply = bnpDMultiply; -BigInteger.prototype.dAddOffset = bnpDAddOffset; -BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; -BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; -BigInteger.prototype.modInt = bnpModInt; -BigInteger.prototype.millerRabin = bnpMillerRabin; - -//public -BigInteger.prototype.clone = bnClone; -BigInteger.prototype.intValue = bnIntValue; -BigInteger.prototype.byteValue = bnByteValue; -BigInteger.prototype.shortValue = bnShortValue; -BigInteger.prototype.signum = bnSigNum; -BigInteger.prototype.toByteArray = bnToByteArray; -BigInteger.prototype.equals = bnEquals; -BigInteger.prototype.min = bnMin; -BigInteger.prototype.max = bnMax; -BigInteger.prototype.and = bnAnd; -BigInteger.prototype.or = bnOr; -BigInteger.prototype.xor = bnXor; -BigInteger.prototype.andNot = bnAndNot; -BigInteger.prototype.not = bnNot; -BigInteger.prototype.shiftLeft = bnShiftLeft; -BigInteger.prototype.shiftRight = bnShiftRight; -BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; -BigInteger.prototype.bitCount = bnBitCount; -BigInteger.prototype.testBit = bnTestBit; -BigInteger.prototype.setBit = bnSetBit; -BigInteger.prototype.clearBit = bnClearBit; -BigInteger.prototype.flipBit = bnFlipBit; -BigInteger.prototype.add = bnAdd; -BigInteger.prototype.subtract = bnSubtract; -BigInteger.prototype.multiply = bnMultiply; -BigInteger.prototype.divide = bnDivide; -BigInteger.prototype.remainder = bnRemainder; -BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; -BigInteger.prototype.modPow = bnModPow; -BigInteger.prototype.modInverse = bnModInverse; -BigInteger.prototype.pow = bnPow; -BigInteger.prototype.gcd = bnGCD; -BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - -//BigInteger interfaces not implemented in jsbn: - -//BigInteger(int signum, byte[] magnitude) -//double doubleValue() -//float floatValue() -//int hashCode() -//long longValue() -//static BigInteger valueOf(long val) diff --git a/node_modules/node-forge/lib/kem.js b/node_modules/node-forge/lib/kem.js deleted file mode 100644 index 1967016..0000000 --- a/node_modules/node-forge/lib/kem.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Javascript implementation of RSA-KEM. - * - * @author Lautaro Cozzani Rodriguez - * @author Dave Longley - * - * Copyright (c) 2014 Lautaro Cozzani - * Copyright (c) 2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); -require('./random'); -require('./jsbn'); - -module.exports = forge.kem = forge.kem || {}; - -var BigInteger = forge.jsbn.BigInteger; - -/** - * The API for the RSA Key Encapsulation Mechanism (RSA-KEM) from ISO 18033-2. - */ -forge.kem.rsa = {}; - -/** - * Creates an RSA KEM API object for generating a secret asymmetric key. - * - * The symmetric key may be generated via a call to 'encrypt', which will - * produce a ciphertext to be transmitted to the recipient and a key to be - * kept secret. The ciphertext is a parameter to be passed to 'decrypt' which - * will produce the same secret key for the recipient to use to decrypt a - * message that was encrypted with the secret key. - * - * @param kdf the KDF API to use (eg: new forge.kem.kdf1()). - * @param options the options to use. - * [prng] a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - */ -forge.kem.rsa.create = function(kdf, options) { - options = options || {}; - var prng = options.prng || forge.random; - - var kem = {}; - - /** - * Generates a secret key and its encapsulation. - * - * @param publicKey the RSA public key to encrypt with. - * @param keyLength the length, in bytes, of the secret key to generate. - * - * @return an object with: - * encapsulation: the ciphertext for generating the secret key, as a - * binary-encoded string of bytes. - * key: the secret key to use for encrypting a message. - */ - kem.encrypt = function(publicKey, keyLength) { - // generate a random r where 1 < r < n - var byteLength = Math.ceil(publicKey.n.bitLength() / 8); - var r; - do { - r = new BigInteger( - forge.util.bytesToHex(prng.getBytesSync(byteLength)), - 16).mod(publicKey.n); - } while(r.compareTo(BigInteger.ONE) <= 0); - - // prepend r with zeros - r = forge.util.hexToBytes(r.toString(16)); - var zeros = byteLength - r.length; - if(zeros > 0) { - r = forge.util.fillString(String.fromCharCode(0), zeros) + r; - } - - // encrypt the random - var encapsulation = publicKey.encrypt(r, 'NONE'); - - // generate the secret key - var key = kdf.generate(r, keyLength); - - return {encapsulation: encapsulation, key: key}; - }; - - /** - * Decrypts an encapsulated secret key. - * - * @param privateKey the RSA private key to decrypt with. - * @param encapsulation the ciphertext for generating the secret key, as - * a binary-encoded string of bytes. - * @param keyLength the length, in bytes, of the secret key to generate. - * - * @return the secret key as a binary-encoded string of bytes. - */ - kem.decrypt = function(privateKey, encapsulation, keyLength) { - // decrypt the encapsulation and generate the secret key - var r = privateKey.decrypt(encapsulation, 'NONE'); - return kdf.generate(r, keyLength); - }; - - return kem; -}; - -// TODO: add forge.kem.kdf.create('KDF1', {md: ..., ...}) API? - -/** - * Creates a key derivation API object that implements KDF1 per ISO 18033-2. - * - * @param md the hash API to use. - * @param [digestLength] an optional digest length that must be positive and - * less than or equal to md.digestLength. - * - * @return a KDF1 API object. - */ -forge.kem.kdf1 = function(md, digestLength) { - _createKDF(this, md, 0, digestLength || md.digestLength); -}; - -/** - * Creates a key derivation API object that implements KDF2 per ISO 18033-2. - * - * @param md the hash API to use. - * @param [digestLength] an optional digest length that must be positive and - * less than or equal to md.digestLength. - * - * @return a KDF2 API object. - */ -forge.kem.kdf2 = function(md, digestLength) { - _createKDF(this, md, 1, digestLength || md.digestLength); -}; - -/** - * Creates a KDF1 or KDF2 API object. - * - * @param md the hash API to use. - * @param counterStart the starting index for the counter. - * @param digestLength the digest length to use. - * - * @return the KDF API object. - */ -function _createKDF(kdf, md, counterStart, digestLength) { - /** - * Generate a key of the specified length. - * - * @param x the binary-encoded byte string to generate a key from. - * @param length the number of bytes to generate (the size of the key). - * - * @return the key as a binary-encoded string. - */ - kdf.generate = function(x, length) { - var key = new forge.util.ByteBuffer(); - - // run counter from counterStart to ceil(length / Hash.len) - var k = Math.ceil(length / digestLength) + counterStart; - - var c = new forge.util.ByteBuffer(); - for(var i = counterStart; i < k; ++i) { - // I2OSP(i, 4): convert counter to an octet string of 4 octets - c.putInt32(i); - - // digest 'x' and the counter and add the result to the key - md.start(); - md.update(x + c.getBytes()); - var hash = md.digest(); - key.putBytes(hash.getBytes(digestLength)); - } - - // truncate to the correct key length - key.truncate(key.length() - length); - return key.getBytes(); - }; -} diff --git a/node_modules/node-forge/lib/log.js b/node_modules/node-forge/lib/log.js deleted file mode 100644 index 8d36f4a..0000000 --- a/node_modules/node-forge/lib/log.js +++ /dev/null @@ -1,317 +0,0 @@ -/** - * Cross-browser support for logging in a web application. - * - * @author David I. Lehn - * - * Copyright (c) 2008-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -/* LOG API */ -module.exports = forge.log = forge.log || {}; - -/** - * Application logging system. - * - * Each logger level available as it's own function of the form: - * forge.log.level(category, args...) - * The category is an arbitrary string, and the args are the same as - * Firebug's console.log API. By default the call will be output as: - * 'LEVEL [category] , args[1], ...' - * This enables proper % formatting via the first argument. - * Each category is enabled by default but can be enabled or disabled with - * the setCategoryEnabled() function. - */ -// list of known levels -forge.log.levels = [ - 'none', 'error', 'warning', 'info', 'debug', 'verbose', 'max']; -// info on the levels indexed by name: -// index: level index -// name: uppercased display name -var sLevelInfo = {}; -// list of loggers -var sLoggers = []; -/** - * Standard console logger. If no console support is enabled this will - * remain null. Check before using. - */ -var sConsoleLogger = null; - -// logger flags -/** - * Lock the level at the current value. Used in cases where user config may - * set the level such that only critical messages are seen but more verbose - * messages are needed for debugging or other purposes. - */ -forge.log.LEVEL_LOCKED = (1 << 1); -/** - * Always call log function. By default, the logging system will check the - * message level against logger.level before calling the log function. This - * flag allows the function to do its own check. - */ -forge.log.NO_LEVEL_CHECK = (1 << 2); -/** - * Perform message interpolation with the passed arguments. "%" style - * fields in log messages will be replaced by arguments as needed. Some - * loggers, such as Firebug, may do this automatically. The original log - * message will be available as 'message' and the interpolated version will - * be available as 'fullMessage'. - */ -forge.log.INTERPOLATE = (1 << 3); - -// setup each log level -for(var i = 0; i < forge.log.levels.length; ++i) { - var level = forge.log.levels[i]; - sLevelInfo[level] = { - index: i, - name: level.toUpperCase() - }; -} - -/** - * Message logger. Will dispatch a message to registered loggers as needed. - * - * @param message message object - */ -forge.log.logMessage = function(message) { - var messageLevelIndex = sLevelInfo[message.level].index; - for(var i = 0; i < sLoggers.length; ++i) { - var logger = sLoggers[i]; - if(logger.flags & forge.log.NO_LEVEL_CHECK) { - logger.f(message); - } else { - // get logger level - var loggerLevelIndex = sLevelInfo[logger.level].index; - // check level - if(messageLevelIndex <= loggerLevelIndex) { - // message critical enough, call logger - logger.f(logger, message); - } - } - } -}; - -/** - * Sets the 'standard' key on a message object to: - * "LEVEL [category] " + message - * - * @param message a message log object - */ -forge.log.prepareStandard = function(message) { - if(!('standard' in message)) { - message.standard = - sLevelInfo[message.level].name + - //' ' + +message.timestamp + - ' [' + message.category + '] ' + - message.message; - } -}; - -/** - * Sets the 'full' key on a message object to the original message - * interpolated via % formatting with the message arguments. - * - * @param message a message log object. - */ -forge.log.prepareFull = function(message) { - if(!('full' in message)) { - // copy args and insert message at the front - var args = [message.message]; - args = args.concat([] || message['arguments']); - // format the message - message.full = forge.util.format.apply(this, args); - } -}; - -/** - * Applies both preparseStandard() and prepareFull() to a message object and - * store result in 'standardFull'. - * - * @param message a message log object. - */ -forge.log.prepareStandardFull = function(message) { - if(!('standardFull' in message)) { - // FIXME implement 'standardFull' logging - forge.log.prepareStandard(message); - message.standardFull = message.standard; - } -}; - -// create log level functions -if(true) { - // levels for which we want functions - var levels = ['error', 'warning', 'info', 'debug', 'verbose']; - for(var i = 0; i < levels.length; ++i) { - // wrap in a function to ensure proper level var is passed - (function(level) { - // create function for this level - forge.log[level] = function(category, message/*, args...*/) { - // convert arguments to real array, remove category and message - var args = Array.prototype.slice.call(arguments).slice(2); - // create message object - // Note: interpolation and standard formatting is done lazily - var msg = { - timestamp: new Date(), - level: level, - category: category, - message: message, - 'arguments': args - /*standard*/ - /*full*/ - /*fullMessage*/ - }; - // process this message - forge.log.logMessage(msg); - }; - })(levels[i]); - } -} - -/** - * Creates a new logger with specified custom logging function. - * - * The logging function has a signature of: - * function(logger, message) - * logger: current logger - * message: object: - * level: level id - * category: category - * message: string message - * arguments: Array of extra arguments - * fullMessage: interpolated message and arguments if INTERPOLATE flag set - * - * @param logFunction a logging function which takes a log message object - * as a parameter. - * - * @return a logger object. - */ -forge.log.makeLogger = function(logFunction) { - var logger = { - flags: 0, - f: logFunction - }; - forge.log.setLevel(logger, 'none'); - return logger; -}; - -/** - * Sets the current log level on a logger. - * - * @param logger the target logger. - * @param level the new maximum log level as a string. - * - * @return true if set, false if not. - */ -forge.log.setLevel = function(logger, level) { - var rval = false; - if(logger && !(logger.flags & forge.log.LEVEL_LOCKED)) { - for(var i = 0; i < forge.log.levels.length; ++i) { - var aValidLevel = forge.log.levels[i]; - if(level == aValidLevel) { - // set level - logger.level = level; - rval = true; - break; - } - } - } - - return rval; -}; - -/** - * Locks the log level at its current value. - * - * @param logger the target logger. - * @param lock boolean lock value, default to true. - */ -forge.log.lock = function(logger, lock) { - if(typeof lock === 'undefined' || lock) { - logger.flags |= forge.log.LEVEL_LOCKED; - } else { - logger.flags &= ~forge.log.LEVEL_LOCKED; - } -}; - -/** - * Adds a logger. - * - * @param logger the logger object. - */ -forge.log.addLogger = function(logger) { - sLoggers.push(logger); -}; - -// setup the console logger if possible, else create fake console.log -if(typeof(console) !== 'undefined' && 'log' in console) { - var logger; - if(console.error && console.warn && console.info && console.debug) { - // looks like Firebug-style logging is available - // level handlers map - var levelHandlers = { - error: console.error, - warning: console.warn, - info: console.info, - debug: console.debug, - verbose: console.debug - }; - var f = function(logger, message) { - forge.log.prepareStandard(message); - var handler = levelHandlers[message.level]; - // prepend standard message and concat args - var args = [message.standard]; - args = args.concat(message['arguments'].slice()); - // apply to low-level console function - handler.apply(console, args); - }; - logger = forge.log.makeLogger(f); - } else { - // only appear to have basic console.log - var f = function(logger, message) { - forge.log.prepareStandardFull(message); - console.log(message.standardFull); - }; - logger = forge.log.makeLogger(f); - } - forge.log.setLevel(logger, 'debug'); - forge.log.addLogger(logger); - sConsoleLogger = logger; -} else { - // define fake console.log to avoid potential script errors on - // browsers that do not have console logging - console = { - log: function() {} - }; -} - -/* - * Check for logging control query vars. - * - * console.level= - * Set's the console log level by name. Useful to override defaults and - * allow more verbose logging before a user config is loaded. - * - * console.lock= - * Lock the console log level at whatever level it is set at. This is run - * after console.level is processed. Useful to force a level of verbosity - * that could otherwise be limited by a user config. - */ -if(sConsoleLogger !== null) { - var query = forge.util.getQueryVariables(); - if('console.level' in query) { - // set with last value - forge.log.setLevel( - sConsoleLogger, query['console.level'].slice(-1)[0]); - } - if('console.lock' in query) { - // set with last value - var lock = query['console.lock'].slice(-1)[0]; - if(lock == 'true') { - forge.log.lock(sConsoleLogger); - } - } -} - -// provide public access to console logger -forge.log.consoleLogger = sConsoleLogger; diff --git a/node_modules/node-forge/lib/md.all.js b/node_modules/node-forge/lib/md.all.js deleted file mode 100644 index 4e0974b..0000000 --- a/node_modules/node-forge/lib/md.all.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Node.js module for all known Forge message digests. - * - * @author Dave Longley - * - * Copyright 2011-2017 Digital Bazaar, Inc. - */ -module.exports = require('./md'); - -require('./md5'); -require('./sha1'); -require('./sha256'); -require('./sha512'); diff --git a/node_modules/node-forge/lib/md.js b/node_modules/node-forge/lib/md.js deleted file mode 100644 index e4a280c..0000000 --- a/node_modules/node-forge/lib/md.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Node.js module for Forge message digests. - * - * @author Dave Longley - * - * Copyright 2011-2017 Digital Bazaar, Inc. - */ -var forge = require('./forge'); - -module.exports = forge.md = forge.md || {}; -forge.md.algorithms = forge.md.algorithms || {}; diff --git a/node_modules/node-forge/lib/md5.js b/node_modules/node-forge/lib/md5.js deleted file mode 100644 index d0ba8f6..0000000 --- a/node_modules/node-forge/lib/md5.js +++ /dev/null @@ -1,289 +0,0 @@ -/** - * Message Digest Algorithm 5 with 128-bit digest (MD5) implementation. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var md5 = module.exports = forge.md5 = forge.md5 || {}; -forge.md.md5 = forge.md.algorithms.md5 = md5; - -/** - * Creates an MD5 message digest object. - * - * @return a message digest object. - */ -md5.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // MD5 state contains four 32-bit integers - var _state = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for word storage - var _w = new Array(16); - - // message digest object - var md = { - algorithm: 'md5', - blockLength: 64, - digestLength: 16, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 0x67452301, - h1: 0xEFCDAB89, - h2: 0x98BADCFE, - h3: 0x10325476 - }; - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = (len[1] / 0x100000000) >>> 0; - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_state, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate MD5 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in little-endian order; since length - // is stored in bytes we multiply by 8 and add carry - var bits, carry = 0; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - bits = md.fullMessageLength[i] * 8 + carry; - carry = (bits / 0x100000000) >>> 0; - finalBlock.putInt32Le(bits >>> 0); - } - - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32Le(s2.h0); - rval.putInt32Le(s2.h1); - rval.putInt32Le(s2.h2); - rval.putInt32Le(s2.h3); - return rval; - }; - - return md; -}; - -// padding, constant tables for calculating md5 -var _padding = null; -var _g = null; -var _r = null; -var _k = null; -var _initialized = false; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - - // g values - _g = [ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, - 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, - 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9]; - - // rounds table - _r = [ - 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, - 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, - 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, - 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]; - - // get the result of abs(sin(i + 1)) as a 32-bit integer - _k = new Array(64); - for(var i = 0; i < 64; ++i) { - _k[i] = Math.floor(Math.abs(Math.sin(i + 1)) * 0x100000000); - } - - // now initialized - _initialized = true; -} - -/** - * Updates an MD5 state with the given byte buffer. - * - * @param s the MD5 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t, a, b, c, d, f, r, i; - var len = bytes.length(); - while(len >= 64) { - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - - // round 1 - for(i = 0; i < 16; ++i) { - w[i] = bytes.getInt32Le(); - f = d ^ (b & (c ^ d)); - t = (a + f + _k[i] + w[i]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - // round 2 - for(; i < 32; ++i) { - f = c ^ (d & (b ^ c)); - t = (a + f + _k[i] + w[_g[i]]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - // round 3 - for(; i < 48; ++i) { - f = b ^ c ^ d; - t = (a + f + _k[i] + w[_g[i]]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - // round 4 - for(; i < 64; ++i) { - f = c ^ (b | ~d); - t = (a + f + _k[i] + w[_g[i]]); - r = _r[i]; - a = d; - d = c; - c = b; - b += (t << r) | (t >>> (32 - r)); - } - - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - - len -= 64; - } -} diff --git a/node_modules/node-forge/lib/mgf.js b/node_modules/node-forge/lib/mgf.js deleted file mode 100644 index 0223bc3..0000000 --- a/node_modules/node-forge/lib/mgf.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Node.js module for Forge mask generation functions. - * - * @author Stefan Siegl - * - * Copyright 2012 Stefan Siegl - */ -var forge = require('./forge'); -require('./mgf1'); - -module.exports = forge.mgf = forge.mgf || {}; -forge.mgf.mgf1 = forge.mgf1; diff --git a/node_modules/node-forge/lib/mgf1.js b/node_modules/node-forge/lib/mgf1.js deleted file mode 100644 index 25ed1f7..0000000 --- a/node_modules/node-forge/lib/mgf1.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Javascript implementation of mask generation function MGF1. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -forge.mgf = forge.mgf || {}; -var mgf1 = module.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; - -/** - * Creates a MGF1 mask generation function object. - * - * @param md the message digest API to use (eg: forge.md.sha1.create()). - * - * @return a mask generation function object. - */ -mgf1.create = function(md) { - var mgf = { - /** - * Generate mask of specified length. - * - * @param {String} seed The seed for mask generation. - * @param maskLen Number of bytes to generate. - * @return {String} The generated mask. - */ - generate: function(seed, maskLen) { - /* 2. Let T be the empty octet string. */ - var t = new forge.util.ByteBuffer(); - - /* 3. For counter from 0 to ceil(maskLen / hLen), do the following: */ - var len = Math.ceil(maskLen / md.digestLength); - for(var i = 0; i < len; i++) { - /* a. Convert counter to an octet string C of length 4 octets */ - var c = new forge.util.ByteBuffer(); - c.putInt32(i); - - /* b. Concatenate the hash of the seed mgfSeed and C to the octet - * string T: */ - md.start(); - md.update(seed + c.getBytes()); - t.putBuffer(md.digest()); - } - - /* Output the leading maskLen octets of T as the octet string mask. */ - t.truncate(t.length() - maskLen); - return t.getBytes(); - } - }; - - return mgf; -}; diff --git a/node_modules/node-forge/lib/oids.js b/node_modules/node-forge/lib/oids.js deleted file mode 100644 index 6a937f5..0000000 --- a/node_modules/node-forge/lib/oids.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Object IDs for ASN.1. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); - -forge.pki = forge.pki || {}; -var oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {}; - -// set id to name mapping and name to id mapping -function _IN(id, name) { - oids[id] = name; - oids[name] = id; -} -// set id to name mapping only -function _I_(id, name) { - oids[id] = name; -} - -// algorithm OIDs -_IN('1.2.840.113549.1.1.1', 'rsaEncryption'); -// Note: md2 & md4 not implemented -//_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption'); -//_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption'); -_IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption'); -_IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption'); -_IN('1.2.840.113549.1.1.7', 'RSAES-OAEP'); -_IN('1.2.840.113549.1.1.8', 'mgf1'); -_IN('1.2.840.113549.1.1.9', 'pSpecified'); -_IN('1.2.840.113549.1.1.10', 'RSASSA-PSS'); -_IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption'); -_IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption'); -_IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption'); -// Edwards-curve Digital Signature Algorithm (EdDSA) Ed25519 -_IN('1.3.101.112', 'EdDSA25519'); - -_IN('1.2.840.10040.4.3', 'dsa-with-sha1'); - -_IN('1.3.14.3.2.7', 'desCBC'); - -_IN('1.3.14.3.2.26', 'sha1'); -_IN('2.16.840.1.101.3.4.2.1', 'sha256'); -_IN('2.16.840.1.101.3.4.2.2', 'sha384'); -_IN('2.16.840.1.101.3.4.2.3', 'sha512'); -_IN('1.2.840.113549.2.5', 'md5'); - -// pkcs#7 content types -_IN('1.2.840.113549.1.7.1', 'data'); -_IN('1.2.840.113549.1.7.2', 'signedData'); -_IN('1.2.840.113549.1.7.3', 'envelopedData'); -_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData'); -_IN('1.2.840.113549.1.7.5', 'digestedData'); -_IN('1.2.840.113549.1.7.6', 'encryptedData'); - -// pkcs#9 oids -_IN('1.2.840.113549.1.9.1', 'emailAddress'); -_IN('1.2.840.113549.1.9.2', 'unstructuredName'); -_IN('1.2.840.113549.1.9.3', 'contentType'); -_IN('1.2.840.113549.1.9.4', 'messageDigest'); -_IN('1.2.840.113549.1.9.5', 'signingTime'); -_IN('1.2.840.113549.1.9.6', 'counterSignature'); -_IN('1.2.840.113549.1.9.7', 'challengePassword'); -_IN('1.2.840.113549.1.9.8', 'unstructuredAddress'); -_IN('1.2.840.113549.1.9.14', 'extensionRequest'); - -_IN('1.2.840.113549.1.9.20', 'friendlyName'); -_IN('1.2.840.113549.1.9.21', 'localKeyId'); -_IN('1.2.840.113549.1.9.22.1', 'x509Certificate'); - -// pkcs#12 safe bags -_IN('1.2.840.113549.1.12.10.1.1', 'keyBag'); -_IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag'); -_IN('1.2.840.113549.1.12.10.1.3', 'certBag'); -_IN('1.2.840.113549.1.12.10.1.4', 'crlBag'); -_IN('1.2.840.113549.1.12.10.1.5', 'secretBag'); -_IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag'); - -// password-based-encryption for pkcs#12 -_IN('1.2.840.113549.1.5.13', 'pkcs5PBES2'); -_IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2'); - -_IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4'); -_IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4'); -_IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC'); -_IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC'); -_IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC'); -_IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC'); - -// hmac OIDs -_IN('1.2.840.113549.2.7', 'hmacWithSHA1'); -_IN('1.2.840.113549.2.8', 'hmacWithSHA224'); -_IN('1.2.840.113549.2.9', 'hmacWithSHA256'); -_IN('1.2.840.113549.2.10', 'hmacWithSHA384'); -_IN('1.2.840.113549.2.11', 'hmacWithSHA512'); - -// symmetric key algorithm oids -_IN('1.2.840.113549.3.7', 'des-EDE3-CBC'); -_IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC'); -_IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC'); -_IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC'); - -// certificate issuer/subject OIDs -_IN('2.5.4.3', 'commonName'); -_IN('2.5.4.5', 'serialName'); -_IN('2.5.4.6', 'countryName'); -_IN('2.5.4.7', 'localityName'); -_IN('2.5.4.8', 'stateOrProvinceName'); -_IN('2.5.4.9', 'streetAddress'); -_IN('2.5.4.10', 'organizationName'); -_IN('2.5.4.11', 'organizationalUnitName'); -_IN('2.5.4.13', 'description'); -_IN('2.5.4.15', 'businessCategory'); -_IN('2.5.4.17', 'postalCode'); -_IN('1.3.6.1.4.1.311.60.2.1.2', 'jurisdictionOfIncorporationStateOrProvinceName'); -_IN('1.3.6.1.4.1.311.60.2.1.3', 'jurisdictionOfIncorporationCountryName'); - -// X.509 extension OIDs -_IN('2.16.840.1.113730.1.1', 'nsCertType'); -_IN('2.16.840.1.113730.1.13', 'nsComment'); // deprecated in theory; still widely used -_I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35 -_I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15 -_I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32 -_I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15 -_I_('2.5.29.5', 'policyMapping'); // deprecated use .33 -_I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30 -_I_('2.5.29.7', 'subjectAltName'); // deprecated use .17 -_I_('2.5.29.8', 'issuerAltName'); // deprecated use .18 -_I_('2.5.29.9', 'subjectDirectoryAttributes'); -_I_('2.5.29.10', 'basicConstraints'); // deprecated use .19 -_I_('2.5.29.11', 'nameConstraints'); // deprecated use .30 -_I_('2.5.29.12', 'policyConstraints'); // deprecated use .36 -_I_('2.5.29.13', 'basicConstraints'); // deprecated use .19 -_IN('2.5.29.14', 'subjectKeyIdentifier'); -_IN('2.5.29.15', 'keyUsage'); -_I_('2.5.29.16', 'privateKeyUsagePeriod'); -_IN('2.5.29.17', 'subjectAltName'); -_IN('2.5.29.18', 'issuerAltName'); -_IN('2.5.29.19', 'basicConstraints'); -_I_('2.5.29.20', 'cRLNumber'); -_I_('2.5.29.21', 'cRLReason'); -_I_('2.5.29.22', 'expirationDate'); -_I_('2.5.29.23', 'instructionCode'); -_I_('2.5.29.24', 'invalidityDate'); -_I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31 -_I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28 -_I_('2.5.29.27', 'deltaCRLIndicator'); -_I_('2.5.29.28', 'issuingDistributionPoint'); -_I_('2.5.29.29', 'certificateIssuer'); -_I_('2.5.29.30', 'nameConstraints'); -_IN('2.5.29.31', 'cRLDistributionPoints'); -_IN('2.5.29.32', 'certificatePolicies'); -_I_('2.5.29.33', 'policyMappings'); -_I_('2.5.29.34', 'policyConstraints'); // deprecated use .36 -_IN('2.5.29.35', 'authorityKeyIdentifier'); -_I_('2.5.29.36', 'policyConstraints'); -_IN('2.5.29.37', 'extKeyUsage'); -_I_('2.5.29.46', 'freshestCRL'); -_I_('2.5.29.54', 'inhibitAnyPolicy'); - -// extKeyUsage purposes -_IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList'); -_IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess'); -_IN('1.3.6.1.5.5.7.3.1', 'serverAuth'); -_IN('1.3.6.1.5.5.7.3.2', 'clientAuth'); -_IN('1.3.6.1.5.5.7.3.3', 'codeSigning'); -_IN('1.3.6.1.5.5.7.3.4', 'emailProtection'); -_IN('1.3.6.1.5.5.7.3.8', 'timeStamping'); diff --git a/node_modules/node-forge/lib/pbe.js b/node_modules/node-forge/lib/pbe.js deleted file mode 100644 index cf8456b..0000000 --- a/node_modules/node-forge/lib/pbe.js +++ /dev/null @@ -1,1023 +0,0 @@ -/** - * Password-based encryption functions. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * An EncryptedPrivateKeyInfo: - * - * EncryptedPrivateKeyInfo ::= SEQUENCE { - * encryptionAlgorithm EncryptionAlgorithmIdentifier, - * encryptedData EncryptedData } - * - * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * EncryptedData ::= OCTET STRING - */ -var forge = require('./forge'); -require('./aes'); -require('./asn1'); -require('./des'); -require('./md'); -require('./oids'); -require('./pbkdf2'); -require('./pem'); -require('./random'); -require('./rc2'); -require('./rsa'); -require('./util'); - -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -/* Password-based encryption implementation. */ -var pki = forge.pki = forge.pki || {}; -module.exports = pki.pbe = forge.pbe = forge.pbe || {}; -var oids = pki.oids; - -// validator for an EncryptedPrivateKeyInfo structure -// Note: Currently only works w/algorithm params -var encryptedPrivateKeyValidator = { - name: 'EncryptedPrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encryptionOid' - }, { - name: 'AlgorithmIdentifier.parameters', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'encryptionParams' - }] - }, { - // encryptedData - name: 'EncryptedPrivateKeyInfo.encryptedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encryptedData' - }] -}; - -// validator for a PBES2Algorithms structure -// Note: Currently only works w/PBKDF2 + AES encryption schemes -var PBES2AlgorithmsValidator = { - name: 'PBES2Algorithms', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.keyDerivationFunc', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.keyDerivationFunc.oid', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'kdfOid' - }, { - name: 'PBES2Algorithms.params', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.params.salt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'kdfSalt' - }, { - name: 'PBES2Algorithms.params.iterationCount', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'kdfIterationCount' - }, { - name: 'PBES2Algorithms.params.keyLength', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: 'keyLength' - }, { - // prf - name: 'PBES2Algorithms.params.prf', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'PBES2Algorithms.params.prf.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'prfOid' - }] - }] - }] - }, { - name: 'PBES2Algorithms.encryptionScheme', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PBES2Algorithms.encryptionScheme.oid', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encOid' - }, { - name: 'PBES2Algorithms.encryptionScheme.iv', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encIv' - }] - }] -}; - -var pkcs12PbeParamsValidator = { - name: 'pkcs-12PbeParams', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'pkcs-12PbeParams.salt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'salt' - }, { - name: 'pkcs-12PbeParams.iterations', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'iterations' - }] -}; - -/** - * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo. - * - * PBES2Algorithms ALGORITHM-IDENTIFIER ::= - * { {PBES2-params IDENTIFIED BY id-PBES2}, ...} - * - * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} - * - * PBES2-params ::= SEQUENCE { - * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}}, - * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} - * } - * - * PBES2-KDFs ALGORITHM-IDENTIFIER ::= - * { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... } - * - * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } - * - * PBKDF2-params ::= SEQUENCE { - * salt CHOICE { - * specified OCTET STRING, - * otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}} - * }, - * iterationCount INTEGER (1..MAX), - * keyLength INTEGER (1..MAX) OPTIONAL, - * prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 - * } - * - * @param obj the ASN.1 PrivateKeyInfo object. - * @param password the password to encrypt with. - * @param options: - * algorithm the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. - * count the iteration count to use. - * saltSize the salt size to use. - * prfAlgorithm the PRF message digest algorithm to use - * ('sha1', 'sha224', 'sha256', 'sha384', 'sha512') - * - * @return the ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptPrivateKeyInfo = function(obj, password, options) { - // set default options - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || 'aes128'; - options.prfAlgorithm = options.prfAlgorithm || 'sha1'; - - // generate PBE params - var salt = forge.random.getBytesSync(options.saltSize); - var count = options.count; - var countBytes = asn1.integerToDer(count); - var dkLen; - var encryptionAlgorithm; - var encryptedData; - if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') { - // do PBES2 - var ivLen, encOid, cipherFn; - switch(options.algorithm) { - case 'aes128': - dkLen = 16; - ivLen = 16; - encOid = oids['aes128-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes192': - dkLen = 24; - ivLen = 16; - encOid = oids['aes192-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes256': - dkLen = 32; - ivLen = 16; - encOid = oids['aes256-CBC']; - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'des': - dkLen = 8; - ivLen = 8; - encOid = oids['desCBC']; - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); - error.algorithm = options.algorithm; - throw error; - } - - // get PRF message digest - var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase(); - var md = prfAlgorithmToMessageDigest(prfAlgorithm); - - // encrypt private key using pbe SHA-1 and AES/DES - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - var iv = forge.random.getBytesSync(ivLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); - - // get PBKDF2-params - var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm); - - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pkcs5PBES2']).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // keyDerivationFunc - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()), - // PBKDF2-params - params - ]), - // encryptionScheme - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(encOid).getBytes()), - // iv - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv) - ]) - ]) - ]); - } else if(options.algorithm === '3des') { - // Do PKCS12 PBE - dkLen = 24; - - var saltBytes = new forge.util.ByteBuffer(salt); - var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen); - var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen); - var cipher = forge.des.createEncryptionCipher(dk); - cipher.start(iv); - cipher.update(asn1.toDer(obj)); - cipher.finish(); - encryptedData = cipher.output.getBytes(); - - encryptionAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()), - // pkcs-12PbeParams - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - countBytes.getBytes()) - ]) - ]); - } else { - var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.'); - error.algorithm = options.algorithm; - throw error; - } - - // EncryptedPrivateKeyInfo - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // encryptionAlgorithm - encryptionAlgorithm, - // encryptedData - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData) - ]); - return rval; -}; - -/** - * Decrypts a ASN.1 PrivateKeyInfo object. - * - * @param obj the ASN.1 EncryptedPrivateKeyInfo object. - * @param password the password to decrypt with. - * - * @return the ASN.1 PrivateKeyInfo on success, null on failure. - */ -pki.decryptPrivateKeyInfo = function(obj, password) { - var rval = null; - - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) { - var error = new Error('Cannot read encrypted private key. ' + - 'ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } - - // get cipher - var oid = asn1.derToOid(capture.encryptionOid); - var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password); - - // get encrypted data - var encrypted = forge.util.createBuffer(capture.encryptedData); - - cipher.update(encrypted); - if(cipher.finish()) { - rval = asn1.fromDer(cipher.output); - } - - return rval; -}; - -/** - * Converts a EncryptedPrivateKeyInfo to PEM format. - * - * @param epki the EncryptedPrivateKeyInfo. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted encrypted private key. - */ -pki.encryptedPrivateKeyToPem = function(epki, maxline) { - // convert to DER, then PEM-encode - var msg = { - type: 'ENCRYPTED PRIVATE KEY', - body: asn1.toDer(epki).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption - * is not performed. - * - * @param pem the EncryptedPrivateKeyInfo in PEM-format. - * - * @return the ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptedPrivateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'ENCRYPTED PRIVATE KEY') { - var error = new Error('Could not convert encrypted private key from PEM; ' + - 'PEM header type is "ENCRYPTED PRIVATE KEY".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert encrypted private key from PEM; ' + - 'PEM is encrypted.'); - } - - // convert DER to ASN.1 object - return asn1.fromDer(msg.body); -}; - -/** - * Encrypts an RSA private key. By default, the key will be wrapped in - * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo. - * This is the standard, preferred way to encrypt a private key. - * - * To produce a non-standard PEM-encrypted private key that uses encapsulated - * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL - * private key encryption), set the 'legacy' option to true. Note: Using this - * option will cause the iteration count to be forced to 1. - * - * Note: The 'des' algorithm is supported, but it is not considered to be - * secure because it only uses a single 56-bit key. If possible, it is highly - * recommended that a different algorithm be used. - * - * @param rsaKey the RSA key to encrypt. - * @param password the password to use. - * @param options: - * algorithm: the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des', 'des'). - * count: the iteration count to use. - * saltSize: the salt size to use. - * legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated - * headers (DEK-Info) private key. - * - * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo. - */ -pki.encryptRsaPrivateKey = function(rsaKey, password, options) { - // standard PKCS#8 - options = options || {}; - if(!options.legacy) { - // encrypt PrivateKeyInfo - var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey)); - rval = pki.encryptPrivateKeyInfo(rval, password, options); - return pki.encryptedPrivateKeyToPem(rval); - } - - // legacy non-PKCS#8 - var algorithm; - var iv; - var dkLen; - var cipherFn; - switch(options.algorithm) { - case 'aes128': - algorithm = 'AES-128-CBC'; - dkLen = 16; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes192': - algorithm = 'AES-192-CBC'; - dkLen = 24; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case 'aes256': - algorithm = 'AES-256-CBC'; - dkLen = 32; - iv = forge.random.getBytesSync(16); - cipherFn = forge.aes.createEncryptionCipher; - break; - case '3des': - algorithm = 'DES-EDE3-CBC'; - dkLen = 24; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - case 'des': - algorithm = 'DES-CBC'; - dkLen = 8; - iv = forge.random.getBytesSync(8); - cipherFn = forge.des.createEncryptionCipher; - break; - default: - var error = new Error('Could not encrypt RSA private key; unsupported ' + - 'encryption algorithm "' + options.algorithm + '".'); - error.algorithm = options.algorithm; - throw error; - } - - // encrypt private key using OpenSSL legacy key derivation - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey))); - cipher.finish(); - - var msg = { - type: 'RSA PRIVATE KEY', - procType: { - version: '4', - type: 'ENCRYPTED' - }, - dekInfo: { - algorithm: algorithm, - parameters: forge.util.bytesToHex(iv).toUpperCase() - }, - body: cipher.output.getBytes() - }; - return forge.pem.encode(msg); -}; - -/** - * Decrypts an RSA private key. - * - * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt. - * @param password the password to use. - * - * @return the RSA key on success, null on failure. - */ -pki.decryptRsaPrivateKey = function(pem, password) { - var rval = null; - - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'ENCRYPTED PRIVATE KEY' && - msg.type !== 'PRIVATE KEY' && - msg.type !== 'RSA PRIVATE KEY') { - var error = new Error('Could not convert private key from PEM; PEM header type ' + - 'is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); - error.headerType = error; - throw error; - } - - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - var dkLen; - var cipherFn; - switch(msg.dekInfo.algorithm) { - case 'DES-CBC': - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'DES-EDE3-CBC': - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'AES-128-CBC': - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'AES-192-CBC': - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'AES-256-CBC': - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'RC2-40-CBC': - dkLen = 5; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 40); - }; - break; - case 'RC2-64-CBC': - dkLen = 8; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 64); - }; - break; - case 'RC2-128-CBC': - dkLen = 16; - cipherFn = function(key) { - return forge.rc2.createDecryptionCipher(key, 128); - }; - break; - default: - var error = new Error('Could not decrypt private key; unsupported ' + - 'encryption algorithm "' + msg.dekInfo.algorithm + '".'); - error.algorithm = msg.dekInfo.algorithm; - throw error; - } - - // use OpenSSL legacy key derivation - var iv = forge.util.hexToBytes(msg.dekInfo.parameters); - var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen); - var cipher = cipherFn(dk); - cipher.start(iv); - cipher.update(forge.util.createBuffer(msg.body)); - if(cipher.finish()) { - rval = cipher.output.getBytes(); - } else { - return rval; - } - } else { - rval = msg.body; - } - - if(msg.type === 'ENCRYPTED PRIVATE KEY') { - rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password); - } else { - // decryption already performed above - rval = asn1.fromDer(rval); - } - - if(rval !== null) { - rval = pki.privateKeyFromAsn1(rval); - } - - return rval; -}; - -/** - * Derives a PKCS#12 key. - * - * @param password the password to derive the key material from, null or - * undefined for none. - * @param salt the salt, as a ByteBuffer, to use. - * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). - * @param iter the iteration count. - * @param n the number of bytes to derive from the password. - * @param md the message digest to use, defaults to SHA-1. - * - * @return a ByteBuffer with the bytes derived from the password. - */ -pki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) { - var j, l; - - if(typeof md === 'undefined' || md === null) { - if(!('sha1' in forge.md)) { - throw new Error('"sha1" hash algorithm unavailable.'); - } - md = forge.md.sha1.create(); - } - - var u = md.digestLength; - var v = md.blockLength; - var result = new forge.util.ByteBuffer(); - - /* Convert password to Unicode byte buffer + trailing 0-byte. */ - var passBuf = new forge.util.ByteBuffer(); - if(password !== null && password !== undefined) { - for(l = 0; l < password.length; l++) { - passBuf.putInt16(password.charCodeAt(l)); - } - passBuf.putInt16(0); - } - - /* Length of salt and password in BYTES. */ - var p = passBuf.length(); - var s = salt.length(); - - /* 1. Construct a string, D (the "diversifier"), by concatenating - v copies of ID. */ - var D = new forge.util.ByteBuffer(); - D.fillWithByte(id, v); - - /* 2. Concatenate copies of the salt together to create a string S of length - v * ceil(s / v) bytes (the final copy of the salt may be trunacted - to create S). - Note that if the salt is the empty string, then so is S. */ - var Slen = v * Math.ceil(s / v); - var S = new forge.util.ByteBuffer(); - for(l = 0; l < Slen; l++) { - S.putByte(salt.at(l % s)); - } - - /* 3. Concatenate copies of the password together to create a string P of - length v * ceil(p / v) bytes (the final copy of the password may be - truncated to create P). - Note that if the password is the empty string, then so is P. */ - var Plen = v * Math.ceil(p / v); - var P = new forge.util.ByteBuffer(); - for(l = 0; l < Plen; l++) { - P.putByte(passBuf.at(l % p)); - } - - /* 4. Set I=S||P to be the concatenation of S and P. */ - var I = S; - I.putBuffer(P); - - /* 5. Set c=ceil(n / u). */ - var c = Math.ceil(n / u); - - /* 6. For i=1, 2, ..., c, do the following: */ - for(var i = 1; i <= c; i++) { - /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */ - var buf = new forge.util.ByteBuffer(); - buf.putBytes(D.bytes()); - buf.putBytes(I.bytes()); - for(var round = 0; round < iter; round++) { - md.start(); - md.update(buf.getBytes()); - buf = md.digest(); - } - - /* b) Concatenate copies of Ai to create a string B of length v bytes (the - final copy of Ai may be truncated to create B). */ - var B = new forge.util.ByteBuffer(); - for(l = 0; l < v; l++) { - B.putByte(buf.at(l % u)); - } - - /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks, - where k=ceil(s / v) + ceil(p / v), modify I by setting - Ij=(Ij+B+1) mod 2v for each j. */ - var k = Math.ceil(s / v) + Math.ceil(p / v); - var Inew = new forge.util.ByteBuffer(); - for(j = 0; j < k; j++) { - var chunk = new forge.util.ByteBuffer(I.getBytes(v)); - var x = 0x1ff; - for(l = B.length() - 1; l >= 0; l--) { - x = x >> 8; - x += B.at(l) + chunk.at(l); - chunk.setAt(l, x & 0xff); - } - Inew.putBuffer(chunk); - } - I = Inew; - - /* Add Ai to A. */ - result.putBuffer(buf); - } - - result.truncate(result.length() - n); - return result; -}; - -/** - * Get new Forge cipher object instance. - * - * @param oid the OID (in string notation). - * @param params the ASN.1 params object. - * @param password the password to decrypt with. - * - * @return new cipher object instance. - */ -pki.pbe.getCipher = function(oid, params, password) { - switch(oid) { - case pki.oids['pkcs5PBES2']: - return pki.pbe.getCipherForPBES2(oid, params, password); - - case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: - case pki.oids['pbewithSHAAnd40BitRC2-CBC']: - return pki.pbe.getCipherForPKCS12PBE(oid, params, password); - - default: - var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.'); - error.oid = oid; - error.supportedOids = [ - 'pkcs5PBES2', - 'pbeWithSHAAnd3-KeyTripleDES-CBC', - 'pbewithSHAAnd40BitRC2-CBC' - ]; - throw error; - } -}; - -/** - * Get new Forge cipher object instance according to PBES2 params block. - * - * The returned cipher instance is already started using the IV - * from PBES2 parameter block. - * - * @param oid the PKCS#5 PBKDF2 OID (in string notation). - * @param params the ASN.1 PBES2-params object. - * @param password the password to decrypt with. - * - * @return new cipher object instance. - */ -pki.pbe.getCipherForPBES2 = function(oid, params, password) { - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { - var error = new Error('Cannot read password-based-encryption algorithm ' + - 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } - - // check oids - oid = asn1.derToOid(capture.kdfOid); - if(oid !== pki.oids['pkcs5PBKDF2']) { - var error = new Error('Cannot read encrypted private key. ' + - 'Unsupported key derivation function OID.'); - error.oid = oid; - error.supportedOids = ['pkcs5PBKDF2']; - throw error; - } - oid = asn1.derToOid(capture.encOid); - if(oid !== pki.oids['aes128-CBC'] && - oid !== pki.oids['aes192-CBC'] && - oid !== pki.oids['aes256-CBC'] && - oid !== pki.oids['des-EDE3-CBC'] && - oid !== pki.oids['desCBC']) { - var error = new Error('Cannot read encrypted private key. ' + - 'Unsupported encryption scheme OID.'); - error.oid = oid; - error.supportedOids = [ - 'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC']; - throw error; - } - - // set PBE params - var salt = capture.kdfSalt; - var count = forge.util.createBuffer(capture.kdfIterationCount); - count = count.getInt(count.length() << 3); - var dkLen; - var cipherFn; - switch(pki.oids[oid]) { - case 'aes128-CBC': - dkLen = 16; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'aes192-CBC': - dkLen = 24; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'aes256-CBC': - dkLen = 32; - cipherFn = forge.aes.createDecryptionCipher; - break; - case 'des-EDE3-CBC': - dkLen = 24; - cipherFn = forge.des.createDecryptionCipher; - break; - case 'desCBC': - dkLen = 8; - cipherFn = forge.des.createDecryptionCipher; - break; - } - - // get PRF message digest - var md = prfOidToMessageDigest(capture.prfOid); - - // decrypt private key using pbe with chosen PRF and AES/DES - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - var iv = capture.encIv; - var cipher = cipherFn(dk); - cipher.start(iv); - - return cipher; -}; - -/** - * Get new Forge cipher object instance for PKCS#12 PBE. - * - * The returned cipher instance is already started using the key & IV - * derived from the provided password and PKCS#12 PBE salt. - * - * @param oid The PKCS#12 PBE OID (in string notation). - * @param params The ASN.1 PKCS#12 PBE-params object. - * @param password The password to decrypt with. - * - * @return the new cipher object instance. - */ -pki.pbe.getCipherForPKCS12PBE = function(oid, params, password) { - // get PBE params - var capture = {}; - var errors = []; - if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) { - var error = new Error('Cannot read password-based-encryption algorithm ' + - 'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.'); - error.errors = errors; - throw error; - } - - var salt = forge.util.createBuffer(capture.salt); - var count = forge.util.createBuffer(capture.iterations); - count = count.getInt(count.length() << 3); - - var dkLen, dIvLen, cipherFn; - switch(oid) { - case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']: - dkLen = 24; - dIvLen = 8; - cipherFn = forge.des.startDecrypting; - break; - - case pki.oids['pbewithSHAAnd40BitRC2-CBC']: - dkLen = 5; - dIvLen = 8; - cipherFn = function(key, iv) { - var cipher = forge.rc2.createDecryptionCipher(key, 40); - cipher.start(iv, null); - return cipher; - }; - break; - - default: - var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.'); - error.oid = oid; - throw error; - } - - // get PRF message digest - var md = prfOidToMessageDigest(capture.prfOid); - var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); - md.start(); - var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); - - return cipherFn(key, iv); -}; - -/** - * OpenSSL's legacy key derivation function. - * - * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html - * - * @param password the password to derive the key from. - * @param salt the salt to use, null for none. - * @param dkLen the number of bytes needed for the derived key. - * @param [options] the options to use: - * [md] an optional message digest object to use. - */ -pki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { - if(typeof md === 'undefined' || md === null) { - if(!('md5' in forge.md)) { - throw new Error('"md5" hash algorithm unavailable.'); - } - md = forge.md.md5.create(); - } - if(salt === null) { - salt = ''; - } - var digests = [hash(md, password + salt)]; - for(var length = 16, i = 1; length < dkLen; ++i, length += 16) { - digests.push(hash(md, digests[i - 1] + password + salt)); - } - return digests.join('').substr(0, dkLen); -}; - -function hash(md, bytes) { - return md.start().update(bytes).digest().getBytes(); -} - -function prfOidToMessageDigest(prfOid) { - // get PRF algorithm, default to SHA-1 - var prfAlgorithm; - if(!prfOid) { - prfAlgorithm = 'hmacWithSHA1'; - } else { - prfAlgorithm = pki.oids[asn1.derToOid(prfOid)]; - if(!prfAlgorithm) { - var error = new Error('Unsupported PRF OID.'); - error.oid = prfOid; - error.supported = [ - 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', - 'hmacWithSHA512']; - throw error; - } - } - return prfAlgorithmToMessageDigest(prfAlgorithm); -} - -function prfAlgorithmToMessageDigest(prfAlgorithm) { - var factory = forge.md; - switch(prfAlgorithm) { - case 'hmacWithSHA224': - factory = forge.md.sha512; - case 'hmacWithSHA1': - case 'hmacWithSHA256': - case 'hmacWithSHA384': - case 'hmacWithSHA512': - prfAlgorithm = prfAlgorithm.substr(8).toLowerCase(); - break; - default: - var error = new Error('Unsupported PRF algorithm.'); - error.algorithm = prfAlgorithm; - error.supported = [ - 'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384', - 'hmacWithSHA512']; - throw error; - } - if(!factory || !(prfAlgorithm in factory)) { - throw new Error('Unknown hash algorithm: ' + prfAlgorithm); - } - return factory[prfAlgorithm].create(); -} - -function createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) { - var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // salt - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt), - // iteration count - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - countBytes.getBytes()) - ]); - // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm - if(prfAlgorithm !== 'hmacWithSHA1') { - params.value.push( - // key length - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(dkLen.toString(16))), - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - } - return params; -} diff --git a/node_modules/node-forge/lib/pbkdf2.js b/node_modules/node-forge/lib/pbkdf2.js deleted file mode 100644 index 714560e..0000000 --- a/node_modules/node-forge/lib/pbkdf2.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Password-Based Key-Derivation Function #2 implementation. - * - * See RFC 2898 for details. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./hmac'); -require('./md'); -require('./util'); - -var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; - -var crypto; -if(forge.util.isNodejs && !forge.options.usePureJavaScript) { - crypto = require('crypto'); -} - -/** - * Derives a key from a password. - * - * @param p the password as a binary-encoded string of bytes. - * @param s the salt as a binary-encoded string of bytes. - * @param c the iteration count, a positive integer. - * @param dkLen the intended length, in bytes, of the derived key, - * (max: 2^32 - 1) * hash length of the PRF. - * @param [md] the message digest (or algorithm identifier as a string) to use - * in the PRF, defaults to SHA-1. - * @param [callback(err, key)] presence triggers asynchronous version, called - * once the operation completes. - * - * @return the derived key, as a binary-encoded string of bytes, for the - * synchronous version (if no callback is specified). - */ -module.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function( - p, s, c, dkLen, md, callback) { - if(typeof md === 'function') { - callback = md; - md = null; - } - - // use native implementation if possible and not disabled, note that - // some node versions only support SHA-1, others allow digest to be changed - if(forge.util.isNodejs && !forge.options.usePureJavaScript && - crypto.pbkdf2 && (md === null || typeof md !== 'object') && - (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) { - if(typeof md !== 'string') { - // default prf to SHA-1 - md = 'sha1'; - } - p = Buffer.from(p, 'binary'); - s = Buffer.from(s, 'binary'); - if(!callback) { - if(crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary'); - } - return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary'); - } - if(crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2(p, s, c, dkLen, function(err, key) { - if(err) { - return callback(err); - } - callback(null, key.toString('binary')); - }); - } - return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) { - if(err) { - return callback(err); - } - callback(null, key.toString('binary')); - }); - } - - if(typeof md === 'undefined' || md === null) { - // default prf to SHA-1 - md = 'sha1'; - } - if(typeof md === 'string') { - if(!(md in forge.md.algorithms)) { - throw new Error('Unknown hash algorithm: ' + md); - } - md = forge.md[md].create(); - } - - var hLen = md.digestLength; - - /* 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and - stop. */ - if(dkLen > (0xFFFFFFFF * hLen)) { - var err = new Error('Derived key is too long.'); - if(callback) { - return callback(err); - } - throw err; - } - - /* 2. Let len be the number of hLen-octet blocks in the derived key, - rounding up, and let r be the number of octets in the last - block: - - len = CEIL(dkLen / hLen), - r = dkLen - (len - 1) * hLen. */ - var len = Math.ceil(dkLen / hLen); - var r = dkLen - (len - 1) * hLen; - - /* 3. For each block of the derived key apply the function F defined - below to the password P, the salt S, the iteration count c, and - the block index to compute the block: - - T_1 = F(P, S, c, 1), - T_2 = F(P, S, c, 2), - ... - T_len = F(P, S, c, len), - - where the function F is defined as the exclusive-or sum of the - first c iterates of the underlying pseudorandom function PRF - applied to the password P and the concatenation of the salt S - and the block index i: - - F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c - - where - - u_1 = PRF(P, S || INT(i)), - u_2 = PRF(P, u_1), - ... - u_c = PRF(P, u_{c-1}). - - Here, INT(i) is a four-octet encoding of the integer i, most - significant octet first. */ - var prf = forge.hmac.create(); - prf.start(md, p); - var dk = ''; - var xor, u_c, u_c1; - - // sync version - if(!callback) { - for(var i = 1; i <= len; ++i) { - // PRF(P, S || INT(i)) (first iteration) - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor = u_c1 = prf.digest().getBytes(); - - // PRF(P, u_{c-1}) (other iterations) - for(var j = 2; j <= c; ++j) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - // F(p, s, c, i) - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - } - - /* 4. Concatenate the blocks and extract the first dkLen octets to - produce a derived key DK: - - DK = T_1 || T_2 || ... || T_len<0..r-1> */ - dk += (i < len) ? xor : xor.substr(0, r); - } - /* 5. Output the derived key DK. */ - return dk; - } - - // async version - var i = 1, j; - function outer() { - if(i > len) { - // done - return callback(null, dk); - } - - // PRF(P, S || INT(i)) (first iteration) - prf.start(null, null); - prf.update(s); - prf.update(forge.util.int32ToBytes(i)); - xor = u_c1 = prf.digest().getBytes(); - - // PRF(P, u_{c-1}) (other iterations) - j = 2; - inner(); - } - - function inner() { - if(j <= c) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - // F(p, s, c, i) - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - ++j; - return forge.util.setImmediate(inner); - } - - /* 4. Concatenate the blocks and extract the first dkLen octets to - produce a derived key DK: - - DK = T_1 || T_2 || ... || T_len<0..r-1> */ - dk += (i < len) ? xor : xor.substr(0, r); - - ++i; - outer(); - } - - outer(); -}; diff --git a/node_modules/node-forge/lib/pem.js b/node_modules/node-forge/lib/pem.js deleted file mode 100644 index aed8bdf..0000000 --- a/node_modules/node-forge/lib/pem.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms. - * - * See: RFC 1421. - * - * @author Dave Longley - * - * Copyright (c) 2013-2014 Digital Bazaar, Inc. - * - * A Forge PEM object has the following fields: - * - * type: identifies the type of message (eg: "RSA PRIVATE KEY"). - * - * procType: identifies the type of processing performed on the message, - * it has two subfields: version and type, eg: 4,ENCRYPTED. - * - * contentDomain: identifies the type of content in the message, typically - * only uses the value: "RFC822". - * - * dekInfo: identifies the message encryption algorithm and mode and includes - * any parameters for the algorithm, it has two subfields: algorithm and - * parameters, eg: DES-CBC,F8143EDE5960C597. - * - * headers: contains all other PEM encapsulated headers -- where order is - * significant (for pairing data like recipient ID + key info). - * - * body: the binary-encoded body. - */ -var forge = require('./forge'); -require('./util'); - -// shortcut for pem API -var pem = module.exports = forge.pem = forge.pem || {}; - -/** - * Encodes (serializes) the given PEM object. - * - * @param msg the PEM message object to encode. - * @param options the options to use: - * maxline the maximum characters per line for the body, (default: 64). - * - * @return the PEM-formatted string. - */ -pem.encode = function(msg, options) { - options = options || {}; - var rval = '-----BEGIN ' + msg.type + '-----\r\n'; - - // encode special headers - var header; - if(msg.procType) { - header = { - name: 'Proc-Type', - values: [String(msg.procType.version), msg.procType.type] - }; - rval += foldHeader(header); - } - if(msg.contentDomain) { - header = {name: 'Content-Domain', values: [msg.contentDomain]}; - rval += foldHeader(header); - } - if(msg.dekInfo) { - header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]}; - if(msg.dekInfo.parameters) { - header.values.push(msg.dekInfo.parameters); - } - rval += foldHeader(header); - } - - if(msg.headers) { - // encode all other headers - for(var i = 0; i < msg.headers.length; ++i) { - rval += foldHeader(msg.headers[i]); - } - } - - // terminate header - if(msg.procType) { - rval += '\r\n'; - } - - // add body - rval += forge.util.encode64(msg.body, options.maxline || 64) + '\r\n'; - - rval += '-----END ' + msg.type + '-----\r\n'; - return rval; -}; - -/** - * Decodes (deserializes) all PEM messages found in the given string. - * - * @param str the PEM-formatted string to decode. - * - * @return the PEM message objects in an array. - */ -pem.decode = function(str) { - var rval = []; - - // split string into PEM messages (be lenient w/EOF on BEGIN line) - var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g; - var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/; - var rCRLF = /\r?\n/; - var match; - while(true) { - match = rMessage.exec(str); - if(!match) { - break; - } - - var msg = { - type: match[1], - procType: null, - contentDomain: null, - dekInfo: null, - headers: [], - body: forge.util.decode64(match[3]) - }; - rval.push(msg); - - // no headers - if(!match[2]) { - continue; - } - - // parse headers - var lines = match[2].split(rCRLF); - var li = 0; - while(match && li < lines.length) { - // get line, trim any rhs whitespace - var line = lines[li].replace(/\s+$/, ''); - - // RFC2822 unfold any following folded lines - for(var nl = li + 1; nl < lines.length; ++nl) { - var next = lines[nl]; - if(!/\s/.test(next[0])) { - break; - } - line += next; - li = nl; - } - - // parse header - match = line.match(rHeader); - if(match) { - var header = {name: match[1], values: []}; - var values = match[2].split(','); - for(var vi = 0; vi < values.length; ++vi) { - header.values.push(ltrim(values[vi])); - } - - // Proc-Type must be the first header - if(!msg.procType) { - if(header.name !== 'Proc-Type') { - throw new Error('Invalid PEM formatted message. The first ' + - 'encapsulated header must be "Proc-Type".'); - } else if(header.values.length !== 2) { - throw new Error('Invalid PEM formatted message. The "Proc-Type" ' + - 'header must have two subfields.'); - } - msg.procType = {version: values[0], type: values[1]}; - } else if(!msg.contentDomain && header.name === 'Content-Domain') { - // special-case Content-Domain - msg.contentDomain = values[0] || ''; - } else if(!msg.dekInfo && header.name === 'DEK-Info') { - // special-case DEK-Info - if(header.values.length === 0) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + - 'header must have at least one subfield.'); - } - msg.dekInfo = {algorithm: values[0], parameters: values[1] || null}; - } else { - msg.headers.push(header); - } - } - - ++li; - } - - if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) { - throw new Error('Invalid PEM formatted message. The "DEK-Info" ' + - 'header must be present if "Proc-Type" is "ENCRYPTED".'); - } - } - - if(rval.length === 0) { - throw new Error('Invalid PEM formatted message.'); - } - - return rval; -}; - -function foldHeader(header) { - var rval = header.name + ': '; - - // ensure values with CRLF are folded - var values = []; - var insertSpace = function(match, $1) { - return ' ' + $1; - }; - for(var i = 0; i < header.values.length; ++i) { - values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); - } - rval += values.join(',') + '\r\n'; - - // do folding - var length = 0; - var candidate = -1; - for(var i = 0; i < rval.length; ++i, ++length) { - if(length > 65 && candidate !== -1) { - var insert = rval[candidate]; - if(insert === ',') { - ++candidate; - rval = rval.substr(0, candidate) + '\r\n ' + rval.substr(candidate); - } else { - rval = rval.substr(0, candidate) + - '\r\n' + insert + rval.substr(candidate + 1); - } - length = (i - candidate - 1); - candidate = -1; - ++i; - } else if(rval[i] === ' ' || rval[i] === '\t' || rval[i] === ',') { - candidate = i; - } - } - - return rval; -} - -function ltrim(str) { - return str.replace(/^\s+/, ''); -} diff --git a/node_modules/node-forge/lib/pkcs1.js b/node_modules/node-forge/lib/pkcs1.js deleted file mode 100644 index a3af924..0000000 --- a/node_modules/node-forge/lib/pkcs1.js +++ /dev/null @@ -1,276 +0,0 @@ -/** - * Partial implementation of PKCS#1 v2.2: RSA-OEAP - * - * Modified but based on the following MIT and BSD licensed code: - * - * https://github.com/kjur/jsjws/blob/master/rsa.js: - * - * The 'jsjws'(JSON Web Signature JavaScript Library) License - * - * Copyright (c) 2012 Kenji Urushima - * - * 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. - * - * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain: - * - * RSAES-OAEP.js - * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $ - * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002) - * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003. - * Contact: ellis@nukinetics.com - * Distributed under the BSD License. - * - * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125 - * - * @author Evan Jones (http://evanjones.ca/) - * @author Dave Longley - * - * Copyright (c) 2013-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); -require('./random'); -require('./sha1'); - -// shortcut for PKCS#1 API -var pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {}; - -/** - * Encode the given RSAES-OAEP message (M) using key, with optional label (L) - * and seed. - * - * This method does not perform RSA encryption, it only encodes the message - * using RSAES-OAEP. - * - * @param key the RSA key to use. - * @param message the message to encode. - * @param options the options to use: - * label an optional label to use. - * seed the seed to use. - * md the message digest object to use, undefined for SHA-1. - * mgf1 optional mgf1 parameters: - * md the message digest object to use for MGF1. - * - * @return the encoded message bytes. - */ -pkcs1.encode_rsa_oaep = function(key, message, options) { - // parse arguments - var label; - var seed; - var md; - var mgf1Md; - // legacy args (label, seed, md) - if(typeof options === 'string') { - label = options; - seed = arguments[3] || undefined; - md = arguments[4] || undefined; - } else if(options) { - label = options.label || undefined; - seed = options.seed || undefined; - md = options.md || undefined; - if(options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - - // default OAEP to SHA-1 message digest - if(!md) { - md = forge.md.sha1.create(); - } else { - md.start(); - } - - // default MGF-1 to same as OAEP - if(!mgf1Md) { - mgf1Md = md; - } - - // compute length in bytes and check output - var keyLength = Math.ceil(key.n.bitLength() / 8); - var maxLength = keyLength - 2 * md.digestLength - 2; - if(message.length > maxLength) { - var error = new Error('RSAES-OAEP input message length is too long.'); - error.length = message.length; - error.maxLength = maxLength; - throw error; - } - - if(!label) { - label = ''; - } - md.update(label, 'raw'); - var lHash = md.digest(); - - var PS = ''; - var PS_length = maxLength - message.length; - for(var i = 0; i < PS_length; i++) { - PS += '\x00'; - } - - var DB = lHash.getBytes() + PS + '\x01' + message; - - if(!seed) { - seed = forge.random.getBytes(md.digestLength); - } else if(seed.length !== md.digestLength) { - var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' + - 'match the digest length.'); - error.seedLength = seed.length; - error.digestLength = md.digestLength; - throw error; - } - - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); - - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length); - - // return encoded message - return '\x00' + maskedSeed + maskedDB; -}; - -/** - * Decode the given RSAES-OAEP encoded message (EM) using key, with optional - * label (L). - * - * This method does not perform RSA decryption, it only decodes the message - * using RSAES-OAEP. - * - * @param key the RSA key to use. - * @param em the encoded message to decode. - * @param options the options to use: - * label an optional label to use. - * md the message digest object to use for OAEP, undefined for SHA-1. - * mgf1 optional mgf1 parameters: - * md the message digest object to use for MGF1. - * - * @return the decoded message bytes. - */ -pkcs1.decode_rsa_oaep = function(key, em, options) { - // parse args - var label; - var md; - var mgf1Md; - // legacy args - if(typeof options === 'string') { - label = options; - md = arguments[3] || undefined; - } else if(options) { - label = options.label || undefined; - md = options.md || undefined; - if(options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - - // compute length in bytes - var keyLength = Math.ceil(key.n.bitLength() / 8); - - if(em.length !== keyLength) { - var error = new Error('RSAES-OAEP encoded message length is invalid.'); - error.length = em.length; - error.expectedLength = keyLength; - throw error; - } - - // default OAEP to SHA-1 message digest - if(md === undefined) { - md = forge.md.sha1.create(); - } else { - md.start(); - } - - // default MGF-1 to same as OAEP - if(!mgf1Md) { - mgf1Md = md; - } - - if(keyLength < 2 * md.digestLength + 2) { - throw new Error('RSAES-OAEP key is too short for the hash function.'); - } - - if(!label) { - label = ''; - } - md.update(label, 'raw'); - var lHash = md.digest().getBytes(); - - // split the message into its parts - var y = em.charAt(0); - var maskedSeed = em.substring(1, md.digestLength + 1); - var maskedDB = em.substring(1 + md.digestLength); - - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); - - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); - - var lHashPrime = db.substring(0, md.digestLength); - - // constant time check that all values match what is expected - var error = (y !== '\x00'); - - // constant time check lHash vs lHashPrime - for(var i = 0; i < md.digestLength; ++i) { - error |= (lHash.charAt(i) !== lHashPrime.charAt(i)); - } - - // "constant time" find the 0x1 byte separating the padding (zeros) from the - // message - // TODO: It must be possible to do this in a better/smarter way? - var in_ps = 1; - var index = md.digestLength; - for(var j = md.digestLength; j < db.length; j++) { - var code = db.charCodeAt(j); - - var is_0 = (code & 0x1) ^ 0x1; - - // non-zero if not 0 or 1 in the ps section - var error_mask = in_ps ? 0xfffe : 0x0000; - error |= (code & error_mask); - - // latch in_ps to zero after we find 0x1 - in_ps = in_ps & is_0; - index += in_ps; - } - - if(error || db.charCodeAt(index) !== 0x1) { - throw new Error('Invalid RSAES-OAEP padding.'); - } - - return db.substring(index + 1); -}; - -function rsa_mgf1(seed, maskLength, hash) { - // default to SHA-1 message digest - if(!hash) { - hash = forge.md.sha1.create(); - } - var t = ''; - var count = Math.ceil(maskLength / hash.digestLength); - for(var i = 0; i < count; ++i) { - var c = String.fromCharCode( - (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); - hash.start(); - hash.update(seed + c); - t += hash.digest().getBytes(); - } - return t.substring(0, maskLength); -} diff --git a/node_modules/node-forge/lib/pkcs12.js b/node_modules/node-forge/lib/pkcs12.js deleted file mode 100644 index cd06c49..0000000 --- a/node_modules/node-forge/lib/pkcs12.js +++ /dev/null @@ -1,1074 +0,0 @@ -/** - * Javascript implementation of PKCS#12. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * The ASN.1 representation of PKCS#12 is as follows - * (see ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12-tc1.pdf for details) - * - * PFX ::= SEQUENCE { - * version INTEGER {v3(3)}(v3,...), - * authSafe ContentInfo, - * macData MacData OPTIONAL - * } - * - * MacData ::= SEQUENCE { - * mac DigestInfo, - * macSalt OCTET STRING, - * iterations INTEGER DEFAULT 1 - * } - * Note: The iterations default is for historical reasons and its use is - * deprecated. A higher value, like 1024, is recommended. - * - * DigestInfo is defined in PKCS#7 as follows: - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of SHA1 there is none. - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * Digest ::= OCTET STRING - * - * - * ContentInfo ::= SEQUENCE { - * contentType ContentType, - * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL - * } - * - * ContentType ::= OBJECT IDENTIFIER - * - * AuthenticatedSafe ::= SEQUENCE OF ContentInfo - * -- Data if unencrypted - * -- EncryptedData if password-encrypted - * -- EnvelopedData if public key-encrypted - * - * - * SafeContents ::= SEQUENCE OF SafeBag - * - * SafeBag ::= SEQUENCE { - * bagId BAG-TYPE.&id ({PKCS12BagSet}) - * bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}), - * bagAttributes SET OF PKCS12Attribute OPTIONAL - * } - * - * PKCS12Attribute ::= SEQUENCE { - * attrId ATTRIBUTE.&id ({PKCS12AttrSet}), - * attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId}) - * } -- This type is compatible with the X.500 type 'Attribute' - * - * PKCS12AttrSet ATTRIBUTE ::= { - * friendlyName | -- from PKCS #9 - * localKeyId, -- from PKCS #9 - * ... -- Other attributes are allowed - * } - * - * CertBag ::= SEQUENCE { - * certId BAG-TYPE.&id ({CertTypes}), - * certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId}) - * } - * - * x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {certTypes 1}} - * -- DER-encoded X.509 certificate stored in OCTET STRING - * - * sdsiCertificate BAG-TYPE ::= {IA5String IDENTIFIED BY {certTypes 2}} - * -- Base64-encoded SDSI certificate stored in IA5String - * - * CertTypes BAG-TYPE ::= { - * x509Certificate | - * sdsiCertificate, - * ... -- For future extensions - * } - */ -var forge = require('./forge'); -require('./asn1'); -require('./hmac'); -require('./oids'); -require('./pkcs7asn1'); -require('./pbe'); -require('./random'); -require('./rsa'); -require('./sha1'); -require('./util'); -require('./x509'); - -// shortcut for asn.1 & PKI API -var asn1 = forge.asn1; -var pki = forge.pki; - -// shortcut for PKCS#12 API -var p12 = module.exports = forge.pkcs12 = forge.pkcs12 || {}; - -var contentInfoValidator = { - name: 'ContentInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, // a ContentInfo - constructed: true, - value: [{ - name: 'ContentInfo.contentType', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'contentType' - }, { - name: 'ContentInfo.content', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - captureAsn1: 'content' - }] -}; - -var pfxValidator = { - name: 'PFX', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'PFX.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, - contentInfoValidator, { - name: 'PFX.macData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'mac', - value: [{ - name: 'PFX.macData.mac', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, // DigestInfo - constructed: true, - value: [{ - name: 'PFX.macData.mac.digestAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, // DigestAlgorithmIdentifier - constructed: true, - value: [{ - name: 'PFX.macData.mac.digestAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'macAlgorithm' - }, { - name: 'PFX.macData.mac.digestAlgorithm.parameters', - tagClass: asn1.Class.UNIVERSAL, - captureAsn1: 'macAlgorithmParameters' - }] - }, { - name: 'PFX.macData.mac.digest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'macDigest' - }] - }, { - name: 'PFX.macData.macSalt', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'macSalt' - }, { - name: 'PFX.macData.iterations', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - optional: true, - capture: 'macIterations' - }] - }] -}; - -var safeBagValidator = { - name: 'SafeBag', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SafeBag.bagId', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'bagId' - }, { - name: 'SafeBag.bagValue', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - captureAsn1: 'bagValue' - }, { - name: 'SafeBag.bagAttributes', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - optional: true, - capture: 'bagAttributes' - }] -}; - -var attributeValidator = { - name: 'Attribute', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'Attribute.attrId', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'oid' - }, { - name: 'Attribute.attrValues', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - capture: 'values' - }] -}; - -var certBagValidator = { - name: 'CertBag', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'CertBag.certId', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'certId' - }, { - name: 'CertBag.certValue', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - constructed: true, - /* So far we only support X.509 certificates (which are wrapped in - an OCTET STRING, hence hard code that here). */ - value: [{ - name: 'CertBag.certValue[0]', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.OCTETSTRING, - constructed: false, - capture: 'cert' - }] - }] -}; - -/** - * Search SafeContents structure for bags with matching attributes. - * - * The search can optionally be narrowed by a certain bag type. - * - * @param safeContents the SafeContents structure to search in. - * @param attrName the name of the attribute to compare against. - * @param attrValue the attribute value to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of matching bags. - */ -function _getBagsByAttribute(safeContents, attrName, attrValue, bagType) { - var result = []; - - for(var i = 0; i < safeContents.length; i++) { - for(var j = 0; j < safeContents[i].safeBags.length; j++) { - var bag = safeContents[i].safeBags[j]; - if(bagType !== undefined && bag.type !== bagType) { - continue; - } - // only filter by bag type, no attribute specified - if(attrName === null) { - result.push(bag); - continue; - } - if(bag.attributes[attrName] !== undefined && - bag.attributes[attrName].indexOf(attrValue) >= 0) { - result.push(bag); - } - } - } - - return result; -} - -/** - * Converts a PKCS#12 PFX in ASN.1 notation into a PFX object. - * - * @param obj The PKCS#12 PFX in ASN.1 notation. - * @param strict true to use strict DER decoding, false not to (default: true). - * @param {String} password Password to decrypt with (optional). - * - * @return PKCS#12 PFX object. - */ -p12.pkcs12FromAsn1 = function(obj, strict, password) { - // handle args - if(typeof strict === 'string') { - password = strict; - strict = true; - } else if(strict === undefined) { - strict = true; - } - - // validate PFX and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, pfxValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#12 PFX. ' + - 'ASN.1 object is not an PKCS#12 PFX.'); - error.errors = error; - throw error; - } - - var pfx = { - version: capture.version.charCodeAt(0), - safeContents: [], - - /** - * Gets bags with matching attributes. - * - * @param filter the attributes to filter by: - * [localKeyId] the localKeyId to search for. - * [localKeyIdHex] the localKeyId in hex to search for. - * [friendlyName] the friendly name to search for. - * [bagType] bag type to narrow each attribute search by. - * - * @return a map of attribute type to an array of matching bags or, if no - * attribute was given but a bag type, the map key will be the - * bag type. - */ - getBags: function(filter) { - var rval = {}; - - var localKeyId; - if('localKeyId' in filter) { - localKeyId = filter.localKeyId; - } else if('localKeyIdHex' in filter) { - localKeyId = forge.util.hexToBytes(filter.localKeyIdHex); - } - - // filter on bagType only - if(localKeyId === undefined && !('friendlyName' in filter) && - 'bagType' in filter) { - rval[filter.bagType] = _getBagsByAttribute( - pfx.safeContents, null, null, filter.bagType); - } - - if(localKeyId !== undefined) { - rval.localKeyId = _getBagsByAttribute( - pfx.safeContents, 'localKeyId', - localKeyId, filter.bagType); - } - if('friendlyName' in filter) { - rval.friendlyName = _getBagsByAttribute( - pfx.safeContents, 'friendlyName', - filter.friendlyName, filter.bagType); - } - - return rval; - }, - - /** - * DEPRECATED: use getBags() instead. - * - * Get bags with matching friendlyName attribute. - * - * @param friendlyName the friendly name to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of bags with matching friendlyName attribute. - */ - getBagsByFriendlyName: function(friendlyName, bagType) { - return _getBagsByAttribute( - pfx.safeContents, 'friendlyName', friendlyName, bagType); - }, - - /** - * DEPRECATED: use getBags() instead. - * - * Get bags with matching localKeyId attribute. - * - * @param localKeyId the localKeyId to search for. - * @param [bagType] bag type to narrow search by. - * - * @return an array of bags with matching localKeyId attribute. - */ - getBagsByLocalKeyId: function(localKeyId, bagType) { - return _getBagsByAttribute( - pfx.safeContents, 'localKeyId', localKeyId, bagType); - } - }; - - if(capture.version.charCodeAt(0) !== 3) { - var error = new Error('PKCS#12 PFX of version other than 3 not supported.'); - error.version = capture.version.charCodeAt(0); - throw error; - } - - if(asn1.derToOid(capture.contentType) !== pki.oids.data) { - var error = new Error('Only PKCS#12 PFX in password integrity mode supported.'); - error.oid = asn1.derToOid(capture.contentType); - throw error; - } - - var data = capture.content.value[0]; - if(data.tagClass !== asn1.Class.UNIVERSAL || - data.type !== asn1.Type.OCTETSTRING) { - throw new Error('PKCS#12 authSafe content data is not an OCTET STRING.'); - } - data = _decodePkcs7Data(data); - - // check for MAC - if(capture.mac) { - var md = null; - var macKeyBytes = 0; - var macAlgorithm = asn1.derToOid(capture.macAlgorithm); - switch(macAlgorithm) { - case pki.oids.sha1: - md = forge.md.sha1.create(); - macKeyBytes = 20; - break; - case pki.oids.sha256: - md = forge.md.sha256.create(); - macKeyBytes = 32; - break; - case pki.oids.sha384: - md = forge.md.sha384.create(); - macKeyBytes = 48; - break; - case pki.oids.sha512: - md = forge.md.sha512.create(); - macKeyBytes = 64; - break; - case pki.oids.md5: - md = forge.md.md5.create(); - macKeyBytes = 16; - break; - } - if(md === null) { - throw new Error('PKCS#12 uses unsupported MAC algorithm: ' + macAlgorithm); - } - - // verify MAC (iterations default to 1) - var macSalt = new forge.util.ByteBuffer(capture.macSalt); - var macIterations = (('macIterations' in capture) ? - parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1); - var macKey = p12.generateKey( - password, macSalt, 3, macIterations, macKeyBytes, md); - var mac = forge.hmac.create(); - mac.start(md, macKey); - mac.update(data.value); - var macValue = mac.getMac(); - if(macValue.getBytes() !== capture.macDigest) { - throw new Error('PKCS#12 MAC could not be verified. Invalid password?'); - } - } - - _decodeAuthenticatedSafe(pfx, data.value, strict, password); - return pfx; -}; - -/** - * Decodes PKCS#7 Data. PKCS#7 (RFC 2315) defines "Data" as an OCTET STRING, - * but it is sometimes an OCTET STRING that is composed/constructed of chunks, - * each its own OCTET STRING. This is BER-encoding vs. DER-encoding. This - * function transforms this corner-case into the usual simple, - * non-composed/constructed OCTET STRING. - * - * This function may be moved to ASN.1 at some point to better deal with - * more BER-encoding issues, should they arise. - * - * @param data the ASN.1 Data object to transform. - */ -function _decodePkcs7Data(data) { - // handle special case of "chunked" data content: an octet string composed - // of other octet strings - if(data.composed || data.constructed) { - var value = forge.util.createBuffer(); - for(var i = 0; i < data.value.length; ++i) { - value.putBytes(data.value[i].value); - } - data.composed = data.constructed = false; - data.value = value.getBytes(); - } - return data; -} - -/** - * Decode PKCS#12 AuthenticatedSafe (BER encoded) into PFX object. - * - * The AuthenticatedSafe is a BER-encoded SEQUENCE OF ContentInfo. - * - * @param pfx The PKCS#12 PFX object to fill. - * @param {String} authSafe BER-encoded AuthenticatedSafe. - * @param strict true to use strict DER decoding, false not to. - * @param {String} password Password to decrypt with (optional). - */ -function _decodeAuthenticatedSafe(pfx, authSafe, strict, password) { - authSafe = asn1.fromDer(authSafe, strict); /* actually it's BER encoded */ - - if(authSafe.tagClass !== asn1.Class.UNIVERSAL || - authSafe.type !== asn1.Type.SEQUENCE || - authSafe.constructed !== true) { - throw new Error('PKCS#12 AuthenticatedSafe expected to be a ' + - 'SEQUENCE OF ContentInfo'); - } - - for(var i = 0; i < authSafe.value.length; i++) { - var contentInfo = authSafe.value[i]; - - // validate contentInfo and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(contentInfo, contentInfoValidator, capture, errors)) { - var error = new Error('Cannot read ContentInfo.'); - error.errors = errors; - throw error; - } - - var obj = { - encrypted: false - }; - var safeContents = null; - var data = capture.content.value[0]; - switch(asn1.derToOid(capture.contentType)) { - case pki.oids.data: - if(data.tagClass !== asn1.Class.UNIVERSAL || - data.type !== asn1.Type.OCTETSTRING) { - throw new Error('PKCS#12 SafeContents Data is not an OCTET STRING.'); - } - safeContents = _decodePkcs7Data(data).value; - break; - case pki.oids.encryptedData: - safeContents = _decryptSafeContents(data, password); - obj.encrypted = true; - break; - default: - var error = new Error('Unsupported PKCS#12 contentType.'); - error.contentType = asn1.derToOid(capture.contentType); - throw error; - } - - obj.safeBags = _decodeSafeContents(safeContents, strict, password); - pfx.safeContents.push(obj); - } -} - -/** - * Decrypt PKCS#7 EncryptedData structure. - * - * @param data ASN.1 encoded EncryptedContentInfo object. - * @param password The user-provided password. - * - * @return The decrypted SafeContents (ASN.1 object). - */ -function _decryptSafeContents(data, password) { - var capture = {}; - var errors = []; - if(!asn1.validate( - data, forge.pkcs7.asn1.encryptedDataValidator, capture, errors)) { - var error = new Error('Cannot read EncryptedContentInfo.'); - error.errors = errors; - throw error; - } - - var oid = asn1.derToOid(capture.contentType); - if(oid !== pki.oids.data) { - var error = new Error( - 'PKCS#12 EncryptedContentInfo ContentType is not Data.'); - error.oid = oid; - throw error; - } - - // get cipher - oid = asn1.derToOid(capture.encAlgorithm); - var cipher = pki.pbe.getCipher(oid, capture.encParameter, password); - - // get encrypted data - var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1); - var encrypted = forge.util.createBuffer(encryptedContentAsn1.value); - - cipher.update(encrypted); - if(!cipher.finish()) { - throw new Error('Failed to decrypt PKCS#12 SafeContents.'); - } - - return cipher.output.getBytes(); -} - -/** - * Decode PKCS#12 SafeContents (BER-encoded) into array of Bag objects. - * - * The safeContents is a BER-encoded SEQUENCE OF SafeBag. - * - * @param {String} safeContents BER-encoded safeContents. - * @param strict true to use strict DER decoding, false not to. - * @param {String} password Password to decrypt with (optional). - * - * @return {Array} Array of Bag objects. - */ -function _decodeSafeContents(safeContents, strict, password) { - // if strict and no safe contents, return empty safes - if(!strict && safeContents.length === 0) { - return []; - } - - // actually it's BER-encoded - safeContents = asn1.fromDer(safeContents, strict); - - if(safeContents.tagClass !== asn1.Class.UNIVERSAL || - safeContents.type !== asn1.Type.SEQUENCE || - safeContents.constructed !== true) { - throw new Error( - 'PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.'); - } - - var res = []; - for(var i = 0; i < safeContents.value.length; i++) { - var safeBag = safeContents.value[i]; - - // validate SafeBag and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(safeBag, safeBagValidator, capture, errors)) { - var error = new Error('Cannot read SafeBag.'); - error.errors = errors; - throw error; - } - - /* Create bag object and push to result array. */ - var bag = { - type: asn1.derToOid(capture.bagId), - attributes: _decodeBagAttributes(capture.bagAttributes) - }; - res.push(bag); - - var validator, decoder; - var bagAsn1 = capture.bagValue.value[0]; - switch(bag.type) { - case pki.oids.pkcs8ShroudedKeyBag: - /* bagAsn1 has a EncryptedPrivateKeyInfo, which we need to decrypt. - Afterwards we can handle it like a keyBag, - which is a PrivateKeyInfo. */ - bagAsn1 = pki.decryptPrivateKeyInfo(bagAsn1, password); - if(bagAsn1 === null) { - throw new Error( - 'Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?'); - } - - /* fall through */ - case pki.oids.keyBag: - /* A PKCS#12 keyBag is a simple PrivateKeyInfo as understood by our - PKI module, hence we don't have to do validation/capturing here, - just pass what we already got. */ - try { - bag.key = pki.privateKeyFromAsn1(bagAsn1); - } catch(e) { - // ignore unknown key type, pass asn1 value - bag.key = null; - bag.asn1 = bagAsn1; - } - continue; /* Nothing more to do. */ - - case pki.oids.certBag: - /* A PKCS#12 certBag can wrap both X.509 and sdsi certificates. - Therefore put the SafeBag content through another validator to - capture the fields. Afterwards check & store the results. */ - validator = certBagValidator; - decoder = function() { - if(asn1.derToOid(capture.certId) !== pki.oids.x509Certificate) { - var error = new Error( - 'Unsupported certificate type, only X.509 supported.'); - error.oid = asn1.derToOid(capture.certId); - throw error; - } - - // true=produce cert hash - var certAsn1 = asn1.fromDer(capture.cert, strict); - try { - bag.cert = pki.certificateFromAsn1(certAsn1, true); - } catch(e) { - // ignore unknown cert type, pass asn1 value - bag.cert = null; - bag.asn1 = certAsn1; - } - }; - break; - - default: - var error = new Error('Unsupported PKCS#12 SafeBag type.'); - error.oid = bag.type; - throw error; - } - - /* Validate SafeBag value (i.e. CertBag, etc.) and capture data if needed. */ - if(validator !== undefined && - !asn1.validate(bagAsn1, validator, capture, errors)) { - var error = new Error('Cannot read PKCS#12 ' + validator.name); - error.errors = errors; - throw error; - } - - /* Call decoder function from above to store the results. */ - decoder(); - } - - return res; -} - -/** - * Decode PKCS#12 SET OF PKCS12Attribute into JavaScript object. - * - * @param attributes SET OF PKCS12Attribute (ASN.1 object). - * - * @return the decoded attributes. - */ -function _decodeBagAttributes(attributes) { - var decodedAttrs = {}; - - if(attributes !== undefined) { - for(var i = 0; i < attributes.length; ++i) { - var capture = {}; - var errors = []; - if(!asn1.validate(attributes[i], attributeValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#12 BagAttribute.'); - error.errors = errors; - throw error; - } - - var oid = asn1.derToOid(capture.oid); - if(pki.oids[oid] === undefined) { - // unsupported attribute type, ignore. - continue; - } - - decodedAttrs[pki.oids[oid]] = []; - for(var j = 0; j < capture.values.length; ++j) { - decodedAttrs[pki.oids[oid]].push(capture.values[j].value); - } - } - } - - return decodedAttrs; -} - -/** - * Wraps a private key and certificate in a PKCS#12 PFX wrapper. If a - * password is provided then the private key will be encrypted. - * - * An entire certificate chain may also be included. To do this, pass - * an array for the "cert" parameter where the first certificate is - * the one that is paired with the private key and each subsequent one - * verifies the previous one. The certificates may be in PEM format or - * have been already parsed by Forge. - * - * @todo implement password-based-encryption for the whole package - * - * @param key the private key. - * @param cert the certificate (may be an array of certificates in order - * to specify a certificate chain). - * @param password the password to use, null for none. - * @param options: - * algorithm the encryption algorithm to use - * ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'. - * count the iteration count to use. - * saltSize the salt size to use. - * useMac true to include a MAC, false not to, defaults to true. - * localKeyId the local key ID to use, in hex. - * friendlyName the friendly name to use. - * generateLocalKeyId true to generate a random local key ID, - * false not to, defaults to true. - * - * @return the PKCS#12 PFX ASN.1 object. - */ -p12.toPkcs12Asn1 = function(key, cert, password, options) { - // set default options - options = options || {}; - options.saltSize = options.saltSize || 8; - options.count = options.count || 2048; - options.algorithm = options.algorithm || options.encAlgorithm || 'aes128'; - if(!('useMac' in options)) { - options.useMac = true; - } - if(!('localKeyId' in options)) { - options.localKeyId = null; - } - if(!('generateLocalKeyId' in options)) { - options.generateLocalKeyId = true; - } - - var localKeyId = options.localKeyId; - var bagAttrs; - if(localKeyId !== null) { - localKeyId = forge.util.hexToBytes(localKeyId); - } else if(options.generateLocalKeyId) { - // use SHA-1 of paired cert, if available - if(cert) { - var pairedCert = forge.util.isArray(cert) ? cert[0] : cert; - if(typeof pairedCert === 'string') { - pairedCert = pki.certificateFromPem(pairedCert); - } - var sha1 = forge.md.sha1.create(); - sha1.update(asn1.toDer(pki.certificateToAsn1(pairedCert)).getBytes()); - localKeyId = sha1.digest().getBytes(); - } else { - // FIXME: consider using SHA-1 of public key (which can be generated - // from private key components), see: cert.generateSubjectKeyIdentifier - // generate random bytes - localKeyId = forge.random.getBytes(20); - } - } - - var attrs = []; - if(localKeyId !== null) { - attrs.push( - // localKeyID - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // attrId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.localKeyId).getBytes()), - // attrValues - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - localKeyId) - ]) - ])); - } - if('friendlyName' in options) { - attrs.push( - // friendlyName - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // attrId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.friendlyName).getBytes()), - // attrValues - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BMPSTRING, false, - options.friendlyName) - ]) - ])); - } - - if(attrs.length > 0) { - bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs); - } - - // collect contents for AuthenticatedSafe - var contents = []; - - // create safe bag(s) for certificate chain - var chain = []; - if(cert !== null) { - if(forge.util.isArray(cert)) { - chain = cert; - } else { - chain = [cert]; - } - } - - var certSafeBags = []; - for(var i = 0; i < chain.length; ++i) { - // convert cert from PEM as necessary - cert = chain[i]; - if(typeof cert === 'string') { - cert = pki.certificateFromPem(cert); - } - - // SafeBag - var certBagAttrs = (i === 0) ? bagAttrs : undefined; - var certAsn1 = pki.certificateToAsn1(cert); - var certSafeBag = - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.certBag).getBytes()), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // CertBag - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // certId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.x509Certificate).getBytes()), - // certValue (x509Certificate) - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(certAsn1).getBytes()) - ])])]), - // bagAttributes (OPTIONAL) - certBagAttrs - ]); - certSafeBags.push(certSafeBag); - } - - if(certSafeBags.length > 0) { - // SafeContents - var certSafeContents = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, certSafeBags); - - // ContentInfo - var certCI = - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - // OID for the content type is 'data' - asn1.oidToDer(pki.oids.data).getBytes()), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(certSafeContents).getBytes()) - ]) - ]); - contents.push(certCI); - } - - // create safe contents for private key - var keyBag = null; - if(key !== null) { - // SafeBag - var pkAsn1 = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(key)); - if(password === null) { - // no encryption - keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.keyBag).getBytes()), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // PrivateKeyInfo - pkAsn1 - ]), - // bagAttributes (OPTIONAL) - bagAttrs - ]); - } else { - // encrypted PrivateKeyInfo - keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // bagId - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.pkcs8ShroudedKeyBag).getBytes()), - // bagValue - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // EncryptedPrivateKeyInfo - pki.encryptPrivateKeyInfo(pkAsn1, password, options) - ]), - // bagAttributes (OPTIONAL) - bagAttrs - ]); - } - - // SafeContents - var keySafeContents = - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [keyBag]); - - // ContentInfo - var keyCI = - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - // OID for the content type is 'data' - asn1.oidToDer(pki.oids.data).getBytes()), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(keySafeContents).getBytes()) - ]) - ]); - contents.push(keyCI); - } - - // create AuthenticatedSafe by stringing together the contents - var safe = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, contents); - - var macData; - if(options.useMac) { - // MacData - var sha1 = forge.md.sha1.create(); - var macSalt = new forge.util.ByteBuffer( - forge.random.getBytes(options.saltSize)); - var count = options.count; - // 160-bit key - var key = p12.generateKey(password, macSalt, 3, count, 20); - var mac = forge.hmac.create(); - mac.start(sha1, key); - mac.update(asn1.toDer(safe).getBytes()); - var macValue = mac.getMac(); - macData = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // mac DigestInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // digestAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm = SHA-1 - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.sha1).getBytes()), - // parameters = Null - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // digest - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, - false, macValue.getBytes()) - ]), - // macSalt OCTET STRING - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macSalt.getBytes()), - // iterations INTEGER (XXX: Only support count < 65536) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(count).getBytes() - ) - ]); - } - - // PFX - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (3) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(3).getBytes()), - // PKCS#7 ContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // contentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - // OID for the content type is 'data' - asn1.oidToDer(pki.oids.data).getBytes()), - // content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(safe).getBytes()) - ]) - ]), - macData - ]); -}; - -/** - * Derives a PKCS#12 key. - * - * @param password the password to derive the key material from, null or - * undefined for none. - * @param salt the salt, as a ByteBuffer, to use. - * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC). - * @param iter the iteration count. - * @param n the number of bytes to derive from the password. - * @param md the message digest to use, defaults to SHA-1. - * - * @return a ByteBuffer with the bytes derived from the password. - */ -p12.generateKey = forge.pbe.generatePkcs12Key; diff --git a/node_modules/node-forge/lib/pkcs7.js b/node_modules/node-forge/lib/pkcs7.js deleted file mode 100644 index bb87de3..0000000 --- a/node_modules/node-forge/lib/pkcs7.js +++ /dev/null @@ -1,1257 +0,0 @@ -/** - * Javascript implementation of PKCS#7 v1.5. - * - * @author Stefan Siegl - * @author Dave Longley - * - * Copyright (c) 2012 Stefan Siegl - * Copyright (c) 2012-2015 Digital Bazaar, Inc. - * - * Currently this implementation only supports ContentType of EnvelopedData, - * EncryptedData, or SignedData at the root level. The top level elements may - * contain only a ContentInfo of ContentType Data, i.e. plain data. Further - * nesting is not (yet) supported. - * - * The Forge validators for PKCS #7's ASN.1 structures are available from - * a separate file pkcs7asn1.js, since those are referenced from other - * PKCS standards like PKCS #12. - */ -var forge = require('./forge'); -require('./aes'); -require('./asn1'); -require('./des'); -require('./oids'); -require('./pem'); -require('./pkcs7asn1'); -require('./random'); -require('./util'); -require('./x509'); - -// shortcut for ASN.1 API -var asn1 = forge.asn1; - -// shortcut for PKCS#7 API -var p7 = module.exports = forge.pkcs7 = forge.pkcs7 || {}; - -/** - * Converts a PKCS#7 message from PEM format. - * - * @param pem the PEM-formatted PKCS#7 message. - * - * @return the PKCS#7 message. - */ -p7.messageFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'PKCS7') { - var error = new Error('Could not convert PKCS#7 message from PEM; PEM ' + - 'header type is not "PKCS#7".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert PKCS#7 message from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body); - - return p7.messageFromAsn1(obj); -}; - -/** - * Converts a PKCS#7 message to PEM format. - * - * @param msg The PKCS#7 message object - * @param maxline The maximum characters per line, defaults to 64. - * - * @return The PEM-formatted PKCS#7 message. - */ -p7.messageToPem = function(msg, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var pemObj = { - type: 'PKCS7', - body: asn1.toDer(msg.toAsn1()).getBytes() - }; - return forge.pem.encode(pemObj, {maxline: maxline}); -}; - -/** - * Converts a PKCS#7 message from an ASN.1 object. - * - * @param obj the ASN.1 representation of a ContentInfo. - * - * @return the PKCS#7 message. - */ -p7.messageFromAsn1 = function(obj) { - // validate root level ContentInfo and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 message. ' + - 'ASN.1 object is not an PKCS#7 ContentInfo.'); - error.errors = errors; - throw error; - } - - var contentType = asn1.derToOid(capture.contentType); - var msg; - - switch(contentType) { - case forge.pki.oids.envelopedData: - msg = p7.createEnvelopedData(); - break; - - case forge.pki.oids.encryptedData: - msg = p7.createEncryptedData(); - break; - - case forge.pki.oids.signedData: - msg = p7.createSignedData(); - break; - - default: - throw new Error('Cannot read PKCS#7 message. ContentType with OID ' + - contentType + ' is not (yet) supported.'); - } - - msg.fromAsn1(capture.content.value[0]); - return msg; -}; - -p7.createSignedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.signedData, - version: 1, - certificates: [], - crls: [], - // TODO: add json-formatted signer stuff here? - signers: [], - // populated during sign() - digestAlgorithmIdentifiers: [], - contentInfo: null, - signerInfos: [], - - fromAsn1: function(obj) { - // validate SignedData content block and capture data. - _fromAsn1(msg, obj, p7.asn1.signedDataValidator); - msg.certificates = []; - msg.crls = []; - msg.digestAlgorithmIdentifiers = []; - msg.contentInfo = null; - msg.signerInfos = []; - - if(msg.rawCapture.certificates) { - var certs = msg.rawCapture.certificates.value; - for(var i = 0; i < certs.length; ++i) { - msg.certificates.push(forge.pki.certificateFromAsn1(certs[i])); - } - } - - // TODO: parse crls - }, - - toAsn1: function() { - // degenerate case with no content - if(!msg.contentInfo) { - msg.sign(); - } - - var certs = []; - for(var i = 0; i < msg.certificates.length; ++i) { - certs.push(forge.pki.certificateToAsn1(msg.certificates[i])); - } - - var crls = []; - // TODO: implement CRLs - - // [0] SignedData - var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(msg.version).getBytes()), - // DigestAlgorithmIdentifiers - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SET, true, - msg.digestAlgorithmIdentifiers), - // ContentInfo - msg.contentInfo - ]) - ]); - if(certs.length > 0) { - // [0] IMPLICIT ExtendedCertificatesAndCertificates OPTIONAL - signedData.value[0].value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs)); - } - if(crls.length > 0) { - // [1] IMPLICIT CertificateRevocationLists OPTIONAL - signedData.value[0].value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls)); - } - // SignerInfos - signedData.value[0].value.push( - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, - msg.signerInfos)); - - // ContentInfo - return asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(msg.type).getBytes()), - // [0] SignedData - signedData - ]); - }, - - /** - * Add (another) entity to list of signers. - * - * Note: If authenticatedAttributes are provided, then, per RFC 2315, - * they must include at least two attributes: content type and - * message digest. The message digest attribute value will be - * auto-calculated during signing and will be ignored if provided. - * - * Here's an example of providing these two attributes: - * - * forge.pkcs7.createSignedData(); - * p7.addSigner({ - * issuer: cert.issuer.attributes, - * serialNumber: cert.serialNumber, - * key: privateKey, - * digestAlgorithm: forge.pki.oids.sha1, - * authenticatedAttributes: [{ - * type: forge.pki.oids.contentType, - * value: forge.pki.oids.data - * }, { - * type: forge.pki.oids.messageDigest - * }] - * }); - * - * TODO: Support [subjectKeyIdentifier] as signer's ID. - * - * @param signer the signer information: - * key the signer's private key. - * [certificate] a certificate containing the public key - * associated with the signer's private key; use this option as - * an alternative to specifying signer.issuer and - * signer.serialNumber. - * [issuer] the issuer attributes (eg: cert.issuer.attributes). - * [serialNumber] the signer's certificate's serial number in - * hexadecimal (eg: cert.serialNumber). - * [digestAlgorithm] the message digest OID, as a string, to use - * (eg: forge.pki.oids.sha1). - * [authenticatedAttributes] an optional array of attributes - * to also sign along with the content. - */ - addSigner: function(signer) { - var issuer = signer.issuer; - var serialNumber = signer.serialNumber; - if(signer.certificate) { - var cert = signer.certificate; - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - issuer = cert.issuer.attributes; - serialNumber = cert.serialNumber; - } - var key = signer.key; - if(!key) { - throw new Error( - 'Could not add PKCS#7 signer; no private key specified.'); - } - if(typeof key === 'string') { - key = forge.pki.privateKeyFromPem(key); - } - - // ensure OID known for digest algorithm - var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1; - switch(digestAlgorithm) { - case forge.pki.oids.sha1: - case forge.pki.oids.sha256: - case forge.pki.oids.sha384: - case forge.pki.oids.sha512: - case forge.pki.oids.md5: - break; - default: - throw new Error( - 'Could not add PKCS#7 signer; unknown message digest algorithm: ' + - digestAlgorithm); - } - - // if authenticatedAttributes is present, then the attributes - // must contain at least PKCS #9 content-type and message-digest - var authenticatedAttributes = signer.authenticatedAttributes || []; - if(authenticatedAttributes.length > 0) { - var contentType = false; - var messageDigest = false; - for(var i = 0; i < authenticatedAttributes.length; ++i) { - var attr = authenticatedAttributes[i]; - if(!contentType && attr.type === forge.pki.oids.contentType) { - contentType = true; - if(messageDigest) { - break; - } - continue; - } - if(!messageDigest && attr.type === forge.pki.oids.messageDigest) { - messageDigest = true; - if(contentType) { - break; - } - continue; - } - } - - if(!contentType || !messageDigest) { - throw new Error('Invalid signer.authenticatedAttributes. If ' + - 'signer.authenticatedAttributes is specified, then it must ' + - 'contain at least two attributes, PKCS #9 content-type and ' + - 'PKCS #9 message-digest.'); - } - } - - msg.signers.push({ - key: key, - version: 1, - issuer: issuer, - serialNumber: serialNumber, - digestAlgorithm: digestAlgorithm, - signatureAlgorithm: forge.pki.oids.rsaEncryption, - signature: null, - authenticatedAttributes: authenticatedAttributes, - unauthenticatedAttributes: [] - }); - }, - - /** - * Signs the content. - * @param options Options to apply when signing: - * [detached] boolean. If signing should be done in detached mode. Defaults to false. - */ - sign: function(options) { - options = options || {}; - // auto-generate content info - if(typeof msg.content !== 'object' || msg.contentInfo === null) { - // use Data ContentInfo - msg.contentInfo = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(forge.pki.oids.data).getBytes()) - ]); - - // add actual content, if present - if('content' in msg) { - var content; - if(msg.content instanceof forge.util.ByteBuffer) { - content = msg.content.bytes(); - } else if(typeof msg.content === 'string') { - content = forge.util.encodeUtf8(msg.content); - } - - if (options.detached) { - msg.detachedContent = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, content); - } else { - msg.contentInfo.value.push( - // [0] EXPLICIT content - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - content) - ])); - } - } - } - - // no signers, return early (degenerate case for certificate container) - if(msg.signers.length === 0) { - return; - } - - // generate digest algorithm identifiers - var mds = addDigestAlgorithmIds(); - - // generate signerInfos - addSignerInfos(mds); - }, - - verify: function() { - throw new Error('PKCS#7 signature verification not yet implemented.'); - }, - - /** - * Add a certificate. - * - * @param cert the certificate to add. - */ - addCertificate: function(cert) { - // convert from PEM - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - msg.certificates.push(cert); - }, - - /** - * Add a certificate revokation list. - * - * @param crl the certificate revokation list to add. - */ - addCertificateRevokationList: function(crl) { - throw new Error('PKCS#7 CRL support not yet implemented.'); - } - }; - return msg; - - function addDigestAlgorithmIds() { - var mds = {}; - - for(var i = 0; i < msg.signers.length; ++i) { - var signer = msg.signers[i]; - var oid = signer.digestAlgorithm; - if(!(oid in mds)) { - // content digest - mds[oid] = forge.md[forge.pki.oids[oid]].create(); - } - if(signer.authenticatedAttributes.length === 0) { - // no custom attributes to digest; use content message digest - signer.md = mds[oid]; - } else { - // custom attributes to be digested; use own message digest - // TODO: optimize to just copy message digest state if that - // feature is ever supported with message digests - signer.md = forge.md[forge.pki.oids[oid]].create(); - } - } - - // add unique digest algorithm identifiers - msg.digestAlgorithmIdentifiers = []; - for(var oid in mds) { - msg.digestAlgorithmIdentifiers.push( - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(oid).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - } - - return mds; - } - - function addSignerInfos(mds) { - var content; - - if (msg.detachedContent) { - // Signature has been made in detached mode. - content = msg.detachedContent; - } else { - // Note: ContentInfo is a SEQUENCE with 2 values, second value is - // the content field and is optional for a ContentInfo but required here - // since signers are present - // get ContentInfo content - content = msg.contentInfo.value[1]; - // skip [0] EXPLICIT content wrapper - content = content.value[0]; - } - - if(!content) { - throw new Error( - 'Could not sign PKCS#7 message; there is no content to sign.'); - } - - // get ContentInfo content type - var contentType = asn1.derToOid(msg.contentInfo.value[0].value); - - // serialize content - var bytes = asn1.toDer(content); - - // skip identifier and length per RFC 2315 9.3 - // skip identifier (1 byte) - bytes.getByte(); - // read and discard length bytes - asn1.getBerValueLength(bytes); - bytes = bytes.getBytes(); - - // digest content DER value bytes - for(var oid in mds) { - mds[oid].start().update(bytes); - } - - // sign content - var signingTime = new Date(); - for(var i = 0; i < msg.signers.length; ++i) { - var signer = msg.signers[i]; - - if(signer.authenticatedAttributes.length === 0) { - // if ContentInfo content type is not "Data", then - // authenticatedAttributes must be present per RFC 2315 - if(contentType !== forge.pki.oids.data) { - throw new Error( - 'Invalid signer; authenticatedAttributes must be present ' + - 'when the ContentInfo content type is not PKCS#7 Data.'); - } - } else { - // process authenticated attributes - // [0] IMPLICIT - signer.authenticatedAttributesAsn1 = asn1.create( - asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - - // per RFC 2315, attributes are to be digested using a SET container - // not the above [0] IMPLICIT container - var attrsAsn1 = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SET, true, []); - - for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai) { - var attr = signer.authenticatedAttributes[ai]; - if(attr.type === forge.pki.oids.messageDigest) { - // use content message digest as value - attr.value = mds[signer.digestAlgorithm].digest(); - } else if(attr.type === forge.pki.oids.signingTime) { - // auto-populate signing time if not already set - if(!attr.value) { - attr.value = signingTime; - } - } - - // convert to ASN.1 and push onto Attributes SET (for signing) and - // onto authenticatedAttributesAsn1 to complete SignedData ASN.1 - // TODO: optimize away duplication - attrsAsn1.value.push(_attributeToAsn1(attr)); - signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr)); - } - - // DER-serialize and digest SET OF attributes only - bytes = asn1.toDer(attrsAsn1).getBytes(); - signer.md.start().update(bytes); - } - - // sign digest - signer.signature = signer.key.sign(signer.md, 'RSASSA-PKCS1-V1_5'); - } - - // add signer info - msg.signerInfos = _signersToAsn1(msg.signers); - } -}; - -/** - * Creates an empty PKCS#7 message of type EncryptedData. - * - * @return the message. - */ -p7.createEncryptedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.encryptedData, - version: 0, - encryptedContent: { - algorithm: forge.pki.oids['aes256-CBC'] - }, - - /** - * Reads an EncryptedData content block (in ASN.1 format) - * - * @param obj The ASN.1 representation of the EncryptedData content block - */ - fromAsn1: function(obj) { - // Validate EncryptedData content block and capture data. - _fromAsn1(msg, obj, p7.asn1.encryptedDataValidator); - }, - - /** - * Decrypt encrypted content - * - * @param key The (symmetric) key as a byte buffer - */ - decrypt: function(key) { - if(key !== undefined) { - msg.encryptedContent.key = key; - } - _decryptContent(msg); - } - }; - return msg; -}; - -/** - * Creates an empty PKCS#7 message of type EnvelopedData. - * - * @return the message. - */ -p7.createEnvelopedData = function() { - var msg = null; - msg = { - type: forge.pki.oids.envelopedData, - version: 0, - recipients: [], - encryptedContent: { - algorithm: forge.pki.oids['aes256-CBC'] - }, - - /** - * Reads an EnvelopedData content block (in ASN.1 format) - * - * @param obj the ASN.1 representation of the EnvelopedData content block. - */ - fromAsn1: function(obj) { - // validate EnvelopedData content block and capture data - var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator); - msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value); - }, - - toAsn1: function() { - // ContentInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // ContentType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(msg.type).getBytes()), - // [0] EnvelopedData - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(msg.version).getBytes()), - // RecipientInfos - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, - _recipientsToAsn1(msg.recipients)), - // EncryptedContentInfo - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, - _encryptedContentToAsn1(msg.encryptedContent)) - ]) - ]) - ]); - }, - - /** - * Find recipient by X.509 certificate's issuer. - * - * @param cert the certificate with the issuer to look for. - * - * @return the recipient object. - */ - findRecipient: function(cert) { - var sAttr = cert.issuer.attributes; - - for(var i = 0; i < msg.recipients.length; ++i) { - var r = msg.recipients[i]; - var rAttr = r.issuer; - - if(r.serialNumber !== cert.serialNumber) { - continue; - } - - if(rAttr.length !== sAttr.length) { - continue; - } - - var match = true; - for(var j = 0; j < sAttr.length; ++j) { - if(rAttr[j].type !== sAttr[j].type || - rAttr[j].value !== sAttr[j].value) { - match = false; - break; - } - } - - if(match) { - return r; - } - } - - return null; - }, - - /** - * Decrypt enveloped content - * - * @param recipient The recipient object related to the private key - * @param privKey The (RSA) private key object - */ - decrypt: function(recipient, privKey) { - if(msg.encryptedContent.key === undefined && recipient !== undefined && - privKey !== undefined) { - switch(recipient.encryptedContent.algorithm) { - case forge.pki.oids.rsaEncryption: - case forge.pki.oids.desCBC: - var key = privKey.decrypt(recipient.encryptedContent.content); - msg.encryptedContent.key = forge.util.createBuffer(key); - break; - - default: - throw new Error('Unsupported asymmetric cipher, ' + - 'OID ' + recipient.encryptedContent.algorithm); - } - } - - _decryptContent(msg); - }, - - /** - * Add (another) entity to list of recipients. - * - * @param cert The certificate of the entity to add. - */ - addRecipient: function(cert) { - msg.recipients.push({ - version: 0, - issuer: cert.issuer.attributes, - serialNumber: cert.serialNumber, - encryptedContent: { - // We simply assume rsaEncryption here, since forge.pki only - // supports RSA so far. If the PKI module supports other - // ciphers one day, we need to modify this one as well. - algorithm: forge.pki.oids.rsaEncryption, - key: cert.publicKey - } - }); - }, - - /** - * Encrypt enveloped content. - * - * This function supports two optional arguments, cipher and key, which - * can be used to influence symmetric encryption. Unless cipher is - * provided, the cipher specified in encryptedContent.algorithm is used - * (defaults to AES-256-CBC). If no key is provided, encryptedContent.key - * is (re-)used. If that one's not set, a random key will be generated - * automatically. - * - * @param [key] The key to be used for symmetric encryption. - * @param [cipher] The OID of the symmetric cipher to use. - */ - encrypt: function(key, cipher) { - // Part 1: Symmetric encryption - if(msg.encryptedContent.content === undefined) { - cipher = cipher || msg.encryptedContent.algorithm; - key = key || msg.encryptedContent.key; - - var keyLen, ivLen, ciphFn; - switch(cipher) { - case forge.pki.oids['aes128-CBC']: - keyLen = 16; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - - case forge.pki.oids['aes192-CBC']: - keyLen = 24; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - - case forge.pki.oids['aes256-CBC']: - keyLen = 32; - ivLen = 16; - ciphFn = forge.aes.createEncryptionCipher; - break; - - case forge.pki.oids['des-EDE3-CBC']: - keyLen = 24; - ivLen = 8; - ciphFn = forge.des.createEncryptionCipher; - break; - - default: - throw new Error('Unsupported symmetric cipher, OID ' + cipher); - } - - if(key === undefined) { - key = forge.util.createBuffer(forge.random.getBytes(keyLen)); - } else if(key.length() != keyLen) { - throw new Error('Symmetric key has wrong length; ' + - 'got ' + key.length() + ' bytes, expected ' + keyLen + '.'); - } - - // Keep a copy of the key & IV in the object, so the caller can - // use it for whatever reason. - msg.encryptedContent.algorithm = cipher; - msg.encryptedContent.key = key; - msg.encryptedContent.parameter = forge.util.createBuffer( - forge.random.getBytes(ivLen)); - - var ciph = ciphFn(key); - ciph.start(msg.encryptedContent.parameter.copy()); - ciph.update(msg.content); - - // The finish function does PKCS#7 padding by default, therefore - // no action required by us. - if(!ciph.finish()) { - throw new Error('Symmetric encryption failed.'); - } - - msg.encryptedContent.content = ciph.output; - } - - // Part 2: asymmetric encryption for each recipient - for(var i = 0; i < msg.recipients.length; ++i) { - var recipient = msg.recipients[i]; - - // Nothing to do, encryption already done. - if(recipient.encryptedContent.content !== undefined) { - continue; - } - - switch(recipient.encryptedContent.algorithm) { - case forge.pki.oids.rsaEncryption: - recipient.encryptedContent.content = - recipient.encryptedContent.key.encrypt( - msg.encryptedContent.key.data); - break; - - default: - throw new Error('Unsupported asymmetric cipher, OID ' + - recipient.encryptedContent.algorithm); - } - } - } - }; - return msg; -}; - -/** - * Converts a single recipient from an ASN.1 object. - * - * @param obj the ASN.1 RecipientInfo. - * - * @return the recipient object. - */ -function _recipientFromAsn1(obj) { - // validate EnvelopedData content block and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 RecipientInfo. ' + - 'ASN.1 object is not an PKCS#7 RecipientInfo.'); - error.errors = errors; - throw error; - } - - return { - version: capture.version.charCodeAt(0), - issuer: forge.pki.RDNAttributesAsArray(capture.issuer), - serialNumber: forge.util.createBuffer(capture.serial).toHex(), - encryptedContent: { - algorithm: asn1.derToOid(capture.encAlgorithm), - parameter: capture.encParameter.value, - content: capture.encKey - } - }; -} - -/** - * Converts a single recipient object to an ASN.1 object. - * - * @param obj the recipient object. - * - * @return the ASN.1 RecipientInfo. - */ -function _recipientToAsn1(obj) { - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(obj.version).getBytes()), - // IssuerAndSerialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Name - forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}), - // Serial - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(obj.serialNumber)) - ]), - // KeyEncryptionAlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()), - // Parameter, force NULL, only RSA supported for now. - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // EncryptedKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - obj.encryptedContent.content) - ]); -} - -/** - * Map a set of RecipientInfo ASN.1 objects to recipient objects. - * - * @param infos an array of ASN.1 representations RecipientInfo (i.e. SET OF). - * - * @return an array of recipient objects. - */ -function _recipientsFromAsn1(infos) { - var ret = []; - for(var i = 0; i < infos.length; ++i) { - ret.push(_recipientFromAsn1(infos[i])); - } - return ret; -} - -/** - * Map an array of recipient objects to ASN.1 RecipientInfo objects. - * - * @param recipients an array of recipientInfo objects. - * - * @return an array of ASN.1 RecipientInfos. - */ -function _recipientsToAsn1(recipients) { - var ret = []; - for(var i = 0; i < recipients.length; ++i) { - ret.push(_recipientToAsn1(recipients[i])); - } - return ret; -} - -/** - * Converts a single signer from an ASN.1 object. - * - * @param obj the ASN.1 representation of a SignerInfo. - * - * @return the signer object. - */ -function _signerFromAsn1(obj) { - // validate EnvelopedData content block and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 SignerInfo. ' + - 'ASN.1 object is not an PKCS#7 SignerInfo.'); - error.errors = errors; - throw error; - } - - var rval = { - version: capture.version.charCodeAt(0), - issuer: forge.pki.RDNAttributesAsArray(capture.issuer), - serialNumber: forge.util.createBuffer(capture.serial).toHex(), - digestAlgorithm: asn1.derToOid(capture.digestAlgorithm), - signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm), - signature: capture.signature, - authenticatedAttributes: [], - unauthenticatedAttributes: [] - }; - - // TODO: convert attributes - var authenticatedAttributes = capture.authenticatedAttributes || []; - var unauthenticatedAttributes = capture.unauthenticatedAttributes || []; - - return rval; -} - -/** - * Converts a single signerInfo object to an ASN.1 object. - * - * @param obj the signerInfo object. - * - * @return the ASN.1 representation of a SignerInfo. - */ -function _signerToAsn1(obj) { - // SignerInfo - var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(obj.version).getBytes()), - // issuerAndSerialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // name - forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}), - // serial - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(obj.serialNumber)) - ]), - // digestAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(obj.digestAlgorithm).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]) - ]); - - // authenticatedAttributes (OPTIONAL) - if(obj.authenticatedAttributesAsn1) { - // add ASN.1 previously generated during signing - rval.value.push(obj.authenticatedAttributesAsn1); - } - - // digestEncryptionAlgorithm - rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(obj.signatureAlgorithm).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ])); - - // encryptedDigest - rval.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature)); - - // unauthenticatedAttributes (OPTIONAL) - if(obj.unauthenticatedAttributes.length > 0) { - // [1] IMPLICIT - var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []); - for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) { - var attr = obj.unauthenticatedAttributes[i]; - attrsAsn1.values.push(_attributeToAsn1(attr)); - } - rval.value.push(attrsAsn1); - } - - return rval; -} - -/** - * Map a set of SignerInfo ASN.1 objects to an array of signer objects. - * - * @param signerInfoAsn1s an array of ASN.1 SignerInfos (i.e. SET OF). - * - * @return an array of signers objects. - */ -function _signersFromAsn1(signerInfoAsn1s) { - var ret = []; - for(var i = 0; i < signerInfoAsn1s.length; ++i) { - ret.push(_signerFromAsn1(signerInfoAsn1s[i])); - } - return ret; -} - -/** - * Map an array of signer objects to ASN.1 objects. - * - * @param signers an array of signer objects. - * - * @return an array of ASN.1 SignerInfos. - */ -function _signersToAsn1(signers) { - var ret = []; - for(var i = 0; i < signers.length; ++i) { - ret.push(_signerToAsn1(signers[i])); - } - return ret; -} - -/** - * Convert an attribute object to an ASN.1 Attribute. - * - * @param attr the attribute object. - * - * @return the ASN.1 Attribute. - */ -function _attributeToAsn1(attr) { - var value; - - // TODO: generalize to support more attributes - if(attr.type === forge.pki.oids.contentType) { - value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.value).getBytes()); - } else if(attr.type === forge.pki.oids.messageDigest) { - value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - attr.value.bytes()); - } else if(attr.type === forge.pki.oids.signingTime) { - /* Note per RFC 2985: Dates between 1 January 1950 and 31 December 2049 - (inclusive) MUST be encoded as UTCTime. Any dates with year values - before 1950 or after 2049 MUST be encoded as GeneralizedTime. [Further,] - UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST - include seconds (i.e., times are YYMMDDHHMMSSZ), even where the - number of seconds is zero. Midnight (GMT) must be represented as - "YYMMDD000000Z". */ - // TODO: make these module-level constants - var jan_1_1950 = new Date('1950-01-01T00:00:00Z'); - var jan_1_2050 = new Date('2050-01-01T00:00:00Z'); - var date = attr.value; - if(typeof date === 'string') { - // try to parse date - var timestamp = Date.parse(date); - if(!isNaN(timestamp)) { - date = new Date(timestamp); - } else if(date.length === 13) { - // YYMMDDHHMMSSZ (13 chars for UTCTime) - date = asn1.utcTimeToDate(date); - } else { - // assume generalized time - date = asn1.generalizedTimeToDate(date); - } - } - - if(date >= jan_1_1950 && date < jan_1_2050) { - value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, - asn1.dateToUtcTime(date)); - } else { - value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, - asn1.dateToGeneralizedTime(date)); - } - } - - // TODO: expose as common API call - // create a RelativeDistinguishedName set - // each value in the set is an AttributeTypeAndValue first - // containing the type (an OID) and second the value - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.type).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - // AttributeValue - value - ]) - ]); -} - -/** - * Map messages encrypted content to ASN.1 objects. - * - * @param ec The encryptedContent object of the message. - * - * @return ASN.1 representation of the encryptedContent object (SEQUENCE). - */ -function _encryptedContentToAsn1(ec) { - return [ - // ContentType, always Data for the moment - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(forge.pki.oids.data).getBytes()), - // ContentEncryptionAlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // Algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(ec.algorithm).getBytes()), - // Parameters (IV) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - ec.parameter.getBytes()) - ]), - // [0] EncryptedContent - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - ec.content.getBytes()) - ]) - ]; -} - -/** - * Reads the "common part" of an PKCS#7 content block (in ASN.1 format) - * - * This function reads the "common part" of the PKCS#7 content blocks - * EncryptedData and EnvelopedData, i.e. version number and symmetrically - * encrypted content block. - * - * The result of the ASN.1 validate and capture process is returned - * to allow the caller to extract further data, e.g. the list of recipients - * in case of a EnvelopedData object. - * - * @param msg the PKCS#7 object to read the data to. - * @param obj the ASN.1 representation of the content block. - * @param validator the ASN.1 structure validator object to use. - * - * @return the value map captured by validator object. - */ -function _fromAsn1(msg, obj, validator) { - var capture = {}; - var errors = []; - if(!asn1.validate(obj, validator, capture, errors)) { - var error = new Error('Cannot read PKCS#7 message. ' + - 'ASN.1 object is not a supported PKCS#7 message.'); - error.errors = error; - throw error; - } - - // Check contentType, so far we only support (raw) Data. - var contentType = asn1.derToOid(capture.contentType); - if(contentType !== forge.pki.oids.data) { - throw new Error('Unsupported PKCS#7 message. ' + - 'Only wrapped ContentType Data supported.'); - } - - if(capture.encryptedContent) { - var content = ''; - if(forge.util.isArray(capture.encryptedContent)) { - for(var i = 0; i < capture.encryptedContent.length; ++i) { - if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) { - throw new Error('Malformed PKCS#7 message, expecting encrypted ' + - 'content constructed of only OCTET STRING objects.'); - } - content += capture.encryptedContent[i].value; - } - } else { - content = capture.encryptedContent; - } - msg.encryptedContent = { - algorithm: asn1.derToOid(capture.encAlgorithm), - parameter: forge.util.createBuffer(capture.encParameter.value), - content: forge.util.createBuffer(content) - }; - } - - if(capture.content) { - var content = ''; - if(forge.util.isArray(capture.content)) { - for(var i = 0; i < capture.content.length; ++i) { - if(capture.content[i].type !== asn1.Type.OCTETSTRING) { - throw new Error('Malformed PKCS#7 message, expecting ' + - 'content constructed of only OCTET STRING objects.'); - } - content += capture.content[i].value; - } - } else { - content = capture.content; - } - msg.content = forge.util.createBuffer(content); - } - - msg.version = capture.version.charCodeAt(0); - msg.rawCapture = capture; - - return capture; -} - -/** - * Decrypt the symmetrically encrypted content block of the PKCS#7 message. - * - * Decryption is skipped in case the PKCS#7 message object already has a - * (decrypted) content attribute. The algorithm, key and cipher parameters - * (probably the iv) are taken from the encryptedContent attribute of the - * message object. - * - * @param The PKCS#7 message object. - */ -function _decryptContent(msg) { - if(msg.encryptedContent.key === undefined) { - throw new Error('Symmetric key not available.'); - } - - if(msg.content === undefined) { - var ciph; - - switch(msg.encryptedContent.algorithm) { - case forge.pki.oids['aes128-CBC']: - case forge.pki.oids['aes192-CBC']: - case forge.pki.oids['aes256-CBC']: - ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key); - break; - - case forge.pki.oids['desCBC']: - case forge.pki.oids['des-EDE3-CBC']: - ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key); - break; - - default: - throw new Error('Unsupported symmetric cipher, OID ' + - msg.encryptedContent.algorithm); - } - ciph.start(msg.encryptedContent.parameter); - ciph.update(msg.encryptedContent.content); - - if(!ciph.finish()) { - throw new Error('Symmetric decryption failed.'); - } - - msg.content = ciph.output; - } -} diff --git a/node_modules/node-forge/lib/pkcs7asn1.js b/node_modules/node-forge/lib/pkcs7asn1.js deleted file mode 100644 index a2ac01f..0000000 --- a/node_modules/node-forge/lib/pkcs7asn1.js +++ /dev/null @@ -1,409 +0,0 @@ -/** - * Javascript implementation of ASN.1 validators for PKCS#7 v1.5. - * - * @author Dave Longley - * @author Stefan Siegl - * - * Copyright (c) 2012-2015 Digital Bazaar, Inc. - * Copyright (c) 2012 Stefan Siegl - * - * The ASN.1 representation of PKCS#7 is as follows - * (see RFC #2315 for details, http://www.ietf.org/rfc/rfc2315.txt): - * - * A PKCS#7 message consists of a ContentInfo on root level, which may - * contain any number of further ContentInfo nested into it. - * - * ContentInfo ::= SEQUENCE { - * contentType ContentType, - * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL - * } - * - * ContentType ::= OBJECT IDENTIFIER - * - * EnvelopedData ::= SEQUENCE { - * version Version, - * recipientInfos RecipientInfos, - * encryptedContentInfo EncryptedContentInfo - * } - * - * EncryptedData ::= SEQUENCE { - * version Version, - * encryptedContentInfo EncryptedContentInfo - * } - * - * id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) - * us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } - * - * SignedData ::= SEQUENCE { - * version INTEGER, - * digestAlgorithms DigestAlgorithmIdentifiers, - * contentInfo ContentInfo, - * certificates [0] IMPLICIT Certificates OPTIONAL, - * crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, - * signerInfos SignerInfos - * } - * - * SignerInfos ::= SET OF SignerInfo - * - * SignerInfo ::= SEQUENCE { - * version Version, - * issuerAndSerialNumber IssuerAndSerialNumber, - * digestAlgorithm DigestAlgorithmIdentifier, - * authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, - * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, - * encryptedDigest EncryptedDigest, - * unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL - * } - * - * EncryptedDigest ::= OCTET STRING - * - * Attributes ::= SET OF Attribute - * - * Attribute ::= SEQUENCE { - * attrType OBJECT IDENTIFIER, - * attrValues SET OF AttributeValue - * } - * - * AttributeValue ::= ANY - * - * Version ::= INTEGER - * - * RecipientInfos ::= SET OF RecipientInfo - * - * EncryptedContentInfo ::= SEQUENCE { - * contentType ContentType, - * contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, - * encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL - * } - * - * ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of AES and DES3, there is only one, - * the IV. - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * EncryptedContent ::= OCTET STRING - * - * RecipientInfo ::= SEQUENCE { - * version Version, - * issuerAndSerialNumber IssuerAndSerialNumber, - * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, - * encryptedKey EncryptedKey - * } - * - * IssuerAndSerialNumber ::= SEQUENCE { - * issuer Name, - * serialNumber CertificateSerialNumber - * } - * - * CertificateSerialNumber ::= INTEGER - * - * KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * EncryptedKey ::= OCTET STRING - */ -var forge = require('./forge'); -require('./asn1'); -require('./util'); - -// shortcut for ASN.1 API -var asn1 = forge.asn1; - -// shortcut for PKCS#7 API -var p7v = module.exports = forge.pkcs7asn1 = forge.pkcs7asn1 || {}; -forge.pkcs7 = forge.pkcs7 || {}; -forge.pkcs7.asn1 = p7v; - -var contentInfoValidator = { - name: 'ContentInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'ContentInfo.ContentType', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'contentType' - }, { - name: 'ContentInfo.content', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - captureAsn1: 'content' - }] -}; -p7v.contentInfoValidator = contentInfoValidator; - -var encryptedContentInfoValidator = { - name: 'EncryptedContentInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedContentInfo.contentType', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'contentType' - }, { - name: 'EncryptedContentInfo.contentEncryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedContentInfo.contentEncryptionAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encAlgorithm' - }, { - name: 'EncryptedContentInfo.contentEncryptionAlgorithm.parameter', - tagClass: asn1.Class.UNIVERSAL, - captureAsn1: 'encParameter' - }] - }, { - name: 'EncryptedContentInfo.encryptedContent', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - /* The PKCS#7 structure output by OpenSSL somewhat differs from what - * other implementations do generate. - * - * OpenSSL generates a structure like this: - * SEQUENCE { - * ... - * [0] - * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 - * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 - * ... - * } - * - * Whereas other implementations (and this PKCS#7 module) generate: - * SEQUENCE { - * ... - * [0] { - * OCTET STRING - * 26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38 - * C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45 - * ... - * } - * } - * - * In order to support both, we just capture the context specific - * field here. The OCTET STRING bit is removed below. - */ - capture: 'encryptedContent', - captureAsn1: 'encryptedContentAsn1' - }] -}; - -p7v.envelopedDataValidator = { - name: 'EnvelopedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EnvelopedData.Version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, { - name: 'EnvelopedData.RecipientInfos', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - captureAsn1: 'recipientInfos' - }].concat(encryptedContentInfoValidator) -}; - -p7v.encryptedDataValidator = { - name: 'EncryptedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'EncryptedData.Version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }].concat(encryptedContentInfoValidator) -}; - -var signerValidator = { - name: 'SignerInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignerInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false - }, { - name: 'SignerInfo.issuerAndSerialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignerInfo.issuerAndSerialNumber.issuer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'issuer' - }, { - name: 'SignerInfo.issuerAndSerialNumber.serialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'serial' - }] - }, { - name: 'SignerInfo.digestAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignerInfo.digestAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'digestAlgorithm' - }, { - name: 'SignerInfo.digestAlgorithm.parameter', - tagClass: asn1.Class.UNIVERSAL, - constructed: false, - captureAsn1: 'digestParameter', - optional: true - }] - }, { - name: 'SignerInfo.authenticatedAttributes', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - capture: 'authenticatedAttributes' - }, { - name: 'SignerInfo.digestEncryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - capture: 'signatureAlgorithm' - }, { - name: 'SignerInfo.encryptedDigest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'signature' - }, { - name: 'SignerInfo.unauthenticatedAttributes', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - optional: true, - capture: 'unauthenticatedAttributes' - }] -}; - -p7v.signedDataValidator = { - name: 'SignedData', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'SignedData.Version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, { - name: 'SignedData.DigestAlgorithms', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true, - captureAsn1: 'digestAlgorithms' - }, - contentInfoValidator, - { - name: 'SignedData.Certificates', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - optional: true, - captureAsn1: 'certificates' - }, { - name: 'SignedData.CertificateRevocationLists', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - optional: true, - captureAsn1: 'crls' - }, { - name: 'SignedData.SignerInfos', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - capture: 'signerInfos', - optional: true, - value: [signerValidator] - }] -}; - -p7v.recipientInfoValidator = { - name: 'RecipientInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'RecipientInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'version' - }, { - name: 'RecipientInfo.issuerAndSerial', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'RecipientInfo.issuerAndSerial.issuer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'issuer' - }, { - name: 'RecipientInfo.issuerAndSerial.serialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'serial' - }] - }, { - name: 'RecipientInfo.keyEncryptionAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'RecipientInfo.keyEncryptionAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'encAlgorithm' - }, { - name: 'RecipientInfo.keyEncryptionAlgorithm.parameter', - tagClass: asn1.Class.UNIVERSAL, - constructed: false, - captureAsn1: 'encParameter' - }] - }, { - name: 'RecipientInfo.encryptedKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'encKey' - }] -}; diff --git a/node_modules/node-forge/lib/pki.js b/node_modules/node-forge/lib/pki.js deleted file mode 100644 index ee82ff1..0000000 --- a/node_modules/node-forge/lib/pki.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Javascript implementation of a basic Public Key Infrastructure, including - * support for RSA public and private keys. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./asn1'); -require('./oids'); -require('./pbe'); -require('./pem'); -require('./pbkdf2'); -require('./pkcs12'); -require('./pss'); -require('./rsa'); -require('./util'); -require('./x509'); - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -/* Public Key Infrastructure (PKI) implementation. */ -var pki = module.exports = forge.pki = forge.pki || {}; - -/** - * NOTE: THIS METHOD IS DEPRECATED. Use pem.decode() instead. - * - * Converts PEM-formatted data to DER. - * - * @param pem the PEM-formatted data. - * - * @return the DER-formatted data. - */ -pki.pemToDer = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert PEM to DER; PEM is encrypted.'); - } - return forge.util.createBuffer(msg.body); -}; - -/** - * Converts an RSA private key from PEM format. - * - * @param pem the PEM-formatted private key. - * - * @return the private key. - */ -pki.privateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'PRIVATE KEY' && msg.type !== 'RSA PRIVATE KEY') { - var error = new Error('Could not convert private key from PEM; PEM ' + - 'header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert private key from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body); - - return pki.privateKeyFromAsn1(obj); -}; - -/** - * Converts an RSA private key to PEM format. - * - * @param key the private key. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted private key. - */ -pki.privateKeyToPem = function(key, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'RSA PRIVATE KEY', - body: asn1.toDer(pki.privateKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts a PrivateKeyInfo to PEM format. - * - * @param pki the PrivateKeyInfo. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted private key. - */ -pki.privateKeyInfoToPem = function(pki, maxline) { - // convert to DER, then PEM-encode - var msg = { - type: 'PRIVATE KEY', - body: asn1.toDer(pki).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; diff --git a/node_modules/node-forge/lib/prime.js b/node_modules/node-forge/lib/prime.js deleted file mode 100644 index 3d51473..0000000 --- a/node_modules/node-forge/lib/prime.js +++ /dev/null @@ -1,297 +0,0 @@ -/** - * Prime number generation API. - * - * @author Dave Longley - * - * Copyright (c) 2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); -require('./jsbn'); -require('./random'); - -(function() { - -// forge.prime already defined -if(forge.prime) { - module.exports = forge.prime; - return; -} - -/* PRIME API */ -var prime = module.exports = forge.prime = forge.prime || {}; - -var BigInteger = forge.jsbn.BigInteger; - -// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; -var THIRTY = new BigInteger(null); -THIRTY.fromInt(30); -var op_or = function(x, y) {return x|y;}; - -/** - * Generates a random probable prime with the given number of bits. - * - * Alternative algorithms can be specified by name as a string or as an - * object with custom options like so: - * - * { - * name: 'PRIMEINC', - * options: { - * maxBlockTime: , - * millerRabinTests: , - * workerScript: , - * workers: . - * workLoad: the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * } - * } - * - * @param bits the number of bits for the prime number. - * @param options the options to use. - * [algorithm] the algorithm to use (default: 'PRIMEINC'). - * [prng] a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - * - * @return callback(err, num) called once the operation completes. - */ -prime.generateProbablePrime = function(bits, options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - - // default to PRIMEINC algorithm - var algorithm = options.algorithm || 'PRIMEINC'; - if(typeof algorithm === 'string') { - algorithm = {name: algorithm}; - } - algorithm.options = algorithm.options || {}; - - // create prng with api that matches BigInteger secure random - var prng = options.prng || forge.random; - var rng = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for(var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - - if(algorithm.name === 'PRIMEINC') { - return primeincFindPrime(bits, rng, algorithm.options, callback); - } - - throw new Error('Invalid prime generation algorithm: ' + algorithm.name); -}; - -function primeincFindPrime(bits, rng, options, callback) { - if('workers' in options) { - return primeincFindPrimeWithWorkers(bits, rng, options, callback); - } - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); -} - -function primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { - // initialize random number - var num = generateRandom(bits, rng); - - /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The - number we are given is always aligned at 30k + 1. Each time the number is - determined not to be prime we add to get to the next 'i', eg: if the number - was at 30k + 1 we add 6. */ - var deltaIdx = 0; - - // get required number of MR tests - var mrTests = getMillerRabinTests(num.bitLength()); - if('millerRabinTests' in options) { - mrTests = options.millerRabinTests; - } - - // find prime nearest to 'num' for maxBlockTime ms - // 10 ms gives 5ms of leeway for other calculations before dropping - // below 60fps (1000/60 == 16.67), but in reality, the number will - // likely be higher due to an 'atomic' big int modPow - var maxBlockTime = 10; - if('maxBlockTime' in options) { - maxBlockTime = options.maxBlockTime; - } - - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); -} - -function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { - var start = +new Date(); - do { - // overflow, regenerate random number - if(num.bitLength() > bits) { - num = generateRandom(bits, rng); - } - // do primality test - if(num.isProbablePrime(mrTests)) { - return callback(null, num); - } - // get next potential prime - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime)); - - // keep trying later - forge.util.setImmediate(function() { - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); - }); -} - -// NOTE: This algorithm is indeterminate in nature because workers -// run in parallel looking at different segments of numbers. Even if this -// algorithm is run twice with the same input from a predictable RNG, it -// may produce different outputs. -function primeincFindPrimeWithWorkers(bits, rng, options, callback) { - // web workers unavailable - if(typeof Worker === 'undefined') { - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); - } - - // initialize random number - var num = generateRandom(bits, rng); - - // use web workers to generate keys - var numWorkers = options.workers; - var workLoad = options.workLoad || 100; - var range = workLoad * 30 / 8; - var workerScript = options.workerScript || 'forge/prime.worker.js'; - if(numWorkers === -1) { - return forge.util.estimateCores(function(err, cores) { - if(err) { - // default to 2 - cores = 2; - } - numWorkers = cores - 1; - generate(); - }); - } - generate(); - - function generate() { - // require at least 1 worker - numWorkers = Math.max(1, numWorkers); - - // TODO: consider optimizing by starting workers outside getPrime() ... - // note that in order to clean up they will have to be made internally - // asynchronous which may actually be slower - - // start workers immediately - var workers = []; - for(var i = 0; i < numWorkers; ++i) { - // FIXME: fix path or use blob URLs - workers[i] = new Worker(workerScript); - } - var running = numWorkers; - - // listen for requests from workers and assign ranges to find prime - for(var i = 0; i < numWorkers; ++i) { - workers[i].addEventListener('message', workerMessage); - } - - /* Note: The distribution of random numbers is unknown. Therefore, each - web worker is continuously allocated a range of numbers to check for a - random number until one is found. - - Every 30 numbers will be checked just 8 times, because prime numbers - have the form: - - 30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this) - - Therefore, if we want a web worker to run N checks before asking for - a new range of numbers, each range must contain N*30/8 numbers. - - For 100 checks (workLoad), this is a range of 375. */ - - var found = false; - function workerMessage(e) { - // ignore message, prime already found - if(found) { - return; - } - - --running; - var data = e.data; - if(data.found) { - // terminate all workers - for(var i = 0; i < workers.length; ++i) { - workers[i].terminate(); - } - found = true; - return callback(null, new BigInteger(data.prime, 16)); - } - - // overflow, regenerate random number - if(num.bitLength() > bits) { - num = generateRandom(bits, rng); - } - - // assign new range to check - var hex = num.toString(16); - - // start prime search - e.target.postMessage({ - hex: hex, - workLoad: workLoad - }); - - num.dAddOffset(range, 0); - } - } -} - -/** - * Generates a random number using the given number of bits and RNG. - * - * @param bits the number of bits for the number. - * @param rng the random number generator to use. - * - * @return the random number. - */ -function generateRandom(bits, rng) { - var num = new BigInteger(bits, rng); - // force MSB set - var bits1 = bits - 1; - if(!num.testBit(bits1)) { - num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); - } - // align number on 30k+1 boundary - num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0); - return num; -} - -/** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. - */ -function getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} - -})(); diff --git a/node_modules/node-forge/lib/prime.worker.js b/node_modules/node-forge/lib/prime.worker.js deleted file mode 100644 index ce1355d..0000000 --- a/node_modules/node-forge/lib/prime.worker.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * RSA Key Generation Worker. - * - * @author Dave Longley - * - * Copyright (c) 2013 Digital Bazaar, Inc. - */ -// worker is built using CommonJS syntax to include all code in one worker file -//importScripts('jsbn.js'); -var forge = require('./forge'); -require('./jsbn'); - -// prime constants -var LOW_PRIMES = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; -var LP_LIMIT = (1 << 26) / LOW_PRIMES[LOW_PRIMES.length - 1]; - -var BigInteger = forge.jsbn.BigInteger; -var BIG_TWO = new BigInteger(null); -BIG_TWO.fromInt(2); - -self.addEventListener('message', function(e) { - var result = findPrime(e.data); - self.postMessage(result); -}); - -// start receiving ranges to check -self.postMessage({found: false}); - -// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - -function findPrime(data) { - // TODO: abstract based on data.algorithm (PRIMEINC vs. others) - - // create BigInteger from given random bytes - var num = new BigInteger(data.hex, 16); - - /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The - number we are given is always aligned at 30k + 1. Each time the number is - determined not to be prime we add to get to the next 'i', eg: if the number - was at 30k + 1 we add 6. */ - var deltaIdx = 0; - - // find nearest prime - var workLoad = data.workLoad; - for(var i = 0; i < workLoad; ++i) { - // do primality test - if(isProbablePrime(num)) { - return {found: true, prime: num.toString(16)}; - } - // get next potential prime - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } - - return {found: false}; -} - -function isProbablePrime(n) { - // divide by low primes, ignore even checks, etc (n alread aligned properly) - var i = 1; - while(i < LOW_PRIMES.length) { - var m = LOW_PRIMES[i]; - var j = i + 1; - while(j < LOW_PRIMES.length && m < LP_LIMIT) { - m *= LOW_PRIMES[j++]; - } - m = n.modInt(m); - while(i < j) { - if(m % LOW_PRIMES[i++] === 0) { - return false; - } - } - } - return runMillerRabin(n); -} - -// HAC 4.24, Miller-Rabin -function runMillerRabin(n) { - // n1 = n - 1 - var n1 = n.subtract(BigInteger.ONE); - - // get s and d such that n1 = 2^s * d - var s = n1.getLowestSetBit(); - if(s <= 0) { - return false; - } - var d = n1.shiftRight(s); - - var k = _getMillerRabinTests(n.bitLength()); - var prng = getPrng(); - var a; - for(var i = 0; i < k; ++i) { - // select witness 'a' at random from between 1 and n - 1 - do { - a = new BigInteger(n.bitLength(), prng); - } while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0); - - /* See if 'a' is a composite witness. */ - - // x = a^d mod n - var x = a.modPow(d, n); - - // probably prime - if(x.compareTo(BigInteger.ONE) === 0 || x.compareTo(n1) === 0) { - continue; - } - - var j = s; - while(--j) { - // x = x^2 mod a - x = x.modPowInt(2, n); - - // 'n' is composite because no previous x == -1 mod n - if(x.compareTo(BigInteger.ONE) === 0) { - return false; - } - // x == -1 mod n, so probably prime - if(x.compareTo(n1) === 0) { - break; - } - } - - // 'x' is first_x^(n1/2) and is not +/- 1, so 'n' is not prime - if(j === 0) { - return false; - } - } - - return true; -} - -// get pseudo random number generator -function getPrng() { - // create prng with api that matches BigInteger secure random - return { - // x is an array to fill with bytes - nextBytes: function(x) { - for(var i = 0; i < x.length; ++i) { - x[i] = Math.floor(Math.random() * 0xFF); - } - } - }; -} - -/** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. - */ -function _getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} diff --git a/node_modules/node-forge/lib/prng.js b/node_modules/node-forge/lib/prng.js deleted file mode 100644 index c2f5f05..0000000 --- a/node_modules/node-forge/lib/prng.js +++ /dev/null @@ -1,419 +0,0 @@ -/** - * A javascript implementation of a cryptographically-secure - * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed - * here though the use of SHA-256 is not enforced; when generating an - * a PRNG context, the hashing algorithm and block cipher used for - * the generator are specified via a plugin. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -var _crypto = null; -if(forge.util.isNodejs && !forge.options.usePureJavaScript && - !process.versions['node-webkit']) { - _crypto = require('crypto'); -} - -/* PRNG API */ -var prng = module.exports = forge.prng = forge.prng || {}; - -/** - * Creates a new PRNG context. - * - * A PRNG plugin must be passed in that will provide: - * - * 1. A function that initializes the key and seed of a PRNG context. It - * will be given a 16 byte key and a 16 byte seed. Any key expansion - * or transformation of the seed from a byte string into an array of - * integers (or similar) should be performed. - * 2. The cryptographic function used by the generator. It takes a key and - * a seed. - * 3. A seed increment function. It takes the seed and returns seed + 1. - * 4. An api to create a message digest. - * - * For an example, see random.js. - * - * @param plugin the PRNG plugin to use. - */ -prng.create = function(plugin) { - var ctx = { - plugin: plugin, - key: null, - seed: null, - time: null, - // number of reseeds so far - reseeds: 0, - // amount of data generated so far - generated: 0, - // no initial key bytes - keyBytes: '' - }; - - // create 32 entropy pools (each is a message digest) - var md = plugin.md; - var pools = new Array(32); - for(var i = 0; i < 32; ++i) { - pools[i] = md.create(); - } - ctx.pools = pools; - - // entropy pools are written to cyclically, starting at index 0 - ctx.pool = 0; - - /** - * Generates random bytes. The bytes may be generated synchronously or - * asynchronously. Web workers must use the asynchronous interface or - * else the behavior is undefined. - * - * @param count the number of random bytes to generate. - * @param [callback(err, bytes)] called once the operation completes. - * - * @return count random bytes as a string. - */ - ctx.generate = function(count, callback) { - // do synchronously - if(!callback) { - return ctx.generateSync(count); - } - - // simple generator using counter-based CBC - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - var b = forge.util.createBuffer(); - - // paranoid deviation from Fortuna: - // reset key for every request to protect previously - // generated random bytes should the key be discovered; - // there is no 100ms based reseeding because of this - // forced reseed for every `generate` call - ctx.key = null; - - generate(); - - function generate(err) { - if(err) { - return callback(err); - } - - // sufficient bytes generated - if(b.length() >= count) { - return callback(null, b.getBytes(count)); - } - - // if amount of data generated is greater than 1 MiB, trigger reseed - if(ctx.generated > 0xfffff) { - ctx.key = null; - } - - if(ctx.key === null) { - // prevent stack overflow - return forge.util.nextTick(function() { - _reseed(generate); - }); - } - - // generate the random bytes - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); - - // generate bytes for a new key and seed - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - - forge.util.setImmediate(generate); - } - }; - - /** - * Generates random bytes synchronously. - * - * @param count the number of random bytes to generate. - * - * @return count random bytes as a string. - */ - ctx.generateSync = function(count) { - // simple generator using counter-based CBC - var cipher = ctx.plugin.cipher; - var increment = ctx.plugin.increment; - var formatKey = ctx.plugin.formatKey; - var formatSeed = ctx.plugin.formatSeed; - - // paranoid deviation from Fortuna: - // reset key for every request to protect previously - // generated random bytes should the key be discovered; - // there is no 100ms based reseeding because of this - // forced reseed for every `generateSync` call - ctx.key = null; - - var b = forge.util.createBuffer(); - while(b.length() < count) { - // if amount of data generated is greater than 1 MiB, trigger reseed - if(ctx.generated > 0xfffff) { - ctx.key = null; - } - - if(ctx.key === null) { - _reseedSync(); - } - - // generate the random bytes - var bytes = cipher(ctx.key, ctx.seed); - ctx.generated += bytes.length; - b.putBytes(bytes); - - // generate bytes for a new key and seed - ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed))); - ctx.seed = formatSeed(cipher(ctx.key, ctx.seed)); - } - - return b.getBytes(count); - }; - - /** - * Private function that asynchronously reseeds a generator. - * - * @param callback(err) called once the operation completes. - */ - function _reseed(callback) { - if(ctx.pools[0].messageLength >= 32) { - _seed(); - return callback(); - } - // not enough seed data... - var needed = (32 - ctx.pools[0].messageLength) << 5; - ctx.seedFile(needed, function(err, bytes) { - if(err) { - return callback(err); - } - ctx.collect(bytes); - _seed(); - callback(); - }); - } - - /** - * Private function that synchronously reseeds a generator. - */ - function _reseedSync() { - if(ctx.pools[0].messageLength >= 32) { - return _seed(); - } - // not enough seed data... - var needed = (32 - ctx.pools[0].messageLength) << 5; - ctx.collect(ctx.seedFileSync(needed)); - _seed(); - } - - /** - * Private function that seeds a generator once enough bytes are available. - */ - function _seed() { - // update reseed count - ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1; - - // goal is to update `key` via: - // key = hash(key + s) - // where 's' is all collected entropy from selected pools, then... - - // create a plugin-based message digest - var md = ctx.plugin.md.create(); - - // consume current key bytes - md.update(ctx.keyBytes); - - // digest the entropy of pools whose index k meet the - // condition 'n mod 2^k == 0' where n is the number of reseeds - var _2powK = 1; - for(var k = 0; k < 32; ++k) { - if(ctx.reseeds % _2powK === 0) { - md.update(ctx.pools[k].digest().getBytes()); - ctx.pools[k].start(); - } - _2powK = _2powK << 1; - } - - // get digest for key bytes - ctx.keyBytes = md.digest().getBytes(); - - // paranoid deviation from Fortuna: - // update `seed` via `seed = hash(key)` - // instead of initializing to zero once and only - // ever incrementing it - md.start(); - md.update(ctx.keyBytes); - var seedBytes = md.digest().getBytes(); - - // update state - ctx.key = ctx.plugin.formatKey(ctx.keyBytes); - ctx.seed = ctx.plugin.formatSeed(seedBytes); - ctx.generated = 0; - } - - /** - * The built-in default seedFile. This seedFile is used when entropy - * is needed immediately. - * - * @param needed the number of bytes that are needed. - * - * @return the random bytes. - */ - function defaultSeedFile(needed) { - // use window.crypto.getRandomValues strong source of entropy if available - var getRandomValues = null; - var globalScope = forge.util.globalScope; - var _crypto = globalScope.crypto || globalScope.msCrypto; - if(_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; - } - - var b = forge.util.createBuffer(); - if(getRandomValues) { - while(b.length() < needed) { - // max byte length is 65536 before QuotaExceededError is thrown - // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues - var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4); - var entropy = new Uint32Array(Math.floor(count)); - try { - getRandomValues(entropy); - for(var i = 0; i < entropy.length; ++i) { - b.putInt32(entropy[i]); - } - } catch(e) { - /* only ignore QuotaExceededError */ - if(!(typeof QuotaExceededError !== 'undefined' && - e instanceof QuotaExceededError)) { - throw e; - } - } - } - } - - // be sad and add some weak random data - if(b.length() < needed) { - /* Draws from Park-Miller "minimal standard" 31 bit PRNG, - implemented with David G. Carta's optimization: with 32 bit math - and without division (Public Domain). */ - var hi, lo, next; - var seed = Math.floor(Math.random() * 0x010000); - while(b.length() < needed) { - lo = 16807 * (seed & 0xFFFF); - hi = 16807 * (seed >> 16); - lo += (hi & 0x7FFF) << 16; - lo += hi >> 15; - lo = (lo & 0x7FFFFFFF) + (lo >> 31); - seed = lo & 0xFFFFFFFF; - - // consume lower 3 bytes of seed - for(var i = 0; i < 3; ++i) { - // throw in more pseudo random - next = seed >>> (i << 3); - next ^= Math.floor(Math.random() * 0x0100); - b.putByte(String.fromCharCode(next & 0xFF)); - } - } - } - - return b.getBytes(needed); - } - // initialize seed file APIs - if(_crypto) { - // use nodejs async API - ctx.seedFile = function(needed, callback) { - _crypto.randomBytes(needed, function(err, bytes) { - if(err) { - return callback(err); - } - callback(null, bytes.toString()); - }); - }; - // use nodejs sync API - ctx.seedFileSync = function(needed) { - return _crypto.randomBytes(needed).toString(); - }; - } else { - ctx.seedFile = function(needed, callback) { - try { - callback(null, defaultSeedFile(needed)); - } catch(e) { - callback(e); - } - }; - ctx.seedFileSync = defaultSeedFile; - } - - /** - * Adds entropy to a prng ctx's accumulator. - * - * @param bytes the bytes of entropy as a string. - */ - ctx.collect = function(bytes) { - // iterate over pools distributing entropy cyclically - var count = bytes.length; - for(var i = 0; i < count; ++i) { - ctx.pools[ctx.pool].update(bytes.substr(i, 1)); - ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1; - } - }; - - /** - * Collects an integer of n bits. - * - * @param i the integer entropy. - * @param n the number of bits in the integer. - */ - ctx.collectInt = function(i, n) { - var bytes = ''; - for(var x = 0; x < n; x += 8) { - bytes += String.fromCharCode((i >> x) & 0xFF); - } - ctx.collect(bytes); - }; - - /** - * Registers a Web Worker to receive immediate entropy from the main thread. - * This method is required until Web Workers can access the native crypto - * API. This method should be called twice for each created worker, once in - * the main thread, and once in the worker itself. - * - * @param worker the worker to register. - */ - ctx.registerWorker = function(worker) { - // worker receives random bytes - if(worker === self) { - ctx.seedFile = function(needed, callback) { - function listener(e) { - var data = e.data; - if(data.forge && data.forge.prng) { - self.removeEventListener('message', listener); - callback(data.forge.prng.err, data.forge.prng.bytes); - } - } - self.addEventListener('message', listener); - self.postMessage({forge: {prng: {needed: needed}}}); - }; - } else { - // main thread sends random bytes upon request - var listener = function(e) { - var data = e.data; - if(data.forge && data.forge.prng) { - ctx.seedFile(data.forge.prng.needed, function(err, bytes) { - worker.postMessage({forge: {prng: {err: err, bytes: bytes}}}); - }); - } - }; - // TODO: do we need to remove the event listener when the worker dies? - worker.addEventListener('message', listener); - } - }; - - return ctx; -}; diff --git a/node_modules/node-forge/lib/pss.js b/node_modules/node-forge/lib/pss.js deleted file mode 100644 index 2596693..0000000 --- a/node_modules/node-forge/lib/pss.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Javascript implementation of PKCS#1 PSS signature padding. - * - * @author Stefan Siegl - * - * Copyright (c) 2012 Stefan Siegl - */ -var forge = require('./forge'); -require('./random'); -require('./util'); - -// shortcut for PSS API -var pss = module.exports = forge.pss = forge.pss || {}; - -/** - * Creates a PSS signature scheme object. - * - * There are several ways to provide a salt for encoding: - * - * 1. Specify the saltLength only and the built-in PRNG will generate it. - * 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that - * will be used. - * 3. Specify the salt itself as a forge.util.ByteBuffer. - * - * @param options the options to use: - * md the message digest object to use, a forge md instance. - * mgf the mask generation function to use, a forge mgf instance. - * [saltLength] the length of the salt in octets. - * [prng] the pseudo-random number generator to use to produce a salt. - * [salt] the salt to use when encoding. - * - * @return a signature scheme object. - */ -pss.create = function(options) { - // backwards compatibility w/legacy args: hash, mgf, sLen - if(arguments.length === 3) { - options = { - md: arguments[0], - mgf: arguments[1], - saltLength: arguments[2] - }; - } - - var hash = options.md; - var mgf = options.mgf; - var hLen = hash.digestLength; - - var salt_ = options.salt || null; - if(typeof salt_ === 'string') { - // assume binary-encoded string - salt_ = forge.util.createBuffer(salt_); - } - - var sLen; - if('saltLength' in options) { - sLen = options.saltLength; - } else if(salt_ !== null) { - sLen = salt_.length(); - } else { - throw new Error('Salt length not specified or specific salt not given.'); - } - - if(salt_ !== null && salt_.length() !== sLen) { - throw new Error('Given salt length does not match length of given salt.'); - } - - var prng = options.prng || forge.random; - - var pssobj = {}; - - /** - * Encodes a PSS signature. - * - * This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1. - * - * @param md the message digest object with the hash to sign. - * @param modsBits the length of the RSA modulus in bits. - * - * @return the encoded message as a binary-encoded string of length - * ceil((modBits - 1) / 8). - */ - pssobj.encode = function(md, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - - /* 2. Let mHash = Hash(M), an octet string of length hLen. */ - var mHash = md.digest().getBytes(); - - /* 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. */ - if(emLen < hLen + sLen + 2) { - throw new Error('Message is too long to encrypt.'); - } - - /* 4. Generate a random octet string salt of length sLen; if sLen = 0, - * then salt is the empty string. */ - var salt; - if(salt_ === null) { - salt = prng.getBytesSync(sLen); - } else { - salt = salt_.bytes(); - } - - /* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */ - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - - /* 6. Let H = Hash(M'), an octet string of length hLen. */ - hash.start(); - hash.update(m_.getBytes()); - var h = hash.digest().getBytes(); - - /* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2 - * zero octets. The length of PS may be 0. */ - var ps = new forge.util.ByteBuffer(); - ps.fillWithByte(0, emLen - sLen - hLen - 2); - - /* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length - * emLen - hLen - 1. */ - ps.putByte(0x01); - ps.putBytes(salt); - var db = ps.getBytes(); - - /* 9. Let dbMask = MGF(H, emLen - hLen - 1). */ - var maskLen = emLen - hLen - 1; - var dbMask = mgf.generate(h, maskLen); - - /* 10. Let maskedDB = DB \xor dbMask. */ - var maskedDB = ''; - for(i = 0; i < maskLen; i++) { - maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i)); - } - - /* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in - * maskedDB to zero. */ - var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF; - maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) + - maskedDB.substr(1); - - /* 12. Let EM = maskedDB || H || 0xbc. - * 13. Output EM. */ - return maskedDB + h + String.fromCharCode(0xbc); - }; - - /** - * Verifies a PSS signature. - * - * This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2. - * - * @param mHash the message digest hash, as a binary-encoded string, to - * compare against the signature. - * @param em the encoded message, as a binary-encoded string - * (RSA decryption result). - * @param modsBits the length of the RSA modulus in bits. - * - * @return true if the signature was verified, false if not. - */ - pssobj.verify = function(mHash, em, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - - /* c. Convert the message representative m to an encoded message EM - * of length emLen = ceil((modBits - 1) / 8) octets, where modBits - * is the length in bits of the RSA modulus n */ - em = em.substr(-emLen); - - /* 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. */ - if(emLen < hLen + sLen + 2) { - throw new Error('Inconsistent parameters to PSS signature verification.'); - } - - /* 4. If the rightmost octet of EM does not have hexadecimal value - * 0xbc, output "inconsistent" and stop. */ - if(em.charCodeAt(emLen - 1) !== 0xbc) { - throw new Error('Encoded message does not end in 0xBC.'); - } - - /* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and - * let H be the next hLen octets. */ - var maskLen = emLen - hLen - 1; - var maskedDB = em.substr(0, maskLen); - var h = em.substr(maskLen, hLen); - - /* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in - * maskedDB are not all equal to zero, output "inconsistent" and stop. */ - var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF; - if((maskedDB.charCodeAt(0) & mask) !== 0) { - throw new Error('Bits beyond keysize not zero as expected.'); - } - - /* 7. Let dbMask = MGF(H, emLen - hLen - 1). */ - var dbMask = mgf.generate(h, maskLen); - - /* 8. Let DB = maskedDB \xor dbMask. */ - var db = ''; - for(i = 0; i < maskLen; i++) { - db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i)); - } - - /* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet - * in DB to zero. */ - db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1); - - /* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero - * or if the octet at position emLen - hLen - sLen - 1 (the leftmost - * position is "position 1") does not have hexadecimal value 0x01, - * output "inconsistent" and stop. */ - var checkLen = emLen - hLen - sLen - 2; - for(i = 0; i < checkLen; i++) { - if(db.charCodeAt(i) !== 0x00) { - throw new Error('Leftmost octets not zero as expected'); - } - } - - if(db.charCodeAt(checkLen) !== 0x01) { - throw new Error('Inconsistent PSS signature, 0x01 marker not found'); - } - - /* 11. Let salt be the last sLen octets of DB. */ - var salt = db.substr(-sLen); - - /* 12. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */ - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - - /* 13. Let H' = Hash(M'), an octet string of length hLen. */ - hash.start(); - hash.update(m_.getBytes()); - var h_ = hash.digest().getBytes(); - - /* 14. If H = H', output "consistent." Otherwise, output "inconsistent." */ - return h === h_; - }; - - return pssobj; -}; diff --git a/node_modules/node-forge/lib/random.js b/node_modules/node-forge/lib/random.js deleted file mode 100644 index d4e4bea..0000000 --- a/node_modules/node-forge/lib/random.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * An API for getting cryptographically-secure random bytes. The bytes are - * generated using the Fortuna algorithm devised by Bruce Schneier and - * Niels Ferguson. - * - * Getting strong random bytes is not yet easy to do in javascript. The only - * truish random entropy that can be collected is from the mouse, keyboard, or - * from timing with respect to page loads, etc. This generator makes a poor - * attempt at providing random bytes when those sources haven't yet provided - * enough entropy to initially seed or to reseed the PRNG. - * - * @author Dave Longley - * - * Copyright (c) 2009-2014 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./aes'); -require('./sha256'); -require('./prng'); -require('./util'); - -(function() { - -// forge.random already defined -if(forge.random && forge.random.getBytes) { - module.exports = forge.random; - return; -} - -(function(jQuery) { - -// the default prng plugin, uses AES-128 -var prng_aes = {}; -var _prng_aes_output = new Array(4); -var _prng_aes_buffer = forge.util.createBuffer(); -prng_aes.formatKey = function(key) { - // convert the key into 32-bit integers - var tmp = forge.util.createBuffer(key); - key = new Array(4); - key[0] = tmp.getInt32(); - key[1] = tmp.getInt32(); - key[2] = tmp.getInt32(); - key[3] = tmp.getInt32(); - - // return the expanded key - return forge.aes._expandKey(key, false); -}; -prng_aes.formatSeed = function(seed) { - // convert seed into 32-bit integers - var tmp = forge.util.createBuffer(seed); - seed = new Array(4); - seed[0] = tmp.getInt32(); - seed[1] = tmp.getInt32(); - seed[2] = tmp.getInt32(); - seed[3] = tmp.getInt32(); - return seed; -}; -prng_aes.cipher = function(key, seed) { - forge.aes._updateBlock(key, seed, _prng_aes_output, false); - _prng_aes_buffer.putInt32(_prng_aes_output[0]); - _prng_aes_buffer.putInt32(_prng_aes_output[1]); - _prng_aes_buffer.putInt32(_prng_aes_output[2]); - _prng_aes_buffer.putInt32(_prng_aes_output[3]); - return _prng_aes_buffer.getBytes(); -}; -prng_aes.increment = function(seed) { - // FIXME: do we care about carry or signed issues? - ++seed[3]; - return seed; -}; -prng_aes.md = forge.md.sha256; - -/** - * Creates a new PRNG. - */ -function spawnPrng() { - var ctx = forge.prng.create(prng_aes); - - /** - * Gets random bytes. If a native secure crypto API is unavailable, this - * method tries to make the bytes more unpredictable by drawing from data that - * can be collected from the user of the browser, eg: mouse movement. - * - * If a callback is given, this method will be called asynchronously. - * - * @param count the number of random bytes to get. - * @param [callback(err, bytes)] called once the operation completes. - * - * @return the random bytes in a string. - */ - ctx.getBytes = function(count, callback) { - return ctx.generate(count, callback); - }; - - /** - * Gets random bytes asynchronously. If a native secure crypto API is - * unavailable, this method tries to make the bytes more unpredictable by - * drawing from data that can be collected from the user of the browser, - * eg: mouse movement. - * - * @param count the number of random bytes to get. - * - * @return the random bytes in a string. - */ - ctx.getBytesSync = function(count) { - return ctx.generate(count); - }; - - return ctx; -} - -// create default prng context -var _ctx = spawnPrng(); - -// add other sources of entropy only if window.crypto.getRandomValues is not -// available -- otherwise this source will be automatically used by the prng -var getRandomValues = null; -var globalScope = forge.util.globalScope; -var _crypto = globalScope.crypto || globalScope.msCrypto; -if(_crypto && _crypto.getRandomValues) { - getRandomValues = function(arr) { - return _crypto.getRandomValues(arr); - }; -} - -if(forge.options.usePureJavaScript || - (!forge.util.isNodejs && !getRandomValues)) { - // if this is a web worker, do not use weak entropy, instead register to - // receive strong entropy asynchronously from the main thread - if(typeof window === 'undefined' || window.document === undefined) { - // FIXME: - } - - // get load time entropy - _ctx.collectInt(+new Date(), 32); - - // add some entropy from navigator object - if(typeof(navigator) !== 'undefined') { - var _navBytes = ''; - for(var key in navigator) { - try { - if(typeof(navigator[key]) == 'string') { - _navBytes += navigator[key]; - } - } catch(e) { - /* Some navigator keys might not be accessible, e.g. the geolocation - attribute throws an exception if touched in Mozilla chrome:// - context. - - Silently ignore this and just don't use this as a source of - entropy. */ - } - } - _ctx.collect(_navBytes); - _navBytes = null; - } - - // add mouse and keyboard collectors if jquery is available - if(jQuery) { - // set up mouse entropy capture - jQuery().mousemove(function(e) { - // add mouse coords - _ctx.collectInt(e.clientX, 16); - _ctx.collectInt(e.clientY, 16); - }); - - // set up keyboard entropy capture - jQuery().keypress(function(e) { - _ctx.collectInt(e.charCode, 8); - }); - } -} - -/* Random API */ -if(!forge.random) { - forge.random = _ctx; -} else { - // extend forge.random with _ctx - for(var key in _ctx) { - forge.random[key] = _ctx[key]; - } -} - -// expose spawn PRNG -forge.random.createInstance = spawnPrng; - -module.exports = forge.random; - -})(typeof(jQuery) !== 'undefined' ? jQuery : null); - -})(); diff --git a/node_modules/node-forge/lib/rc2.js b/node_modules/node-forge/lib/rc2.js deleted file mode 100644 index e33f78a..0000000 --- a/node_modules/node-forge/lib/rc2.js +++ /dev/null @@ -1,410 +0,0 @@ -/** - * RC2 implementation. - * - * @author Stefan Siegl - * - * Copyright (c) 2012 Stefan Siegl - * - * Information on the RC2 cipher is available from RFC #2268, - * http://www.ietf.org/rfc/rfc2268.txt - */ -var forge = require('./forge'); -require('./util'); - -var piTable = [ - 0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d, - 0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2, - 0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32, - 0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82, - 0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc, - 0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26, - 0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03, - 0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7, - 0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a, - 0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec, - 0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39, - 0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31, - 0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9, - 0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9, - 0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e, - 0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad -]; - -var s = [1, 2, 3, 5]; - -/** - * Rotate a word left by given number of bits. - * - * Bits that are shifted out on the left are put back in on the right - * hand side. - * - * @param word The word to shift left. - * @param bits The number of bits to shift by. - * @return The rotated word. - */ -var rol = function(word, bits) { - return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits)); -}; - -/** - * Rotate a word right by given number of bits. - * - * Bits that are shifted out on the right are put back in on the left - * hand side. - * - * @param word The word to shift right. - * @param bits The number of bits to shift by. - * @return The rotated word. - */ -var ror = function(word, bits) { - return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff); -}; - -/* RC2 API */ -module.exports = forge.rc2 = forge.rc2 || {}; - -/** - * Perform RC2 key expansion as per RFC #2268, section 2. - * - * @param key variable-length user key (between 1 and 128 bytes) - * @param effKeyBits number of effective key bits (default: 128) - * @return the expanded RC2 key (ByteBuffer of 128 bytes) - */ -forge.rc2.expandKey = function(key, effKeyBits) { - if(typeof key === 'string') { - key = forge.util.createBuffer(key); - } - effKeyBits = effKeyBits || 128; - - /* introduce variables that match the names used in RFC #2268 */ - var L = key; - var T = key.length(); - var T1 = effKeyBits; - var T8 = Math.ceil(T1 / 8); - var TM = 0xff >> (T1 & 0x07); - var i; - - for(i = T; i < 128; i++) { - L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]); - } - - L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]); - - for(i = 127 - T8; i >= 0; i--) { - L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]); - } - - return L; -}; - -/** - * Creates a RC2 cipher object. - * - * @param key the symmetric key to use (as base for key generation). - * @param bits the number of effective key bits. - * @param encrypt false for decryption, true for encryption. - * - * @return the cipher. - */ -var createCipher = function(key, bits, encrypt) { - var _finish = false, _input = null, _output = null, _iv = null; - var mixRound, mashRound; - var i, j, K = []; - - /* Expand key and fill into K[] Array */ - key = forge.rc2.expandKey(key, bits); - for(i = 0; i < 64; i++) { - K.push(key.getInt16Le()); - } - - if(encrypt) { - /** - * Perform one mixing round "in place". - * - * @param R Array of four words to perform mixing on. - */ - mixRound = function(R) { - for(i = 0; i < 4; i++) { - R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + - ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); - R[i] = rol(R[i], s[i]); - j++; - } - }; - - /** - * Perform one mashing round "in place". - * - * @param R Array of four words to perform mashing on. - */ - mashRound = function(R) { - for(i = 0; i < 4; i++) { - R[i] += K[R[(i + 3) % 4] & 63]; - } - }; - } else { - /** - * Perform one r-mixing round "in place". - * - * @param R Array of four words to perform mixing on. - */ - mixRound = function(R) { - for(i = 3; i >= 0; i--) { - R[i] = ror(R[i], s[i]); - R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) + - ((~R[(i + 3) % 4]) & R[(i + 1) % 4]); - j--; - } - }; - - /** - * Perform one r-mashing round "in place". - * - * @param R Array of four words to perform mashing on. - */ - mashRound = function(R) { - for(i = 3; i >= 0; i--) { - R[i] -= K[R[(i + 3) % 4] & 63]; - } - }; - } - - /** - * Run the specified cipher execution plan. - * - * This function takes four words from the input buffer, applies the IV on - * it (if requested) and runs the provided execution plan. - * - * The plan must be put together in form of a array of arrays. Where the - * outer one is simply a list of steps to perform and the inner one needs - * to have two elements: the first one telling how many rounds to perform, - * the second one telling what to do (i.e. the function to call). - * - * @param {Array} plan The plan to execute. - */ - var runPlan = function(plan) { - var R = []; - - /* Get data from input buffer and fill the four words into R */ - for(i = 0; i < 4; i++) { - var val = _input.getInt16Le(); - - if(_iv !== null) { - if(encrypt) { - /* We're encrypting, apply the IV first. */ - val ^= _iv.getInt16Le(); - } else { - /* We're decryption, keep cipher text for next block. */ - _iv.putInt16Le(val); - } - } - - R.push(val & 0xffff); - } - - /* Reset global "j" variable as per spec. */ - j = encrypt ? 0 : 63; - - /* Run execution plan. */ - for(var ptr = 0; ptr < plan.length; ptr++) { - for(var ctr = 0; ctr < plan[ptr][0]; ctr++) { - plan[ptr][1](R); - } - } - - /* Write back result to output buffer. */ - for(i = 0; i < 4; i++) { - if(_iv !== null) { - if(encrypt) { - /* We're encrypting in CBC-mode, feed back encrypted bytes into - IV buffer to carry it forward to next block. */ - _iv.putInt16Le(R[i]); - } else { - R[i] ^= _iv.getInt16Le(); - } - } - - _output.putInt16Le(R[i]); - } - }; - - /* Create cipher object */ - var cipher = null; - cipher = { - /** - * Starts or restarts the encryption or decryption process, whichever - * was previously configured. - * - * To use the cipher in CBC mode, iv may be given either as a string - * of bytes, or as a byte buffer. For ECB mode, give null as iv. - * - * @param iv the initialization vector to use, null for ECB mode. - * @param output the output the buffer to write to, null to create one. - */ - start: function(iv, output) { - if(iv) { - /* CBC mode */ - if(typeof iv === 'string') { - iv = forge.util.createBuffer(iv); - } - } - - _finish = false; - _input = forge.util.createBuffer(); - _output = output || new forge.util.createBuffer(); - _iv = iv; - - cipher.output = _output; - }, - - /** - * Updates the next block. - * - * @param input the buffer to read from. - */ - update: function(input) { - if(!_finish) { - // not finishing, so fill the input buffer with more input - _input.putBuffer(input); - } - - while(_input.length() >= 8) { - runPlan([ - [ 5, mixRound ], - [ 1, mashRound ], - [ 6, mixRound ], - [ 1, mashRound ], - [ 5, mixRound ] - ]); - } - }, - - /** - * Finishes encrypting or decrypting. - * - * @param pad a padding function to use, null for PKCS#7 padding, - * signature(blockSize, buffer, decrypt). - * - * @return true if successful, false on error. - */ - finish: function(pad) { - var rval = true; - - if(encrypt) { - if(pad) { - rval = pad(8, _input, !encrypt); - } else { - // add PKCS#7 padding to block (each pad byte is the - // value of the number of pad bytes) - var padding = (_input.length() === 8) ? 8 : (8 - _input.length()); - _input.fillWithByte(padding, padding); - } - } - - if(rval) { - // do final update - _finish = true; - cipher.update(); - } - - if(!encrypt) { - // check for error: input data not a multiple of block size - rval = (_input.length() === 0); - if(rval) { - if(pad) { - rval = pad(8, _output, !encrypt); - } else { - // ensure padding byte count is valid - var len = _output.length(); - var count = _output.at(len - 1); - - if(count > len) { - rval = false; - } else { - // trim off padding bytes - _output.truncate(count); - } - } - } - } - - return rval; - } - }; - - return cipher; -}; - -/** - * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the - * given symmetric key. The output will be stored in the 'output' member - * of the returned cipher. - * - * The key and iv may be given as a string of bytes or a byte buffer. - * The cipher is initialized to use 128 effective key bits. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * - * @return the cipher. - */ -forge.rc2.startEncrypting = function(key, iv, output) { - var cipher = forge.rc2.createEncryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; -}; - -/** - * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the - * given symmetric key. - * - * The key may be given as a string of bytes or a byte buffer. - * - * To start encrypting call start() on the cipher with an iv and optional - * output buffer. - * - * @param key the symmetric key to use. - * - * @return the cipher. - */ -forge.rc2.createEncryptionCipher = function(key, bits) { - return createCipher(key, bits, true); -}; - -/** - * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the - * given symmetric key. The output will be stored in the 'output' member - * of the returned cipher. - * - * The key and iv may be given as a string of bytes or a byte buffer. - * The cipher is initialized to use 128 effective key bits. - * - * @param key the symmetric key to use. - * @param iv the initialization vector to use. - * @param output the buffer to write to, null to create one. - * - * @return the cipher. - */ -forge.rc2.startDecrypting = function(key, iv, output) { - var cipher = forge.rc2.createDecryptionCipher(key, 128); - cipher.start(iv, output); - return cipher; -}; - -/** - * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the - * given symmetric key. - * - * The key may be given as a string of bytes or a byte buffer. - * - * To start decrypting call start() on the cipher with an iv and optional - * output buffer. - * - * @param key the symmetric key to use. - * - * @return the cipher. - */ -forge.rc2.createDecryptionCipher = function(key, bits) { - return createCipher(key, bits, false); -}; diff --git a/node_modules/node-forge/lib/rsa.js b/node_modules/node-forge/lib/rsa.js deleted file mode 100644 index 7c67917..0000000 --- a/node_modules/node-forge/lib/rsa.js +++ /dev/null @@ -1,1858 +0,0 @@ -/** - * Javascript implementation of basic RSA algorithms. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * - * The only algorithm currently supported for PKI is RSA. - * - * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo - * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier - * and a subjectPublicKey of type bit string. - * - * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters - * for the algorithm, if any. In the case of RSA, there aren't any. - * - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING - * } - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * For an RSA public key, the subjectPublicKey is: - * - * RSAPublicKey ::= SEQUENCE { - * modulus INTEGER, -- n - * publicExponent INTEGER -- e - * } - * - * PrivateKeyInfo ::= SEQUENCE { - * version Version, - * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, - * privateKey PrivateKey, - * attributes [0] IMPLICIT Attributes OPTIONAL - * } - * - * Version ::= INTEGER - * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier - * PrivateKey ::= OCTET STRING - * Attributes ::= SET OF Attribute - * - * An RSA private key as the following structure: - * - * RSAPrivateKey ::= SEQUENCE { - * version Version, - * modulus INTEGER, -- n - * publicExponent INTEGER, -- e - * privateExponent INTEGER, -- d - * prime1 INTEGER, -- p - * prime2 INTEGER, -- q - * exponent1 INTEGER, -- d mod (p-1) - * exponent2 INTEGER, -- d mod (q-1) - * coefficient INTEGER -- (inverse of q) mod p - * } - * - * Version ::= INTEGER - * - * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1 - */ -var forge = require('./forge'); -require('./asn1'); -require('./jsbn'); -require('./oids'); -require('./pkcs1'); -require('./prime'); -require('./random'); -require('./util'); - -if(typeof BigInteger === 'undefined') { - var BigInteger = forge.jsbn.BigInteger; -} - -var _crypto = forge.util.isNodejs ? require('crypto') : null; - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -// shortcut for util API -var util = forge.util; - -/* - * RSA encryption and decryption, see RFC 2313. - */ -forge.pki = forge.pki || {}; -module.exports = forge.pki.rsa = forge.rsa = forge.rsa || {}; -var pki = forge.pki; - -// for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29 -var GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2]; - -// validator for a PrivateKeyInfo structure -var privateKeyValidator = { - // PrivateKeyInfo - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'PrivateKeyInfo.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // privateKeyAlgorithm - name: 'PrivateKeyInfo.privateKeyAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'privateKeyOid' - }] - }, { - // PrivateKey - name: 'PrivateKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OCTETSTRING, - constructed: false, - capture: 'privateKey' - }] -}; - -// validator for an RSA private key -var rsaPrivateKeyValidator = { - // RSAPrivateKey - name: 'RSAPrivateKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // Version (INTEGER) - name: 'RSAPrivateKey.version', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyVersion' - }, { - // modulus (n) - name: 'RSAPrivateKey.modulus', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyModulus' - }, { - // publicExponent (e) - name: 'RSAPrivateKey.publicExponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPublicExponent' - }, { - // privateExponent (d) - name: 'RSAPrivateKey.privateExponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrivateExponent' - }, { - // prime1 (p) - name: 'RSAPrivateKey.prime1', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrime1' - }, { - // prime2 (q) - name: 'RSAPrivateKey.prime2', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyPrime2' - }, { - // exponent1 (d mod (p-1)) - name: 'RSAPrivateKey.exponent1', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyExponent1' - }, { - // exponent2 (d mod (q-1)) - name: 'RSAPrivateKey.exponent2', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyExponent2' - }, { - // coefficient ((inverse of q) mod p) - name: 'RSAPrivateKey.coefficient', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'privateKeyCoefficient' - }] -}; - -// validator for an RSA public key -var rsaPublicKeyValidator = { - // RSAPublicKey - name: 'RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // modulus (n) - name: 'RSAPublicKey.modulus', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'publicKeyModulus' - }, { - // publicExponent (e) - name: 'RSAPublicKey.exponent', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'publicKeyExponent' - }] -}; - -// validator for an SubjectPublicKeyInfo structure -// Note: Currently only works with an RSA public key -var publicKeyValidator = forge.pki.rsa.publicKeyValidator = { - name: 'SubjectPublicKeyInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'subjectPublicKeyInfo', - value: [{ - name: 'SubjectPublicKeyInfo.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'publicKeyOid' - }] - }, { - // subjectPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - optional: true, - captureAsn1: 'rsaPublicKey' - }] - }] -}; - -/** - * Wrap digest in DigestInfo object. - * - * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447. - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * Digest ::= OCTET STRING - * - * @param md the message digest object with the hash to sign. - * - * @return the encoded message (ready for RSA encrytion) - */ -var emsaPkcs1v15encode = function(md) { - // get the oid for the algorithm - var oid; - if(md.algorithm in pki.oids) { - oid = pki.oids[md.algorithm]; - } else { - var error = new Error('Unknown message digest algorithm.'); - error.algorithm = md.algorithm; - throw error; - } - var oidBytes = asn1.oidToDer(oid).getBytes(); - - // create the digest info - var digestInfo = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var digestAlgorithm = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes)); - digestAlgorithm.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')); - var digest = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, - false, md.digest().getBytes()); - digestInfo.value.push(digestAlgorithm); - digestInfo.value.push(digest); - - // encode digest info - return asn1.toDer(digestInfo).getBytes(); -}; - -/** - * Performs x^c mod n (RSA encryption or decryption operation). - * - * @param x the number to raise and mod. - * @param key the key to use. - * @param pub true if the key is public, false if private. - * - * @return the result of x^c mod n. - */ -var _modPow = function(x, key, pub) { - if(pub) { - return x.modPow(key.e, key.n); - } - - if(!key.p || !key.q) { - // allow calculation without CRT params (slow) - return x.modPow(key.d, key.n); - } - - // pre-compute dP, dQ, and qInv if necessary - if(!key.dP) { - key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); - } - if(!key.dQ) { - key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); - } - if(!key.qInv) { - key.qInv = key.q.modInverse(key.p); - } - - /* Chinese remainder theorem (CRT) states: - - Suppose n1, n2, ..., nk are positive integers which are pairwise - coprime (n1 and n2 have no common factors other than 1). For any - integers x1, x2, ..., xk there exists an integer x solving the - system of simultaneous congruences (where ~= means modularly - congruent so a ~= b mod n means a mod n = b mod n): - - x ~= x1 mod n1 - x ~= x2 mod n2 - ... - x ~= xk mod nk - - This system of congruences has a single simultaneous solution x - between 0 and n - 1. Furthermore, each xk solution and x itself - is congruent modulo the product n = n1*n2*...*nk. - So x1 mod n = x2 mod n = xk mod n = x mod n. - - The single simultaneous solution x can be solved with the following - equation: - - x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni. - - Where x is less than n, xi = x mod ni. - - For RSA we are only concerned with k = 2. The modulus n = pq, where - p and q are coprime. The RSA decryption algorithm is: - - y = x^d mod n - - Given the above: - - x1 = x^d mod p - r1 = n/p = q - s1 = q^-1 mod p - x2 = x^d mod q - r2 = n/q = p - s2 = p^-1 mod q - - So y = (x1r1s1 + x2r2s2) mod n - = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n - - According to Fermat's Little Theorem, if the modulus P is prime, - for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P. - Since A is not divisible by P it follows that if: - N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore: - - A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort - to calculate). In order to calculate x^d mod p more quickly the - exponent d mod (p - 1) is stored in the RSA private key (the same - is done for x^d mod q). These values are referred to as dP and dQ - respectively. Therefore we now have: - - y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n - - Since we'll be reducing x^dP by modulo p (same for q) we can also - reduce x by p (and q respectively) before hand. Therefore, let - - xp = ((x mod p)^dP mod p), and - xq = ((x mod q)^dQ mod q), yielding: - - y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n - - This can be further reduced to a simple algorithm that only - requires 1 inverse (the q inverse is used) to be used and stored. - The algorithm is called Garner's algorithm. If qInv is the - inverse of q, we simply calculate: - - y = (qInv*(xp - xq) mod p) * q + xq - - However, there are two further complications. First, we need to - ensure that xp > xq to prevent signed BigIntegers from being used - so we add p until this is true (since we will be mod'ing with - p anyway). Then, there is a known timing attack on algorithms - using the CRT. To mitigate this risk, "cryptographic blinding" - should be used. This requires simply generating a random number r - between 0 and n-1 and its inverse and multiplying x by r^e before - calculating y and then multiplying y by r^-1 afterwards. Note that - r must be coprime with n (gcd(r, n) === 1) in order to have an - inverse. - */ - - // cryptographic blinding - var r; - do { - r = new BigInteger( - forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)), - 16); - } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE)); - x = x.multiply(r.modPow(key.e, key.n)).mod(key.n); - - // calculate xp and xq - var xp = x.mod(key.p).modPow(key.dP, key.p); - var xq = x.mod(key.q).modPow(key.dQ, key.q); - - // xp must be larger than xq to avoid signed bit usage - while(xp.compareTo(xq) < 0) { - xp = xp.add(key.p); - } - - // do last step - var y = xp.subtract(xq) - .multiply(key.qInv).mod(key.p) - .multiply(key.q).add(xq); - - // remove effect of random for cryptographic blinding - y = y.multiply(r.modInverse(key.n)).mod(key.n); - - return y; -}; - -/** - * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or - * 'encrypt' on a public key object instead. - * - * Performs RSA encryption. - * - * The parameter bt controls whether to put padding bytes before the - * message passed in. Set bt to either true or false to disable padding - * completely (in order to handle e.g. EMSA-PSS encoding seperately before), - * signaling whether the encryption operation is a public key operation - * (i.e. encrypting data) or not, i.e. private key operation (data signing). - * - * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01 - * (for signing) or 0x02 (for encryption). The key operation mode (private - * or public) is derived from this flag in that case). - * - * @param m the message to encrypt as a byte string. - * @param key the RSA key to use. - * @param bt for PKCS#1 v1.5 padding, the block type to use - * (0x01 for private key, 0x02 for public), - * to disable padding: true = public key, false = private key. - * - * @return the encrypted bytes as a string. - */ -pki.rsa.encrypt = function(m, key, bt) { - var pub = bt; - var eb; - - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - if(bt !== false && bt !== true) { - // legacy, default to PKCS#1 v1.5 padding - pub = (bt === 0x02); - eb = _encodePkcs1_v1_5(m, key, bt); - } else { - eb = forge.util.createBuffer(); - eb.putBytes(m); - } - - // load encryption block as big integer 'x' - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var x = new BigInteger(eb.toHex(), 16); - - // do RSA encryption - var y = _modPow(x, key, pub); - - // convert y into the encrypted data byte string, if y is shorter in - // bytes than k, then prepend zero bytes to fill up ed - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var yhex = y.toString(16); - var ed = forge.util.createBuffer(); - var zeros = k - Math.ceil(yhex.length / 2); - while(zeros > 0) { - ed.putByte(0x00); - --zeros; - } - ed.putBytes(forge.util.hexToBytes(yhex)); - return ed.getBytes(); -}; - -/** - * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or - * 'verify' on a public key object instead. - * - * Performs RSA decryption. - * - * The parameter ml controls whether to apply PKCS#1 v1.5 padding - * or not. Set ml = false to disable padding removal completely - * (in order to handle e.g. EMSA-PSS later on) and simply pass back - * the RSA encryption block. - * - * @param ed the encrypted data to decrypt in as a byte string. - * @param key the RSA key to use. - * @param pub true for a public key operation, false for private. - * @param ml the message length, if known, false to disable padding. - * - * @return the decrypted message as a byte string. - */ -pki.rsa.decrypt = function(ed, key, pub, ml) { - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - // error if the length of the encrypted data ED is not k - if(ed.length !== k) { - var error = new Error('Encrypted message length is invalid.'); - error.length = ed.length; - error.expected = k; - throw error; - } - - // convert encrypted data into a big integer - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); - - // y must be less than the modulus or it wasn't the result of - // a previous mod operation (encryption) using that modulus - if(y.compareTo(key.n) >= 0) { - throw new Error('Encrypted message is invalid.'); - } - - // do RSA decryption - var x = _modPow(y, key, pub); - - // create the encryption block, if x is shorter in bytes than k, then - // prepend zero bytes to fill up eb - // FIXME: hex conversion inefficient, get BigInteger w/byte strings - var xhex = x.toString(16); - var eb = forge.util.createBuffer(); - var zeros = k - Math.ceil(xhex.length / 2); - while(zeros > 0) { - eb.putByte(0x00); - --zeros; - } - eb.putBytes(forge.util.hexToBytes(xhex)); - - if(ml !== false) { - // legacy, default to PKCS#1 v1.5 padding - return _decodePkcs1_v1_5(eb.getBytes(), key, pub); - } - - // return message - return eb.getBytes(); -}; - -/** - * Creates an RSA key-pair generation state object. It is used to allow - * key-generation to be performed in steps. It also allows for a UI to - * display progress updates. - * - * @param bits the size for the private key in bits, defaults to 2048. - * @param e the public exponent to use, defaults to 65537 (0x10001). - * @param [options] the options to use. - * prng a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". - * algorithm the algorithm to use (default: 'PRIMEINC'). - * - * @return the state object to use to generate the key-pair. - */ -pki.rsa.createKeyPairGenerationState = function(bits, e, options) { - // TODO: migrate step-based prime generation code to forge.prime - - // set default bits - if(typeof(bits) === 'string') { - bits = parseInt(bits, 10); - } - bits = bits || 2048; - - // create prng with api that matches BigInteger secure random - options = options || {}; - var prng = options.prng || forge.random; - var rng = { - // x is an array to fill with bytes - nextBytes: function(x) { - var b = prng.getBytesSync(x.length); - for(var i = 0; i < x.length; ++i) { - x[i] = b.charCodeAt(i); - } - } - }; - - var algorithm = options.algorithm || 'PRIMEINC'; - - // create PRIMEINC algorithm state - var rval; - if(algorithm === 'PRIMEINC') { - rval = { - algorithm: algorithm, - state: 0, - bits: bits, - rng: rng, - eInt: e || 65537, - e: new BigInteger(null), - p: null, - q: null, - qBits: bits >> 1, - pBits: bits - (bits >> 1), - pqState: 0, - num: null, - keys: null - }; - rval.e.fromInt(rval.eInt); - } else { - throw new Error('Invalid key generation algorithm: ' + algorithm); - } - - return rval; -}; - -/** - * Attempts to runs the key-generation algorithm for at most n seconds - * (approximately) using the given state. When key-generation has completed, - * the keys will be stored in state.keys. - * - * To use this function to update a UI while generating a key or to prevent - * causing browser lockups/warnings, set "n" to a value other than 0. A - * simple pattern for generating a key and showing a progress indicator is: - * - * var state = pki.rsa.createKeyPairGenerationState(2048); - * var step = function() { - * // step key-generation, run algorithm for 100 ms, repeat - * if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) { - * setTimeout(step, 1); - * } else { - * // key-generation complete - * // TODO: turn off progress indicator here - * // TODO: use the generated key-pair in "state.keys" - * } - * }; - * // TODO: turn on progress indicator here - * setTimeout(step, 0); - * - * @param state the state to use. - * @param n the maximum number of milliseconds to run the algorithm for, 0 - * to run the algorithm to completion. - * - * @return true if the key-generation completed, false if not. - */ -pki.rsa.stepKeyPairGenerationState = function(state, n) { - // set default algorithm if not set - if(!('algorithm' in state)) { - state.algorithm = 'PRIMEINC'; - } - - // TODO: migrate step-based prime generation code to forge.prime - // TODO: abstract as PRIMEINC algorithm - - // do key generation (based on Tom Wu's rsa.js, see jsbn.js license) - // with some minor optimizations and designed to run in steps - - // local state vars - var THIRTY = new BigInteger(null); - THIRTY.fromInt(30); - var deltaIdx = 0; - var op_or = function(x, y) {return x | y;}; - - // keep stepping until time limit is reached or done - var t1 = +new Date(); - var t2; - var total = 0; - while(state.keys === null && (n <= 0 || total < n)) { - // generate p or q - if(state.state === 0) { - /* Note: All primes are of the form: - - 30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i - - When we generate a random number, we always align it at 30k + 1. Each - time the number is determined not to be prime we add to get to the - next 'i', eg: if the number was at 30k + 1 we add 6. */ - var bits = (state.p === null) ? state.pBits : state.qBits; - var bits1 = bits - 1; - - // get a random number - if(state.pqState === 0) { - state.num = new BigInteger(bits, state.rng); - // force MSB set - if(!state.num.testBit(bits1)) { - state.num.bitwiseTo( - BigInteger.ONE.shiftLeft(bits1), op_or, state.num); - } - // align number on 30k+1 boundary - state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0); - deltaIdx = 0; - - ++state.pqState; - } else if(state.pqState === 1) { - // try to make the number a prime - if(state.num.bitLength() > bits) { - // overflow, try again - state.pqState = 0; - // do primality test - } else if(state.num.isProbablePrime( - _getMillerRabinTests(state.num.bitLength()))) { - ++state.pqState; - } else { - // get next potential prime - state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } - } else if(state.pqState === 2) { - // ensure number is coprime with e - state.pqState = - (state.num.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) === 0) ? 3 : 0; - } else if(state.pqState === 3) { - // store p or q - state.pqState = 0; - if(state.p === null) { - state.p = state.num; - } else { - state.q = state.num; - } - - // advance state if both p and q are ready - if(state.p !== null && state.q !== null) { - ++state.state; - } - state.num = null; - } - } else if(state.state === 1) { - // ensure p is larger than q (swap them if not) - if(state.p.compareTo(state.q) < 0) { - state.num = state.p; - state.p = state.q; - state.q = state.num; - } - ++state.state; - } else if(state.state === 2) { - // compute phi: (p - 1)(q - 1) (Euler's totient function) - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - ++state.state; - } else if(state.state === 3) { - // ensure e and phi are coprime - if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) { - // phi and e are coprime, advance - ++state.state; - } else { - // phi and e aren't coprime, so generate a new p and q - state.p = null; - state.q = null; - state.state = 0; - } - } else if(state.state === 4) { - // create n, ensure n is has the right number of bits - state.n = state.p.multiply(state.q); - - // ensure n is right number of bits - if(state.n.bitLength() === state.bits) { - // success, advance - ++state.state; - } else { - // failed, get new q - state.q = null; - state.state = 0; - } - } else if(state.state === 5) { - // set keys - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki.rsa.setPrivateKey( - state.n, state.e, d, state.p, state.q, - d.mod(state.p1), d.mod(state.q1), - state.q.modInverse(state.p)), - publicKey: pki.rsa.setPublicKey(state.n, state.e) - }; - } - - // update timing - t2 = +new Date(); - total += t2 - t1; - t1 = t2; - } - - return state.keys !== null; -}; - -/** - * Generates an RSA public-private key pair in a single call. - * - * To generate a key-pair in steps (to allow for progress updates and to - * prevent blocking or warnings in slow browsers) then use the key-pair - * generation state functions. - * - * To generate a key-pair asynchronously (either through web-workers, if - * available, or by breaking up the work on the main thread), pass a - * callback function. - * - * @param [bits] the size for the private key in bits, defaults to 2048. - * @param [e] the public exponent to use, defaults to 65537. - * @param [options] options for key-pair generation, if given then 'bits' - * and 'e' must *not* be given: - * bits the size for the private key in bits, (default: 2048). - * e the public exponent to use, (default: 65537 (0x10001)). - * workerScript the worker script URL. - * workers the number of web workers (if supported) to use, - * (default: 2). - * workLoad the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * prng a custom crypto-secure pseudo-random number generator to use, - * that must define "getBytesSync". Disables use of native APIs. - * algorithm the algorithm to use (default: 'PRIMEINC'). - * @param [callback(err, keypair)] called once the operation completes. - * - * @return an object with privateKey and publicKey properties. - */ -pki.rsa.generateKeyPair = function(bits, e, options, callback) { - // (bits), (options), (callback) - if(arguments.length === 1) { - if(typeof bits === 'object') { - options = bits; - bits = undefined; - } else if(typeof bits === 'function') { - callback = bits; - bits = undefined; - } - } else if(arguments.length === 2) { - // (bits, e), (bits, options), (bits, callback), (options, callback) - if(typeof bits === 'number') { - if(typeof e === 'function') { - callback = e; - e = undefined; - } else if(typeof e !== 'number') { - options = e; - e = undefined; - } - } else { - options = bits; - callback = e; - bits = undefined; - e = undefined; - } - } else if(arguments.length === 3) { - // (bits, e, options), (bits, e, callback), (bits, options, callback) - if(typeof e === 'number') { - if(typeof options === 'function') { - callback = options; - options = undefined; - } - } else { - callback = options; - options = e; - e = undefined; - } - } - options = options || {}; - if(bits === undefined) { - bits = options.bits || 2048; - } - if(e === undefined) { - e = options.e || 0x10001; - } - - // use native code if permitted, available, and parameters are acceptable - if(!forge.options.usePureJavaScript && !options.prng && - bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) { - if(callback) { - // try native async - if(_detectNodeCrypto('generateKeyPair')) { - return _crypto.generateKeyPair('rsa', { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: 'spki', - format: 'pem' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'pem' - } - }, function(err, pub, priv) { - if(err) { - return callback(err); - } - callback(null, { - privateKey: pki.privateKeyFromPem(priv), - publicKey: pki.publicKeyFromPem(pub) - }); - }); - } - if(_detectSubtleCrypto('generateKey') && - _detectSubtleCrypto('exportKey')) { - // use standard native generateKey - return util.globalScope.crypto.subtle.generateKey({ - name: 'RSASSA-PKCS1-v1_5', - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: {name: 'SHA-256'} - }, true /* key can be exported*/, ['sign', 'verify']) - .then(function(pair) { - return util.globalScope.crypto.subtle.exportKey( - 'pkcs8', pair.privateKey); - // avoiding catch(function(err) {...}) to support IE <= 8 - }).then(undefined, function(err) { - callback(err); - }).then(function(pkcs8) { - if(pkcs8) { - var privateKey = pki.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8))); - callback(null, { - privateKey: privateKey, - publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) - }); - } - }); - } - if(_detectSubtleMsCrypto('generateKey') && - _detectSubtleMsCrypto('exportKey')) { - var genOp = util.globalScope.msCrypto.subtle.generateKey({ - name: 'RSASSA-PKCS1-v1_5', - modulusLength: bits, - publicExponent: _intToUint8Array(e), - hash: {name: 'SHA-256'} - }, true /* key can be exported*/, ['sign', 'verify']); - genOp.oncomplete = function(e) { - var pair = e.target.result; - var exportOp = util.globalScope.msCrypto.subtle.exportKey( - 'pkcs8', pair.privateKey); - exportOp.oncomplete = function(e) { - var pkcs8 = e.target.result; - var privateKey = pki.privateKeyFromAsn1( - asn1.fromDer(forge.util.createBuffer(pkcs8))); - callback(null, { - privateKey: privateKey, - publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e) - }); - }; - exportOp.onerror = function(err) { - callback(err); - }; - }; - genOp.onerror = function(err) { - callback(err); - }; - return; - } - } else { - // try native sync - if(_detectNodeCrypto('generateKeyPairSync')) { - var keypair = _crypto.generateKeyPairSync('rsa', { - modulusLength: bits, - publicExponent: e, - publicKeyEncoding: { - type: 'spki', - format: 'pem' - }, - privateKeyEncoding: { - type: 'pkcs8', - format: 'pem' - } - }); - return { - privateKey: pki.privateKeyFromPem(keypair.privateKey), - publicKey: pki.publicKeyFromPem(keypair.publicKey) - }; - } - } - } - - // use JavaScript implementation - var state = pki.rsa.createKeyPairGenerationState(bits, e, options); - if(!callback) { - pki.rsa.stepKeyPairGenerationState(state, 0); - return state.keys; - } - _generateKeyPair(state, options, callback); -}; - -/** - * Sets an RSA public key from BigIntegers modulus and exponent. - * - * @param n the modulus. - * @param e the exponent. - * - * @return the public key. - */ -pki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) { - var key = { - n: n, - e: e - }; - - /** - * Encrypts the given data with this public key. Newer applications - * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for - * legacy applications. - * - * @param data the byte string to encrypt. - * @param scheme the encryption scheme to use: - * 'RSAES-PKCS1-V1_5' (default), - * 'RSA-OAEP', - * 'RAW', 'NONE', or null to perform raw RSA encryption, - * an object with an 'encode' property set to a function - * with the signature 'function(data, key)' that returns - * a binary-encoded string representing the encoded data. - * @param schemeOptions any scheme-specific options. - * - * @return the encrypted byte string. - */ - key.encrypt = function(data, scheme, schemeOptions) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSAES-PKCS1-V1_5'; - } - - if(scheme === 'RSAES-PKCS1-V1_5') { - scheme = { - encode: function(m, key, pub) { - return _encodePkcs1_v1_5(m, key, 0x02).getBytes(); - } - }; - } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { - scheme = { - encode: function(m, key) { - return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions); - } - }; - } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { - scheme = {encode: function(e) {return e;}}; - } else if(typeof scheme === 'string') { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } - - // do scheme-based encoding then rsa encryption - var e = scheme.encode(data, key, true); - return pki.rsa.encrypt(e, key, true); - }; - - /** - * Verifies the given signature against the given digest. - * - * PKCS#1 supports multiple (currently two) signature schemes: - * RSASSA-PKCS1-V1_5 and RSASSA-PSS. - * - * By default this implementation uses the "old scheme", i.e. - * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the - * signature is an OCTET STRING that holds a DigestInfo. - * - * DigestInfo ::= SEQUENCE { - * digestAlgorithm DigestAlgorithmIdentifier, - * digest Digest - * } - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * Digest ::= OCTET STRING - * - * To perform PSS signature verification, provide an instance - * of Forge PSS object as the scheme parameter. - * - * @param digest the message digest hash to compare against the signature, - * as a binary-encoded string. - * @param signature the signature to verify, as a binary-encoded string. - * @param scheme signature verification scheme to use: - * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, - * a Forge PSS object for RSASSA-PSS, - * 'NONE' or null for none, DigestInfo will not be expected, but - * PKCS#1 v1.5 padding will still be used. - * - * @return true if the signature was verified, false if not. - */ - key.verify = function(digest, signature, scheme) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSASSA-PKCS1-V1_5'; - } - - if(scheme === 'RSASSA-PKCS1-V1_5') { - scheme = { - verify: function(digest, d) { - // remove padding - d = _decodePkcs1_v1_5(d, key, true); - // d is ASN.1 BER-encoded DigestInfo - var obj = asn1.fromDer(d); - // compare the given digest to the decrypted one - return digest === obj.value[1].value; - } - }; - } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { - scheme = { - verify: function(digest, d) { - // remove padding - d = _decodePkcs1_v1_5(d, key, true); - return digest === d; - } - }; - } - - // do rsa decryption w/o any decoding, then verify -- which does decoding - var d = pki.rsa.decrypt(signature, key, true, false); - return scheme.verify(digest, d, key.n.bitLength()); - }; - - return key; -}; - -/** - * Sets an RSA private key from BigIntegers modulus, exponent, primes, - * prime exponents, and modular multiplicative inverse. - * - * @param n the modulus. - * @param e the public exponent. - * @param d the private exponent ((inverse of e) mod n). - * @param p the first prime. - * @param q the second prime. - * @param dP exponent1 (d mod (p-1)). - * @param dQ exponent2 (d mod (q-1)). - * @param qInv ((inverse of q) mod p) - * - * @return the private key. - */ -pki.setRsaPrivateKey = pki.rsa.setPrivateKey = function( - n, e, d, p, q, dP, dQ, qInv) { - var key = { - n: n, - e: e, - d: d, - p: p, - q: q, - dP: dP, - dQ: dQ, - qInv: qInv - }; - - /** - * Decrypts the given data with this private key. The decryption scheme - * must match the one used to encrypt the data. - * - * @param data the byte string to decrypt. - * @param scheme the decryption scheme to use: - * 'RSAES-PKCS1-V1_5' (default), - * 'RSA-OAEP', - * 'RAW', 'NONE', or null to perform raw RSA decryption. - * @param schemeOptions any scheme-specific options. - * - * @return the decrypted byte string. - */ - key.decrypt = function(data, scheme, schemeOptions) { - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } else if(scheme === undefined) { - scheme = 'RSAES-PKCS1-V1_5'; - } - - // do rsa decryption w/o any decoding - var d = pki.rsa.decrypt(data, key, false, false); - - if(scheme === 'RSAES-PKCS1-V1_5') { - scheme = {decode: _decodePkcs1_v1_5}; - } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') { - scheme = { - decode: function(d, key) { - return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions); - } - }; - } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) { - scheme = {decode: function(d) {return d;}}; - } else { - throw new Error('Unsupported encryption scheme: "' + scheme + '".'); - } - - // decode according to scheme - return scheme.decode(d, key, false); - }; - - /** - * Signs the given digest, producing a signature. - * - * PKCS#1 supports multiple (currently two) signature schemes: - * RSASSA-PKCS1-V1_5 and RSASSA-PSS. - * - * By default this implementation uses the "old scheme", i.e. - * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide - * an instance of Forge PSS object as the scheme parameter. - * - * @param md the message digest object with the hash to sign. - * @param scheme the signature scheme to use: - * 'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5, - * a Forge PSS object for RSASSA-PSS, - * 'NONE' or null for none, DigestInfo will not be used but - * PKCS#1 v1.5 padding will still be used. - * - * @return the signature as a byte string. - */ - key.sign = function(md, scheme) { - /* Note: The internal implementation of RSA operations is being - transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy - code like the use of an encoding block identifier 'bt' will eventually - be removed. */ - - // private key operation - var bt = false; - - if(typeof scheme === 'string') { - scheme = scheme.toUpperCase(); - } - - if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') { - scheme = {encode: emsaPkcs1v15encode}; - bt = 0x01; - } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) { - scheme = {encode: function() {return md;}}; - bt = 0x01; - } - - // encode and then encrypt - var d = scheme.encode(md, key.n.bitLength()); - return pki.rsa.encrypt(d, key, bt); - }; - - return key; -}; - -/** - * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object. - * - * @param rsaKey the ASN.1 RSAPrivateKey. - * - * @return the ASN.1 PrivateKeyInfo. - */ -pki.wrapRsaPrivateKey = function(rsaKey) { - // PrivateKeyInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(0).getBytes()), - // privateKeyAlgorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // PrivateKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, - asn1.toDer(rsaKey).getBytes()) - ]); -}; - -/** - * Converts a private key from an ASN.1 object. - * - * @param obj the ASN.1 representation of a PrivateKeyInfo containing an - * RSAPrivateKey or an RSAPrivateKey. - * - * @return the private key. - */ -pki.privateKeyFromAsn1 = function(obj) { - // get PrivateKeyInfo - var capture = {}; - var errors = []; - if(asn1.validate(obj, privateKeyValidator, capture, errors)) { - obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); - } - - // get RSAPrivateKey - capture = {}; - errors = []; - if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) { - var error = new Error('Cannot read private key. ' + - 'ASN.1 object does not contain an RSAPrivateKey.'); - error.errors = errors; - throw error; - } - - // Note: Version is currently ignored. - // capture.privateKeyVersion - // FIXME: inefficient, get a BigInteger that uses byte strings - var n, e, d, p, q, dP, dQ, qInv; - n = forge.util.createBuffer(capture.privateKeyModulus).toHex(); - e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex(); - d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex(); - p = forge.util.createBuffer(capture.privateKeyPrime1).toHex(); - q = forge.util.createBuffer(capture.privateKeyPrime2).toHex(); - dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex(); - dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex(); - qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex(); - - // set private key - return pki.setRsaPrivateKey( - new BigInteger(n, 16), - new BigInteger(e, 16), - new BigInteger(d, 16), - new BigInteger(p, 16), - new BigInteger(q, 16), - new BigInteger(dP, 16), - new BigInteger(dQ, 16), - new BigInteger(qInv, 16)); -}; - -/** - * Converts a private key to an ASN.1 RSAPrivateKey. - * - * @param key the private key. - * - * @return the ASN.1 representation of an RSAPrivateKey. - */ -pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) { - // RSAPrivateKey - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version (0 = only 2 primes, 1 multiple primes) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(0).getBytes()), - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)), - // privateExponent (d) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.d)), - // privateKeyPrime1 (p) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.p)), - // privateKeyPrime2 (q) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.q)), - // privateKeyExponent1 (dP) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.dP)), - // privateKeyExponent2 (dQ) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.dQ)), - // coefficient (qInv) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.qInv)) - ]); -}; - -/** - * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey. - * - * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey. - * - * @return the public key. - */ -pki.publicKeyFromAsn1 = function(obj) { - // get SubjectPublicKeyInfo - var capture = {}; - var errors = []; - if(asn1.validate(obj, publicKeyValidator, capture, errors)) { - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - var error = new Error('Cannot read public key. Unknown OID.'); - error.oid = oid; - throw error; - } - obj = capture.rsaPublicKey; - } - - // get RSA params - errors = []; - if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { - var error = new Error('Cannot read public key. ' + - 'ASN.1 object does not contain an RSAPublicKey.'); - error.errors = errors; - throw error; - } - - // FIXME: inefficient, get a BigInteger that uses byte strings - var n = forge.util.createBuffer(capture.publicKeyModulus).toHex(); - var e = forge.util.createBuffer(capture.publicKeyExponent).toHex(); - - // set public key - return pki.setRsaPublicKey( - new BigInteger(n, 16), - new BigInteger(e, 16)); -}; - -/** - * Converts a public key to an ASN.1 SubjectPublicKeyInfo. - * - * @param key the public key. - * - * @return the asn1 representation of a SubjectPublicKeyInfo. - */ -pki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) { - // SubjectPublicKeyInfo - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AlgorithmIdentifier - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(pki.oids.rsaEncryption).getBytes()), - // parameters (null) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]), - // subjectPublicKey - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [ - pki.publicKeyToRSAPublicKey(key) - ]) - ]); -}; - -/** - * Converts a public key to an ASN.1 RSAPublicKey. - * - * @param key the public key. - * - * @return the asn1 representation of a RSAPublicKey. - */ -pki.publicKeyToRSAPublicKey = function(key) { - // RSAPublicKey - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // modulus (n) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.n)), - // publicExponent (e) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - _bnToBytes(key.e)) - ]); -}; - -/** - * Encodes a message using PKCS#1 v1.5 padding. - * - * @param m the message to encode. - * @param key the RSA key to use. - * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02 - * (for encryption). - * - * @return the padded byte buffer. - */ -function _encodePkcs1_v1_5(m, key, bt) { - var eb = forge.util.createBuffer(); - - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - /* use PKCS#1 v1.5 padding */ - if(m.length > (k - 11)) { - var error = new Error('Message is too long for PKCS#1 v1.5 padding.'); - error.length = m.length; - error.max = k - 11; - throw error; - } - - /* A block type BT, a padding string PS, and the data D shall be - formatted into an octet string EB, the encryption block: - - EB = 00 || BT || PS || 00 || D - - The block type BT shall be a single octet indicating the structure of - the encryption block. For this version of the document it shall have - value 00, 01, or 02. For a private-key operation, the block type - shall be 00 or 01. For a public-key operation, it shall be 02. - - The padding string PS shall consist of k-3-||D|| octets. For block - type 00, the octets shall have value 00; for block type 01, they - shall have value FF; and for block type 02, they shall be - pseudorandomly generated and nonzero. This makes the length of the - encryption block EB equal to k. */ - - // build the encryption block - eb.putByte(0x00); - eb.putByte(bt); - - // create the padding - var padNum = k - 3 - m.length; - var padByte; - // private key op - if(bt === 0x00 || bt === 0x01) { - padByte = (bt === 0x00) ? 0x00 : 0xFF; - for(var i = 0; i < padNum; ++i) { - eb.putByte(padByte); - } - } else { - // public key op - // pad with random non-zero values - while(padNum > 0) { - var numZeros = 0; - var padBytes = forge.random.getBytes(padNum); - for(var i = 0; i < padNum; ++i) { - padByte = padBytes.charCodeAt(i); - if(padByte === 0) { - ++numZeros; - } else { - eb.putByte(padByte); - } - } - padNum = numZeros; - } - } - - // zero followed by message - eb.putByte(0x00); - eb.putBytes(m); - - return eb; -} - -/** - * Decodes a message using PKCS#1 v1.5 padding. - * - * @param em the message to decode. - * @param key the RSA key to use. - * @param pub true if the key is a public key, false if it is private. - * @param ml the message length, if specified. - * - * @return the decoded bytes. - */ -function _decodePkcs1_v1_5(em, key, pub, ml) { - // get the length of the modulus in bytes - var k = Math.ceil(key.n.bitLength() / 8); - - /* It is an error if any of the following conditions occurs: - - 1. The encryption block EB cannot be parsed unambiguously. - 2. The padding string PS consists of fewer than eight octets - or is inconsisent with the block type BT. - 3. The decryption process is a public-key operation and the block - type BT is not 00 or 01, or the decryption process is a - private-key operation and the block type is not 02. - */ - - // parse the encryption block - var eb = forge.util.createBuffer(em); - var first = eb.getByte(); - var bt = eb.getByte(); - if(first !== 0x00 || - (pub && bt !== 0x00 && bt !== 0x01) || - (!pub && bt != 0x02) || - (pub && bt === 0x00 && typeof(ml) === 'undefined')) { - throw new Error('Encryption block is invalid.'); - } - - var padNum = 0; - if(bt === 0x00) { - // check all padding bytes for 0x00 - padNum = k - 3 - ml; - for(var i = 0; i < padNum; ++i) { - if(eb.getByte() !== 0x00) { - throw new Error('Encryption block is invalid.'); - } - } - } else if(bt === 0x01) { - // find the first byte that isn't 0xFF, should be after all padding - padNum = 0; - while(eb.length() > 1) { - if(eb.getByte() !== 0xFF) { - --eb.read; - break; - } - ++padNum; - } - } else if(bt === 0x02) { - // look for 0x00 byte - padNum = 0; - while(eb.length() > 1) { - if(eb.getByte() === 0x00) { - --eb.read; - break; - } - ++padNum; - } - } - - // zero must be 0x00 and padNum must be (k - 3 - message length) - var zero = eb.getByte(); - if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) { - throw new Error('Encryption block is invalid.'); - } - - return eb.getBytes(); -} - -/** - * Runs the key-generation algorithm asynchronously, either in the background - * via Web Workers, or using the main thread and setImmediate. - * - * @param state the key-pair generation state. - * @param [options] options for key-pair generation: - * workerScript the worker script URL. - * workers the number of web workers (if supported) to use, - * (default: 2, -1 to use estimated cores minus one). - * workLoad the size of the work load, ie: number of possible prime - * numbers for each web worker to check per work assignment, - * (default: 100). - * @param callback(err, keypair) called once the operation completes. - */ -function _generateKeyPair(state, options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - - var opts = { - algorithm: { - name: options.algorithm || 'PRIMEINC', - options: { - workers: options.workers || 2, - workLoad: options.workLoad || 100, - workerScript: options.workerScript - } - } - }; - if('prng' in options) { - opts.prng = options.prng; - } - - generate(); - - function generate() { - // find p and then q (done in series to simplify) - getPrime(state.pBits, function(err, num) { - if(err) { - return callback(err); - } - state.p = num; - if(state.q !== null) { - return finish(err, state.q); - } - getPrime(state.qBits, finish); - }); - } - - function getPrime(bits, callback) { - forge.prime.generateProbablePrime(bits, opts, callback); - } - - function finish(err, num) { - if(err) { - return callback(err); - } - - // set q - state.q = num; - - // ensure p is larger than q (swap them if not) - if(state.p.compareTo(state.q) < 0) { - var tmp = state.p; - state.p = state.q; - state.q = tmp; - } - - // ensure p is coprime with e - if(state.p.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) !== 0) { - state.p = null; - generate(); - return; - } - - // ensure q is coprime with e - if(state.q.subtract(BigInteger.ONE).gcd(state.e) - .compareTo(BigInteger.ONE) !== 0) { - state.q = null; - getPrime(state.qBits, finish); - return; - } - - // compute phi: (p - 1)(q - 1) (Euler's totient function) - state.p1 = state.p.subtract(BigInteger.ONE); - state.q1 = state.q.subtract(BigInteger.ONE); - state.phi = state.p1.multiply(state.q1); - - // ensure e and phi are coprime - if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) { - // phi and e aren't coprime, so generate a new p and q - state.p = state.q = null; - generate(); - return; - } - - // create n, ensure n is has the right number of bits - state.n = state.p.multiply(state.q); - if(state.n.bitLength() !== state.bits) { - // failed, get new q - state.q = null; - getPrime(state.qBits, finish); - return; - } - - // set keys - var d = state.e.modInverse(state.phi); - state.keys = { - privateKey: pki.rsa.setPrivateKey( - state.n, state.e, d, state.p, state.q, - d.mod(state.p1), d.mod(state.q1), - state.q.modInverse(state.p)), - publicKey: pki.rsa.setPublicKey(state.n, state.e) - }; - - callback(null, state.keys); - } -} - -/** - * Converts a positive BigInteger into 2's-complement big-endian bytes. - * - * @param b the big integer to convert. - * - * @return the bytes. - */ -function _bnToBytes(b) { - // prepend 0x00 if first byte >= 0x80 - var hex = b.toString(16); - if(hex[0] >= '8') { - hex = '00' + hex; - } - var bytes = forge.util.hexToBytes(hex); - - // ensure integer is minimally-encoded - if(bytes.length > 1 && - // leading 0x00 for positive integer - ((bytes.charCodeAt(0) === 0 && - (bytes.charCodeAt(1) & 0x80) === 0) || - // leading 0xFF for negative integer - (bytes.charCodeAt(0) === 0xFF && - (bytes.charCodeAt(1) & 0x80) === 0x80))) { - return bytes.substr(1); - } - return bytes; -} - -/** - * Returns the required number of Miller-Rabin tests to generate a - * prime with an error probability of (1/2)^80. - * - * See Handbook of Applied Cryptography Chapter 4, Table 4.4. - * - * @param bits the bit size. - * - * @return the required number of iterations. - */ -function _getMillerRabinTests(bits) { - if(bits <= 100) return 27; - if(bits <= 150) return 18; - if(bits <= 200) return 15; - if(bits <= 250) return 12; - if(bits <= 300) return 9; - if(bits <= 350) return 8; - if(bits <= 400) return 7; - if(bits <= 500) return 6; - if(bits <= 600) return 5; - if(bits <= 800) return 4; - if(bits <= 1250) return 3; - return 2; -} - -/** - * Performs feature detection on the Node crypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. - */ -function _detectNodeCrypto(fn) { - return forge.util.isNodejs && typeof _crypto[fn] === 'function'; -} - -/** - * Performs feature detection on the SubtleCrypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. - */ -function _detectSubtleCrypto(fn) { - return (typeof util.globalScope !== 'undefined' && - typeof util.globalScope.crypto === 'object' && - typeof util.globalScope.crypto.subtle === 'object' && - typeof util.globalScope.crypto.subtle[fn] === 'function'); -} - -/** - * Performs feature detection on the deprecated Microsoft Internet Explorer - * outdated SubtleCrypto interface. This function should only be used after - * checking for the modern, standard SubtleCrypto interface. - * - * @param fn the feature (function) to detect. - * - * @return true if detected, false if not. - */ -function _detectSubtleMsCrypto(fn) { - return (typeof util.globalScope !== 'undefined' && - typeof util.globalScope.msCrypto === 'object' && - typeof util.globalScope.msCrypto.subtle === 'object' && - typeof util.globalScope.msCrypto.subtle[fn] === 'function'); -} - -function _intToUint8Array(x) { - var bytes = forge.util.hexToBytes(x.toString(16)); - var buffer = new Uint8Array(bytes.length); - for(var i = 0; i < bytes.length; ++i) { - buffer[i] = bytes.charCodeAt(i); - } - return buffer; -} - -function _privateKeyFromJwk(jwk) { - if(jwk.kty !== 'RSA') { - throw new Error( - 'Unsupported key algorithm "' + jwk.kty + '"; algorithm must be "RSA".'); - } - return pki.setRsaPrivateKey( - _base64ToBigInt(jwk.n), - _base64ToBigInt(jwk.e), - _base64ToBigInt(jwk.d), - _base64ToBigInt(jwk.p), - _base64ToBigInt(jwk.q), - _base64ToBigInt(jwk.dp), - _base64ToBigInt(jwk.dq), - _base64ToBigInt(jwk.qi)); -} - -function _publicKeyFromJwk(jwk) { - if(jwk.kty !== 'RSA') { - throw new Error('Key algorithm must be "RSA".'); - } - return pki.setRsaPublicKey( - _base64ToBigInt(jwk.n), - _base64ToBigInt(jwk.e)); -} - -function _base64ToBigInt(b64) { - return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16); -} diff --git a/node_modules/node-forge/lib/sha1.js b/node_modules/node-forge/lib/sha1.js deleted file mode 100644 index 5f84eb6..0000000 --- a/node_modules/node-forge/lib/sha1.js +++ /dev/null @@ -1,319 +0,0 @@ -/** - * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var sha1 = module.exports = forge.sha1 = forge.sha1 || {}; -forge.md.sha1 = forge.md.algorithms.sha1 = sha1; - -/** - * Creates a SHA-1 message digest object. - * - * @return a message digest object. - */ -sha1.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // SHA-1 state contains five 32-bit integers - var _state = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for word storage - var _w = new Array(80); - - // message digest object - var md = { - algorithm: 'sha1', - blockLength: 64, - digestLength: 20, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 0x67452301, - h1: 0xEFCDAB89, - h2: 0x98BADCFE, - h3: 0x10325476, - h4: 0xC3D2E1F0 - }; - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_state, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-1 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - return rval; - }; - - return md; -}; - -// sha-1 padding bytes not initialized yet -var _padding = null; -var _initialized = false; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - - // now initialized - _initialized = true; -} - -/** - * Updates a SHA-1 state with the given byte buffer. - * - * @param s the SHA-1 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t, a, b, c, d, e, f, i; - var len = bytes.length(); - while(len >= 64) { - // the w array will be populated with sixteen 32-bit big-endian words - // and then extended into 80 32-bit words according to SHA-1 algorithm - // and for 32-79 using Max Locktyukhin's optimization - - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - - // round 1 - for(i = 0; i < 16; ++i) { - t = bytes.getInt32(); - w[i] = t; - f = d ^ (b & (c ^ d)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - for(; i < 20; ++i) { - t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); - t = (t << 1) | (t >>> 31); - w[i] = t; - f = d ^ (b & (c ^ d)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 2 - for(; i < 32; ++i) { - t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]); - t = (t << 1) | (t >>> 31); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - for(; i < 40; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 3 - for(; i < 60; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = (b & c) | (d & (b ^ c)); - t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - // round 4 - for(; i < 80; ++i) { - t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]); - t = (t << 2) | (t >>> 30); - w[i] = t; - f = b ^ c ^ d; - t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t; - e = d; - d = c; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - c = ((b << 30) | (b >>> 2)) >>> 0; - b = a; - a = t; - } - - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - s.h4 = (s.h4 + e) | 0; - - len -= 64; - } -} diff --git a/node_modules/node-forge/lib/sha256.js b/node_modules/node-forge/lib/sha256.js deleted file mode 100644 index 0659ad7..0000000 --- a/node_modules/node-forge/lib/sha256.js +++ /dev/null @@ -1,327 +0,0 @@ -/** - * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation. - * - * See FIPS 180-2 for details. - * - * @author Dave Longley - * - * Copyright (c) 2010-2015 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var sha256 = module.exports = forge.sha256 = forge.sha256 || {}; -forge.md.sha256 = forge.md.algorithms.sha256 = sha256; - -/** - * Creates a SHA-256 message digest object. - * - * @return a message digest object. - */ -sha256.create = function() { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - // SHA-256 state contains eight 32-bit integers - var _state = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for word storage - var _w = new Array(64); - - // message digest object - var md = { - algorithm: 'sha256', - blockLength: 64, - digestLength: 32, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 8 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength64 for backwards-compatibility) - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 0x6A09E667, - h1: 0xBB67AE85, - h2: 0x3C6EF372, - h3: 0xA54FF53A, - h4: 0x510E527F, - h5: 0x9B05688C, - h6: 0x1F83D9AB, - h7: 0x5BE0CD19 - }; - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_state, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-256 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 448 mod 512. In other words, - the data to be digested must be a multiple of 512 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 8 bytes (64 - bits), that means that the last segment of the data must have 56 bytes - (448 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 448 mod 512 because - 512 - 128 = 448. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 448 mod 512, then 512 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - - var s2 = { - h0: _state.h0, - h1: _state.h1, - h2: _state.h2, - h3: _state.h3, - h4: _state.h4, - h5: _state.h5, - h6: _state.h6, - h7: _state.h7 - }; - _update(s2, _w, finalBlock); - var rval = forge.util.createBuffer(); - rval.putInt32(s2.h0); - rval.putInt32(s2.h1); - rval.putInt32(s2.h2); - rval.putInt32(s2.h3); - rval.putInt32(s2.h4); - rval.putInt32(s2.h5); - rval.putInt32(s2.h6); - rval.putInt32(s2.h7); - return rval; - }; - - return md; -}; - -// sha-256 padding bytes not initialized yet -var _padding = null; -var _initialized = false; - -// table of constants -var _k = null; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 64); - - // create K table for SHA-256 - _k = [ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; - - // now initialized - _initialized = true; -} - -/** - * Updates a SHA-256 state with the given byte buffer. - * - * @param s the SHA-256 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (64 byte) chunks - var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h; - var len = bytes.length(); - while(len >= 64) { - // the w array will be populated with sixteen 32-bit big-endian words - // and then extended into 64 32-bit words according to SHA-256 - for(i = 0; i < 16; ++i) { - w[i] = bytes.getInt32(); - } - for(; i < 64; ++i) { - // XOR word 2 words ago rot right 17, rot right 19, shft right 10 - t1 = w[i - 2]; - t1 = - ((t1 >>> 17) | (t1 << 15)) ^ - ((t1 >>> 19) | (t1 << 13)) ^ - (t1 >>> 10); - // XOR word 15 words ago rot right 7, rot right 18, shft right 3 - t2 = w[i - 15]; - t2 = - ((t2 >>> 7) | (t2 << 25)) ^ - ((t2 >>> 18) | (t2 << 14)) ^ - (t2 >>> 3); - // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32 - w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0; - } - - // initialize hash value for this chunk - a = s.h0; - b = s.h1; - c = s.h2; - d = s.h3; - e = s.h4; - f = s.h5; - g = s.h6; - h = s.h7; - - // round function - for(i = 0; i < 64; ++i) { - // Sum1(e) - s1 = - ((e >>> 6) | (e << 26)) ^ - ((e >>> 11) | (e << 21)) ^ - ((e >>> 25) | (e << 7)); - // Ch(e, f, g) (optimized the same way as SHA-1) - ch = g ^ (e & (f ^ g)); - // Sum0(a) - s0 = - ((a >>> 2) | (a << 30)) ^ - ((a >>> 13) | (a << 19)) ^ - ((a >>> 22) | (a << 10)); - // Maj(a, b, c) (optimized the same way as SHA-1) - maj = (a & b) | (c & (a ^ b)); - - // main algorithm - t1 = h + s1 + ch + _k[i] + w[i]; - t2 = s0 + maj; - h = g; - g = f; - f = e; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - // can't truncate with `| 0` - e = (d + t1) >>> 0; - d = c; - c = b; - b = a; - // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug - // can't truncate with `| 0` - a = (t1 + t2) >>> 0; - } - - // update hash state - s.h0 = (s.h0 + a) | 0; - s.h1 = (s.h1 + b) | 0; - s.h2 = (s.h2 + c) | 0; - s.h3 = (s.h3 + d) | 0; - s.h4 = (s.h4 + e) | 0; - s.h5 = (s.h5 + f) | 0; - s.h6 = (s.h6 + g) | 0; - s.h7 = (s.h7 + h) | 0; - len -= 64; - } -} diff --git a/node_modules/node-forge/lib/sha512.js b/node_modules/node-forge/lib/sha512.js deleted file mode 100644 index e09b442..0000000 --- a/node_modules/node-forge/lib/sha512.js +++ /dev/null @@ -1,561 +0,0 @@ -/** - * Secure Hash Algorithm with a 1024-bit block size implementation. - * - * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For - * SHA-256 (block size 512 bits), see sha256.js. - * - * See FIPS 180-4 for details. - * - * @author Dave Longley - * - * Copyright (c) 2014-2015 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./md'); -require('./util'); - -var sha512 = module.exports = forge.sha512 = forge.sha512 || {}; - -// SHA-512 -forge.md.sha512 = forge.md.algorithms.sha512 = sha512; - -// SHA-384 -var sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {}; -sha384.create = function() { - return sha512.create('SHA-384'); -}; -forge.md.sha384 = forge.md.algorithms.sha384 = sha384; - -// SHA-512/256 -forge.sha512.sha256 = forge.sha512.sha256 || { - create: function() { - return sha512.create('SHA-512/256'); - } -}; -forge.md['sha512/256'] = forge.md.algorithms['sha512/256'] = - forge.sha512.sha256; - -// SHA-512/224 -forge.sha512.sha224 = forge.sha512.sha224 || { - create: function() { - return sha512.create('SHA-512/224'); - } -}; -forge.md['sha512/224'] = forge.md.algorithms['sha512/224'] = - forge.sha512.sha224; - -/** - * Creates a SHA-2 message digest object. - * - * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224, - * SHA-512/256). - * - * @return a message digest object. - */ -sha512.create = function(algorithm) { - // do initialization as necessary - if(!_initialized) { - _init(); - } - - if(typeof algorithm === 'undefined') { - algorithm = 'SHA-512'; - } - - if(!(algorithm in _states)) { - throw new Error('Invalid SHA-512 algorithm: ' + algorithm); - } - - // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints) - var _state = _states[algorithm]; - var _h = null; - - // input buffer - var _input = forge.util.createBuffer(); - - // used for 64-bit word storage - var _w = new Array(80); - for(var wi = 0; wi < 80; ++wi) { - _w[wi] = new Array(2); - } - - // determine digest length by algorithm name (default) - var digestLength = 64; - switch(algorithm) { - case 'SHA-384': - digestLength = 48; - break; - case 'SHA-512/256': - digestLength = 32; - break; - case 'SHA-512/224': - digestLength = 28; - break; - } - - // message digest object - var md = { - // SHA-512 => sha512 - algorithm: algorithm.replace('-', '').toLowerCase(), - blockLength: 128, - digestLength: digestLength, - // 56-bit length of message so far (does not including padding) - messageLength: 0, - // true message length - fullMessageLength: null, - // size of message length in bytes - messageLengthSize: 16 - }; - - /** - * Starts the digest. - * - * @return this digest object. - */ - md.start = function() { - // up to 56-bit message length for convenience - md.messageLength = 0; - - // full message length (set md.messageLength128 for backwards-compatibility) - md.fullMessageLength = md.messageLength128 = []; - var int32s = md.messageLengthSize / 4; - for(var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _h = new Array(_state.length); - for(var i = 0; i < _state.length; ++i) { - _h[i] = _state[i].slice(0); - } - return md; - }; - // start digest automatically for first time - md.start(); - - /** - * Updates the digest with the given message input. The given input can - * treated as raw input (no encoding will be applied) or an encoding of - * 'utf8' maybe given to encode the input using UTF-8. - * - * @param msg the message input to update with. - * @param encoding the encoding to use (default: 'raw', other: 'utf8'). - * - * @return this digest object. - */ - md.update = function(msg, encoding) { - if(encoding === 'utf8') { - msg = forge.util.encodeUtf8(msg); - } - - // update message length - var len = msg.length; - md.messageLength += len; - len = [(len / 0x100000000) >>> 0, len >>> 0]; - for(var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = ((len[1] / 0x100000000) >>> 0); - } - - // add bytes to input buffer - _input.putBytes(msg); - - // process bytes - _update(_h, _w, _input); - - // compact input buffer every 2K or if empty - if(_input.read > 2048 || _input.length() === 0) { - _input.compact(); - } - - return md; - }; - - /** - * Produces the digest. - * - * @return a byte buffer containing the digest value. - */ - md.digest = function() { - /* Note: Here we copy the remaining bytes in the input buffer and - add the appropriate SHA-512 padding. Then we do the final update - on a copy of the state so that if the user wants to get - intermediate digests they can do so. */ - - /* Determine the number of bytes that must be added to the message - to ensure its length is congruent to 896 mod 1024. In other words, - the data to be digested must be a multiple of 1024 bits (or 128 bytes). - This data includes the message, some padding, and the length of the - message. Since the length of the message will be encoded as 16 bytes (128 - bits), that means that the last segment of the data must have 112 bytes - (896 bits) of message and padding. Therefore, the length of the message - plus the padding must be congruent to 896 mod 1024 because - 1024 - 128 = 896. - - In order to fill up the message length it must be filled with - padding that begins with 1 bit followed by all 0 bits. Padding - must *always* be present, so if the message length is already - congruent to 896 mod 1024, then 1024 padding bits must be added. */ - - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - - // compute remaining size to be digested (include message length size) - var remaining = ( - md.fullMessageLength[md.fullMessageLength.length - 1] + - md.messageLengthSize); - - // add padding for overflow blockSize - overflow - // _padding starts with 1 byte with first bit is set (byte value 128), then - // there may be up to (blockSize - 1) other pad bytes - var overflow = remaining & (md.blockLength - 1); - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - - // serialize message length in bits in big-endian order; since length - // is stored in bytes we multiply by 8 and add carry from next int - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for(var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = (next / 0x100000000) >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; - } - finalBlock.putInt32(bits); - - var h = new Array(_h.length); - for(var i = 0; i < _h.length; ++i) { - h[i] = _h[i].slice(0); - } - _update(h, _w, finalBlock); - var rval = forge.util.createBuffer(); - var hlen; - if(algorithm === 'SHA-512') { - hlen = h.length; - } else if(algorithm === 'SHA-384') { - hlen = h.length - 2; - } else { - hlen = h.length - 4; - } - for(var i = 0; i < hlen; ++i) { - rval.putInt32(h[i][0]); - if(i !== hlen - 1 || algorithm !== 'SHA-512/224') { - rval.putInt32(h[i][1]); - } - } - return rval; - }; - - return md; -}; - -// sha-512 padding bytes not initialized yet -var _padding = null; -var _initialized = false; - -// table of constants -var _k = null; - -// initial hash states -var _states = null; - -/** - * Initializes the constant tables. - */ -function _init() { - // create padding - _padding = String.fromCharCode(128); - _padding += forge.util.fillString(String.fromCharCode(0x00), 128); - - // create K table for SHA-512 - _k = [ - [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd], - [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc], - [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019], - [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118], - [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe], - [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2], - [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1], - [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694], - [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3], - [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65], - [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483], - [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5], - [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210], - [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4], - [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725], - [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70], - [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926], - [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df], - [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8], - [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b], - [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001], - [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30], - [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910], - [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8], - [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53], - [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8], - [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb], - [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3], - [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60], - [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec], - [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9], - [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b], - [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207], - [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178], - [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6], - [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b], - [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493], - [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c], - [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a], - [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817] - ]; - - // initial hash states - _states = {}; - _states['SHA-512'] = [ - [0x6a09e667, 0xf3bcc908], - [0xbb67ae85, 0x84caa73b], - [0x3c6ef372, 0xfe94f82b], - [0xa54ff53a, 0x5f1d36f1], - [0x510e527f, 0xade682d1], - [0x9b05688c, 0x2b3e6c1f], - [0x1f83d9ab, 0xfb41bd6b], - [0x5be0cd19, 0x137e2179] - ]; - _states['SHA-384'] = [ - [0xcbbb9d5d, 0xc1059ed8], - [0x629a292a, 0x367cd507], - [0x9159015a, 0x3070dd17], - [0x152fecd8, 0xf70e5939], - [0x67332667, 0xffc00b31], - [0x8eb44a87, 0x68581511], - [0xdb0c2e0d, 0x64f98fa7], - [0x47b5481d, 0xbefa4fa4] - ]; - _states['SHA-512/256'] = [ - [0x22312194, 0xFC2BF72C], - [0x9F555FA3, 0xC84C64C2], - [0x2393B86B, 0x6F53B151], - [0x96387719, 0x5940EABD], - [0x96283EE2, 0xA88EFFE3], - [0xBE5E1E25, 0x53863992], - [0x2B0199FC, 0x2C85B8AA], - [0x0EB72DDC, 0x81C52CA2] - ]; - _states['SHA-512/224'] = [ - [0x8C3D37C8, 0x19544DA2], - [0x73E19966, 0x89DCD4D6], - [0x1DFAB7AE, 0x32FF9C82], - [0x679DD514, 0x582F9FCF], - [0x0F6D2B69, 0x7BD44DA8], - [0x77E36F73, 0x04C48942], - [0x3F9D85A8, 0x6A1D36C8], - [0x1112E6AD, 0x91D692A1] - ]; - - // now initialized - _initialized = true; -} - -/** - * Updates a SHA-512 state with the given byte buffer. - * - * @param s the SHA-512 state to update. - * @param w the array to use to store words. - * @param bytes the byte buffer to update with. - */ -function _update(s, w, bytes) { - // consume 512 bit (128 byte) chunks - var t1_hi, t1_lo; - var t2_hi, t2_lo; - var s0_hi, s0_lo; - var s1_hi, s1_lo; - var ch_hi, ch_lo; - var maj_hi, maj_lo; - var a_hi, a_lo; - var b_hi, b_lo; - var c_hi, c_lo; - var d_hi, d_lo; - var e_hi, e_lo; - var f_hi, f_lo; - var g_hi, g_lo; - var h_hi, h_lo; - var i, hi, lo, w2, w7, w15, w16; - var len = bytes.length(); - while(len >= 128) { - // the w array will be populated with sixteen 64-bit big-endian words - // and then extended into 64 64-bit words according to SHA-512 - for(i = 0; i < 16; ++i) { - w[i][0] = bytes.getInt32() >>> 0; - w[i][1] = bytes.getInt32() >>> 0; - } - for(; i < 80; ++i) { - // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x) - w2 = w[i - 2]; - hi = w2[0]; - lo = w2[1]; - - // high bits - t1_hi = ( - ((hi >>> 19) | (lo << 13)) ^ // ROTR 19 - ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29) - (hi >>> 6)) >>> 0; // SHR 6 - // low bits - t1_lo = ( - ((hi << 13) | (lo >>> 19)) ^ // ROTR 19 - ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29) - ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6 - - // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x) - w15 = w[i - 15]; - hi = w15[0]; - lo = w15[1]; - - // high bits - t2_hi = ( - ((hi >>> 1) | (lo << 31)) ^ // ROTR 1 - ((hi >>> 8) | (lo << 24)) ^ // ROTR 8 - (hi >>> 7)) >>> 0; // SHR 7 - // low bits - t2_lo = ( - ((hi << 31) | (lo >>> 1)) ^ // ROTR 1 - ((hi << 24) | (lo >>> 8)) ^ // ROTR 8 - ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7 - - // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow) - w7 = w[i - 7]; - w16 = w[i - 16]; - lo = (t1_lo + w7[1] + t2_lo + w16[1]); - w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] + - ((lo / 0x100000000) >>> 0)) >>> 0; - w[i][1] = lo >>> 0; - } - - // initialize hash value for this chunk - a_hi = s[0][0]; - a_lo = s[0][1]; - b_hi = s[1][0]; - b_lo = s[1][1]; - c_hi = s[2][0]; - c_lo = s[2][1]; - d_hi = s[3][0]; - d_lo = s[3][1]; - e_hi = s[4][0]; - e_lo = s[4][1]; - f_hi = s[5][0]; - f_lo = s[5][1]; - g_hi = s[6][0]; - g_lo = s[6][1]; - h_hi = s[7][0]; - h_lo = s[7][1]; - - // round function - for(i = 0; i < 80; ++i) { - // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e) - s1_hi = ( - ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14 - ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18 - ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9) - s1_lo = ( - ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14 - ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18 - ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9) - - // Ch(e, f, g) (optimized the same way as SHA-1) - ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0; - ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0; - - // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a) - s0_hi = ( - ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28 - ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2) - ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7) - s0_lo = ( - ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28 - ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2) - ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7) - - // Maj(a, b, c) (optimized the same way as SHA-1) - maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0; - maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0; - - // main algorithm - // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow) - lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]); - t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] + - ((lo / 0x100000000) >>> 0)) >>> 0; - t1_lo = lo >>> 0; - - // t2 = s0 + maj modulo 2^64 (carry lo overflow) - lo = s0_lo + maj_lo; - t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - t2_lo = lo >>> 0; - - h_hi = g_hi; - h_lo = g_lo; - - g_hi = f_hi; - g_lo = f_lo; - - f_hi = e_hi; - f_lo = e_lo; - - // e = (d + t1) modulo 2^64 (carry lo overflow) - lo = d_lo + t1_lo; - e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - e_lo = lo >>> 0; - - d_hi = c_hi; - d_lo = c_lo; - - c_hi = b_hi; - c_lo = b_lo; - - b_hi = a_hi; - b_lo = a_lo; - - // a = (t1 + t2) modulo 2^64 (carry lo overflow) - lo = t1_lo + t2_lo; - a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - a_lo = lo >>> 0; - } - - // update hash state (additional modulo 2^64) - lo = s[0][1] + a_lo; - s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[0][1] = lo >>> 0; - - lo = s[1][1] + b_lo; - s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[1][1] = lo >>> 0; - - lo = s[2][1] + c_lo; - s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[2][1] = lo >>> 0; - - lo = s[3][1] + d_lo; - s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[3][1] = lo >>> 0; - - lo = s[4][1] + e_lo; - s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[4][1] = lo >>> 0; - - lo = s[5][1] + f_lo; - s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[5][1] = lo >>> 0; - - lo = s[6][1] + g_lo; - s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[6][1] = lo >>> 0; - - lo = s[7][1] + h_lo; - s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0; - s[7][1] = lo >>> 0; - - len -= 128; - } -} diff --git a/node_modules/node-forge/lib/socket.js b/node_modules/node-forge/lib/socket.js deleted file mode 100644 index 3a1d7ff..0000000 --- a/node_modules/node-forge/lib/socket.js +++ /dev/null @@ -1,287 +0,0 @@ -/** - * Socket implementation that uses flash SocketPool class as a backend. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./util'); - -// define net namespace -var net = module.exports = forge.net = forge.net || {}; - -// map of flash ID to socket pool -net.socketPools = {}; - -/** - * Creates a flash socket pool. - * - * @param options: - * flashId: the dom ID for the flash object element. - * policyPort: the default policy port for sockets, 0 to use the - * flash default. - * policyUrl: the default policy file URL for sockets (if provided - * used instead of a policy port). - * msie: true if the browser is msie, false if not. - * - * @return the created socket pool. - */ -net.createSocketPool = function(options) { - // set default - options.msie = options.msie || false; - - // initialize the flash interface - var spId = options.flashId; - var api = document.getElementById(spId); - api.init({marshallExceptions: !options.msie}); - - // create socket pool entry - var sp = { - // ID of the socket pool - id: spId, - // flash interface - flashApi: api, - // map of socket ID to sockets - sockets: {}, - // default policy port - policyPort: options.policyPort || 0, - // default policy URL - policyUrl: options.policyUrl || null - }; - net.socketPools[spId] = sp; - - // create event handler, subscribe to flash events - if(options.msie === true) { - sp.handler = function(e) { - if(e.id in sp.sockets) { - // get handler function - var f; - switch(e.type) { - case 'connect': - f = 'connected'; - break; - case 'close': - f = 'closed'; - break; - case 'socketData': - f = 'data'; - break; - default: - f = 'error'; - break; - } - /* IE calls javascript on the thread of the external object - that triggered the event (in this case flash) ... which will - either run concurrently with other javascript or pre-empt any - running javascript in the middle of its execution (BAD!) ... - calling setTimeout() will schedule the javascript to run on - the javascript thread and solve this EVIL problem. */ - setTimeout(function() {sp.sockets[e.id][f](e);}, 0); - } - }; - } else { - sp.handler = function(e) { - if(e.id in sp.sockets) { - // get handler function - var f; - switch(e.type) { - case 'connect': - f = 'connected'; - break; - case 'close': - f = 'closed'; - break; - case 'socketData': - f = 'data'; - break; - default: - f = 'error'; - break; - } - sp.sockets[e.id][f](e); - } - }; - } - var handler = 'forge.net.socketPools[\'' + spId + '\'].handler'; - api.subscribe('connect', handler); - api.subscribe('close', handler); - api.subscribe('socketData', handler); - api.subscribe('ioError', handler); - api.subscribe('securityError', handler); - - /** - * Destroys a socket pool. The socket pool still needs to be cleaned - * up via net.cleanup(). - */ - sp.destroy = function() { - delete net.socketPools[options.flashId]; - for(var id in sp.sockets) { - sp.sockets[id].destroy(); - } - sp.sockets = {}; - api.cleanup(); - }; - - /** - * Creates a new socket. - * - * @param options: - * connected: function(event) called when the socket connects. - * closed: function(event) called when the socket closes. - * data: function(event) called when socket data has arrived, - * it can be read from the socket using receive(). - * error: function(event) called when a socket error occurs. - */ - sp.createSocket = function(options) { - // default to empty options - options = options || {}; - - // create flash socket - var id = api.create(); - - // create javascript socket wrapper - var socket = { - id: id, - // set handlers - connected: options.connected || function(e) {}, - closed: options.closed || function(e) {}, - data: options.data || function(e) {}, - error: options.error || function(e) {} - }; - - /** - * Destroys this socket. - */ - socket.destroy = function() { - api.destroy(id); - delete sp.sockets[id]; - }; - - /** - * Connects this socket. - * - * @param options: - * host: the host to connect to. - * port: the port to connect to. - * policyPort: the policy port to use (if non-default), 0 to - * use the flash default. - * policyUrl: the policy file URL to use (instead of port). - */ - socket.connect = function(options) { - // give precedence to policy URL over policy port - // if no policy URL and passed port isn't 0, use default port, - // otherwise use 0 for the port - var policyUrl = options.policyUrl || null; - var policyPort = 0; - if(policyUrl === null && options.policyPort !== 0) { - policyPort = options.policyPort || sp.policyPort; - } - api.connect(id, options.host, options.port, policyPort, policyUrl); - }; - - /** - * Closes this socket. - */ - socket.close = function() { - api.close(id); - socket.closed({ - id: socket.id, - type: 'close', - bytesAvailable: 0 - }); - }; - - /** - * Determines if the socket is connected or not. - * - * @return true if connected, false if not. - */ - socket.isConnected = function() { - return api.isConnected(id); - }; - - /** - * Writes bytes to this socket. - * - * @param bytes the bytes (as a string) to write. - * - * @return true on success, false on failure. - */ - socket.send = function(bytes) { - return api.send(id, forge.util.encode64(bytes)); - }; - - /** - * Reads bytes from this socket (non-blocking). Fewer than the number - * of bytes requested may be read if enough bytes are not available. - * - * This method should be called from the data handler if there are - * enough bytes available. To see how many bytes are available, check - * the 'bytesAvailable' property on the event in the data handler or - * call the bytesAvailable() function on the socket. If the browser is - * msie, then the bytesAvailable() function should be used to avoid - * race conditions. Otherwise, using the property on the data handler's - * event may be quicker. - * - * @param count the maximum number of bytes to read. - * - * @return the bytes read (as a string) or null on error. - */ - socket.receive = function(count) { - var rval = api.receive(id, count).rval; - return (rval === null) ? null : forge.util.decode64(rval); - }; - - /** - * Gets the number of bytes available for receiving on the socket. - * - * @return the number of bytes available for receiving. - */ - socket.bytesAvailable = function() { - return api.getBytesAvailable(id); - }; - - // store and return socket - sp.sockets[id] = socket; - return socket; - }; - - return sp; -}; - -/** - * Destroys a flash socket pool. - * - * @param options: - * flashId: the dom ID for the flash object element. - */ -net.destroySocketPool = function(options) { - if(options.flashId in net.socketPools) { - var sp = net.socketPools[options.flashId]; - sp.destroy(); - } -}; - -/** - * Creates a new socket. - * - * @param options: - * flashId: the dom ID for the flash object element. - * connected: function(event) called when the socket connects. - * closed: function(event) called when the socket closes. - * data: function(event) called when socket data has arrived, it - * can be read from the socket using receive(). - * error: function(event) called when a socket error occurs. - * - * @return the created socket. - */ -net.createSocket = function(options) { - var socket = null; - if(options.flashId in net.socketPools) { - // get related socket pool - var sp = net.socketPools[options.flashId]; - socket = sp.createSocket(options); - } - return socket; -}; diff --git a/node_modules/node-forge/lib/ssh.js b/node_modules/node-forge/lib/ssh.js deleted file mode 100644 index 6480203..0000000 --- a/node_modules/node-forge/lib/ssh.js +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Functions to output keys in SSH-friendly formats. - * - * This is part of the Forge project which may be used under the terms of - * either the BSD License or the GNU General Public License (GPL) Version 2. - * - * See: https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE - * - * @author https://github.com/shellac - */ -var forge = require('./forge'); -require('./aes'); -require('./hmac'); -require('./md5'); -require('./sha1'); -require('./util'); - -var ssh = module.exports = forge.ssh = forge.ssh || {}; - -/** - * Encodes (and optionally encrypts) a private RSA key as a Putty PPK file. - * - * @param privateKey the key. - * @param passphrase a passphrase to protect the key (falsy for no encryption). - * @param comment a comment to include in the key file. - * - * @return the PPK file as a string. - */ -ssh.privateKeyToPutty = function(privateKey, passphrase, comment) { - comment = comment || ''; - passphrase = passphrase || ''; - var algorithm = 'ssh-rsa'; - var encryptionAlgorithm = (passphrase === '') ? 'none' : 'aes256-cbc'; - - var ppk = 'PuTTY-User-Key-File-2: ' + algorithm + '\r\n'; - ppk += 'Encryption: ' + encryptionAlgorithm + '\r\n'; - ppk += 'Comment: ' + comment + '\r\n'; - - // public key into buffer for ppk - var pubbuffer = forge.util.createBuffer(); - _addStringToBuffer(pubbuffer, algorithm); - _addBigIntegerToBuffer(pubbuffer, privateKey.e); - _addBigIntegerToBuffer(pubbuffer, privateKey.n); - - // write public key - var pub = forge.util.encode64(pubbuffer.bytes(), 64); - var length = Math.floor(pub.length / 66) + 1; // 66 = 64 + \r\n - ppk += 'Public-Lines: ' + length + '\r\n'; - ppk += pub; - - // private key into a buffer - var privbuffer = forge.util.createBuffer(); - _addBigIntegerToBuffer(privbuffer, privateKey.d); - _addBigIntegerToBuffer(privbuffer, privateKey.p); - _addBigIntegerToBuffer(privbuffer, privateKey.q); - _addBigIntegerToBuffer(privbuffer, privateKey.qInv); - - // optionally encrypt the private key - var priv; - if(!passphrase) { - // use the unencrypted buffer - priv = forge.util.encode64(privbuffer.bytes(), 64); - } else { - // encrypt RSA key using passphrase - var encLen = privbuffer.length() + 16 - 1; - encLen -= encLen % 16; - - // pad private key with sha1-d data -- needs to be a multiple of 16 - var padding = _sha1(privbuffer.bytes()); - - padding.truncate(padding.length() - encLen + privbuffer.length()); - privbuffer.putBuffer(padding); - - var aeskey = forge.util.createBuffer(); - aeskey.putBuffer(_sha1('\x00\x00\x00\x00', passphrase)); - aeskey.putBuffer(_sha1('\x00\x00\x00\x01', passphrase)); - - // encrypt some bytes using CBC mode - // key is 40 bytes, so truncate *by* 8 bytes - var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), 'CBC'); - cipher.start(forge.util.createBuffer().fillWithByte(0, 16)); - cipher.update(privbuffer.copy()); - cipher.finish(); - var encrypted = cipher.output; - - // Note: this appears to differ from Putty -- is forge wrong, or putty? - // due to padding we finish as an exact multiple of 16 - encrypted.truncate(16); // all padding - - priv = forge.util.encode64(encrypted.bytes(), 64); - } - - // output private key - length = Math.floor(priv.length / 66) + 1; // 64 + \r\n - ppk += '\r\nPrivate-Lines: ' + length + '\r\n'; - ppk += priv; - - // MAC - var mackey = _sha1('putty-private-key-file-mac-key', passphrase); - - var macbuffer = forge.util.createBuffer(); - _addStringToBuffer(macbuffer, algorithm); - _addStringToBuffer(macbuffer, encryptionAlgorithm); - _addStringToBuffer(macbuffer, comment); - macbuffer.putInt32(pubbuffer.length()); - macbuffer.putBuffer(pubbuffer); - macbuffer.putInt32(privbuffer.length()); - macbuffer.putBuffer(privbuffer); - - var hmac = forge.hmac.create(); - hmac.start('sha1', mackey); - hmac.update(macbuffer.bytes()); - - ppk += '\r\nPrivate-MAC: ' + hmac.digest().toHex() + '\r\n'; - - return ppk; -}; - -/** - * Encodes a public RSA key as an OpenSSH file. - * - * @param key the key. - * @param comment a comment. - * - * @return the public key in OpenSSH format. - */ -ssh.publicKeyToOpenSSH = function(key, comment) { - var type = 'ssh-rsa'; - comment = comment || ''; - - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - - return type + ' ' + forge.util.encode64(buffer.bytes()) + ' ' + comment; -}; - -/** - * Encodes a private RSA key as an OpenSSH file. - * - * @param key the key. - * @param passphrase a passphrase to protect the key (falsy for no encryption). - * - * @return the public key in OpenSSH format. - */ -ssh.privateKeyToOpenSSH = function(privateKey, passphrase) { - if(!passphrase) { - return forge.pki.privateKeyToPem(privateKey); - } - // OpenSSH private key is just a legacy format, it seems - return forge.pki.encryptRsaPrivateKey(privateKey, passphrase, - {legacy: true, algorithm: 'aes128'}); -}; - -/** - * Gets the SSH fingerprint for the given public key. - * - * @param options the options to use. - * [md] the message digest object to use (defaults to forge.md.md5). - * [encoding] an alternative output encoding, such as 'hex' - * (defaults to none, outputs a byte buffer). - * [delimiter] the delimiter to use between bytes for 'hex' encoded - * output, eg: ':' (defaults to none). - * - * @return the fingerprint as a byte buffer or other encoding based on options. - */ -ssh.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md = options.md || forge.md.md5.create(); - - var type = 'ssh-rsa'; - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - - // hash public key bytes - md.start(); - md.update(buffer.getBytes()); - var digest = md.digest(); - if(options.encoding === 'hex') { - var hex = digest.toHex(); - if(options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); - } - return hex; - } else if(options.encoding === 'binary') { - return digest.getBytes(); - } else if(options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); - } - return digest; -}; - -/** - * Adds len(val) then val to a buffer. - * - * @param buffer the buffer to add to. - * @param val a big integer. - */ -function _addBigIntegerToBuffer(buffer, val) { - var hexVal = val.toString(16); - // ensure 2s complement +ve - if(hexVal[0] >= '8') { - hexVal = '00' + hexVal; - } - var bytes = forge.util.hexToBytes(hexVal); - buffer.putInt32(bytes.length); - buffer.putBytes(bytes); -} - -/** - * Adds len(val) then val to a buffer. - * - * @param buffer the buffer to add to. - * @param val a string. - */ -function _addStringToBuffer(buffer, val) { - buffer.putInt32(val.length); - buffer.putString(val); -} - -/** - * Hashes the arguments into one value using SHA-1. - * - * @return the sha1 hash of the provided arguments. - */ -function _sha1() { - var sha = forge.md.sha1.create(); - var num = arguments.length; - for (var i = 0; i < num; ++i) { - sha.update(arguments[i]); - } - return sha.digest(); -} diff --git a/node_modules/node-forge/lib/task.js b/node_modules/node-forge/lib/task.js deleted file mode 100644 index df48660..0000000 --- a/node_modules/node-forge/lib/task.js +++ /dev/null @@ -1,725 +0,0 @@ -/** - * Support for concurrent task management and synchronization in web - * applications. - * - * @author Dave Longley - * @author David I. Lehn - * - * Copyright (c) 2009-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./debug'); -require('./log'); -require('./util'); - -// logging category -var cat = 'forge.task'; - -// verbose level -// 0: off, 1: a little, 2: a whole lot -// Verbose debug logging is surrounded by a level check to avoid the -// performance issues with even calling the logging code regardless if it -// is actually logged. For performance reasons this should not be set to 2 -// for production use. -// ex: if(sVL >= 2) forge.log.verbose(....) -var sVL = 0; - -// track tasks for debugging -var sTasks = {}; -var sNextTaskId = 0; -// debug access -forge.debug.set(cat, 'tasks', sTasks); - -// a map of task type to task queue -var sTaskQueues = {}; -// debug access -forge.debug.set(cat, 'queues', sTaskQueues); - -// name for unnamed tasks -var sNoTaskName = '?'; - -// maximum number of doNext() recursions before a context swap occurs -// FIXME: might need to tweak this based on the browser -var sMaxRecursions = 30; - -// time slice for doing tasks before a context swap occurs -// FIXME: might need to tweak this based on the browser -var sTimeSlice = 20; - -/** - * Task states. - * - * READY: ready to start processing - * RUNNING: task or a subtask is running - * BLOCKED: task is waiting to acquire N permits to continue - * SLEEPING: task is sleeping for a period of time - * DONE: task is done - * ERROR: task has an error - */ -var READY = 'ready'; -var RUNNING = 'running'; -var BLOCKED = 'blocked'; -var SLEEPING = 'sleeping'; -var DONE = 'done'; -var ERROR = 'error'; - -/** - * Task actions. Used to control state transitions. - * - * STOP: stop processing - * START: start processing tasks - * BLOCK: block task from continuing until 1 or more permits are released - * UNBLOCK: release one or more permits - * SLEEP: sleep for a period of time - * WAKEUP: wakeup early from SLEEPING state - * CANCEL: cancel further tasks - * FAIL: a failure occured - */ -var STOP = 'stop'; -var START = 'start'; -var BLOCK = 'block'; -var UNBLOCK = 'unblock'; -var SLEEP = 'sleep'; -var WAKEUP = 'wakeup'; -var CANCEL = 'cancel'; -var FAIL = 'fail'; - -/** - * State transition table. - * - * nextState = sStateTable[currentState][action] - */ -var sStateTable = {}; - -sStateTable[READY] = {}; -sStateTable[READY][STOP] = READY; -sStateTable[READY][START] = RUNNING; -sStateTable[READY][CANCEL] = DONE; -sStateTable[READY][FAIL] = ERROR; - -sStateTable[RUNNING] = {}; -sStateTable[RUNNING][STOP] = READY; -sStateTable[RUNNING][START] = RUNNING; -sStateTable[RUNNING][BLOCK] = BLOCKED; -sStateTable[RUNNING][UNBLOCK] = RUNNING; -sStateTable[RUNNING][SLEEP] = SLEEPING; -sStateTable[RUNNING][WAKEUP] = RUNNING; -sStateTable[RUNNING][CANCEL] = DONE; -sStateTable[RUNNING][FAIL] = ERROR; - -sStateTable[BLOCKED] = {}; -sStateTable[BLOCKED][STOP] = BLOCKED; -sStateTable[BLOCKED][START] = BLOCKED; -sStateTable[BLOCKED][BLOCK] = BLOCKED; -sStateTable[BLOCKED][UNBLOCK] = BLOCKED; -sStateTable[BLOCKED][SLEEP] = BLOCKED; -sStateTable[BLOCKED][WAKEUP] = BLOCKED; -sStateTable[BLOCKED][CANCEL] = DONE; -sStateTable[BLOCKED][FAIL] = ERROR; - -sStateTable[SLEEPING] = {}; -sStateTable[SLEEPING][STOP] = SLEEPING; -sStateTable[SLEEPING][START] = SLEEPING; -sStateTable[SLEEPING][BLOCK] = SLEEPING; -sStateTable[SLEEPING][UNBLOCK] = SLEEPING; -sStateTable[SLEEPING][SLEEP] = SLEEPING; -sStateTable[SLEEPING][WAKEUP] = SLEEPING; -sStateTable[SLEEPING][CANCEL] = DONE; -sStateTable[SLEEPING][FAIL] = ERROR; - -sStateTable[DONE] = {}; -sStateTable[DONE][STOP] = DONE; -sStateTable[DONE][START] = DONE; -sStateTable[DONE][BLOCK] = DONE; -sStateTable[DONE][UNBLOCK] = DONE; -sStateTable[DONE][SLEEP] = DONE; -sStateTable[DONE][WAKEUP] = DONE; -sStateTable[DONE][CANCEL] = DONE; -sStateTable[DONE][FAIL] = ERROR; - -sStateTable[ERROR] = {}; -sStateTable[ERROR][STOP] = ERROR; -sStateTable[ERROR][START] = ERROR; -sStateTable[ERROR][BLOCK] = ERROR; -sStateTable[ERROR][UNBLOCK] = ERROR; -sStateTable[ERROR][SLEEP] = ERROR; -sStateTable[ERROR][WAKEUP] = ERROR; -sStateTable[ERROR][CANCEL] = ERROR; -sStateTable[ERROR][FAIL] = ERROR; - -/** - * Creates a new task. - * - * @param options options for this task - * run: the run function for the task (required) - * name: the run function for the task (optional) - * parent: parent of this task (optional) - * - * @return the empty task. - */ -var Task = function(options) { - // task id - this.id = -1; - - // task name - this.name = options.name || sNoTaskName; - - // task has no parent - this.parent = options.parent || null; - - // save run function - this.run = options.run; - - // create a queue of subtasks to run - this.subtasks = []; - - // error flag - this.error = false; - - // state of the task - this.state = READY; - - // number of times the task has been blocked (also the number - // of permits needed to be released to continue running) - this.blocks = 0; - - // timeout id when sleeping - this.timeoutId = null; - - // no swap time yet - this.swapTime = null; - - // no user data - this.userData = null; - - // initialize task - // FIXME: deal with overflow - this.id = sNextTaskId++; - sTasks[this.id] = this; - if(sVL >= 1) { - forge.log.verbose(cat, '[%s][%s] init', this.id, this.name, this); - } -}; - -/** - * Logs debug information on this task and the system state. - */ -Task.prototype.debug = function(msg) { - msg = msg || ''; - forge.log.debug(cat, msg, - '[%s][%s] task:', this.id, this.name, this, - 'subtasks:', this.subtasks.length, - 'queue:', sTaskQueues); -}; - -/** - * Adds a subtask to run after task.doNext() or task.fail() is called. - * - * @param name human readable name for this task (optional). - * @param subrun a function to run that takes the current task as - * its first parameter. - * - * @return the current task (useful for chaining next() calls). - */ -Task.prototype.next = function(name, subrun) { - // juggle parameters if it looks like no name is given - if(typeof(name) === 'function') { - subrun = name; - - // inherit parent's name - name = this.name; - } - // create subtask, set parent to this task, propagate callbacks - var subtask = new Task({ - run: subrun, - name: name, - parent: this - }); - // start subtasks running - subtask.state = RUNNING; - subtask.type = this.type; - subtask.successCallback = this.successCallback || null; - subtask.failureCallback = this.failureCallback || null; - - // queue a new subtask - this.subtasks.push(subtask); - - return this; -}; - -/** - * Adds subtasks to run in parallel after task.doNext() or task.fail() - * is called. - * - * @param name human readable name for this task (optional). - * @param subrun functions to run that take the current task as - * their first parameter. - * - * @return the current task (useful for chaining next() calls). - */ -Task.prototype.parallel = function(name, subrun) { - // juggle parameters if it looks like no name is given - if(forge.util.isArray(name)) { - subrun = name; - - // inherit parent's name - name = this.name; - } - // Wrap parallel tasks in a regular task so they are started at the - // proper time. - return this.next(name, function(task) { - // block waiting for subtasks - var ptask = task; - ptask.block(subrun.length); - - // we pass the iterator from the loop below as a parameter - // to a function because it is otherwise included in the - // closure and changes as the loop changes -- causing i - // to always be set to its highest value - var startParallelTask = function(pname, pi) { - forge.task.start({ - type: pname, - run: function(task) { - subrun[pi](task); - }, - success: function(task) { - ptask.unblock(); - }, - failure: function(task) { - ptask.unblock(); - } - }); - }; - - for(var i = 0; i < subrun.length; i++) { - // Type must be unique so task starts in parallel: - // name + private string + task id + sub-task index - // start tasks in parallel and unblock when the finish - var pname = name + '__parallel-' + task.id + '-' + i; - var pi = i; - startParallelTask(pname, pi); - } - }); -}; - -/** - * Stops a running task. - */ -Task.prototype.stop = function() { - this.state = sStateTable[this.state][STOP]; -}; - -/** - * Starts running a task. - */ -Task.prototype.start = function() { - this.error = false; - this.state = sStateTable[this.state][START]; - - // try to restart - if(this.state === RUNNING) { - this.start = new Date(); - this.run(this); - runNext(this, 0); - } -}; - -/** - * Blocks a task until it one or more permits have been released. The - * task will not resume until the requested number of permits have - * been released with call(s) to unblock(). - * - * @param n number of permits to wait for(default: 1). - */ -Task.prototype.block = function(n) { - n = typeof(n) === 'undefined' ? 1 : n; - this.blocks += n; - if(this.blocks > 0) { - this.state = sStateTable[this.state][BLOCK]; - } -}; - -/** - * Releases a permit to unblock a task. If a task was blocked by - * requesting N permits via block(), then it will only continue - * running once enough permits have been released via unblock() calls. - * - * If multiple processes need to synchronize with a single task then - * use a condition variable (see forge.task.createCondition). It is - * an error to unblock a task more times than it has been blocked. - * - * @param n number of permits to release (default: 1). - * - * @return the current block count (task is unblocked when count is 0) - */ -Task.prototype.unblock = function(n) { - n = typeof(n) === 'undefined' ? 1 : n; - this.blocks -= n; - if(this.blocks === 0 && this.state !== DONE) { - this.state = RUNNING; - runNext(this, 0); - } - return this.blocks; -}; - -/** - * Sleep for a period of time before resuming tasks. - * - * @param n number of milliseconds to sleep (default: 0). - */ -Task.prototype.sleep = function(n) { - n = typeof(n) === 'undefined' ? 0 : n; - this.state = sStateTable[this.state][SLEEP]; - var self = this; - this.timeoutId = setTimeout(function() { - self.timeoutId = null; - self.state = RUNNING; - runNext(self, 0); - }, n); -}; - -/** - * Waits on a condition variable until notified. The next task will - * not be scheduled until notification. A condition variable can be - * created with forge.task.createCondition(). - * - * Once cond.notify() is called, the task will continue. - * - * @param cond the condition variable to wait on. - */ -Task.prototype.wait = function(cond) { - cond.wait(this); -}; - -/** - * If sleeping, wakeup and continue running tasks. - */ -Task.prototype.wakeup = function() { - if(this.state === SLEEPING) { - cancelTimeout(this.timeoutId); - this.timeoutId = null; - this.state = RUNNING; - runNext(this, 0); - } -}; - -/** - * Cancel all remaining subtasks of this task. - */ -Task.prototype.cancel = function() { - this.state = sStateTable[this.state][CANCEL]; - // remove permits needed - this.permitsNeeded = 0; - // cancel timeouts - if(this.timeoutId !== null) { - cancelTimeout(this.timeoutId); - this.timeoutId = null; - } - // remove subtasks - this.subtasks = []; -}; - -/** - * Finishes this task with failure and sets error flag. The entire - * task will be aborted unless the next task that should execute - * is passed as a parameter. This allows levels of subtasks to be - * skipped. For instance, to abort only this tasks's subtasks, then - * call fail(task.parent). To abort this task's subtasks and its - * parent's subtasks, call fail(task.parent.parent). To abort - * all tasks and simply call the task callback, call fail() or - * fail(null). - * - * The task callback (success or failure) will always, eventually, be - * called. - * - * @param next the task to continue at, or null to abort entirely. - */ -Task.prototype.fail = function(next) { - // set error flag - this.error = true; - - // finish task - finish(this, true); - - if(next) { - // propagate task info - next.error = this.error; - next.swapTime = this.swapTime; - next.userData = this.userData; - - // do next task as specified - runNext(next, 0); - } else { - if(this.parent !== null) { - // finish root task (ensures it is removed from task queue) - var parent = this.parent; - while(parent.parent !== null) { - // propagate task info - parent.error = this.error; - parent.swapTime = this.swapTime; - parent.userData = this.userData; - parent = parent.parent; - } - finish(parent, true); - } - - // call failure callback if one exists - if(this.failureCallback) { - this.failureCallback(this); - } - } -}; - -/** - * Asynchronously start a task. - * - * @param task the task to start. - */ -var start = function(task) { - task.error = false; - task.state = sStateTable[task.state][START]; - setTimeout(function() { - if(task.state === RUNNING) { - task.swapTime = +new Date(); - task.run(task); - runNext(task, 0); - } - }, 0); -}; - -/** - * Run the next subtask or finish this task. - * - * @param task the task to process. - * @param recurse the recursion count. - */ -var runNext = function(task, recurse) { - // get time since last context swap (ms), if enough time has passed set - // swap to true to indicate that doNext was performed asynchronously - // also, if recurse is too high do asynchronously - var swap = - (recurse > sMaxRecursions) || - (+new Date() - task.swapTime) > sTimeSlice; - - var doNext = function(recurse) { - recurse++; - if(task.state === RUNNING) { - if(swap) { - // update swap time - task.swapTime = +new Date(); - } - - if(task.subtasks.length > 0) { - // run next subtask - var subtask = task.subtasks.shift(); - subtask.error = task.error; - subtask.swapTime = task.swapTime; - subtask.userData = task.userData; - subtask.run(subtask); - if(!subtask.error) { - runNext(subtask, recurse); - } - } else { - finish(task); - - if(!task.error) { - // chain back up and run parent - if(task.parent !== null) { - // propagate task info - task.parent.error = task.error; - task.parent.swapTime = task.swapTime; - task.parent.userData = task.userData; - - // no subtasks left, call run next subtask on parent - runNext(task.parent, recurse); - } - } - } - } - }; - - if(swap) { - // we're swapping, so run asynchronously - setTimeout(doNext, 0); - } else { - // not swapping, so run synchronously - doNext(recurse); - } -}; - -/** - * Finishes a task and looks for the next task in the queue to start. - * - * @param task the task to finish. - * @param suppressCallbacks true to suppress callbacks. - */ -var finish = function(task, suppressCallbacks) { - // subtask is now done - task.state = DONE; - - delete sTasks[task.id]; - if(sVL >= 1) { - forge.log.verbose(cat, '[%s][%s] finish', - task.id, task.name, task); - } - - // only do queue processing for root tasks - if(task.parent === null) { - // report error if queue is missing - if(!(task.type in sTaskQueues)) { - forge.log.error(cat, - '[%s][%s] task queue missing [%s]', - task.id, task.name, task.type); - } else if(sTaskQueues[task.type].length === 0) { - // report error if queue is empty - forge.log.error(cat, - '[%s][%s] task queue empty [%s]', - task.id, task.name, task.type); - } else if(sTaskQueues[task.type][0] !== task) { - // report error if this task isn't the first in the queue - forge.log.error(cat, - '[%s][%s] task not first in queue [%s]', - task.id, task.name, task.type); - } else { - // remove ourselves from the queue - sTaskQueues[task.type].shift(); - // clean up queue if it is empty - if(sTaskQueues[task.type].length === 0) { - if(sVL >= 1) { - forge.log.verbose(cat, '[%s][%s] delete queue [%s]', - task.id, task.name, task.type); - } - /* Note: Only a task can delete a queue of its own type. This - is used as a way to synchronize tasks. If a queue for a certain - task type exists, then a task of that type is running. - */ - delete sTaskQueues[task.type]; - } else { - // dequeue the next task and start it - if(sVL >= 1) { - forge.log.verbose(cat, - '[%s][%s] queue start next [%s] remain:%s', - task.id, task.name, task.type, - sTaskQueues[task.type].length); - } - sTaskQueues[task.type][0].start(); - } - } - - if(!suppressCallbacks) { - // call final callback if one exists - if(task.error && task.failureCallback) { - task.failureCallback(task); - } else if(!task.error && task.successCallback) { - task.successCallback(task); - } - } - } -}; - -/* Tasks API */ -module.exports = forge.task = forge.task || {}; - -/** - * Starts a new task that will run the passed function asynchronously. - * - * In order to finish the task, either task.doNext() or task.fail() - * *must* be called. - * - * The task must have a type (a string identifier) that can be used to - * synchronize it with other tasks of the same type. That type can also - * be used to cancel tasks that haven't started yet. - * - * To start a task, the following object must be provided as a parameter - * (each function takes a task object as its first parameter): - * - * { - * type: the type of task. - * run: the function to run to execute the task. - * success: a callback to call when the task succeeds (optional). - * failure: a callback to call when the task fails (optional). - * } - * - * @param options the object as described above. - */ -forge.task.start = function(options) { - // create a new task - var task = new Task({ - run: options.run, - name: options.name || sNoTaskName - }); - task.type = options.type; - task.successCallback = options.success || null; - task.failureCallback = options.failure || null; - - // append the task onto the appropriate queue - if(!(task.type in sTaskQueues)) { - if(sVL >= 1) { - forge.log.verbose(cat, '[%s][%s] create queue [%s]', - task.id, task.name, task.type); - } - // create the queue with the new task - sTaskQueues[task.type] = [task]; - start(task); - } else { - // push the task onto the queue, it will be run after a task - // with the same type completes - sTaskQueues[options.type].push(task); - } -}; - -/** - * Cancels all tasks of the given type that haven't started yet. - * - * @param type the type of task to cancel. - */ -forge.task.cancel = function(type) { - // find the task queue - if(type in sTaskQueues) { - // empty all but the current task from the queue - sTaskQueues[type] = [sTaskQueues[type][0]]; - } -}; - -/** - * Creates a condition variable to synchronize tasks. To make a task wait - * on the condition variable, call task.wait(condition). To notify all - * tasks that are waiting, call condition.notify(). - * - * @return the condition variable. - */ -forge.task.createCondition = function() { - var cond = { - // all tasks that are blocked - tasks: {} - }; - - /** - * Causes the given task to block until notify is called. If the task - * is already waiting on this condition then this is a no-op. - * - * @param task the task to cause to wait. - */ - cond.wait = function(task) { - // only block once - if(!(task.id in cond.tasks)) { - task.block(); - cond.tasks[task.id] = task; - } - }; - - /** - * Notifies all waiting tasks to wake up. - */ - cond.notify = function() { - // since unblock() will run the next task from here, make sure to - // clear the condition's blocked task list before unblocking - var tmp = cond.tasks; - cond.tasks = {}; - for(var id in tmp) { - tmp[id].unblock(); - } - }; - - return cond; -}; diff --git a/node_modules/node-forge/lib/tls.js b/node_modules/node-forge/lib/tls.js deleted file mode 100644 index fadfd64..0000000 --- a/node_modules/node-forge/lib/tls.js +++ /dev/null @@ -1,4282 +0,0 @@ -/** - * A Javascript implementation of Transport Layer Security (TLS). - * - * @author Dave Longley - * - * Copyright (c) 2009-2014 Digital Bazaar, Inc. - * - * The TLS Handshake Protocol involves the following steps: - * - * - Exchange hello messages to agree on algorithms, exchange random values, - * and check for session resumption. - * - * - Exchange the necessary cryptographic parameters to allow the client and - * server to agree on a premaster secret. - * - * - Exchange certificates and cryptographic information to allow the client - * and server to authenticate themselves. - * - * - Generate a master secret from the premaster secret and exchanged random - * values. - * - * - Provide security parameters to the record layer. - * - * - Allow the client and server to verify that their peer has calculated the - * same security parameters and that the handshake occurred without tampering - * by an attacker. - * - * Up to 4 different messages may be sent during a key exchange. The server - * certificate, the server key exchange, the client certificate, and the - * client key exchange. - * - * A typical handshake (from the client's perspective). - * - * 1. Client sends ClientHello. - * 2. Client receives ServerHello. - * 3. Client receives optional Certificate. - * 4. Client receives optional ServerKeyExchange. - * 5. Client receives ServerHelloDone. - * 6. Client sends optional Certificate. - * 7. Client sends ClientKeyExchange. - * 8. Client sends optional CertificateVerify. - * 9. Client sends ChangeCipherSpec. - * 10. Client sends Finished. - * 11. Client receives ChangeCipherSpec. - * 12. Client receives Finished. - * 13. Client sends/receives application data. - * - * To reuse an existing session: - * - * 1. Client sends ClientHello with session ID for reuse. - * 2. Client receives ServerHello with same session ID if reusing. - * 3. Client receives ChangeCipherSpec message if reusing. - * 4. Client receives Finished. - * 5. Client sends ChangeCipherSpec. - * 6. Client sends Finished. - * - * Note: Client ignores HelloRequest if in the middle of a handshake. - * - * Record Layer: - * - * The record layer fragments information blocks into TLSPlaintext records - * carrying data in chunks of 2^14 bytes or less. Client message boundaries are - * not preserved in the record layer (i.e., multiple client messages of the - * same ContentType MAY be coalesced into a single TLSPlaintext record, or a - * single message MAY be fragmented across several records). - * - * struct { - * uint8 major; - * uint8 minor; - * } ProtocolVersion; - * - * struct { - * ContentType type; - * ProtocolVersion version; - * uint16 length; - * opaque fragment[TLSPlaintext.length]; - * } TLSPlaintext; - * - * type: - * The higher-level protocol used to process the enclosed fragment. - * - * version: - * The version of the protocol being employed. TLS Version 1.2 uses version - * {3, 3}. TLS Version 1.0 uses version {3, 1}. Note that a client that - * supports multiple versions of TLS may not know what version will be - * employed before it receives the ServerHello. - * - * length: - * The length (in bytes) of the following TLSPlaintext.fragment. The length - * MUST NOT exceed 2^14 = 16384 bytes. - * - * fragment: - * The application data. This data is transparent and treated as an - * independent block to be dealt with by the higher-level protocol specified - * by the type field. - * - * Implementations MUST NOT send zero-length fragments of Handshake, Alert, or - * ChangeCipherSpec content types. Zero-length fragments of Application data - * MAY be sent as they are potentially useful as a traffic analysis - * countermeasure. - * - * Note: Data of different TLS record layer content types MAY be interleaved. - * Application data is generally of lower precedence for transmission than - * other content types. However, records MUST be delivered to the network in - * the same order as they are protected by the record layer. Recipients MUST - * receive and process interleaved application layer traffic during handshakes - * subsequent to the first one on a connection. - * - * struct { - * ContentType type; // same as TLSPlaintext.type - * ProtocolVersion version;// same as TLSPlaintext.version - * uint16 length; - * opaque fragment[TLSCompressed.length]; - * } TLSCompressed; - * - * length: - * The length (in bytes) of the following TLSCompressed.fragment. - * The length MUST NOT exceed 2^14 + 1024. - * - * fragment: - * The compressed form of TLSPlaintext.fragment. - * - * Note: A CompressionMethod.null operation is an identity operation; no fields - * are altered. In this implementation, since no compression is supported, - * uncompressed records are always the same as compressed records. - * - * Encryption Information: - * - * The encryption and MAC functions translate a TLSCompressed structure into a - * TLSCiphertext. The decryption functions reverse the process. The MAC of the - * record also includes a sequence number so that missing, extra, or repeated - * messages are detectable. - * - * struct { - * ContentType type; - * ProtocolVersion version; - * uint16 length; - * select (SecurityParameters.cipher_type) { - * case stream: GenericStreamCipher; - * case block: GenericBlockCipher; - * case aead: GenericAEADCipher; - * } fragment; - * } TLSCiphertext; - * - * type: - * The type field is identical to TLSCompressed.type. - * - * version: - * The version field is identical to TLSCompressed.version. - * - * length: - * The length (in bytes) of the following TLSCiphertext.fragment. - * The length MUST NOT exceed 2^14 + 2048. - * - * fragment: - * The encrypted form of TLSCompressed.fragment, with the MAC. - * - * Note: Only CBC Block Ciphers are supported by this implementation. - * - * The TLSCompressed.fragment structures are converted to/from block - * TLSCiphertext.fragment structures. - * - * struct { - * opaque IV[SecurityParameters.record_iv_length]; - * block-ciphered struct { - * opaque content[TLSCompressed.length]; - * opaque MAC[SecurityParameters.mac_length]; - * uint8 padding[GenericBlockCipher.padding_length]; - * uint8 padding_length; - * }; - * } GenericBlockCipher; - * - * The MAC is generated as described in Section 6.2.3.1. - * - * IV: - * The Initialization Vector (IV) SHOULD be chosen at random, and MUST be - * unpredictable. Note that in versions of TLS prior to 1.1, there was no - * IV field, and the last ciphertext block of the previous record (the "CBC - * residue") was used as the IV. This was changed to prevent the attacks - * described in [CBCATT]. For block ciphers, the IV length is of length - * SecurityParameters.record_iv_length, which is equal to the - * SecurityParameters.block_size. - * - * padding: - * Padding that is added to force the length of the plaintext to be an - * integral multiple of the block cipher's block length. The padding MAY be - * any length up to 255 bytes, as long as it results in the - * TLSCiphertext.length being an integral multiple of the block length. - * Lengths longer than necessary might be desirable to frustrate attacks on - * a protocol that are based on analysis of the lengths of exchanged - * messages. Each uint8 in the padding data vector MUST be filled with the - * padding length value. The receiver MUST check this padding and MUST use - * the bad_record_mac alert to indicate padding errors. - * - * padding_length: - * The padding length MUST be such that the total size of the - * GenericBlockCipher structure is a multiple of the cipher's block length. - * Legal values range from zero to 255, inclusive. This length specifies the - * length of the padding field exclusive of the padding_length field itself. - * - * The encrypted data length (TLSCiphertext.length) is one more than the sum of - * SecurityParameters.block_length, TLSCompressed.length, - * SecurityParameters.mac_length, and padding_length. - * - * Example: If the block length is 8 bytes, the content length - * (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes, then the - * length before padding is 82 bytes (this does not include the IV. Thus, the - * padding length modulo 8 must be equal to 6 in order to make the total length - * an even multiple of 8 bytes (the block length). The padding length can be - * 6, 14, 22, and so on, through 254. If the padding length were the minimum - * necessary, 6, the padding would be 6 bytes, each containing the value 6. - * Thus, the last 8 octets of the GenericBlockCipher before block encryption - * would be xx 06 06 06 06 06 06 06, where xx is the last octet of the MAC. - * - * Note: With block ciphers in CBC mode (Cipher Block Chaining), it is critical - * that the entire plaintext of the record be known before any ciphertext is - * transmitted. Otherwise, it is possible for the attacker to mount the attack - * described in [CBCATT]. - * - * Implementation note: Canvel et al. [CBCTIME] have demonstrated a timing - * attack on CBC padding based on the time required to compute the MAC. In - * order to defend against this attack, implementations MUST ensure that - * record processing time is essentially the same whether or not the padding - * is correct. In general, the best way to do this is to compute the MAC even - * if the padding is incorrect, and only then reject the packet. For instance, - * if the pad appears to be incorrect, the implementation might assume a - * zero-length pad and then compute the MAC. This leaves a small timing - * channel, since MAC performance depends, to some extent, on the size of the - * data fragment, but it is not believed to be large enough to be exploitable, - * due to the large block size of existing MACs and the small size of the - * timing signal. - */ -var forge = require('./forge'); -require('./asn1'); -require('./hmac'); -require('./md5'); -require('./pem'); -require('./pki'); -require('./random'); -require('./sha1'); -require('./util'); - -/** - * Generates pseudo random bytes by mixing the result of two hash functions, - * MD5 and SHA-1. - * - * prf_TLS1(secret, label, seed) = - * P_MD5(S1, label + seed) XOR P_SHA-1(S2, label + seed); - * - * Each P_hash function functions as follows: - * - * P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) + - * HMAC_hash(secret, A(2) + seed) + - * HMAC_hash(secret, A(3) + seed) + ... - * A() is defined as: - * A(0) = seed - * A(i) = HMAC_hash(secret, A(i-1)) - * - * The '+' operator denotes concatenation. - * - * As many iterations A(N) as are needed are performed to generate enough - * pseudo random byte output. If an iteration creates more data than is - * necessary, then it is truncated. - * - * Therefore: - * A(1) = HMAC_hash(secret, A(0)) - * = HMAC_hash(secret, seed) - * A(2) = HMAC_hash(secret, A(1)) - * = HMAC_hash(secret, HMAC_hash(secret, seed)) - * - * Therefore: - * P_hash(secret, seed) = - * HMAC_hash(secret, HMAC_hash(secret, A(0)) + seed) + - * HMAC_hash(secret, HMAC_hash(secret, A(1)) + seed) + - * ... - * - * Therefore: - * P_hash(secret, seed) = - * HMAC_hash(secret, HMAC_hash(secret, seed) + seed) + - * HMAC_hash(secret, HMAC_hash(secret, HMAC_hash(secret, seed)) + seed) + - * ... - * - * @param secret the secret to use. - * @param label the label to use. - * @param seed the seed value to use. - * @param length the number of bytes to generate. - * - * @return the pseudo random bytes in a byte buffer. - */ -var prf_TLS1 = function(secret, label, seed, length) { - var rval = forge.util.createBuffer(); - - /* For TLS 1.0, the secret is split in half, into two secrets of equal - length. If the secret has an odd length then the last byte of the first - half will be the same as the first byte of the second. The length of the - two secrets is half of the secret rounded up. */ - var idx = (secret.length >> 1); - var slen = idx + (secret.length & 1); - var s1 = secret.substr(0, slen); - var s2 = secret.substr(idx, slen); - var ai = forge.util.createBuffer(); - var hmac = forge.hmac.create(); - seed = label + seed; - - // determine the number of iterations that must be performed to generate - // enough output bytes, md5 creates 16 byte hashes, sha1 creates 20 - var md5itr = Math.ceil(length / 16); - var sha1itr = Math.ceil(length / 20); - - // do md5 iterations - hmac.start('MD5', s1); - var md5bytes = forge.util.createBuffer(); - ai.putBytes(seed); - for(var i = 0; i < md5itr; ++i) { - // HMAC_hash(secret, A(i-1)) - hmac.start(null, null); - hmac.update(ai.getBytes()); - ai.putBuffer(hmac.digest()); - - // HMAC_hash(secret, A(i) + seed) - hmac.start(null, null); - hmac.update(ai.bytes() + seed); - md5bytes.putBuffer(hmac.digest()); - } - - // do sha1 iterations - hmac.start('SHA1', s2); - var sha1bytes = forge.util.createBuffer(); - ai.clear(); - ai.putBytes(seed); - for(var i = 0; i < sha1itr; ++i) { - // HMAC_hash(secret, A(i-1)) - hmac.start(null, null); - hmac.update(ai.getBytes()); - ai.putBuffer(hmac.digest()); - - // HMAC_hash(secret, A(i) + seed) - hmac.start(null, null); - hmac.update(ai.bytes() + seed); - sha1bytes.putBuffer(hmac.digest()); - } - - // XOR the md5 bytes with the sha1 bytes - rval.putBytes(forge.util.xorBytes( - md5bytes.getBytes(), sha1bytes.getBytes(), length)); - - return rval; -}; - -/** - * Generates pseudo random bytes using a SHA256 algorithm. For TLS 1.2. - * - * @param secret the secret to use. - * @param label the label to use. - * @param seed the seed value to use. - * @param length the number of bytes to generate. - * - * @return the pseudo random bytes in a byte buffer. - */ -var prf_sha256 = function(secret, label, seed, length) { - // FIXME: implement me for TLS 1.2 -}; - -/** - * Gets a MAC for a record using the SHA-1 hash algorithm. - * - * @param key the mac key. - * @param state the sequence number (array of two 32-bit integers). - * @param record the record. - * - * @return the sha-1 hash (20 bytes) for the given record. - */ -var hmac_sha1 = function(key, seqNum, record) { - /* MAC is computed like so: - HMAC_hash( - key, seqNum + - TLSCompressed.type + - TLSCompressed.version + - TLSCompressed.length + - TLSCompressed.fragment) - */ - var hmac = forge.hmac.create(); - hmac.start('SHA1', key); - var b = forge.util.createBuffer(); - b.putInt32(seqNum[0]); - b.putInt32(seqNum[1]); - b.putByte(record.type); - b.putByte(record.version.major); - b.putByte(record.version.minor); - b.putInt16(record.length); - b.putBytes(record.fragment.bytes()); - hmac.update(b.getBytes()); - return hmac.digest().getBytes(); -}; - -/** - * Compresses the TLSPlaintext record into a TLSCompressed record using the - * deflate algorithm. - * - * @param c the TLS connection. - * @param record the TLSPlaintext record to compress. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -var deflate = function(c, record, s) { - var rval = false; - - try { - var bytes = c.deflate(record.fragment.getBytes()); - record.fragment = forge.util.createBuffer(bytes); - record.length = bytes.length; - rval = true; - } catch(ex) { - // deflate error, fail out - } - - return rval; -}; - -/** - * Decompresses the TLSCompressed record into a TLSPlaintext record using the - * deflate algorithm. - * - * @param c the TLS connection. - * @param record the TLSCompressed record to decompress. - * @param s the ConnectionState to use. - * - * @return true on success, false on failure. - */ -var inflate = function(c, record, s) { - var rval = false; - - try { - var bytes = c.inflate(record.fragment.getBytes()); - record.fragment = forge.util.createBuffer(bytes); - record.length = bytes.length; - rval = true; - } catch(ex) { - // inflate error, fail out - } - - return rval; -}; - -/** - * Reads a TLS variable-length vector from a byte buffer. - * - * Variable-length vectors are defined by specifying a subrange of legal - * lengths, inclusively, using the notation . When these are - * encoded, the actual length precedes the vector's contents in the byte - * stream. The length will be in the form of a number consuming as many bytes - * as required to hold the vector's specified maximum (ceiling) length. A - * variable-length vector with an actual length field of zero is referred to - * as an empty vector. - * - * @param b the byte buffer. - * @param lenBytes the number of bytes required to store the length. - * - * @return the resulting byte buffer. - */ -var readVector = function(b, lenBytes) { - var len = 0; - switch(lenBytes) { - case 1: - len = b.getByte(); - break; - case 2: - len = b.getInt16(); - break; - case 3: - len = b.getInt24(); - break; - case 4: - len = b.getInt32(); - break; - } - - // read vector bytes into a new buffer - return forge.util.createBuffer(b.getBytes(len)); -}; - -/** - * Writes a TLS variable-length vector to a byte buffer. - * - * @param b the byte buffer. - * @param lenBytes the number of bytes required to store the length. - * @param v the byte buffer vector. - */ -var writeVector = function(b, lenBytes, v) { - // encode length at the start of the vector, where the number of bytes for - // the length is the maximum number of bytes it would take to encode the - // vector's ceiling - b.putInt(v.length(), lenBytes << 3); - b.putBuffer(v); -}; - -/** - * The tls implementation. - */ -var tls = {}; - -/** - * Version: TLS 1.2 = 3.3, TLS 1.1 = 3.2, TLS 1.0 = 3.1. Both TLS 1.1 and - * TLS 1.2 were still too new (ie: openSSL didn't implement them) at the time - * of this implementation so TLS 1.0 was implemented instead. - */ -tls.Versions = { - TLS_1_0: {major: 3, minor: 1}, - TLS_1_1: {major: 3, minor: 2}, - TLS_1_2: {major: 3, minor: 3} -}; -tls.SupportedVersions = [ - tls.Versions.TLS_1_1, - tls.Versions.TLS_1_0 -]; -tls.Version = tls.SupportedVersions[0]; - -/** - * Maximum fragment size. True maximum is 16384, but we fragment before that - * to allow for unusual small increases during compression. - */ -tls.MaxFragment = 16384 - 1024; - -/** - * Whether this entity is considered the "client" or "server". - * enum { server, client } ConnectionEnd; - */ -tls.ConnectionEnd = { - server: 0, - client: 1 -}; - -/** - * Pseudo-random function algorithm used to generate keys from the master - * secret. - * enum { tls_prf_sha256 } PRFAlgorithm; - */ -tls.PRFAlgorithm = { - tls_prf_sha256: 0 -}; - -/** - * Bulk encryption algorithms. - * enum { null, rc4, des3, aes } BulkCipherAlgorithm; - */ -tls.BulkCipherAlgorithm = { - none: null, - rc4: 0, - des3: 1, - aes: 2 -}; - -/** - * Cipher types. - * enum { stream, block, aead } CipherType; - */ -tls.CipherType = { - stream: 0, - block: 1, - aead: 2 -}; - -/** - * MAC (Message Authentication Code) algorithms. - * enum { null, hmac_md5, hmac_sha1, hmac_sha256, - * hmac_sha384, hmac_sha512} MACAlgorithm; - */ -tls.MACAlgorithm = { - none: null, - hmac_md5: 0, - hmac_sha1: 1, - hmac_sha256: 2, - hmac_sha384: 3, - hmac_sha512: 4 -}; - -/** - * Compression algorithms. - * enum { null(0), deflate(1), (255) } CompressionMethod; - */ -tls.CompressionMethod = { - none: 0, - deflate: 1 -}; - -/** - * TLS record content types. - * enum { - * change_cipher_spec(20), alert(21), handshake(22), - * application_data(23), (255) - * } ContentType; - */ -tls.ContentType = { - change_cipher_spec: 20, - alert: 21, - handshake: 22, - application_data: 23, - heartbeat: 24 -}; - -/** - * TLS handshake types. - * enum { - * hello_request(0), client_hello(1), server_hello(2), - * certificate(11), server_key_exchange (12), - * certificate_request(13), server_hello_done(14), - * certificate_verify(15), client_key_exchange(16), - * finished(20), (255) - * } HandshakeType; - */ -tls.HandshakeType = { - hello_request: 0, - client_hello: 1, - server_hello: 2, - certificate: 11, - server_key_exchange: 12, - certificate_request: 13, - server_hello_done: 14, - certificate_verify: 15, - client_key_exchange: 16, - finished: 20 -}; - -/** - * TLS Alert Protocol. - * - * enum { warning(1), fatal(2), (255) } AlertLevel; - * - * enum { - * close_notify(0), - * unexpected_message(10), - * bad_record_mac(20), - * decryption_failed(21), - * record_overflow(22), - * decompression_failure(30), - * handshake_failure(40), - * bad_certificate(42), - * unsupported_certificate(43), - * certificate_revoked(44), - * certificate_expired(45), - * certificate_unknown(46), - * illegal_parameter(47), - * unknown_ca(48), - * access_denied(49), - * decode_error(50), - * decrypt_error(51), - * export_restriction(60), - * protocol_version(70), - * insufficient_security(71), - * internal_error(80), - * user_canceled(90), - * no_renegotiation(100), - * (255) - * } AlertDescription; - * - * struct { - * AlertLevel level; - * AlertDescription description; - * } Alert; - */ -tls.Alert = {}; -tls.Alert.Level = { - warning: 1, - fatal: 2 -}; -tls.Alert.Description = { - close_notify: 0, - unexpected_message: 10, - bad_record_mac: 20, - decryption_failed: 21, - record_overflow: 22, - decompression_failure: 30, - handshake_failure: 40, - bad_certificate: 42, - unsupported_certificate: 43, - certificate_revoked: 44, - certificate_expired: 45, - certificate_unknown: 46, - illegal_parameter: 47, - unknown_ca: 48, - access_denied: 49, - decode_error: 50, - decrypt_error: 51, - export_restriction: 60, - protocol_version: 70, - insufficient_security: 71, - internal_error: 80, - user_canceled: 90, - no_renegotiation: 100 -}; - -/** - * TLS Heartbeat Message types. - * enum { - * heartbeat_request(1), - * heartbeat_response(2), - * (255) - * } HeartbeatMessageType; - */ -tls.HeartbeatMessageType = { - heartbeat_request: 1, - heartbeat_response: 2 -}; - -/** - * Supported cipher suites. - */ -tls.CipherSuites = {}; - -/** - * Gets a supported cipher suite from its 2 byte ID. - * - * @param twoBytes two bytes in a string. - * - * @return the matching supported cipher suite or null. - */ -tls.getCipherSuite = function(twoBytes) { - var rval = null; - for(var key in tls.CipherSuites) { - var cs = tls.CipherSuites[key]; - if(cs.id[0] === twoBytes.charCodeAt(0) && - cs.id[1] === twoBytes.charCodeAt(1)) { - rval = cs; - break; - } - } - return rval; -}; - -/** - * Called when an unexpected record is encountered. - * - * @param c the connection. - * @param record the record. - */ -tls.handleUnexpected = function(c, record) { - // if connection is client and closed, ignore unexpected messages - var ignore = (!c.open && c.entity === tls.ConnectionEnd.client); - if(!ignore) { - c.error(c, { - message: 'Unexpected message. Received TLS record out of order.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unexpected_message - } - }); - } -}; - -/** - * Called when a client receives a HelloRequest record. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleHelloRequest = function(c, record, length) { - // ignore renegotiation requests from the server during a handshake, but - // if handshaking, send a warning alert that renegotation is denied - if(!c.handshaking && c.handshakes > 0) { - // send alert warning - tls.queue(c, tls.createAlert(c, { - level: tls.Alert.Level.warning, - description: tls.Alert.Description.no_renegotiation - })); - tls.flush(c); - } - - // continue - c.process(); -}; - -/** - * Parses a hello message from a ClientHello or ServerHello record. - * - * @param record the record to parse. - * - * @return the parsed message. - */ -tls.parseHelloMessage = function(c, record, length) { - var msg = null; - - var client = (c.entity === tls.ConnectionEnd.client); - - // minimum of 38 bytes in message - if(length < 38) { - c.error(c, { - message: client ? - 'Invalid ServerHello message. Message too short.' : - 'Invalid ClientHello message. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } else { - // use 'remaining' to calculate # of remaining bytes in the message - var b = record.fragment; - var remaining = b.length(); - msg = { - version: { - major: b.getByte(), - minor: b.getByte() - }, - random: forge.util.createBuffer(b.getBytes(32)), - session_id: readVector(b, 1), - extensions: [] - }; - if(client) { - msg.cipher_suite = b.getBytes(2); - msg.compression_method = b.getByte(); - } else { - msg.cipher_suites = readVector(b, 2); - msg.compression_methods = readVector(b, 1); - } - - // read extensions if there are any bytes left in the message - remaining = length - (remaining - b.length()); - if(remaining > 0) { - // parse extensions - var exts = readVector(b, 2); - while(exts.length() > 0) { - msg.extensions.push({ - type: [exts.getByte(), exts.getByte()], - data: readVector(exts, 2) - }); - } - - // TODO: make extension support modular - if(!client) { - for(var i = 0; i < msg.extensions.length; ++i) { - var ext = msg.extensions[i]; - - // support SNI extension - if(ext.type[0] === 0x00 && ext.type[1] === 0x00) { - // get server name list - var snl = readVector(ext.data, 2); - while(snl.length() > 0) { - // read server name type - var snType = snl.getByte(); - - // only HostName type (0x00) is known, break out if - // another type is detected - if(snType !== 0x00) { - break; - } - - // add host name to server name list - c.session.extensions.server_name.serverNameList.push( - readVector(snl, 2).getBytes()); - } - } - } - } - } - - // version already set, do not allow version change - if(c.session.version) { - if(msg.version.major !== c.session.version.major || - msg.version.minor !== c.session.version.minor) { - return c.error(c, { - message: 'TLS version change is disallowed during renegotiation.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - } - - // get the chosen (ServerHello) cipher suite - if(client) { - // FIXME: should be checking configured acceptable cipher suites - c.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite); - } else { - // get a supported preferred (ClientHello) cipher suite - // choose the first supported cipher suite - var tmp = forge.util.createBuffer(msg.cipher_suites.bytes()); - while(tmp.length() > 0) { - // FIXME: should be checking configured acceptable suites - // cipher suites take up 2 bytes - c.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2)); - if(c.session.cipherSuite !== null) { - break; - } - } - } - - // cipher suite not supported - if(c.session.cipherSuite === null) { - return c.error(c, { - message: 'No cipher suites in common.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.handshake_failure - }, - cipherSuite: forge.util.bytesToHex(msg.cipher_suite) - }); - } - - // TODO: handle compression methods - if(client) { - c.session.compressionMethod = msg.compression_method; - } else { - // no compression - c.session.compressionMethod = tls.CompressionMethod.none; - } - } - - return msg; -}; - -/** - * Creates security parameters for the given connection based on the given - * hello message. - * - * @param c the TLS connection. - * @param msg the hello message. - */ -tls.createSecurityParameters = function(c, msg) { - /* Note: security params are from TLS 1.2, some values like prf_algorithm - are ignored for TLS 1.0/1.1 and the builtin as specified in the spec is - used. */ - - // TODO: handle other options from server when more supported - - // get client and server randoms - var client = (c.entity === tls.ConnectionEnd.client); - var msgRandom = msg.random.bytes(); - var cRandom = client ? c.session.sp.client_random : msgRandom; - var sRandom = client ? msgRandom : tls.createRandom().getBytes(); - - // create new security parameters - c.session.sp = { - entity: c.entity, - prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256, - bulk_cipher_algorithm: null, - cipher_type: null, - enc_key_length: null, - block_length: null, - fixed_iv_length: null, - record_iv_length: null, - mac_algorithm: null, - mac_length: null, - mac_key_length: null, - compression_algorithm: c.session.compressionMethod, - pre_master_secret: null, - master_secret: null, - client_random: cRandom, - server_random: sRandom - }; -}; - -/** - * Called when a client receives a ServerHello record. - * - * When a ServerHello message will be sent: - * The server will send this message in response to a client hello message - * when it was able to find an acceptable set of algorithms. If it cannot - * find such a match, it will respond with a handshake failure alert. - * - * uint24 length; - * struct { - * ProtocolVersion server_version; - * Random random; - * SessionID session_id; - * CipherSuite cipher_suite; - * CompressionMethod compression_method; - * select(extensions_present) { - * case false: - * struct {}; - * case true: - * Extension extensions<0..2^16-1>; - * }; - * } ServerHello; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleServerHello = function(c, record, length) { - var msg = tls.parseHelloMessage(c, record, length); - if(c.fail) { - return; - } - - // ensure server version is compatible - if(msg.version.minor <= c.version.minor) { - c.version.minor = msg.version.minor; - } else { - return c.error(c, { - message: 'Incompatible TLS version.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - - // indicate session version has been set - c.session.version = c.version; - - // get the session ID from the message - var sessionId = msg.session_id.bytes(); - - // if the session ID is not blank and matches the cached one, resume - // the session - if(sessionId.length > 0 && sessionId === c.session.id) { - // resuming session, expect a ChangeCipherSpec next - c.expect = SCC; - c.session.resuming = true; - - // get new server random - c.session.sp.server_random = msg.random.bytes(); - } else { - // not resuming, expect a server Certificate message next - c.expect = SCE; - c.session.resuming = false; - - // create new security parameters - tls.createSecurityParameters(c, msg); - } - - // set new session ID - c.session.id = sessionId; - - // continue - c.process(); -}; - -/** - * Called when a server receives a ClientHello record. - * - * When a ClientHello message will be sent: - * When a client first connects to a server it is required to send the - * client hello as its first message. The client can also send a client - * hello in response to a hello request or on its own initiative in order - * to renegotiate the security parameters in an existing connection. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleClientHello = function(c, record, length) { - var msg = tls.parseHelloMessage(c, record, length); - if(c.fail) { - return; - } - - // get the session ID from the message - var sessionId = msg.session_id.bytes(); - - // see if the given session ID is in the cache - var session = null; - if(c.sessionCache) { - session = c.sessionCache.getSession(sessionId); - if(session === null) { - // session ID not found - sessionId = ''; - } else if(session.version.major !== msg.version.major || - session.version.minor > msg.version.minor) { - // if session version is incompatible with client version, do not resume - session = null; - sessionId = ''; - } - } - - // no session found to resume, generate a new session ID - if(sessionId.length === 0) { - sessionId = forge.random.getBytes(32); - } - - // update session - c.session.id = sessionId; - c.session.clientHelloVersion = msg.version; - c.session.sp = {}; - if(session) { - // use version and security parameters from resumed session - c.version = c.session.version = session.version; - c.session.sp = session.sp; - } else { - // use highest compatible minor version - var version; - for(var i = 1; i < tls.SupportedVersions.length; ++i) { - version = tls.SupportedVersions[i]; - if(version.minor <= msg.version.minor) { - break; - } - } - c.version = {major: version.major, minor: version.minor}; - c.session.version = c.version; - } - - // if a session is set, resume it - if(session !== null) { - // resuming session, expect a ChangeCipherSpec next - c.expect = CCC; - c.session.resuming = true; - - // get new client random - c.session.sp.client_random = msg.random.bytes(); - } else { - // not resuming, expect a Certificate or ClientKeyExchange - c.expect = (c.verifyClient !== false) ? CCE : CKE; - c.session.resuming = false; - - // create new security parameters - tls.createSecurityParameters(c, msg); - } - - // connection now open - c.open = true; - - // queue server hello - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerHello(c) - })); - - if(c.session.resuming) { - // queue change cipher spec message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - - // create pending state - c.state.pending = tls.createConnectionState(c); - - // change current write state to pending write state - c.state.current.write = c.state.pending.write; - - // queue finished - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - } else { - // queue server certificate - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - })); - - if(!c.fail) { - // queue server key exchange - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerKeyExchange(c) - })); - - // request client certificate if set - if(c.verifyClient !== false) { - // queue certificate request - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificateRequest(c) - })); - } - - // queue server hello done - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createServerHelloDone(c) - })); - } - } - - // send records - tls.flush(c); - - // continue - c.process(); -}; - -/** - * Called when a client receives a Certificate record. - * - * When this message will be sent: - * The server must send a certificate whenever the agreed-upon key exchange - * method is not an anonymous one. This message will always immediately - * follow the server hello message. - * - * Meaning of this message: - * The certificate type must be appropriate for the selected cipher suite's - * key exchange algorithm, and is generally an X.509v3 certificate. It must - * contain a key which matches the key exchange method, as follows. Unless - * otherwise specified, the signing algorithm for the certificate must be - * the same as the algorithm for the certificate key. Unless otherwise - * specified, the public key may be of any length. - * - * opaque ASN.1Cert<1..2^24-1>; - * struct { - * ASN.1Cert certificate_list<1..2^24-1>; - * } Certificate; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleCertificate = function(c, record, length) { - // minimum of 3 bytes in message - if(length < 3) { - return c.error(c, { - message: 'Invalid Certificate message. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - var b = record.fragment; - var msg = { - certificate_list: readVector(b, 3) - }; - - /* The sender's certificate will be first in the list (chain), each - subsequent one that follows will certify the previous one, but root - certificates (self-signed) that specify the certificate authority may - be omitted under the assumption that clients must already possess it. */ - var cert, asn1; - var certs = []; - try { - while(msg.certificate_list.length() > 0) { - // each entry in msg.certificate_list is a vector with 3 len bytes - cert = readVector(msg.certificate_list, 3); - asn1 = forge.asn1.fromDer(cert); - cert = forge.pki.certificateFromAsn1(asn1, true); - certs.push(cert); - } - } catch(ex) { - return c.error(c, { - message: 'Could not parse certificate list.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - } - }); - } - - // ensure at least 1 certificate was provided if in client-mode - // or if verifyClient was set to true to require a certificate - // (as opposed to 'optional') - var client = (c.entity === tls.ConnectionEnd.client); - if((client || c.verifyClient === true) && certs.length === 0) { - // error, no certificate - c.error(c, { - message: client ? - 'No server certificate provided.' : - 'No client certificate provided.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } else if(certs.length === 0) { - // no certs to verify - // expect a ServerKeyExchange or ClientKeyExchange message next - c.expect = client ? SKE : CKE; - } else { - // save certificate in session - if(client) { - c.session.serverCertificate = certs[0]; - } else { - c.session.clientCertificate = certs[0]; - } - - if(tls.verifyCertificateChain(c, certs)) { - // expect a ServerKeyExchange or ClientKeyExchange message next - c.expect = client ? SKE : CKE; - } - } - - // continue - c.process(); -}; - -/** - * Called when a client receives a ServerKeyExchange record. - * - * When this message will be sent: - * This message will be sent immediately after the server certificate - * message (or the server hello message, if this is an anonymous - * negotiation). - * - * The server key exchange message is sent by the server only when the - * server certificate message (if sent) does not contain enough data to - * allow the client to exchange a premaster secret. - * - * Meaning of this message: - * This message conveys cryptographic information to allow the client to - * communicate the premaster secret: either an RSA public key to encrypt - * the premaster secret with, or a Diffie-Hellman public key with which the - * client can complete a key exchange (with the result being the premaster - * secret.) - * - * enum { - * dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa - * } KeyExchangeAlgorithm; - * - * struct { - * opaque dh_p<1..2^16-1>; - * opaque dh_g<1..2^16-1>; - * opaque dh_Ys<1..2^16-1>; - * } ServerDHParams; - * - * struct { - * select(KeyExchangeAlgorithm) { - * case dh_anon: - * ServerDHParams params; - * case dhe_dss: - * case dhe_rsa: - * ServerDHParams params; - * digitally-signed struct { - * opaque client_random[32]; - * opaque server_random[32]; - * ServerDHParams params; - * } signed_params; - * case rsa: - * case dh_dss: - * case dh_rsa: - * struct {}; - * }; - * } ServerKeyExchange; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleServerKeyExchange = function(c, record, length) { - // this implementation only supports RSA, no Diffie-Hellman support - // so any length > 0 is invalid - if(length > 0) { - return c.error(c, { - message: 'Invalid key parameters. Only RSA is supported.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unsupported_certificate - } - }); - } - - // expect an optional CertificateRequest message next - c.expect = SCR; - - // continue - c.process(); -}; - -/** - * Called when a client receives a ClientKeyExchange record. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleClientKeyExchange = function(c, record, length) { - // this implementation only supports RSA, no Diffie-Hellman support - // so any length < 48 is invalid - if(length < 48) { - return c.error(c, { - message: 'Invalid key parameters. Only RSA is supported.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.unsupported_certificate - } - }); - } - - var b = record.fragment; - var msg = { - enc_pre_master_secret: readVector(b, 2).getBytes() - }; - - // do rsa decryption - var privateKey = null; - if(c.getPrivateKey) { - try { - privateKey = c.getPrivateKey(c, c.session.serverCertificate); - privateKey = forge.pki.privateKeyFromPem(privateKey); - } catch(ex) { - c.error(c, { - message: 'Could not get private key.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - } - - if(privateKey === null) { - return c.error(c, { - message: 'No private key set.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - - try { - // decrypt 48-byte pre-master secret - var sp = c.session.sp; - sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret); - - // ensure client hello version matches first 2 bytes - var version = c.session.clientHelloVersion; - if(version.major !== sp.pre_master_secret.charCodeAt(0) || - version.minor !== sp.pre_master_secret.charCodeAt(1)) { - // error, do not send alert (see BLEI attack below) - throw new Error('TLS version rollback attack detected.'); - } - } catch(ex) { - /* Note: Daniel Bleichenbacher [BLEI] can be used to attack a - TLS server which is using PKCS#1 encoded RSA, so instead of - failing here, we generate 48 random bytes and use that as - the pre-master secret. */ - sp.pre_master_secret = forge.random.getBytes(48); - } - - // expect a CertificateVerify message if a Certificate was received that - // does not have fixed Diffie-Hellman params, otherwise expect - // ChangeCipherSpec - c.expect = CCC; - if(c.session.clientCertificate !== null) { - // only RSA support, so expect CertificateVerify - // TODO: support Diffie-Hellman - c.expect = CCV; - } - - // continue - c.process(); -}; - -/** - * Called when a client receives a CertificateRequest record. - * - * When this message will be sent: - * A non-anonymous server can optionally request a certificate from the - * client, if appropriate for the selected cipher suite. This message, if - * sent, will immediately follow the Server Key Exchange message (if it is - * sent; otherwise, the Server Certificate message). - * - * enum { - * rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), - * rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6), - * fortezza_dms_RESERVED(20), (255) - * } ClientCertificateType; - * - * opaque DistinguishedName<1..2^16-1>; - * - * struct { - * ClientCertificateType certificate_types<1..2^8-1>; - * SignatureAndHashAlgorithm supported_signature_algorithms<2^16-1>; - * DistinguishedName certificate_authorities<0..2^16-1>; - * } CertificateRequest; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleCertificateRequest = function(c, record, length) { - // minimum of 3 bytes in message - if(length < 3) { - return c.error(c, { - message: 'Invalid CertificateRequest. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - // TODO: TLS 1.2+ has different format including - // SignatureAndHashAlgorithm after cert types - var b = record.fragment; - var msg = { - certificate_types: readVector(b, 1), - certificate_authorities: readVector(b, 2) - }; - - // save certificate request in session - c.session.certificateRequest = msg; - - // expect a ServerHelloDone message next - c.expect = SHD; - - // continue - c.process(); -}; - -/** - * Called when a server receives a CertificateVerify record. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleCertificateVerify = function(c, record, length) { - if(length < 2) { - return c.error(c, { - message: 'Invalid CertificateVerify. Message too short.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - // rewind to get full bytes for message so it can be manually - // digested below (special case for CertificateVerify messages because - // they must be digested *after* handling as opposed to all others) - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - - var msg = { - signature: readVector(b, 2).getBytes() - }; - - // TODO: add support for DSA - - // generate data to verify - var verify = forge.util.createBuffer(); - verify.putBuffer(c.session.md5.digest()); - verify.putBuffer(c.session.sha1.digest()); - verify = verify.getBytes(); - - try { - var cert = c.session.clientCertificate; - /*b = forge.pki.rsa.decrypt( - msg.signature, cert.publicKey, true, verify.length); - if(b !== verify) {*/ - if(!cert.publicKey.verify(verify, msg.signature, 'NONE')) { - throw new Error('CertificateVerify signature does not match.'); - } - - // digest message now that it has been handled - c.session.md5.update(msgBytes); - c.session.sha1.update(msgBytes); - } catch(ex) { - return c.error(c, { - message: 'Bad signature in CertificateVerify.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.handshake_failure - } - }); - } - - // expect ChangeCipherSpec - c.expect = CCC; - - // continue - c.process(); -}; - -/** - * Called when a client receives a ServerHelloDone record. - * - * When this message will be sent: - * The server hello done message is sent by the server to indicate the end - * of the server hello and associated messages. After sending this message - * the server will wait for a client response. - * - * Meaning of this message: - * This message means that the server is done sending messages to support - * the key exchange, and the client can proceed with its phase of the key - * exchange. - * - * Upon receipt of the server hello done message the client should verify - * that the server provided a valid certificate if required and check that - * the server hello parameters are acceptable. - * - * struct {} ServerHelloDone; - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleServerHelloDone = function(c, record, length) { - // len must be 0 bytes - if(length > 0) { - return c.error(c, { - message: 'Invalid ServerHelloDone message. Invalid length.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.record_overflow - } - }); - } - - if(c.serverCertificate === null) { - // no server certificate was provided - var error = { - message: 'No server certificate provided. Not enough security.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.insufficient_security - } - }; - - // call application callback - var depth = 0; - var ret = c.verify(c, error.alert.description, depth, []); - if(ret !== true) { - // check for custom alert info - if(ret || ret === 0) { - // set custom message and alert description - if(typeof ret === 'object' && !forge.util.isArray(ret)) { - if(ret.message) { - error.message = ret.message; - } - if(ret.alert) { - error.alert.description = ret.alert; - } - } else if(typeof ret === 'number') { - // set custom alert description - error.alert.description = ret; - } - } - - // send error - return c.error(c, error); - } - } - - // create client certificate message if requested - if(c.session.certificateRequest !== null) { - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - }); - tls.queue(c, record); - } - - // create client key exchange message - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createClientKeyExchange(c) - }); - tls.queue(c, record); - - // expect no messages until the following callback has been called - c.expect = SER; - - // create callback to handle client signature (for client-certs) - var callback = function(c, signature) { - if(c.session.certificateRequest !== null && - c.session.clientCertificate !== null) { - // create certificate verify message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificateVerify(c, signature) - })); - } - - // create change cipher spec message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - - // create pending state - c.state.pending = tls.createConnectionState(c); - - // change current write state to pending write state - c.state.current.write = c.state.pending.write; - - // create finished message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - - // expect a server ChangeCipherSpec message next - c.expect = SCC; - - // send records - tls.flush(c); - - // continue - c.process(); - }; - - // if there is no certificate request or no client certificate, do - // callback immediately - if(c.session.certificateRequest === null || - c.session.clientCertificate === null) { - return callback(c, null); - } - - // otherwise get the client signature - tls.getClientSignature(c, callback); -}; - -/** - * Called when a ChangeCipherSpec record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleChangeCipherSpec = function(c, record) { - if(record.fragment.getByte() !== 0x01) { - return c.error(c, { - message: 'Invalid ChangeCipherSpec message received.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.illegal_parameter - } - }); - } - - // create pending state if: - // 1. Resuming session in client mode OR - // 2. NOT resuming session in server mode - var client = (c.entity === tls.ConnectionEnd.client); - if((c.session.resuming && client) || (!c.session.resuming && !client)) { - c.state.pending = tls.createConnectionState(c); - } - - // change current read state to pending read state - c.state.current.read = c.state.pending.read; - - // clear pending state if: - // 1. NOT resuming session in client mode OR - // 2. resuming a session in server mode - if((!c.session.resuming && client) || (c.session.resuming && !client)) { - c.state.pending = null; - } - - // expect a Finished record next - c.expect = client ? SFI : CFI; - - // continue - c.process(); -}; - -/** - * Called when a Finished record is received. - * - * When this message will be sent: - * A finished message is always sent immediately after a change - * cipher spec message to verify that the key exchange and - * authentication processes were successful. It is essential that a - * change cipher spec message be received between the other - * handshake messages and the Finished message. - * - * Meaning of this message: - * The finished message is the first protected with the just- - * negotiated algorithms, keys, and secrets. Recipients of finished - * messages must verify that the contents are correct. Once a side - * has sent its Finished message and received and validated the - * Finished message from its peer, it may begin to send and receive - * application data over the connection. - * - * struct { - * opaque verify_data[verify_data_length]; - * } Finished; - * - * verify_data - * PRF(master_secret, finished_label, Hash(handshake_messages)) - * [0..verify_data_length-1]; - * - * finished_label - * For Finished messages sent by the client, the string - * "client finished". For Finished messages sent by the server, the - * string "server finished". - * - * verify_data_length depends on the cipher suite. If it is not specified - * by the cipher suite, then it is 12. Versions of TLS < 1.2 always used - * 12 bytes. - * - * @param c the connection. - * @param record the record. - * @param length the length of the handshake message. - */ -tls.handleFinished = function(c, record, length) { - // rewind to get full bytes for message so it can be manually - // digested below (special case for Finished messages because they - // must be digested *after* handling as opposed to all others) - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - - // message contains only verify_data - var vd = record.fragment.getBytes(); - - // ensure verify data is correct - b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - - // set label based on entity type - var client = (c.entity === tls.ConnectionEnd.client); - var label = client ? 'server finished' : 'client finished'; - - // TODO: determine prf function and verify length for TLS 1.2 - var sp = c.session.sp; - var vdl = 12; - var prf = prf_TLS1; - b = prf(sp.master_secret, label, b.getBytes(), vdl); - if(b.getBytes() !== vd) { - return c.error(c, { - message: 'Invalid verify_data in Finished message.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.decrypt_error - } - }); - } - - // digest finished message now that it has been handled - c.session.md5.update(msgBytes); - c.session.sha1.update(msgBytes); - - // resuming session as client or NOT resuming session as server - if((c.session.resuming && client) || (!c.session.resuming && !client)) { - // create change cipher spec message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.change_cipher_spec, - data: tls.createChangeCipherSpec() - })); - - // change current write state to pending write state, clear pending - c.state.current.write = c.state.pending.write; - c.state.pending = null; - - // create finished message - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createFinished(c) - })); - } - - // expect application data next - c.expect = client ? SAD : CAD; - - // handshake complete - c.handshaking = false; - ++c.handshakes; - - // save access to peer certificate - c.peerCertificate = client ? - c.session.serverCertificate : c.session.clientCertificate; - - // send records - tls.flush(c); - - // now connected - c.isConnected = true; - c.connected(c); - - // continue - c.process(); -}; - -/** - * Called when an Alert record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleAlert = function(c, record) { - // read alert - var b = record.fragment; - var alert = { - level: b.getByte(), - description: b.getByte() - }; - - // TODO: consider using a table? - // get appropriate message - var msg; - switch(alert.description) { - case tls.Alert.Description.close_notify: - msg = 'Connection closed.'; - break; - case tls.Alert.Description.unexpected_message: - msg = 'Unexpected message.'; - break; - case tls.Alert.Description.bad_record_mac: - msg = 'Bad record MAC.'; - break; - case tls.Alert.Description.decryption_failed: - msg = 'Decryption failed.'; - break; - case tls.Alert.Description.record_overflow: - msg = 'Record overflow.'; - break; - case tls.Alert.Description.decompression_failure: - msg = 'Decompression failed.'; - break; - case tls.Alert.Description.handshake_failure: - msg = 'Handshake failure.'; - break; - case tls.Alert.Description.bad_certificate: - msg = 'Bad certificate.'; - break; - case tls.Alert.Description.unsupported_certificate: - msg = 'Unsupported certificate.'; - break; - case tls.Alert.Description.certificate_revoked: - msg = 'Certificate revoked.'; - break; - case tls.Alert.Description.certificate_expired: - msg = 'Certificate expired.'; - break; - case tls.Alert.Description.certificate_unknown: - msg = 'Certificate unknown.'; - break; - case tls.Alert.Description.illegal_parameter: - msg = 'Illegal parameter.'; - break; - case tls.Alert.Description.unknown_ca: - msg = 'Unknown certificate authority.'; - break; - case tls.Alert.Description.access_denied: - msg = 'Access denied.'; - break; - case tls.Alert.Description.decode_error: - msg = 'Decode error.'; - break; - case tls.Alert.Description.decrypt_error: - msg = 'Decrypt error.'; - break; - case tls.Alert.Description.export_restriction: - msg = 'Export restriction.'; - break; - case tls.Alert.Description.protocol_version: - msg = 'Unsupported protocol version.'; - break; - case tls.Alert.Description.insufficient_security: - msg = 'Insufficient security.'; - break; - case tls.Alert.Description.internal_error: - msg = 'Internal error.'; - break; - case tls.Alert.Description.user_canceled: - msg = 'User canceled.'; - break; - case tls.Alert.Description.no_renegotiation: - msg = 'Renegotiation not supported.'; - break; - default: - msg = 'Unknown error.'; - break; - } - - // close connection on close_notify, not an error - if(alert.description === tls.Alert.Description.close_notify) { - return c.close(); - } - - // call error handler - c.error(c, { - message: msg, - send: false, - // origin is the opposite end - origin: (c.entity === tls.ConnectionEnd.client) ? 'server' : 'client', - alert: alert - }); - - // continue - c.process(); -}; - -/** - * Called when a Handshake record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleHandshake = function(c, record) { - // get the handshake type and message length - var b = record.fragment; - var type = b.getByte(); - var length = b.getInt24(); - - // see if the record fragment doesn't yet contain the full message - if(length > b.length()) { - // cache the record, clear its fragment, and reset the buffer read - // pointer before the type and length were read - c.fragmented = record; - record.fragment = forge.util.createBuffer(); - b.read -= 4; - - // continue - return c.process(); - } - - // full message now available, clear cache, reset read pointer to - // before type and length - c.fragmented = null; - b.read -= 4; - - // save the handshake bytes for digestion after handler is found - // (include type and length of handshake msg) - var bytes = b.bytes(length + 4); - - // restore read pointer - b.read += 4; - - // handle expected message - if(type in hsTable[c.entity][c.expect]) { - // initialize server session - if(c.entity === tls.ConnectionEnd.server && !c.open && !c.fail) { - c.handshaking = true; - c.session = { - version: null, - extensions: { - server_name: { - serverNameList: [] - } - }, - cipherSuite: null, - compressionMethod: null, - serverCertificate: null, - clientCertificate: null, - md5: forge.md.md5.create(), - sha1: forge.md.sha1.create() - }; - } - - /* Update handshake messages digest. Finished and CertificateVerify - messages are not digested here. They can't be digested as part of - the verify_data that they contain. These messages are manually - digested in their handlers. HelloRequest messages are simply never - included in the handshake message digest according to spec. */ - if(type !== tls.HandshakeType.hello_request && - type !== tls.HandshakeType.certificate_verify && - type !== tls.HandshakeType.finished) { - c.session.md5.update(bytes); - c.session.sha1.update(bytes); - } - - // handle specific handshake type record - hsTable[c.entity][c.expect][type](c, record, length); - } else { - // unexpected record - tls.handleUnexpected(c, record); - } -}; - -/** - * Called when an ApplicationData record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleApplicationData = function(c, record) { - // buffer data, notify that its ready - c.data.putBuffer(record.fragment); - c.dataReady(c); - - // continue - c.process(); -}; - -/** - * Called when a Heartbeat record is received. - * - * @param c the connection. - * @param record the record. - */ -tls.handleHeartbeat = function(c, record) { - // get the heartbeat type and payload - var b = record.fragment; - var type = b.getByte(); - var length = b.getInt16(); - var payload = b.getBytes(length); - - if(type === tls.HeartbeatMessageType.heartbeat_request) { - // discard request during handshake or if length is too large - if(c.handshaking || length > payload.length) { - // continue - return c.process(); - } - // retransmit payload - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_response, payload) - })); - tls.flush(c); - } else if(type === tls.HeartbeatMessageType.heartbeat_response) { - // check payload against expected payload, discard heartbeat if no match - if(payload !== c.expectedHeartbeatPayload) { - // continue - return c.process(); - } - - // notify that a valid heartbeat was received - if(c.heartbeatReceived) { - c.heartbeatReceived(c, forge.util.createBuffer(payload)); - } - } - - // continue - c.process(); -}; - -/** - * The transistional state tables for receiving TLS records. It maps the - * current TLS engine state and a received record to a function to handle the - * record and update the state. - * - * For instance, if the current state is SHE, then the TLS engine is expecting - * a ServerHello record. Once a record is received, the handler function is - * looked up using the state SHE and the record's content type. - * - * The resulting function will either be an error handler or a record handler. - * The function will take whatever action is appropriate and update the state - * for the next record. - * - * The states are all based on possible server record types. Note that the - * client will never specifically expect to receive a HelloRequest or an alert - * from the server so there is no state that reflects this. These messages may - * occur at any time. - * - * There are two tables for mapping states because there is a second tier of - * types for handshake messages. Once a record with a content type of handshake - * is received, the handshake record handler will look up the handshake type in - * the secondary map to get its appropriate handler. - * - * Valid message orders are as follows: - * - * =======================FULL HANDSHAKE====================== - * Client Server - * - * ClientHello --------> - * ServerHello - * Certificate* - * ServerKeyExchange* - * CertificateRequest* - * <-------- ServerHelloDone - * Certificate* - * ClientKeyExchange - * CertificateVerify* - * [ChangeCipherSpec] - * Finished --------> - * [ChangeCipherSpec] - * <-------- Finished - * Application Data <-------> Application Data - * - * =====================SESSION RESUMPTION===================== - * Client Server - * - * ClientHello --------> - * ServerHello - * [ChangeCipherSpec] - * <-------- Finished - * [ChangeCipherSpec] - * Finished --------> - * Application Data <-------> Application Data - */ -// client expect states (indicate which records are expected to be received) -var SHE = 0; // rcv server hello -var SCE = 1; // rcv server certificate -var SKE = 2; // rcv server key exchange -var SCR = 3; // rcv certificate request -var SHD = 4; // rcv server hello done -var SCC = 5; // rcv change cipher spec -var SFI = 6; // rcv finished -var SAD = 7; // rcv application data -var SER = 8; // not expecting any messages at this point - -// server expect states -var CHE = 0; // rcv client hello -var CCE = 1; // rcv client certificate -var CKE = 2; // rcv client key exchange -var CCV = 3; // rcv certificate verify -var CCC = 4; // rcv change cipher spec -var CFI = 5; // rcv finished -var CAD = 6; // rcv application data -var CER = 7; // not expecting any messages at this point - -// map client current expect state and content type to function -var __ = tls.handleUnexpected; -var R0 = tls.handleChangeCipherSpec; -var R1 = tls.handleAlert; -var R2 = tls.handleHandshake; -var R3 = tls.handleApplicationData; -var R4 = tls.handleHeartbeat; -var ctTable = []; -ctTable[tls.ConnectionEnd.client] = [ -// CC,AL,HS,AD,HB -/*SHE*/[__,R1,R2,__,R4], -/*SCE*/[__,R1,R2,__,R4], -/*SKE*/[__,R1,R2,__,R4], -/*SCR*/[__,R1,R2,__,R4], -/*SHD*/[__,R1,R2,__,R4], -/*SCC*/[R0,R1,__,__,R4], -/*SFI*/[__,R1,R2,__,R4], -/*SAD*/[__,R1,R2,R3,R4], -/*SER*/[__,R1,R2,__,R4] -]; - -// map server current expect state and content type to function -ctTable[tls.ConnectionEnd.server] = [ -// CC,AL,HS,AD -/*CHE*/[__,R1,R2,__,R4], -/*CCE*/[__,R1,R2,__,R4], -/*CKE*/[__,R1,R2,__,R4], -/*CCV*/[__,R1,R2,__,R4], -/*CCC*/[R0,R1,__,__,R4], -/*CFI*/[__,R1,R2,__,R4], -/*CAD*/[__,R1,R2,R3,R4], -/*CER*/[__,R1,R2,__,R4] -]; - -// map client current expect state and handshake type to function -var H0 = tls.handleHelloRequest; -var H1 = tls.handleServerHello; -var H2 = tls.handleCertificate; -var H3 = tls.handleServerKeyExchange; -var H4 = tls.handleCertificateRequest; -var H5 = tls.handleServerHelloDone; -var H6 = tls.handleFinished; -var hsTable = []; -hsTable[tls.ConnectionEnd.client] = [ -// HR,01,SH,03,04,05,06,07,08,09,10,SC,SK,CR,HD,15,CK,17,18,19,FI -/*SHE*/[__,__,H1,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*SCE*/[H0,__,__,__,__,__,__,__,__,__,__,H2,H3,H4,H5,__,__,__,__,__,__], -/*SKE*/[H0,__,__,__,__,__,__,__,__,__,__,__,H3,H4,H5,__,__,__,__,__,__], -/*SCR*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,H4,H5,__,__,__,__,__,__], -/*SHD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,H5,__,__,__,__,__,__], -/*SCC*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*SFI*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6], -/*SAD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*SER*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__] -]; - -// map server current expect state and handshake type to function -// Note: CAD[CH] does not map to FB because renegotation is prohibited -var H7 = tls.handleClientHello; -var H8 = tls.handleClientKeyExchange; -var H9 = tls.handleCertificateVerify; -hsTable[tls.ConnectionEnd.server] = [ -// 01,CH,02,03,04,05,06,07,08,09,10,CC,12,13,14,CV,CK,17,18,19,FI -/*CHE*/[__,H7,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*CCE*/[__,__,__,__,__,__,__,__,__,__,__,H2,__,__,__,__,__,__,__,__,__], -/*CKE*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H8,__,__,__,__], -/*CCV*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H9,__,__,__,__,__], -/*CCC*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*CFI*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6], -/*CAD*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__], -/*CER*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__] -]; - -/** - * Generates the master_secret and keys using the given security parameters. - * - * The security parameters for a TLS connection state are defined as such: - * - * struct { - * ConnectionEnd entity; - * PRFAlgorithm prf_algorithm; - * BulkCipherAlgorithm bulk_cipher_algorithm; - * CipherType cipher_type; - * uint8 enc_key_length; - * uint8 block_length; - * uint8 fixed_iv_length; - * uint8 record_iv_length; - * MACAlgorithm mac_algorithm; - * uint8 mac_length; - * uint8 mac_key_length; - * CompressionMethod compression_algorithm; - * opaque master_secret[48]; - * opaque client_random[32]; - * opaque server_random[32]; - * } SecurityParameters; - * - * Note that this definition is from TLS 1.2. In TLS 1.0 some of these - * parameters are ignored because, for instance, the PRFAlgorithm is a - * builtin-fixed algorithm combining iterations of MD5 and SHA-1 in TLS 1.0. - * - * The Record Protocol requires an algorithm to generate keys required by the - * current connection state. - * - * The master secret is expanded into a sequence of secure bytes, which is then - * split to a client write MAC key, a server write MAC key, a client write - * encryption key, and a server write encryption key. In TLS 1.0 a client write - * IV and server write IV are also generated. Each of these is generated from - * the byte sequence in that order. Unused values are empty. In TLS 1.2, some - * AEAD ciphers may additionally require a client write IV and a server write - * IV (see Section 6.2.3.3). - * - * When keys, MAC keys, and IVs are generated, the master secret is used as an - * entropy source. - * - * To generate the key material, compute: - * - * master_secret = PRF(pre_master_secret, "master secret", - * ClientHello.random + ServerHello.random) - * - * key_block = PRF(SecurityParameters.master_secret, - * "key expansion", - * SecurityParameters.server_random + - * SecurityParameters.client_random); - * - * until enough output has been generated. Then, the key_block is - * partitioned as follows: - * - * client_write_MAC_key[SecurityParameters.mac_key_length] - * server_write_MAC_key[SecurityParameters.mac_key_length] - * client_write_key[SecurityParameters.enc_key_length] - * server_write_key[SecurityParameters.enc_key_length] - * client_write_IV[SecurityParameters.fixed_iv_length] - * server_write_IV[SecurityParameters.fixed_iv_length] - * - * In TLS 1.2, the client_write_IV and server_write_IV are only generated for - * implicit nonce techniques as described in Section 3.2.1 of [AEAD]. This - * implementation uses TLS 1.0 so IVs are generated. - * - * Implementation note: The currently defined cipher suite which requires the - * most material is AES_256_CBC_SHA256. It requires 2 x 32 byte keys and 2 x 32 - * byte MAC keys, for a total 128 bytes of key material. In TLS 1.0 it also - * requires 2 x 16 byte IVs, so it actually takes 160 bytes of key material. - * - * @param c the connection. - * @param sp the security parameters to use. - * - * @return the security keys. - */ -tls.generateKeys = function(c, sp) { - // TLS_RSA_WITH_AES_128_CBC_SHA (required to be compliant with TLS 1.2) & - // TLS_RSA_WITH_AES_256_CBC_SHA are the only cipher suites implemented - // at present - - // TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA is required to be compliant with - // TLS 1.0 but we don't care right now because AES is better and we have - // an implementation for it - - // TODO: TLS 1.2 implementation - /* - // determine the PRF - var prf; - switch(sp.prf_algorithm) { - case tls.PRFAlgorithm.tls_prf_sha256: - prf = prf_sha256; - break; - default: - // should never happen - throw new Error('Invalid PRF'); - } - */ - - // TLS 1.0/1.1 implementation - var prf = prf_TLS1; - - // concatenate server and client random - var random = sp.client_random + sp.server_random; - - // only create master secret if session is new - if(!c.session.resuming) { - // create master secret, clean up pre-master secret - sp.master_secret = prf( - sp.pre_master_secret, 'master secret', random, 48).bytes(); - sp.pre_master_secret = null; - } - - // generate the amount of key material needed - random = sp.server_random + sp.client_random; - var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length; - - // include IV for TLS/1.0 - var tls10 = (c.version.major === tls.Versions.TLS_1_0.major && - c.version.minor === tls.Versions.TLS_1_0.minor); - if(tls10) { - length += 2 * sp.fixed_iv_length; - } - var km = prf(sp.master_secret, 'key expansion', random, length); - - // split the key material into the MAC and encryption keys - var rval = { - client_write_MAC_key: km.getBytes(sp.mac_key_length), - server_write_MAC_key: km.getBytes(sp.mac_key_length), - client_write_key: km.getBytes(sp.enc_key_length), - server_write_key: km.getBytes(sp.enc_key_length) - }; - - // include TLS 1.0 IVs - if(tls10) { - rval.client_write_IV = km.getBytes(sp.fixed_iv_length); - rval.server_write_IV = km.getBytes(sp.fixed_iv_length); - } - - return rval; -}; - -/** - * Creates a new initialized TLS connection state. A connection state has - * a read mode and a write mode. - * - * compression state: - * The current state of the compression algorithm. - * - * cipher state: - * The current state of the encryption algorithm. This will consist of the - * scheduled key for that connection. For stream ciphers, this will also - * contain whatever state information is necessary to allow the stream to - * continue to encrypt or decrypt data. - * - * MAC key: - * The MAC key for the connection. - * - * sequence number: - * Each connection state contains a sequence number, which is maintained - * separately for read and write states. The sequence number MUST be set to - * zero whenever a connection state is made the active state. Sequence - * numbers are of type uint64 and may not exceed 2^64-1. Sequence numbers do - * not wrap. If a TLS implementation would need to wrap a sequence number, - * it must renegotiate instead. A sequence number is incremented after each - * record: specifically, the first record transmitted under a particular - * connection state MUST use sequence number 0. - * - * @param c the connection. - * - * @return the new initialized TLS connection state. - */ -tls.createConnectionState = function(c) { - var client = (c.entity === tls.ConnectionEnd.client); - - var createMode = function() { - var mode = { - // two 32-bit numbers, first is most significant - sequenceNumber: [0, 0], - macKey: null, - macLength: 0, - macFunction: null, - cipherState: null, - cipherFunction: function(record) {return true;}, - compressionState: null, - compressFunction: function(record) {return true;}, - updateSequenceNumber: function() { - if(mode.sequenceNumber[1] === 0xFFFFFFFF) { - mode.sequenceNumber[1] = 0; - ++mode.sequenceNumber[0]; - } else { - ++mode.sequenceNumber[1]; - } - } - }; - return mode; - }; - var state = { - read: createMode(), - write: createMode() - }; - - // update function in read mode will decrypt then decompress a record - state.read.update = function(c, record) { - if(!state.read.cipherFunction(record, state.read)) { - c.error(c, { - message: 'Could not decrypt record or bad MAC.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - // doesn't matter if decryption failed or MAC was - // invalid, return the same error so as not to reveal - // which one occurred - description: tls.Alert.Description.bad_record_mac - } - }); - } else if(!state.read.compressFunction(c, record, state.read)) { - c.error(c, { - message: 'Could not decompress record.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.decompression_failure - } - }); - } - return !c.fail; - }; - - // update function in write mode will compress then encrypt a record - state.write.update = function(c, record) { - if(!state.write.compressFunction(c, record, state.write)) { - // error, but do not send alert since it would require - // compression as well - c.error(c, { - message: 'Could not compress record.', - send: false, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } else if(!state.write.cipherFunction(record, state.write)) { - // error, but do not send alert since it would require - // encryption as well - c.error(c, { - message: 'Could not encrypt record.', - send: false, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - return !c.fail; - }; - - // handle security parameters - if(c.session) { - var sp = c.session.sp; - c.session.cipherSuite.initSecurityParameters(sp); - - // generate keys - sp.keys = tls.generateKeys(c, sp); - state.read.macKey = client ? - sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key; - state.write.macKey = client ? - sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key; - - // cipher suite setup - c.session.cipherSuite.initConnectionState(state, c, sp); - - // compression setup - switch(sp.compression_algorithm) { - case tls.CompressionMethod.none: - break; - case tls.CompressionMethod.deflate: - state.read.compressFunction = inflate; - state.write.compressFunction = deflate; - break; - default: - throw new Error('Unsupported compression algorithm.'); - } - } - - return state; -}; - -/** - * Creates a Random structure. - * - * struct { - * uint32 gmt_unix_time; - * opaque random_bytes[28]; - * } Random; - * - * gmt_unix_time: - * The current time and date in standard UNIX 32-bit format (seconds since - * the midnight starting Jan 1, 1970, UTC, ignoring leap seconds) according - * to the sender's internal clock. Clocks are not required to be set - * correctly by the basic TLS protocol; higher-level or application - * protocols may define additional requirements. Note that, for historical - * reasons, the data element is named using GMT, the predecessor of the - * current worldwide time base, UTC. - * random_bytes: - * 28 bytes generated by a secure random number generator. - * - * @return the Random structure as a byte array. - */ -tls.createRandom = function() { - // get UTC milliseconds - var d = new Date(); - var utc = +d + d.getTimezoneOffset() * 60000; - var rval = forge.util.createBuffer(); - rval.putInt32(utc); - rval.putBytes(forge.random.getBytes(28)); - return rval; -}; - -/** - * Creates a TLS record with the given type and data. - * - * @param c the connection. - * @param options: - * type: the record type. - * data: the plain text data in a byte buffer. - * - * @return the created record. - */ -tls.createRecord = function(c, options) { - if(!options.data) { - return null; - } - var record = { - type: options.type, - version: { - major: c.version.major, - minor: c.version.minor - }, - length: options.data.length(), - fragment: options.data - }; - return record; -}; - -/** - * Creates a TLS alert record. - * - * @param c the connection. - * @param alert: - * level: the TLS alert level. - * description: the TLS alert description. - * - * @return the created alert record. - */ -tls.createAlert = function(c, alert) { - var b = forge.util.createBuffer(); - b.putByte(alert.level); - b.putByte(alert.description); - return tls.createRecord(c, { - type: tls.ContentType.alert, - data: b - }); -}; - -/* The structure of a TLS handshake message. - * - * struct { - * HandshakeType msg_type; // handshake type - * uint24 length; // bytes in message - * select(HandshakeType) { - * case hello_request: HelloRequest; - * case client_hello: ClientHello; - * case server_hello: ServerHello; - * case certificate: Certificate; - * case server_key_exchange: ServerKeyExchange; - * case certificate_request: CertificateRequest; - * case server_hello_done: ServerHelloDone; - * case certificate_verify: CertificateVerify; - * case client_key_exchange: ClientKeyExchange; - * case finished: Finished; - * } body; - * } Handshake; - */ - -/** - * Creates a ClientHello message. - * - * opaque SessionID<0..32>; - * enum { null(0), deflate(1), (255) } CompressionMethod; - * uint8 CipherSuite[2]; - * - * struct { - * ProtocolVersion client_version; - * Random random; - * SessionID session_id; - * CipherSuite cipher_suites<2..2^16-2>; - * CompressionMethod compression_methods<1..2^8-1>; - * select(extensions_present) { - * case false: - * struct {}; - * case true: - * Extension extensions<0..2^16-1>; - * }; - * } ClientHello; - * - * The extension format for extended client hellos and server hellos is: - * - * struct { - * ExtensionType extension_type; - * opaque extension_data<0..2^16-1>; - * } Extension; - * - * Here: - * - * - "extension_type" identifies the particular extension type. - * - "extension_data" contains information specific to the particular - * extension type. - * - * The extension types defined in this document are: - * - * enum { - * server_name(0), max_fragment_length(1), - * client_certificate_url(2), trusted_ca_keys(3), - * truncated_hmac(4), status_request(5), (65535) - * } ExtensionType; - * - * @param c the connection. - * - * @return the ClientHello byte buffer. - */ -tls.createClientHello = function(c) { - // save hello version - c.session.clientHelloVersion = { - major: c.version.major, - minor: c.version.minor - }; - - // create supported cipher suites - var cipherSuites = forge.util.createBuffer(); - for(var i = 0; i < c.cipherSuites.length; ++i) { - var cs = c.cipherSuites[i]; - cipherSuites.putByte(cs.id[0]); - cipherSuites.putByte(cs.id[1]); - } - var cSuites = cipherSuites.length(); - - // create supported compression methods, null always supported, but - // also support deflate if connection has inflate and deflate methods - var compressionMethods = forge.util.createBuffer(); - compressionMethods.putByte(tls.CompressionMethod.none); - // FIXME: deflate support disabled until issues with raw deflate data - // without zlib headers are resolved - /* - if(c.inflate !== null && c.deflate !== null) { - compressionMethods.putByte(tls.CompressionMethod.deflate); - } - */ - var cMethods = compressionMethods.length(); - - // create TLS SNI (server name indication) extension if virtual host - // has been specified, see RFC 3546 - var extensions = forge.util.createBuffer(); - if(c.virtualHost) { - // create extension struct - var ext = forge.util.createBuffer(); - ext.putByte(0x00); // type server_name (ExtensionType is 2 bytes) - ext.putByte(0x00); - - /* In order to provide the server name, clients MAY include an - * extension of type "server_name" in the (extended) client hello. - * The "extension_data" field of this extension SHALL contain - * "ServerNameList" where: - * - * struct { - * NameType name_type; - * select(name_type) { - * case host_name: HostName; - * } name; - * } ServerName; - * - * enum { - * host_name(0), (255) - * } NameType; - * - * opaque HostName<1..2^16-1>; - * - * struct { - * ServerName server_name_list<1..2^16-1> - * } ServerNameList; - */ - var serverName = forge.util.createBuffer(); - serverName.putByte(0x00); // type host_name - writeVector(serverName, 2, forge.util.createBuffer(c.virtualHost)); - - // ServerNameList is in extension_data - var snList = forge.util.createBuffer(); - writeVector(snList, 2, serverName); - writeVector(ext, 2, snList); - extensions.putBuffer(ext); - } - var extLength = extensions.length(); - if(extLength > 0) { - // add extension vector length - extLength += 2; - } - - // determine length of the handshake message - // cipher suites and compression methods size will need to be - // updated if more get added to the list - var sessionId = c.session.id; - var length = - sessionId.length + 1 + // session ID vector - 2 + // version (major + minor) - 4 + 28 + // random time and random bytes - 2 + cSuites + // cipher suites vector - 1 + cMethods + // compression methods vector - extLength; // extensions vector - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.client_hello); - rval.putInt24(length); // handshake length - rval.putByte(c.version.major); // major version - rval.putByte(c.version.minor); // minor version - rval.putBytes(c.session.sp.client_random); // random time + bytes - writeVector(rval, 1, forge.util.createBuffer(sessionId)); - writeVector(rval, 2, cipherSuites); - writeVector(rval, 1, compressionMethods); - if(extLength > 0) { - writeVector(rval, 2, extensions); - } - return rval; -}; - -/** - * Creates a ServerHello message. - * - * @param c the connection. - * - * @return the ServerHello byte buffer. - */ -tls.createServerHello = function(c) { - // determine length of the handshake message - var sessionId = c.session.id; - var length = - sessionId.length + 1 + // session ID vector - 2 + // version (major + minor) - 4 + 28 + // random time and random bytes - 2 + // chosen cipher suite - 1; // chosen compression method - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.server_hello); - rval.putInt24(length); // handshake length - rval.putByte(c.version.major); // major version - rval.putByte(c.version.minor); // minor version - rval.putBytes(c.session.sp.server_random); // random time + bytes - writeVector(rval, 1, forge.util.createBuffer(sessionId)); - rval.putByte(c.session.cipherSuite.id[0]); - rval.putByte(c.session.cipherSuite.id[1]); - rval.putByte(c.session.compressionMethod); - return rval; -}; - -/** - * Creates a Certificate message. - * - * When this message will be sent: - * This is the first message the client can send after receiving a server - * hello done message and the first message the server can send after - * sending a ServerHello. This client message is only sent if the server - * requests a certificate. If no suitable certificate is available, the - * client should send a certificate message containing no certificates. If - * client authentication is required by the server for the handshake to - * continue, it may respond with a fatal handshake failure alert. - * - * opaque ASN.1Cert<1..2^24-1>; - * - * struct { - * ASN.1Cert certificate_list<0..2^24-1>; - * } Certificate; - * - * @param c the connection. - * - * @return the Certificate byte buffer. - */ -tls.createCertificate = function(c) { - // TODO: check certificate request to ensure types are supported - - // get a certificate (a certificate as a PEM string) - var client = (c.entity === tls.ConnectionEnd.client); - var cert = null; - if(c.getCertificate) { - var hint; - if(client) { - hint = c.session.certificateRequest; - } else { - hint = c.session.extensions.server_name.serverNameList; - } - cert = c.getCertificate(c, hint); - } - - // buffer to hold certificate list - var certList = forge.util.createBuffer(); - if(cert !== null) { - try { - // normalize cert to a chain of certificates - if(!forge.util.isArray(cert)) { - cert = [cert]; - } - var asn1 = null; - for(var i = 0; i < cert.length; ++i) { - var msg = forge.pem.decode(cert[i])[0]; - if(msg.type !== 'CERTIFICATE' && - msg.type !== 'X509 CERTIFICATE' && - msg.type !== 'TRUSTED CERTIFICATE') { - var error = new Error('Could not convert certificate from PEM; PEM ' + - 'header type is not "CERTIFICATE", "X509 CERTIFICATE", or ' + - '"TRUSTED CERTIFICATE".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert certificate from PEM; PEM is encrypted.'); - } - - var der = forge.util.createBuffer(msg.body); - if(asn1 === null) { - asn1 = forge.asn1.fromDer(der.bytes(), false); - } - - // certificate entry is itself a vector with 3 length bytes - var certBuffer = forge.util.createBuffer(); - writeVector(certBuffer, 3, der); - - // add cert vector to cert list vector - certList.putBuffer(certBuffer); - } - - // save certificate - cert = forge.pki.certificateFromAsn1(asn1); - if(client) { - c.session.clientCertificate = cert; - } else { - c.session.serverCertificate = cert; - } - } catch(ex) { - return c.error(c, { - message: 'Could not send certificate list.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - } - }); - } - } - - // determine length of the handshake message - var length = 3 + certList.length(); // cert list vector - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate); - rval.putInt24(length); - writeVector(rval, 3, certList); - return rval; -}; - -/** - * Creates a ClientKeyExchange message. - * - * When this message will be sent: - * This message is always sent by the client. It will immediately follow the - * client certificate message, if it is sent. Otherwise it will be the first - * message sent by the client after it receives the server hello done - * message. - * - * Meaning of this message: - * With this message, the premaster secret is set, either though direct - * transmission of the RSA-encrypted secret, or by the transmission of - * Diffie-Hellman parameters which will allow each side to agree upon the - * same premaster secret. When the key exchange method is DH_RSA or DH_DSS, - * client certification has been requested, and the client was able to - * respond with a certificate which contained a Diffie-Hellman public key - * whose parameters (group and generator) matched those specified by the - * server in its certificate, this message will not contain any data. - * - * Meaning of this message: - * If RSA is being used for key agreement and authentication, the client - * generates a 48-byte premaster secret, encrypts it using the public key - * from the server's certificate or the temporary RSA key provided in a - * server key exchange message, and sends the result in an encrypted - * premaster secret message. This structure is a variant of the client - * key exchange message, not a message in itself. - * - * struct { - * select(KeyExchangeAlgorithm) { - * case rsa: EncryptedPreMasterSecret; - * case diffie_hellman: ClientDiffieHellmanPublic; - * } exchange_keys; - * } ClientKeyExchange; - * - * struct { - * ProtocolVersion client_version; - * opaque random[46]; - * } PreMasterSecret; - * - * struct { - * public-key-encrypted PreMasterSecret pre_master_secret; - * } EncryptedPreMasterSecret; - * - * A public-key-encrypted element is encoded as a vector <0..2^16-1>. - * - * @param c the connection. - * - * @return the ClientKeyExchange byte buffer. - */ -tls.createClientKeyExchange = function(c) { - // create buffer to encrypt - var b = forge.util.createBuffer(); - - // add highest client-supported protocol to help server avoid version - // rollback attacks - b.putByte(c.session.clientHelloVersion.major); - b.putByte(c.session.clientHelloVersion.minor); - - // generate and add 46 random bytes - b.putBytes(forge.random.getBytes(46)); - - // save pre-master secret - var sp = c.session.sp; - sp.pre_master_secret = b.getBytes(); - - // RSA-encrypt the pre-master secret - var key = c.session.serverCertificate.publicKey; - b = key.encrypt(sp.pre_master_secret); - - /* Note: The encrypted pre-master secret will be stored in a - public-key-encrypted opaque vector that has the length prefixed using - 2 bytes, so include those 2 bytes in the handshake message length. This - is done as a minor optimization instead of calling writeVector(). */ - - // determine length of the handshake message - var length = b.length + 2; - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.client_key_exchange); - rval.putInt24(length); - // add vector length bytes - rval.putInt16(b.length); - rval.putBytes(b); - return rval; -}; - -/** - * Creates a ServerKeyExchange message. - * - * @param c the connection. - * - * @return the ServerKeyExchange byte buffer. - */ -tls.createServerKeyExchange = function(c) { - // this implementation only supports RSA, no Diffie-Hellman support, - // so this record is empty - - // determine length of the handshake message - var length = 0; - - // build record fragment - var rval = forge.util.createBuffer(); - if(length > 0) { - rval.putByte(tls.HandshakeType.server_key_exchange); - rval.putInt24(length); - } - return rval; -}; - -/** - * Gets the signed data used to verify a client-side certificate. See - * tls.createCertificateVerify() for details. - * - * @param c the connection. - * @param callback the callback to call once the signed data is ready. - */ -tls.getClientSignature = function(c, callback) { - // generate data to RSA encrypt - var b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - b = b.getBytes(); - - // create default signing function as necessary - c.getSignature = c.getSignature || function(c, b, callback) { - // do rsa encryption, call callback - var privateKey = null; - if(c.getPrivateKey) { - try { - privateKey = c.getPrivateKey(c, c.session.clientCertificate); - privateKey = forge.pki.privateKeyFromPem(privateKey); - } catch(ex) { - c.error(c, { - message: 'Could not get private key.', - cause: ex, - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } - } - if(privateKey === null) { - c.error(c, { - message: 'No private key set.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.internal_error - } - }); - } else { - b = privateKey.sign(b, null); - } - callback(c, b); - }; - - // get client signature - c.getSignature(c, b, callback); -}; - -/** - * Creates a CertificateVerify message. - * - * Meaning of this message: - * This structure conveys the client's Diffie-Hellman public value - * (Yc) if it was not already included in the client's certificate. - * The encoding used for Yc is determined by the enumerated - * PublicValueEncoding. This structure is a variant of the client - * key exchange message, not a message in itself. - * - * When this message will be sent: - * This message is used to provide explicit verification of a client - * certificate. This message is only sent following a client - * certificate that has signing capability (i.e. all certificates - * except those containing fixed Diffie-Hellman parameters). When - * sent, it will immediately follow the client key exchange message. - * - * struct { - * Signature signature; - * } CertificateVerify; - * - * CertificateVerify.signature.md5_hash - * MD5(handshake_messages); - * - * Certificate.signature.sha_hash - * SHA(handshake_messages); - * - * Here handshake_messages refers to all handshake messages sent or - * received starting at client hello up to but not including this - * message, including the type and length fields of the handshake - * messages. - * - * select(SignatureAlgorithm) { - * case anonymous: struct { }; - * case rsa: - * digitally-signed struct { - * opaque md5_hash[16]; - * opaque sha_hash[20]; - * }; - * case dsa: - * digitally-signed struct { - * opaque sha_hash[20]; - * }; - * } Signature; - * - * In digital signing, one-way hash functions are used as input for a - * signing algorithm. A digitally-signed element is encoded as an opaque - * vector <0..2^16-1>, where the length is specified by the signing - * algorithm and key. - * - * In RSA signing, a 36-byte structure of two hashes (one SHA and one - * MD5) is signed (encrypted with the private key). It is encoded with - * PKCS #1 block type 0 or type 1 as described in [PKCS1]. - * - * In DSS, the 20 bytes of the SHA hash are run directly through the - * Digital Signing Algorithm with no additional hashing. - * - * @param c the connection. - * @param signature the signature to include in the message. - * - * @return the CertificateVerify byte buffer. - */ -tls.createCertificateVerify = function(c, signature) { - /* Note: The signature will be stored in a "digitally-signed" opaque - vector that has the length prefixed using 2 bytes, so include those - 2 bytes in the handshake message length. This is done as a minor - optimization instead of calling writeVector(). */ - - // determine length of the handshake message - var length = signature.length + 2; - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate_verify); - rval.putInt24(length); - // add vector length bytes - rval.putInt16(signature.length); - rval.putBytes(signature); - return rval; -}; - -/** - * Creates a CertificateRequest message. - * - * @param c the connection. - * - * @return the CertificateRequest byte buffer. - */ -tls.createCertificateRequest = function(c) { - // TODO: support other certificate types - var certTypes = forge.util.createBuffer(); - - // common RSA certificate type - certTypes.putByte(0x01); - - // add distinguished names from CA store - var cAs = forge.util.createBuffer(); - for(var key in c.caStore.certs) { - var cert = c.caStore.certs[key]; - var dn = forge.pki.distinguishedNameToAsn1(cert.subject); - var byteBuffer = forge.asn1.toDer(dn); - cAs.putInt16(byteBuffer.length()); - cAs.putBuffer(byteBuffer); - } - - // TODO: TLS 1.2+ has a different format - - // determine length of the handshake message - var length = - 1 + certTypes.length() + - 2 + cAs.length(); - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.certificate_request); - rval.putInt24(length); - writeVector(rval, 1, certTypes); - writeVector(rval, 2, cAs); - return rval; -}; - -/** - * Creates a ServerHelloDone message. - * - * @param c the connection. - * - * @return the ServerHelloDone byte buffer. - */ -tls.createServerHelloDone = function(c) { - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.server_hello_done); - rval.putInt24(0); - return rval; -}; - -/** - * Creates a ChangeCipherSpec message. - * - * The change cipher spec protocol exists to signal transitions in - * ciphering strategies. The protocol consists of a single message, - * which is encrypted and compressed under the current (not the pending) - * connection state. The message consists of a single byte of value 1. - * - * struct { - * enum { change_cipher_spec(1), (255) } type; - * } ChangeCipherSpec; - * - * @return the ChangeCipherSpec byte buffer. - */ -tls.createChangeCipherSpec = function() { - var rval = forge.util.createBuffer(); - rval.putByte(0x01); - return rval; -}; - -/** - * Creates a Finished message. - * - * struct { - * opaque verify_data[12]; - * } Finished; - * - * verify_data - * PRF(master_secret, finished_label, MD5(handshake_messages) + - * SHA-1(handshake_messages)) [0..11]; - * - * finished_label - * For Finished messages sent by the client, the string "client - * finished". For Finished messages sent by the server, the - * string "server finished". - * - * handshake_messages - * All of the data from all handshake messages up to but not - * including this message. This is only data visible at the - * handshake layer and does not include record layer headers. - * This is the concatenation of all the Handshake structures as - * defined in 7.4 exchanged thus far. - * - * @param c the connection. - * - * @return the Finished byte buffer. - */ -tls.createFinished = function(c) { - // generate verify_data - var b = forge.util.createBuffer(); - b.putBuffer(c.session.md5.digest()); - b.putBuffer(c.session.sha1.digest()); - - // TODO: determine prf function and verify length for TLS 1.2 - var client = (c.entity === tls.ConnectionEnd.client); - var sp = c.session.sp; - var vdl = 12; - var prf = prf_TLS1; - var label = client ? 'client finished' : 'server finished'; - b = prf(sp.master_secret, label, b.getBytes(), vdl); - - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(tls.HandshakeType.finished); - rval.putInt24(b.length()); - rval.putBuffer(b); - return rval; -}; - -/** - * Creates a HeartbeatMessage (See RFC 6520). - * - * struct { - * HeartbeatMessageType type; - * uint16 payload_length; - * opaque payload[HeartbeatMessage.payload_length]; - * opaque padding[padding_length]; - * } HeartbeatMessage; - * - * The total length of a HeartbeatMessage MUST NOT exceed 2^14 or - * max_fragment_length when negotiated as defined in [RFC6066]. - * - * type: The message type, either heartbeat_request or heartbeat_response. - * - * payload_length: The length of the payload. - * - * payload: The payload consists of arbitrary content. - * - * padding: The padding is random content that MUST be ignored by the - * receiver. The length of a HeartbeatMessage is TLSPlaintext.length - * for TLS and DTLSPlaintext.length for DTLS. Furthermore, the - * length of the type field is 1 byte, and the length of the - * payload_length is 2. Therefore, the padding_length is - * TLSPlaintext.length - payload_length - 3 for TLS and - * DTLSPlaintext.length - payload_length - 3 for DTLS. The - * padding_length MUST be at least 16. - * - * The sender of a HeartbeatMessage MUST use a random padding of at - * least 16 bytes. The padding of a received HeartbeatMessage message - * MUST be ignored. - * - * If the payload_length of a received HeartbeatMessage is too large, - * the received HeartbeatMessage MUST be discarded silently. - * - * @param c the connection. - * @param type the tls.HeartbeatMessageType. - * @param payload the heartbeat data to send as the payload. - * @param [payloadLength] the payload length to use, defaults to the - * actual payload length. - * - * @return the HeartbeatRequest byte buffer. - */ -tls.createHeartbeat = function(type, payload, payloadLength) { - if(typeof payloadLength === 'undefined') { - payloadLength = payload.length; - } - // build record fragment - var rval = forge.util.createBuffer(); - rval.putByte(type); // heartbeat message type - rval.putInt16(payloadLength); // payload length - rval.putBytes(payload); // payload - // padding - var plaintextLength = rval.length(); - var paddingLength = Math.max(16, plaintextLength - payloadLength - 3); - rval.putBytes(forge.random.getBytes(paddingLength)); - return rval; -}; - -/** - * Fragments, compresses, encrypts, and queues a record for delivery. - * - * @param c the connection. - * @param record the record to queue. - */ -tls.queue = function(c, record) { - // error during record creation - if(!record) { - return; - } - - if(record.fragment.length() === 0) { - if(record.type === tls.ContentType.handshake || - record.type === tls.ContentType.alert || - record.type === tls.ContentType.change_cipher_spec) { - // Empty handshake, alert of change cipher spec messages are not allowed per the TLS specification and should not be sent. - return; - } - } - - // if the record is a handshake record, update handshake hashes - if(record.type === tls.ContentType.handshake) { - var bytes = record.fragment.bytes(); - c.session.md5.update(bytes); - c.session.sha1.update(bytes); - bytes = null; - } - - // handle record fragmentation - var records; - if(record.fragment.length() <= tls.MaxFragment) { - records = [record]; - } else { - // fragment data as long as it is too long - records = []; - var data = record.fragment.bytes(); - while(data.length > tls.MaxFragment) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data.slice(0, tls.MaxFragment)) - })); - data = data.slice(tls.MaxFragment); - } - // add last record - if(data.length > 0) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data) - })); - } - } - - // compress and encrypt all fragmented records - for(var i = 0; i < records.length && !c.fail; ++i) { - // update the record using current write state - var rec = records[i]; - var s = c.state.current.write; - if(s.update(c, rec)) { - // store record - c.records.push(rec); - } - } -}; - -/** - * Flushes all queued records to the output buffer and calls the - * tlsDataReady() handler on the given connection. - * - * @param c the connection. - * - * @return true on success, false on failure. - */ -tls.flush = function(c) { - for(var i = 0; i < c.records.length; ++i) { - var record = c.records[i]; - - // add record header and fragment - c.tlsData.putByte(record.type); - c.tlsData.putByte(record.version.major); - c.tlsData.putByte(record.version.minor); - c.tlsData.putInt16(record.fragment.length()); - c.tlsData.putBuffer(c.records[i].fragment); - } - c.records = []; - return c.tlsDataReady(c); -}; - -/** - * Maps a pki.certificateError to a tls.Alert.Description. - * - * @param error the error to map. - * - * @return the alert description. - */ -var _certErrorToAlertDesc = function(error) { - switch(error) { - case true: - return true; - case forge.pki.certificateError.bad_certificate: - return tls.Alert.Description.bad_certificate; - case forge.pki.certificateError.unsupported_certificate: - return tls.Alert.Description.unsupported_certificate; - case forge.pki.certificateError.certificate_revoked: - return tls.Alert.Description.certificate_revoked; - case forge.pki.certificateError.certificate_expired: - return tls.Alert.Description.certificate_expired; - case forge.pki.certificateError.certificate_unknown: - return tls.Alert.Description.certificate_unknown; - case forge.pki.certificateError.unknown_ca: - return tls.Alert.Description.unknown_ca; - default: - return tls.Alert.Description.bad_certificate; - } -}; - -/** - * Maps a tls.Alert.Description to a pki.certificateError. - * - * @param desc the alert description. - * - * @return the certificate error. - */ -var _alertDescToCertError = function(desc) { - switch(desc) { - case true: - return true; - case tls.Alert.Description.bad_certificate: - return forge.pki.certificateError.bad_certificate; - case tls.Alert.Description.unsupported_certificate: - return forge.pki.certificateError.unsupported_certificate; - case tls.Alert.Description.certificate_revoked: - return forge.pki.certificateError.certificate_revoked; - case tls.Alert.Description.certificate_expired: - return forge.pki.certificateError.certificate_expired; - case tls.Alert.Description.certificate_unknown: - return forge.pki.certificateError.certificate_unknown; - case tls.Alert.Description.unknown_ca: - return forge.pki.certificateError.unknown_ca; - default: - return forge.pki.certificateError.bad_certificate; - } -}; - -/** - * Verifies a certificate chain against the given connection's - * Certificate Authority store. - * - * @param c the TLS connection. - * @param chain the certificate chain to verify, with the root or highest - * authority at the end. - * - * @return true if successful, false if not. - */ -tls.verifyCertificateChain = function(c, chain) { - try { - // Make a copy of c.verifyOptions so that we can modify options.verify - // without modifying c.verifyOptions. - var options = {}; - for (var key in c.verifyOptions) { - options[key] = c.verifyOptions[key]; - } - - options.verify = function(vfd, depth, chain) { - // convert pki.certificateError to tls alert description - var desc = _certErrorToAlertDesc(vfd); - - // call application callback - var ret = c.verify(c, vfd, depth, chain); - if(ret !== true) { - if(typeof ret === 'object' && !forge.util.isArray(ret)) { - // throw custom error - var error = new Error('The application rejected the certificate.'); - error.send = true; - error.alert = { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - }; - if(ret.message) { - error.message = ret.message; - } - if(ret.alert) { - error.alert.description = ret.alert; - } - throw error; - } - - // convert tls alert description to pki.certificateError - if(ret !== vfd) { - ret = _alertDescToCertError(ret); - } - } - - return ret; - }; - - // verify chain - forge.pki.verifyCertificateChain(c.caStore, chain, options); - } catch(ex) { - // build tls error if not already customized - var err = ex; - if(typeof err !== 'object' || forge.util.isArray(err)) { - err = { - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(ex) - } - }; - } - if(!('send' in err)) { - err.send = true; - } - if(!('alert' in err)) { - err.alert = { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(err.error) - }; - } - - // send error - c.error(c, err); - } - - return !c.fail; -}; - -/** - * Creates a new TLS session cache. - * - * @param cache optional map of session ID to cached session. - * @param capacity the maximum size for the cache (default: 100). - * - * @return the new TLS session cache. - */ -tls.createSessionCache = function(cache, capacity) { - var rval = null; - - // assume input is already a session cache object - if(cache && cache.getSession && cache.setSession && cache.order) { - rval = cache; - } else { - // create cache - rval = {}; - rval.cache = cache || {}; - rval.capacity = Math.max(capacity || 100, 1); - rval.order = []; - - // store order for sessions, delete session overflow - for(var key in cache) { - if(rval.order.length <= capacity) { - rval.order.push(key); - } else { - delete cache[key]; - } - } - - // get a session from a session ID (or get any session) - rval.getSession = function(sessionId) { - var session = null; - var key = null; - - // if session ID provided, use it - if(sessionId) { - key = forge.util.bytesToHex(sessionId); - } else if(rval.order.length > 0) { - // get first session from cache - key = rval.order[0]; - } - - if(key !== null && key in rval.cache) { - // get cached session and remove from cache - session = rval.cache[key]; - delete rval.cache[key]; - for(var i in rval.order) { - if(rval.order[i] === key) { - rval.order.splice(i, 1); - break; - } - } - } - - return session; - }; - - // set a session in the cache - rval.setSession = function(sessionId, session) { - // remove session from cache if at capacity - if(rval.order.length === rval.capacity) { - var key = rval.order.shift(); - delete rval.cache[key]; - } - // add session to cache - var key = forge.util.bytesToHex(sessionId); - rval.order.push(key); - rval.cache[key] = session; - }; - } - - return rval; -}; - -/** - * Creates a new TLS connection. - * - * See public createConnection() docs for more details. - * - * @param options the options for this connection. - * - * @return the new TLS connection. - */ -tls.createConnection = function(options) { - var caStore = null; - if(options.caStore) { - // if CA store is an array, convert it to a CA store object - if(forge.util.isArray(options.caStore)) { - caStore = forge.pki.createCaStore(options.caStore); - } else { - caStore = options.caStore; - } - } else { - // create empty CA store - caStore = forge.pki.createCaStore(); - } - - // setup default cipher suites - var cipherSuites = options.cipherSuites || null; - if(cipherSuites === null) { - cipherSuites = []; - for(var key in tls.CipherSuites) { - cipherSuites.push(tls.CipherSuites[key]); - } - } - - // set default entity - var entity = (options.server || false) ? - tls.ConnectionEnd.server : tls.ConnectionEnd.client; - - // create session cache if requested - var sessionCache = options.sessionCache ? - tls.createSessionCache(options.sessionCache) : null; - - // create TLS connection - var c = { - version: {major: tls.Version.major, minor: tls.Version.minor}, - entity: entity, - sessionId: options.sessionId, - caStore: caStore, - sessionCache: sessionCache, - cipherSuites: cipherSuites, - connected: options.connected, - virtualHost: options.virtualHost || null, - verifyClient: options.verifyClient || false, - verify: options.verify || function(cn, vfd, dpth, cts) {return vfd;}, - verifyOptions: options.verifyOptions || {}, - getCertificate: options.getCertificate || null, - getPrivateKey: options.getPrivateKey || null, - getSignature: options.getSignature || null, - input: forge.util.createBuffer(), - tlsData: forge.util.createBuffer(), - data: forge.util.createBuffer(), - tlsDataReady: options.tlsDataReady, - dataReady: options.dataReady, - heartbeatReceived: options.heartbeatReceived, - closed: options.closed, - error: function(c, ex) { - // set origin if not set - ex.origin = ex.origin || - ((c.entity === tls.ConnectionEnd.client) ? 'client' : 'server'); - - // send TLS alert - if(ex.send) { - tls.queue(c, tls.createAlert(c, ex.alert)); - tls.flush(c); - } - - // error is fatal by default - var fatal = (ex.fatal !== false); - if(fatal) { - // set fail flag - c.fail = true; - } - - // call error handler first - options.error(c, ex); - - if(fatal) { - // fatal error, close connection, do not clear fail - c.close(false); - } - }, - deflate: options.deflate || null, - inflate: options.inflate || null - }; - - /** - * Resets a closed TLS connection for reuse. Called in c.close(). - * - * @param clearFail true to clear the fail flag (default: true). - */ - c.reset = function(clearFail) { - c.version = {major: tls.Version.major, minor: tls.Version.minor}; - c.record = null; - c.session = null; - c.peerCertificate = null; - c.state = { - pending: null, - current: null - }; - c.expect = (c.entity === tls.ConnectionEnd.client) ? SHE : CHE; - c.fragmented = null; - c.records = []; - c.open = false; - c.handshakes = 0; - c.handshaking = false; - c.isConnected = false; - c.fail = !(clearFail || typeof(clearFail) === 'undefined'); - c.input.clear(); - c.tlsData.clear(); - c.data.clear(); - c.state.current = tls.createConnectionState(c); - }; - - // do initial reset of connection - c.reset(); - - /** - * Updates the current TLS engine state based on the given record. - * - * @param c the TLS connection. - * @param record the TLS record to act on. - */ - var _update = function(c, record) { - // get record handler (align type in table by subtracting lowest) - var aligned = record.type - tls.ContentType.change_cipher_spec; - var handlers = ctTable[c.entity][c.expect]; - if(aligned in handlers) { - handlers[aligned](c, record); - } else { - // unexpected record - tls.handleUnexpected(c, record); - } - }; - - /** - * Reads the record header and initializes the next record on the given - * connection. - * - * @param c the TLS connection with the next record. - * - * @return 0 if the input data could be processed, otherwise the - * number of bytes required for data to be processed. - */ - var _readRecordHeader = function(c) { - var rval = 0; - - // get input buffer and its length - var b = c.input; - var len = b.length(); - - // need at least 5 bytes to initialize a record - if(len < 5) { - rval = 5 - len; - } else { - // enough bytes for header - // initialize record - c.record = { - type: b.getByte(), - version: { - major: b.getByte(), - minor: b.getByte() - }, - length: b.getInt16(), - fragment: forge.util.createBuffer(), - ready: false - }; - - // check record version - var compatibleVersion = (c.record.version.major === c.version.major); - if(compatibleVersion && c.session && c.session.version) { - // session version already set, require same minor version - compatibleVersion = (c.record.version.minor === c.version.minor); - } - if(!compatibleVersion) { - c.error(c, { - message: 'Incompatible TLS version.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.protocol_version - } - }); - } - } - - return rval; - }; - - /** - * Reads the next record's contents and appends its message to any - * previously fragmented message. - * - * @param c the TLS connection with the next record. - * - * @return 0 if the input data could be processed, otherwise the - * number of bytes required for data to be processed. - */ - var _readRecord = function(c) { - var rval = 0; - - // ensure there is enough input data to get the entire record - var b = c.input; - var len = b.length(); - if(len < c.record.length) { - // not enough data yet, return how much is required - rval = c.record.length - len; - } else { - // there is enough data to parse the pending record - // fill record fragment and compact input buffer - c.record.fragment.putBytes(b.getBytes(c.record.length)); - b.compact(); - - // update record using current read state - var s = c.state.current.read; - if(s.update(c, c.record)) { - // see if there is a previously fragmented message that the - // new record's message fragment should be appended to - if(c.fragmented !== null) { - // if the record type matches a previously fragmented - // record, append the record fragment to it - if(c.fragmented.type === c.record.type) { - // concatenate record fragments - c.fragmented.fragment.putBuffer(c.record.fragment); - c.record = c.fragmented; - } else { - // error, invalid fragmented record - c.error(c, { - message: 'Invalid fragmented record.', - send: true, - alert: { - level: tls.Alert.Level.fatal, - description: - tls.Alert.Description.unexpected_message - } - }); - } - } - - // record is now ready - c.record.ready = true; - } - } - - return rval; - }; - - /** - * Performs a handshake using the TLS Handshake Protocol, as a client. - * - * This method should only be called if the connection is in client mode. - * - * @param sessionId the session ID to use, null to start a new one. - */ - c.handshake = function(sessionId) { - // error to call this in non-client mode - if(c.entity !== tls.ConnectionEnd.client) { - // not fatal error - c.error(c, { - message: 'Cannot initiate handshake as a server.', - fatal: false - }); - } else if(c.handshaking) { - // handshake is already in progress, fail but not fatal error - c.error(c, { - message: 'Handshake already in progress.', - fatal: false - }); - } else { - // clear fail flag on reuse - if(c.fail && !c.open && c.handshakes === 0) { - c.fail = false; - } - - // now handshaking - c.handshaking = true; - - // default to blank (new session) - sessionId = sessionId || ''; - - // if a session ID was specified, try to find it in the cache - var session = null; - if(sessionId.length > 0) { - if(c.sessionCache) { - session = c.sessionCache.getSession(sessionId); - } - - // matching session not found in cache, clear session ID - if(session === null) { - sessionId = ''; - } - } - - // no session given, grab a session from the cache, if available - if(sessionId.length === 0 && c.sessionCache) { - session = c.sessionCache.getSession(); - if(session !== null) { - sessionId = session.id; - } - } - - // set up session - c.session = { - id: sessionId, - version: null, - cipherSuite: null, - compressionMethod: null, - serverCertificate: null, - certificateRequest: null, - clientCertificate: null, - sp: {}, - md5: forge.md.md5.create(), - sha1: forge.md.sha1.create() - }; - - // use existing session information - if(session) { - // only update version on connection, session version not yet set - c.version = session.version; - c.session.sp = session.sp; - } - - // generate new client random - c.session.sp.client_random = tls.createRandom().getBytes(); - - // connection now open - c.open = true; - - // send hello - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createClientHello(c) - })); - tls.flush(c); - } - }; - - /** - * Called when TLS protocol data has been received from somewhere and should - * be processed by the TLS engine. - * - * @param data the TLS protocol data, as a string, to process. - * - * @return 0 if the data could be processed, otherwise the number of bytes - * required for data to be processed. - */ - c.process = function(data) { - var rval = 0; - - // buffer input data - if(data) { - c.input.putBytes(data); - } - - // process next record if no failure, process will be called after - // each record is handled (since handling can be asynchronous) - if(!c.fail) { - // reset record if ready and now empty - if(c.record !== null && - c.record.ready && c.record.fragment.isEmpty()) { - c.record = null; - } - - // if there is no pending record, try to read record header - if(c.record === null) { - rval = _readRecordHeader(c); - } - - // read the next record (if record not yet ready) - if(!c.fail && c.record !== null && !c.record.ready) { - rval = _readRecord(c); - } - - // record ready to be handled, update engine state - if(!c.fail && c.record !== null && c.record.ready) { - _update(c, c.record); - } - } - - return rval; - }; - - /** - * Requests that application data be packaged into a TLS record. The - * tlsDataReady handler will be called when the TLS record(s) have been - * prepared. - * - * @param data the application data, as a raw 'binary' encoded string, to - * be sent; to send utf-16/utf-8 string data, use the return value - * of util.encodeUtf8(str). - * - * @return true on success, false on failure. - */ - c.prepare = function(data) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.application_data, - data: forge.util.createBuffer(data) - })); - return tls.flush(c); - }; - - /** - * Requests that a heartbeat request be packaged into a TLS record for - * transmission. The tlsDataReady handler will be called when TLS record(s) - * have been prepared. - * - * When a heartbeat response has been received, the heartbeatReceived - * handler will be called with the matching payload. This handler can - * be used to clear a retransmission timer, etc. - * - * @param payload the heartbeat data to send as the payload in the message. - * @param [payloadLength] the payload length to use, defaults to the - * actual payload length. - * - * @return true on success, false on failure. - */ - c.prepareHeartbeatRequest = function(payload, payloadLength) { - if(payload instanceof forge.util.ByteBuffer) { - payload = payload.bytes(); - } - if(typeof payloadLength === 'undefined') { - payloadLength = payload.length; - } - c.expectedHeartbeatPayload = payload; - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_request, payload, payloadLength) - })); - return tls.flush(c); - }; - - /** - * Closes the connection (sends a close_notify alert). - * - * @param clearFail true to clear the fail flag (default: true). - */ - c.close = function(clearFail) { - // save session if connection didn't fail - if(!c.fail && c.sessionCache && c.session) { - // only need to preserve session ID, version, and security params - var session = { - id: c.session.id, - version: c.session.version, - sp: c.session.sp - }; - session.sp.keys = null; - c.sessionCache.setSession(session.id, session); - } - - if(c.open) { - // connection no longer open, clear input - c.open = false; - c.input.clear(); - - // if connected or handshaking, send an alert - if(c.isConnected || c.handshaking) { - c.isConnected = c.handshaking = false; - - // send close_notify alert - tls.queue(c, tls.createAlert(c, { - level: tls.Alert.Level.warning, - description: tls.Alert.Description.close_notify - })); - tls.flush(c); - } - - // call handler - c.closed(c); - } - - // reset TLS connection, do not clear fail flag - c.reset(clearFail); - }; - - return c; -}; - -/* TLS API */ -module.exports = forge.tls = forge.tls || {}; - -// expose non-functions -for(var key in tls) { - if(typeof tls[key] !== 'function') { - forge.tls[key] = tls[key]; - } -} - -// expose prf_tls1 for testing -forge.tls.prf_tls1 = prf_TLS1; - -// expose sha1 hmac method -forge.tls.hmac_sha1 = hmac_sha1; - -// expose session cache creation -forge.tls.createSessionCache = tls.createSessionCache; - -/** - * Creates a new TLS connection. This does not make any assumptions about the - * transport layer that TLS is working on top of, ie: it does not assume there - * is a TCP/IP connection or establish one. A TLS connection is totally - * abstracted away from the layer is runs on top of, it merely establishes a - * secure channel between a client" and a "server". - * - * A TLS connection contains 4 connection states: pending read and write, and - * current read and write. - * - * At initialization, the current read and write states will be null. Only once - * the security parameters have been set and the keys have been generated can - * the pending states be converted into current states. Current states will be - * updated for each record processed. - * - * A custom certificate verify callback may be provided to check information - * like the common name on the server's certificate. It will be called for - * every certificate in the chain. It has the following signature: - * - * variable func(c, certs, index, preVerify) - * Where: - * c The TLS connection - * verified Set to true if certificate was verified, otherwise the alert - * tls.Alert.Description for why the certificate failed. - * depth The current index in the chain, where 0 is the server's cert. - * certs The certificate chain, *NOTE* if the server was anonymous then - * the chain will be empty. - * - * The function returns true on success and on failure either the appropriate - * tls.Alert.Description or an object with 'alert' set to the appropriate - * tls.Alert.Description and 'message' set to a custom error message. If true - * is not returned then the connection will abort using, in order of - * availability, first the returned alert description, second the preVerify - * alert description, and lastly the default 'bad_certificate'. - * - * There are three callbacks that can be used to make use of client-side - * certificates where each takes the TLS connection as the first parameter: - * - * getCertificate(conn, hint) - * The second parameter is a hint as to which certificate should be - * returned. If the connection entity is a client, then the hint will be - * the CertificateRequest message from the server that is part of the - * TLS protocol. If the connection entity is a server, then it will be - * the servername list provided via an SNI extension the ClientHello, if - * one was provided (empty array if not). The hint can be examined to - * determine which certificate to use (advanced). Most implementations - * will just return a certificate. The return value must be a - * PEM-formatted certificate or an array of PEM-formatted certificates - * that constitute a certificate chain, with the first in the array/chain - * being the client's certificate. - * getPrivateKey(conn, certificate) - * The second parameter is an forge.pki X.509 certificate object that - * is associated with the requested private key. The return value must - * be a PEM-formatted private key. - * getSignature(conn, bytes, callback) - * This callback can be used instead of getPrivateKey if the private key - * is not directly accessible in javascript or should not be. For - * instance, a secure external web service could provide the signature - * in exchange for appropriate credentials. The second parameter is a - * string of bytes to be signed that are part of the TLS protocol. These - * bytes are used to verify that the private key for the previously - * provided client-side certificate is accessible to the client. The - * callback is a function that takes 2 parameters, the TLS connection - * and the RSA encrypted (signed) bytes as a string. This callback must - * be called once the signature is ready. - * - * @param options the options for this connection: - * server: true if the connection is server-side, false for client. - * sessionId: a session ID to reuse, null for a new connection. - * caStore: an array of certificates to trust. - * sessionCache: a session cache to use. - * cipherSuites: an optional array of cipher suites to use, - * see tls.CipherSuites. - * connected: function(conn) called when the first handshake completes. - * virtualHost: the virtual server name to use in a TLS SNI extension. - * verifyClient: true to require a client certificate in server mode, - * 'optional' to request one, false not to (default: false). - * verify: a handler used to custom verify certificates in the chain. - * verifyOptions: an object with options for the certificate chain validation. - * See documentation of pki.verifyCertificateChain for possible options. - * verifyOptions.verify is ignored. If you wish to specify a verify handler - * use the verify key. - * getCertificate: an optional callback used to get a certificate or - * a chain of certificates (as an array). - * getPrivateKey: an optional callback used to get a private key. - * getSignature: an optional callback used to get a signature. - * tlsDataReady: function(conn) called when TLS protocol data has been - * prepared and is ready to be used (typically sent over a socket - * connection to its destination), read from conn.tlsData buffer. - * dataReady: function(conn) called when application data has - * been parsed from a TLS record and should be consumed by the - * application, read from conn.data buffer. - * closed: function(conn) called when the connection has been closed. - * error: function(conn, error) called when there was an error. - * deflate: function(inBytes) if provided, will deflate TLS records using - * the deflate algorithm if the server supports it. - * inflate: function(inBytes) if provided, will inflate TLS records using - * the deflate algorithm if the server supports it. - * - * @return the new TLS connection. - */ -forge.tls.createConnection = tls.createConnection; diff --git a/node_modules/node-forge/lib/tlssocket.js b/node_modules/node-forge/lib/tlssocket.js deleted file mode 100644 index d09b650..0000000 --- a/node_modules/node-forge/lib/tlssocket.js +++ /dev/null @@ -1,249 +0,0 @@ -/** - * Socket wrapping functions for TLS. - * - * @author Dave Longley - * - * Copyright (c) 2009-2012 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./tls'); - -/** - * Wraps a forge.net socket with a TLS layer. - * - * @param options: - * sessionId: a session ID to reuse, null for a new connection if no session - * cache is provided or it is empty. - * caStore: an array of certificates to trust. - * sessionCache: a session cache to use. - * cipherSuites: an optional array of cipher suites to use, see - * tls.CipherSuites. - * socket: the socket to wrap. - * virtualHost: the virtual server name to use in a TLS SNI extension. - * verify: a handler used to custom verify certificates in the chain. - * getCertificate: an optional callback used to get a certificate. - * getPrivateKey: an optional callback used to get a private key. - * getSignature: an optional callback used to get a signature. - * deflate: function(inBytes) if provided, will deflate TLS records using - * the deflate algorithm if the server supports it. - * inflate: function(inBytes) if provided, will inflate TLS records using - * the deflate algorithm if the server supports it. - * - * @return the TLS-wrapped socket. - */ -forge.tls.wrapSocket = function(options) { - // get raw socket - var socket = options.socket; - - // create TLS socket - var tlsSocket = { - id: socket.id, - // set handlers - connected: socket.connected || function(e) {}, - closed: socket.closed || function(e) {}, - data: socket.data || function(e) {}, - error: socket.error || function(e) {} - }; - - // create TLS connection - var c = forge.tls.createConnection({ - server: false, - sessionId: options.sessionId || null, - caStore: options.caStore || [], - sessionCache: options.sessionCache || null, - cipherSuites: options.cipherSuites || null, - virtualHost: options.virtualHost, - verify: options.verify, - getCertificate: options.getCertificate, - getPrivateKey: options.getPrivateKey, - getSignature: options.getSignature, - deflate: options.deflate, - inflate: options.inflate, - connected: function(c) { - // first handshake complete, call handler - if(c.handshakes === 1) { - tlsSocket.connected({ - id: socket.id, - type: 'connect', - bytesAvailable: c.data.length() - }); - } - }, - tlsDataReady: function(c) { - // send TLS data over socket - return socket.send(c.tlsData.getBytes()); - }, - dataReady: function(c) { - // indicate application data is ready - tlsSocket.data({ - id: socket.id, - type: 'socketData', - bytesAvailable: c.data.length() - }); - }, - closed: function(c) { - // close socket - socket.close(); - }, - error: function(c, e) { - // send error, close socket - tlsSocket.error({ - id: socket.id, - type: 'tlsError', - message: e.message, - bytesAvailable: 0, - error: e - }); - socket.close(); - } - }); - - // handle doing handshake after connecting - socket.connected = function(e) { - c.handshake(options.sessionId); - }; - - // handle closing TLS connection - socket.closed = function(e) { - if(c.open && c.handshaking) { - // error - tlsSocket.error({ - id: socket.id, - type: 'ioError', - message: 'Connection closed during handshake.', - bytesAvailable: 0 - }); - } - c.close(); - - // call socket handler - tlsSocket.closed({ - id: socket.id, - type: 'close', - bytesAvailable: 0 - }); - }; - - // handle error on socket - socket.error = function(e) { - // error - tlsSocket.error({ - id: socket.id, - type: e.type, - message: e.message, - bytesAvailable: 0 - }); - c.close(); - }; - - // handle receiving raw TLS data from socket - var _requiredBytes = 0; - socket.data = function(e) { - // drop data if connection not open - if(!c.open) { - socket.receive(e.bytesAvailable); - } else { - // only receive if there are enough bytes available to - // process a record - if(e.bytesAvailable >= _requiredBytes) { - var count = Math.max(e.bytesAvailable, _requiredBytes); - var data = socket.receive(count); - if(data !== null) { - _requiredBytes = c.process(data); - } - } - } - }; - - /** - * Destroys this socket. - */ - tlsSocket.destroy = function() { - socket.destroy(); - }; - - /** - * Sets this socket's TLS session cache. This should be called before - * the socket is connected or after it is closed. - * - * The cache is an object mapping session IDs to internal opaque state. - * An application might need to change the cache used by a particular - * tlsSocket between connections if it accesses multiple TLS hosts. - * - * @param cache the session cache to use. - */ - tlsSocket.setSessionCache = function(cache) { - c.sessionCache = tls.createSessionCache(cache); - }; - - /** - * Connects this socket. - * - * @param options: - * host: the host to connect to. - * port: the port to connect to. - * policyPort: the policy port to use (if non-default), 0 to - * use the flash default. - * policyUrl: the policy file URL to use (instead of port). - */ - tlsSocket.connect = function(options) { - socket.connect(options); - }; - - /** - * Closes this socket. - */ - tlsSocket.close = function() { - c.close(); - }; - - /** - * Determines if the socket is connected or not. - * - * @return true if connected, false if not. - */ - tlsSocket.isConnected = function() { - return c.isConnected && socket.isConnected(); - }; - - /** - * Writes bytes to this socket. - * - * @param bytes the bytes (as a string) to write. - * - * @return true on success, false on failure. - */ - tlsSocket.send = function(bytes) { - return c.prepare(bytes); - }; - - /** - * Reads bytes from this socket (non-blocking). Fewer than the number of - * bytes requested may be read if enough bytes are not available. - * - * This method should be called from the data handler if there are enough - * bytes available. To see how many bytes are available, check the - * 'bytesAvailable' property on the event in the data handler or call the - * bytesAvailable() function on the socket. If the browser is msie, then the - * bytesAvailable() function should be used to avoid race conditions. - * Otherwise, using the property on the data handler's event may be quicker. - * - * @param count the maximum number of bytes to read. - * - * @return the bytes read (as a string) or null on error. - */ - tlsSocket.receive = function(count) { - return c.data.getBytes(count); - }; - - /** - * Gets the number of bytes available for receiving on the socket. - * - * @return the number of bytes available for receiving. - */ - tlsSocket.bytesAvailable = function() { - return c.data.length(); - }; - - return tlsSocket; -}; diff --git a/node_modules/node-forge/lib/util.js b/node_modules/node-forge/lib/util.js deleted file mode 100644 index 98dfd34..0000000 --- a/node_modules/node-forge/lib/util.js +++ /dev/null @@ -1,2907 +0,0 @@ -/** - * Utility functions for web applications. - * - * @author Dave Longley - * - * Copyright (c) 2010-2018 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -var baseN = require('./baseN'); - -/* Utilities API */ -var util = module.exports = forge.util = forge.util || {}; - -// define setImmediate and nextTick -(function() { - // use native nextTick (unless we're in webpack) - // webpack (or better node-libs-browser polyfill) sets process.browser. - // this way we can detect webpack properly - if(typeof process !== 'undefined' && process.nextTick && !process.browser) { - util.nextTick = process.nextTick; - if(typeof setImmediate === 'function') { - util.setImmediate = setImmediate; - } else { - // polyfill setImmediate with nextTick, older versions of node - // (those w/o setImmediate) won't totally starve IO - util.setImmediate = util.nextTick; - } - return; - } - - // polyfill nextTick with native setImmediate - if(typeof setImmediate === 'function') { - util.setImmediate = function() { return setImmediate.apply(undefined, arguments); }; - util.nextTick = function(callback) { - return setImmediate(callback); - }; - return; - } - - /* Note: A polyfill upgrade pattern is used here to allow combining - polyfills. For example, MutationObserver is fast, but blocks UI updates, - so it needs to allow UI updates periodically, so it falls back on - postMessage or setTimeout. */ - - // polyfill with setTimeout - util.setImmediate = function(callback) { - setTimeout(callback, 0); - }; - - // upgrade polyfill to use postMessage - if(typeof window !== 'undefined' && - typeof window.postMessage === 'function') { - var msg = 'forge.setImmediate'; - var callbacks = []; - util.setImmediate = function(callback) { - callbacks.push(callback); - // only send message when one hasn't been sent in - // the current turn of the event loop - if(callbacks.length === 1) { - window.postMessage(msg, '*'); - } - }; - function handler(event) { - if(event.source === window && event.data === msg) { - event.stopPropagation(); - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - } - } - window.addEventListener('message', handler, true); - } - - // upgrade polyfill to use MutationObserver - if(typeof MutationObserver !== 'undefined') { - // polyfill with MutationObserver - var now = Date.now(); - var attr = true; - var div = document.createElement('div'); - var callbacks = []; - new MutationObserver(function() { - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - }).observe(div, {attributes: true}); - var oldSetImmediate = util.setImmediate; - util.setImmediate = function(callback) { - if(Date.now() - now > 15) { - now = Date.now(); - oldSetImmediate(callback); - } else { - callbacks.push(callback); - // only trigger observer when it hasn't been triggered in - // the current turn of the event loop - if(callbacks.length === 1) { - div.setAttribute('a', attr = !attr); - } - } - }; - } - - util.nextTick = util.setImmediate; -})(); - -// check if running under Node.js -util.isNodejs = - typeof process !== 'undefined' && process.versions && process.versions.node; - - -// 'self' will also work in Web Workers (instance of WorkerGlobalScope) while -// it will point to `window` in the main thread. -// To remain compatible with older browsers, we fall back to 'window' if 'self' -// is not available. -util.globalScope = (function() { - if(util.isNodejs) { - return global; - } - - return typeof self === 'undefined' ? window : self; -})(); - -// define isArray -util.isArray = Array.isArray || function(x) { - return Object.prototype.toString.call(x) === '[object Array]'; -}; - -// define isArrayBuffer -util.isArrayBuffer = function(x) { - return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer; -}; - -// define isArrayBufferView -util.isArrayBufferView = function(x) { - return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined; -}; - -/** - * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for - * algorithms where bit manipulation, JavaScript limitations, and/or algorithm - * design only allow for byte operations of a limited size. - * - * @param n number of bits. - * - * Throw Error if n invalid. - */ -function _checkBitsParam(n) { - if(!(n === 8 || n === 16 || n === 24 || n === 32)) { - throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n); - } -} - -// TODO: set ByteBuffer to best available backing -util.ByteBuffer = ByteStringBuffer; - -/** Buffer w/BinaryString backing */ - -/** - * Constructor for a binary string backed byte buffer. - * - * @param [b] the bytes to wrap (either encoded as string, one byte per - * character, or as an ArrayBuffer or Typed Array). - */ -function ByteStringBuffer(b) { - // TODO: update to match DataBuffer API - - // the data in this buffer - this.data = ''; - // the pointer for reading from this buffer - this.read = 0; - - if(typeof b === 'string') { - this.data = b; - } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) { - if(typeof Buffer !== 'undefined' && b instanceof Buffer) { - this.data = b.toString('binary'); - } else { - // convert native buffer to forge buffer - // FIXME: support native buffers internally instead - var arr = new Uint8Array(b); - try { - this.data = String.fromCharCode.apply(null, arr); - } catch(e) { - for(var i = 0; i < arr.length; ++i) { - this.putByte(arr[i]); - } - } - } - } else if(b instanceof ByteStringBuffer || - (typeof b === 'object' && typeof b.data === 'string' && - typeof b.read === 'number')) { - // copy existing buffer - this.data = b.data; - this.read = b.read; - } - - // used for v8 optimization - this._constructedStringLength = 0; -} -util.ByteStringBuffer = ByteStringBuffer; - -/* Note: This is an optimization for V8-based browsers. When V8 concatenates - a string, the strings are only joined logically using a "cons string" or - "constructed/concatenated string". These containers keep references to one - another and can result in very large memory usage. For example, if a 2MB - string is constructed by concatenating 4 bytes together at a time, the - memory usage will be ~44MB; so ~22x increase. The strings are only joined - together when an operation requiring their joining takes place, such as - substr(). This function is called when adding data to this buffer to ensure - these types of strings are periodically joined to reduce the memory - footprint. */ -var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; -util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { - this._constructedStringLength += x; - if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { - // this substr() should cause the constructed string to join - this.data.substr(0, 1); - this._constructedStringLength = 0; - } -}; - -/** - * Gets the number of bytes in this buffer. - * - * @return the number of bytes in this buffer. - */ -util.ByteStringBuffer.prototype.length = function() { - return this.data.length - this.read; -}; - -/** - * Gets whether or not this buffer is empty. - * - * @return true if this buffer is empty, false if not. - */ -util.ByteStringBuffer.prototype.isEmpty = function() { - return this.length() <= 0; -}; - -/** - * Puts a byte in this buffer. - * - * @param b the byte to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putByte = function(b) { - return this.putBytes(String.fromCharCode(b)); -}; - -/** - * Puts a byte in this buffer N times. - * - * @param b the byte to put. - * @param n the number of bytes of value b to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.fillWithByte = function(b, n) { - b = String.fromCharCode(b); - var d = this.data; - while(n > 0) { - if(n & 1) { - d += b; - } - n >>>= 1; - if(n > 0) { - b += b; - } - } - this.data = d; - this._optimizeConstructedString(n); - return this; -}; - -/** - * Puts bytes in this buffer. - * - * @param bytes the bytes (as a binary encoded string) to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putBytes = function(bytes) { - this.data += bytes; - this._optimizeConstructedString(bytes.length); - return this; -}; - -/** - * Puts a UTF-16 encoded string into this buffer. - * - * @param str the string to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putString = function(str) { - return this.putBytes(util.encodeUtf8(str)); -}; - -/** - * Puts a 16-bit integer in this buffer in big-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt16 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -/** - * Puts a 24-bit integer in this buffer in big-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt24 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -/** - * Puts a 32-bit integer in this buffer in big-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt32 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 24 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -/** - * Puts a 16-bit integer in this buffer in little-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt16Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF)); -}; - -/** - * Puts a 24-bit integer in this buffer in little-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt24Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF)); -}; - -/** - * Puts a 32-bit integer in this buffer in little-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt32Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 24 & 0xFF)); -}; - -/** - * Puts an n-bit integer in this buffer in big-endian order. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - var bytes = ''; - do { - n -= 8; - bytes += String.fromCharCode((i >> n) & 0xFF); - } while(n > 0); - return this.putBytes(bytes); -}; - -/** - * Puts a signed n-bit integer in this buffer in big-endian order. Two's - * complement representation is used. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { - // putInt checks n - if(i < 0) { - i += 2 << (n - 1); - } - return this.putInt(i, n); -}; - -/** - * Puts the given buffer into this buffer. - * - * @param buffer the buffer to put into this one. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.putBuffer = function(buffer) { - return this.putBytes(buffer.getBytes()); -}; - -/** - * Gets a byte from this buffer and advances the read pointer by 1. - * - * @return the byte. - */ -util.ByteStringBuffer.prototype.getByte = function() { - return this.data.charCodeAt(this.read++); -}; - -/** - * Gets a uint16 from this buffer in big-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.ByteStringBuffer.prototype.getInt16 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 8 ^ - this.data.charCodeAt(this.read + 1)); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in big-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.ByteStringBuffer.prototype.getInt24 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 16 ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2)); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in big-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.ByteStringBuffer.prototype.getInt32 = function() { - var rval = ( - this.data.charCodeAt(this.read) << 24 ^ - this.data.charCodeAt(this.read + 1) << 16 ^ - this.data.charCodeAt(this.read + 2) << 8 ^ - this.data.charCodeAt(this.read + 3)); - this.read += 4; - return rval; -}; - -/** - * Gets a uint16 from this buffer in little-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.ByteStringBuffer.prototype.getInt16Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in little-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.ByteStringBuffer.prototype.getInt24Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2) << 16); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in little-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.ByteStringBuffer.prototype.getInt32Le = function() { - var rval = ( - this.data.charCodeAt(this.read) ^ - this.data.charCodeAt(this.read + 1) << 8 ^ - this.data.charCodeAt(this.read + 2) << 16 ^ - this.data.charCodeAt(this.read + 3) << 24); - this.read += 4; - return rval; -}; - -/** - * Gets an n-bit integer from this buffer in big-endian order and advances the - * read pointer by ceil(n/8). - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.ByteStringBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. - rval = (rval << 8) + this.data.charCodeAt(this.read++); - n -= 8; - } while(n > 0); - return rval; -}; - -/** - * Gets a signed n-bit integer from this buffer in big-endian order, using - * two's complement, and advances the read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.ByteStringBuffer.prototype.getSignedInt = function(n) { - // getInt checks n - var x = this.getInt(n); - var max = 2 << (n - 2); - if(x >= max) { - x -= max << 1; - } - return x; -}; - -/** - * Reads bytes out as a binary encoded string and clears them from the - * buffer. Note that the resulting string is binary encoded (in node.js this - * encoding is referred to as `binary`, it is *not* `utf8`). - * - * @param count the number of bytes to read, undefined or null for all. - * - * @return a binary encoded string of bytes. - */ -util.ByteStringBuffer.prototype.getBytes = function(count) { - var rval; - if(count) { - // read count bytes - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if(count === 0) { - rval = ''; - } else { - // read all bytes, optimize to only copy when needed - rval = (this.read === 0) ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; -}; - -/** - * Gets a binary encoded string of the bytes from this buffer without - * modifying the read pointer. - * - * @param count the number of bytes to get, omit to get all. - * - * @return a string full of binary encoded characters. - */ -util.ByteStringBuffer.prototype.bytes = function(count) { - return (typeof(count) === 'undefined' ? - this.data.slice(this.read) : - this.data.slice(this.read, this.read + count)); -}; - -/** - * Gets a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * - * @return the byte. - */ -util.ByteStringBuffer.prototype.at = function(i) { - return this.data.charCodeAt(this.read + i); -}; - -/** - * Puts a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * @param b the byte to put. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.setAt = function(i, b) { - this.data = this.data.substr(0, this.read + i) + - String.fromCharCode(b) + - this.data.substr(this.read + i + 1); - return this; -}; - -/** - * Gets the last byte without modifying the read pointer. - * - * @return the last byte. - */ -util.ByteStringBuffer.prototype.last = function() { - return this.data.charCodeAt(this.data.length - 1); -}; - -/** - * Creates a copy of this buffer. - * - * @return the copy. - */ -util.ByteStringBuffer.prototype.copy = function() { - var c = util.createBuffer(this.data); - c.read = this.read; - return c; -}; - -/** - * Compacts this buffer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.compact = function() { - if(this.read > 0) { - this.data = this.data.slice(this.read); - this.read = 0; - } - return this; -}; - -/** - * Clears this buffer. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.clear = function() { - this.data = ''; - this.read = 0; - return this; -}; - -/** - * Shortens this buffer by triming bytes off of the end of this buffer. - * - * @param count the number of bytes to trim off. - * - * @return this buffer. - */ -util.ByteStringBuffer.prototype.truncate = function(count) { - var len = Math.max(0, this.length() - count); - this.data = this.data.substr(this.read, len); - this.read = 0; - return this; -}; - -/** - * Converts this buffer to a hexadecimal string. - * - * @return a hexadecimal string. - */ -util.ByteStringBuffer.prototype.toHex = function() { - var rval = ''; - for(var i = this.read; i < this.data.length; ++i) { - var b = this.data.charCodeAt(i); - if(b < 16) { - rval += '0'; - } - rval += b.toString(16); - } - return rval; -}; - -/** - * Converts this buffer to a UTF-16 string (standard JavaScript string). - * - * @return a UTF-16 string. - */ -util.ByteStringBuffer.prototype.toString = function() { - return util.decodeUtf8(this.bytes()); -}; - -/** End Buffer w/BinaryString backing */ - -/** Buffer w/UInt8Array backing */ - -/** - * FIXME: Experimental. Do not use yet. - * - * Constructor for an ArrayBuffer-backed byte buffer. - * - * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a - * TypedArray. - * - * If a string is given, its encoding should be provided as an option, - * otherwise it will default to 'binary'. A 'binary' string is encoded such - * that each character is one byte in length and size. - * - * If an ArrayBuffer, DataView, or TypedArray is given, it will be used - * *directly* without any copying. Note that, if a write to the buffer requires - * more space, the buffer will allocate a new backing ArrayBuffer to - * accommodate. The starting read and write offsets for the buffer may be - * given as options. - * - * @param [b] the initial bytes for this buffer. - * @param options the options to use: - * [readOffset] the starting read offset to use (default: 0). - * [writeOffset] the starting write offset to use (default: the - * length of the first parameter). - * [growSize] the minimum amount, in bytes, to grow the buffer by to - * accommodate writes (default: 1024). - * [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the - * first parameter, if it is a string (default: 'binary'). - */ -function DataBuffer(b, options) { - // default options - options = options || {}; - - // pointers for read from/write to buffer - this.read = options.readOffset || 0; - this.growSize = options.growSize || 1024; - - var isArrayBuffer = util.isArrayBuffer(b); - var isArrayBufferView = util.isArrayBufferView(b); - if(isArrayBuffer || isArrayBufferView) { - // use ArrayBuffer directly - if(isArrayBuffer) { - this.data = new DataView(b); - } else { - // TODO: adjust read/write offset based on the type of view - // or specify that this must be done in the options ... that the - // offsets are byte-based - this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); - } - this.write = ('writeOffset' in options ? - options.writeOffset : this.data.byteLength); - return; - } - - // initialize to empty array buffer and add any given bytes using putBytes - this.data = new DataView(new ArrayBuffer(0)); - this.write = 0; - - if(b !== null && b !== undefined) { - this.putBytes(b); - } - - if('writeOffset' in options) { - this.write = options.writeOffset; - } -} -util.DataBuffer = DataBuffer; - -/** - * Gets the number of bytes in this buffer. - * - * @return the number of bytes in this buffer. - */ -util.DataBuffer.prototype.length = function() { - return this.write - this.read; -}; - -/** - * Gets whether or not this buffer is empty. - * - * @return true if this buffer is empty, false if not. - */ -util.DataBuffer.prototype.isEmpty = function() { - return this.length() <= 0; -}; - -/** - * Ensures this buffer has enough empty space to accommodate the given number - * of bytes. An optional parameter may be given that indicates a minimum - * amount to grow the buffer if necessary. If the parameter is not given, - * the buffer will be grown by some previously-specified default amount - * or heuristic. - * - * @param amount the number of bytes to accommodate. - * @param [growSize] the minimum amount, in bytes, to grow the buffer by if - * necessary. - */ -util.DataBuffer.prototype.accommodate = function(amount, growSize) { - if(this.length() >= amount) { - return this; - } - growSize = Math.max(growSize || this.growSize, amount); - - // grow buffer - var src = new Uint8Array( - this.data.buffer, this.data.byteOffset, this.data.byteLength); - var dst = new Uint8Array(this.length() + growSize); - dst.set(src); - this.data = new DataView(dst.buffer); - - return this; -}; - -/** - * Puts a byte in this buffer. - * - * @param b the byte to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putByte = function(b) { - this.accommodate(1); - this.data.setUint8(this.write++, b); - return this; -}; - -/** - * Puts a byte in this buffer N times. - * - * @param b the byte to put. - * @param n the number of bytes of value b to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.fillWithByte = function(b, n) { - this.accommodate(n); - for(var i = 0; i < n; ++i) { - this.data.setUint8(b); - } - return this; -}; - -/** - * Puts bytes in this buffer. The bytes may be given as a string, an - * ArrayBuffer, a DataView, or a TypedArray. - * - * @param bytes the bytes to put. - * @param [encoding] the encoding for the first parameter ('binary', 'utf8', - * 'utf16', 'hex'), if it is a string (default: 'binary'). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putBytes = function(bytes, encoding) { - if(util.isArrayBufferView(bytes)) { - var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength); - var len = src.byteLength - src.byteOffset; - this.accommodate(len); - var dst = new Uint8Array(this.data.buffer, this.write); - dst.set(src); - this.write += len; - return this; - } - - if(util.isArrayBuffer(bytes)) { - var src = new Uint8Array(bytes); - this.accommodate(src.byteLength); - var dst = new Uint8Array(this.data.buffer); - dst.set(src, this.write); - this.write += src.byteLength; - return this; - } - - // bytes is a util.DataBuffer or equivalent - if(bytes instanceof util.DataBuffer || - (typeof bytes === 'object' && - typeof bytes.read === 'number' && typeof bytes.write === 'number' && - util.isArrayBufferView(bytes.data))) { - var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length()); - this.accommodate(src.byteLength); - var dst = new Uint8Array(bytes.data.byteLength, this.write); - dst.set(src); - this.write += src.byteLength; - return this; - } - - if(bytes instanceof util.ByteStringBuffer) { - // copy binary string and process as the same as a string parameter below - bytes = bytes.data; - encoding = 'binary'; - } - - // string conversion - encoding = encoding || 'binary'; - if(typeof bytes === 'string') { - var view; - - // decode from string - if(encoding === 'hex') { - this.accommodate(Math.ceil(bytes.length / 2)); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.hex.decode(bytes, view, this.write); - return this; - } - if(encoding === 'base64') { - this.accommodate(Math.ceil(bytes.length / 4) * 3); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.base64.decode(bytes, view, this.write); - return this; - } - - // encode text as UTF-8 bytes - if(encoding === 'utf8') { - // encode as UTF-8 then decode string as raw binary - bytes = util.encodeUtf8(bytes); - encoding = 'binary'; - } - - // decode string as raw binary - if(encoding === 'binary' || encoding === 'raw') { - // one byte per character - this.accommodate(bytes.length); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.raw.decode(view); - return this; - } - - // encode text as UTF-16 bytes - if(encoding === 'utf16') { - // two bytes per character - this.accommodate(bytes.length * 2); - view = new Uint16Array(this.data.buffer, this.write); - this.write += util.text.utf16.encode(view); - return this; - } - - throw new Error('Invalid encoding: ' + encoding); - } - - throw Error('Invalid parameter: ' + bytes); -}; - -/** - * Puts the given buffer into this buffer. - * - * @param buffer the buffer to put into this one. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putBuffer = function(buffer) { - this.putBytes(buffer); - buffer.clear(); - return this; -}; - -/** - * Puts a string into this buffer. - * - * @param str the string to put. - * @param [encoding] the encoding for the string (default: 'utf16'). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putString = function(str) { - return this.putBytes(str, 'utf16'); -}; - -/** - * Puts a 16-bit integer in this buffer in big-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt16 = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i); - this.write += 2; - return this; -}; - -/** - * Puts a 24-bit integer in this buffer in big-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt24 = function(i) { - this.accommodate(3); - this.data.setInt16(this.write, i >> 8 & 0xFFFF); - this.data.setInt8(this.write, i >> 16 & 0xFF); - this.write += 3; - return this; -}; - -/** - * Puts a 32-bit integer in this buffer in big-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt32 = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i); - this.write += 4; - return this; -}; - -/** - * Puts a 16-bit integer in this buffer in little-endian order. - * - * @param i the 16-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt16Le = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i, true); - this.write += 2; - return this; -}; - -/** - * Puts a 24-bit integer in this buffer in little-endian order. - * - * @param i the 24-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt24Le = function(i) { - this.accommodate(3); - this.data.setInt8(this.write, i >> 16 & 0xFF); - this.data.setInt16(this.write, i >> 8 & 0xFFFF, true); - this.write += 3; - return this; -}; - -/** - * Puts a 32-bit integer in this buffer in little-endian order. - * - * @param i the 32-bit integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt32Le = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i, true); - this.write += 4; - return this; -}; - -/** - * Puts an n-bit integer in this buffer in big-endian order. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return this buffer. - */ -util.DataBuffer.prototype.putInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - do { - n -= 8; - this.data.setInt8(this.write++, (i >> n) & 0xFF); - } while(n > 0); - return this; -}; - -/** - * Puts a signed n-bit integer in this buffer in big-endian order. Two's - * complement representation is used. - * - * @param i the n-bit integer. - * @param n the number of bits in the integer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.putSignedInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - if(i < 0) { - i += 2 << (n - 1); - } - return this.putInt(i, n); -}; - -/** - * Gets a byte from this buffer and advances the read pointer by 1. - * - * @return the byte. - */ -util.DataBuffer.prototype.getByte = function() { - return this.data.getInt8(this.read++); -}; - -/** - * Gets a uint16 from this buffer in big-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.DataBuffer.prototype.getInt16 = function() { - var rval = this.data.getInt16(this.read); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in big-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.DataBuffer.prototype.getInt24 = function() { - var rval = ( - this.data.getInt16(this.read) << 8 ^ - this.data.getInt8(this.read + 2)); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in big-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.DataBuffer.prototype.getInt32 = function() { - var rval = this.data.getInt32(this.read); - this.read += 4; - return rval; -}; - -/** - * Gets a uint16 from this buffer in little-endian order and advances the read - * pointer by 2. - * - * @return the uint16. - */ -util.DataBuffer.prototype.getInt16Le = function() { - var rval = this.data.getInt16(this.read, true); - this.read += 2; - return rval; -}; - -/** - * Gets a uint24 from this buffer in little-endian order and advances the read - * pointer by 3. - * - * @return the uint24. - */ -util.DataBuffer.prototype.getInt24Le = function() { - var rval = ( - this.data.getInt8(this.read) ^ - this.data.getInt16(this.read + 1, true) << 8); - this.read += 3; - return rval; -}; - -/** - * Gets a uint32 from this buffer in little-endian order and advances the read - * pointer by 4. - * - * @return the word. - */ -util.DataBuffer.prototype.getInt32Le = function() { - var rval = this.data.getInt32(this.read, true); - this.read += 4; - return rval; -}; - -/** - * Gets an n-bit integer from this buffer in big-endian order and advances the - * read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.DataBuffer.prototype.getInt = function(n) { - _checkBitsParam(n); - var rval = 0; - do { - // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits. - rval = (rval << 8) + this.data.getInt8(this.read++); - n -= 8; - } while(n > 0); - return rval; -}; - -/** - * Gets a signed n-bit integer from this buffer in big-endian order, using - * two's complement, and advances the read pointer by n/8. - * - * @param n the number of bits in the integer (8, 16, 24, or 32). - * - * @return the integer. - */ -util.DataBuffer.prototype.getSignedInt = function(n) { - // getInt checks n - var x = this.getInt(n); - var max = 2 << (n - 2); - if(x >= max) { - x -= max << 1; - } - return x; -}; - -/** - * Reads bytes out as a binary encoded string and clears them from the - * buffer. - * - * @param count the number of bytes to read, undefined or null for all. - * - * @return a binary encoded string of bytes. - */ -util.DataBuffer.prototype.getBytes = function(count) { - // TODO: deprecate this method, it is poorly named and - // this.toString('binary') replaces it - // add a toTypedArray()/toArrayBuffer() function - var rval; - if(count) { - // read count bytes - count = Math.min(this.length(), count); - rval = this.data.slice(this.read, this.read + count); - this.read += count; - } else if(count === 0) { - rval = ''; - } else { - // read all bytes, optimize to only copy when needed - rval = (this.read === 0) ? this.data : this.data.slice(this.read); - this.clear(); - } - return rval; -}; - -/** - * Gets a binary encoded string of the bytes from this buffer without - * modifying the read pointer. - * - * @param count the number of bytes to get, omit to get all. - * - * @return a string full of binary encoded characters. - */ -util.DataBuffer.prototype.bytes = function(count) { - // TODO: deprecate this method, it is poorly named, add "getString()" - return (typeof(count) === 'undefined' ? - this.data.slice(this.read) : - this.data.slice(this.read, this.read + count)); -}; - -/** - * Gets a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * - * @return the byte. - */ -util.DataBuffer.prototype.at = function(i) { - return this.data.getUint8(this.read + i); -}; - -/** - * Puts a byte at the given index without modifying the read pointer. - * - * @param i the byte index. - * @param b the byte to put. - * - * @return this buffer. - */ -util.DataBuffer.prototype.setAt = function(i, b) { - this.data.setUint8(i, b); - return this; -}; - -/** - * Gets the last byte without modifying the read pointer. - * - * @return the last byte. - */ -util.DataBuffer.prototype.last = function() { - return this.data.getUint8(this.write - 1); -}; - -/** - * Creates a copy of this buffer. - * - * @return the copy. - */ -util.DataBuffer.prototype.copy = function() { - return new util.DataBuffer(this); -}; - -/** - * Compacts this buffer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.compact = function() { - if(this.read > 0) { - var src = new Uint8Array(this.data.buffer, this.read); - var dst = new Uint8Array(src.byteLength); - dst.set(src); - this.data = new DataView(dst); - this.write -= this.read; - this.read = 0; - } - return this; -}; - -/** - * Clears this buffer. - * - * @return this buffer. - */ -util.DataBuffer.prototype.clear = function() { - this.data = new DataView(new ArrayBuffer(0)); - this.read = this.write = 0; - return this; -}; - -/** - * Shortens this buffer by triming bytes off of the end of this buffer. - * - * @param count the number of bytes to trim off. - * - * @return this buffer. - */ -util.DataBuffer.prototype.truncate = function(count) { - this.write = Math.max(0, this.length() - count); - this.read = Math.min(this.read, this.write); - return this; -}; - -/** - * Converts this buffer to a hexadecimal string. - * - * @return a hexadecimal string. - */ -util.DataBuffer.prototype.toHex = function() { - var rval = ''; - for(var i = this.read; i < this.data.byteLength; ++i) { - var b = this.data.getUint8(i); - if(b < 16) { - rval += '0'; - } - rval += b.toString(16); - } - return rval; -}; - -/** - * Converts this buffer to a string, using the given encoding. If no - * encoding is given, 'utf8' (UTF-8) is used. - * - * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex', - * 'base64' (default: 'utf8'). - * - * @return a string representation of the bytes in this buffer. - */ -util.DataBuffer.prototype.toString = function(encoding) { - var view = new Uint8Array(this.data, this.read, this.length()); - encoding = encoding || 'utf8'; - - // encode to string - if(encoding === 'binary' || encoding === 'raw') { - return util.binary.raw.encode(view); - } - if(encoding === 'hex') { - return util.binary.hex.encode(view); - } - if(encoding === 'base64') { - return util.binary.base64.encode(view); - } - - // decode to text - if(encoding === 'utf8') { - return util.text.utf8.decode(view); - } - if(encoding === 'utf16') { - return util.text.utf16.decode(view); - } - - throw new Error('Invalid encoding: ' + encoding); -}; - -/** End Buffer w/UInt8Array backing */ - -/** - * Creates a buffer that stores bytes. A value may be given to populate the - * buffer with data. This value can either be string of encoded bytes or a - * regular string of characters. When passing a string of binary encoded - * bytes, the encoding `raw` should be given. This is also the default. When - * passing a string of characters, the encoding `utf8` should be given. - * - * @param [input] a string with encoded bytes to store in the buffer. - * @param [encoding] (default: 'raw', other: 'utf8'). - */ -util.createBuffer = function(input, encoding) { - // TODO: deprecate, use new ByteBuffer() instead - encoding = encoding || 'raw'; - if(input !== undefined && encoding === 'utf8') { - input = util.encodeUtf8(input); - } - return new util.ByteBuffer(input); -}; - -/** - * Fills a string with a particular value. If you want the string to be a byte - * string, pass in String.fromCharCode(theByte). - * - * @param c the character to fill the string with, use String.fromCharCode - * to fill the string with a byte value. - * @param n the number of characters of value c to fill with. - * - * @return the filled string. - */ -util.fillString = function(c, n) { - var s = ''; - while(n > 0) { - if(n & 1) { - s += c; - } - n >>>= 1; - if(n > 0) { - c += c; - } - } - return s; -}; - -/** - * Performs a per byte XOR between two byte strings and returns the result as a - * string of bytes. - * - * @param s1 first string of bytes. - * @param s2 second string of bytes. - * @param n the number of bytes to XOR. - * - * @return the XOR'd result. - */ -util.xorBytes = function(s1, s2, n) { - var s3 = ''; - var b = ''; - var t = ''; - var i = 0; - var c = 0; - for(; n > 0; --n, ++i) { - b = s1.charCodeAt(i) ^ s2.charCodeAt(i); - if(c >= 10) { - s3 += t; - t = ''; - c = 0; - } - t += String.fromCharCode(b); - ++c; - } - s3 += t; - return s3; -}; - -/** - * Converts a hex string into a 'binary' encoded string of bytes. - * - * @param hex the hexadecimal string to convert. - * - * @return the binary-encoded string of bytes. - */ -util.hexToBytes = function(hex) { - // TODO: deprecate: "Deprecated. Use util.binary.hex.decode instead." - var rval = ''; - var i = 0; - if(hex.length & 1 == 1) { - // odd number of characters, convert first character alone - i = 1; - rval += String.fromCharCode(parseInt(hex[0], 16)); - } - // convert 2 characters (1 byte) at a time - for(; i < hex.length; i += 2) { - rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); - } - return rval; -}; - -/** - * Converts a 'binary' encoded string of bytes to hex. - * - * @param bytes the byte string to convert. - * - * @return the string of hexadecimal characters. - */ -util.bytesToHex = function(bytes) { - // TODO: deprecate: "Deprecated. Use util.binary.hex.encode instead." - return util.createBuffer(bytes).toHex(); -}; - -/** - * Converts an 32-bit integer to 4-big-endian byte string. - * - * @param i the integer. - * - * @return the byte string. - */ -util.int32ToBytes = function(i) { - return ( - String.fromCharCode(i >> 24 & 0xFF) + - String.fromCharCode(i >> 16 & 0xFF) + - String.fromCharCode(i >> 8 & 0xFF) + - String.fromCharCode(i & 0xFF)); -}; - -// base64 characters, reverse mapping -var _base64 = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; -var _base64Idx = [ -/*43 -43 = 0*/ -/*'+', 1, 2, 3,'/' */ - 62, -1, -1, -1, 63, - -/*'0','1','2','3','4','5','6','7','8','9' */ - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - -/*15, 16, 17,'=', 19, 20, 21 */ - -1, -1, -1, 64, -1, -1, -1, - -/*65 - 43 = 22*/ -/*'A','B','C','D','E','F','G','H','I','J','K','L','M', */ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - -/*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - -/*91 - 43 = 48 */ -/*48, 49, 50, 51, 52, 53 */ - -1, -1, -1, -1, -1, -1, - -/*97 - 43 = 54*/ -/*'a','b','c','d','e','f','g','h','i','j','k','l','m' */ - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - -/*'n','o','p','q','r','s','t','u','v','w','x','y','z' */ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 -]; - -// base58 characters (Bitcoin alphabet) -var _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - -/** - * Base64 encodes a 'binary' encoded string of bytes. - * - * @param input the binary encoded string of bytes to base64-encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the base64-encoded output. - */ -util.encode64 = function(input, maxline) { - // TODO: deprecate: "Deprecated. Use util.binary.base64.encode instead." - var line = ''; - var output = ''; - var chr1, chr2, chr3; - var i = 0; - while(i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - // encode 4 character group - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); - if(isNaN(chr2)) { - line += '=='; - } else { - line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); - line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); - } - - if(maxline && line.length > maxline) { - output += line.substr(0, maxline) + '\r\n'; - line = line.substr(maxline); - } - } - output += line; - return output; -}; - -/** - * Base64 decodes a string into a 'binary' encoded string of bytes. - * - * @param input the base64-encoded input. - * - * @return the binary encoded string. - */ -util.decode64 = function(input) { - // TODO: deprecate: "Deprecated. Use util.binary.base64.decode instead." - - // remove all non-base64 characters - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); - - var output = ''; - var enc1, enc2, enc3, enc4; - var i = 0; - - while(i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - - output += String.fromCharCode((enc1 << 2) | (enc2 >> 4)); - if(enc3 !== 64) { - // decoded at least 2 bytes - output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2)); - if(enc4 !== 64) { - // decoded 3 bytes - output += String.fromCharCode(((enc3 & 3) << 6) | enc4); - } - } - } - - return output; -}; - -/** - * Encodes the given string of characters (a standard JavaScript - * string) as a binary encoded string where the bytes represent - * a UTF-8 encoded string of characters. Non-ASCII characters will be - * encoded as multiple bytes according to UTF-8. - * - * @param str a standard string of characters to encode. - * - * @return the binary encoded string. - */ -util.encodeUtf8 = function(str) { - return unescape(encodeURIComponent(str)); -}; - -/** - * Decodes a binary encoded string that contains bytes that - * represent a UTF-8 encoded string of characters -- into a - * string of characters (a standard JavaScript string). - * - * @param str the binary encoded string to decode. - * - * @return the resulting standard string of characters. - */ -util.decodeUtf8 = function(str) { - return decodeURIComponent(escape(str)); -}; - -// binary encoding/decoding tools -// FIXME: Experimental. Do not use yet. -util.binary = { - raw: {}, - hex: {}, - base64: {}, - base58: {}, - baseN : { - encode: baseN.encode, - decode: baseN.decode - } -}; - -/** - * Encodes a Uint8Array as a binary-encoded string. This encoding uses - * a value between 0 and 255 for each character. - * - * @param bytes the Uint8Array to encode. - * - * @return the binary-encoded string. - */ -util.binary.raw.encode = function(bytes) { - return String.fromCharCode.apply(null, bytes); -}; - -/** - * Decodes a binary-encoded string to a Uint8Array. This encoding uses - * a value between 0 and 255 for each character. - * - * @param str the binary-encoded string to decode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.raw.decode = function(str, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for(var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? (j - offset) : out; -}; - -/** - * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or - * ByteBuffer as a string of hexadecimal characters. - * - * @param bytes the bytes to convert. - * - * @return the string of hexadecimal characters. - */ -util.binary.hex.encode = util.bytesToHex; - -/** - * Decodes a hex-encoded string to a Uint8Array. - * - * @param hex the hexadecimal string to convert. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.hex.decode = function(hex, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(Math.ceil(hex.length / 2)); - } - offset = offset || 0; - var i = 0, j = offset; - if(hex.length & 1) { - // odd number of characters, convert first character alone - i = 1; - out[j++] = parseInt(hex[0], 16); - } - // convert 2 characters (1 byte) at a time - for(; i < hex.length; i += 2) { - out[j++] = parseInt(hex.substr(i, 2), 16); - } - return output ? (j - offset) : out; -}; - -/** - * Base64-encodes a Uint8Array. - * - * @param input the Uint8Array to encode. - * @param maxline the maximum number of encoded characters per line to use, - * defaults to none. - * - * @return the base64-encoded output string. - */ -util.binary.base64.encode = function(input, maxline) { - var line = ''; - var output = ''; - var chr1, chr2, chr3; - var i = 0; - while(i < input.byteLength) { - chr1 = input[i++]; - chr2 = input[i++]; - chr3 = input[i++]; - - // encode 4 character group - line += _base64.charAt(chr1 >> 2); - line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4)); - if(isNaN(chr2)) { - line += '=='; - } else { - line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6)); - line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63); - } - - if(maxline && line.length > maxline) { - output += line.substr(0, maxline) + '\r\n'; - line = line.substr(maxline); - } - } - output += line; - return output; -}; - -/** - * Decodes a base64-encoded string to a Uint8Array. - * - * @param input the base64-encoded input string. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.binary.base64.decode = function(input, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(Math.ceil(input.length / 4) * 3); - } - - // remove all non-base64 characters - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); - - offset = offset || 0; - var enc1, enc2, enc3, enc4; - var i = 0, j = offset; - - while(i < input.length) { - enc1 = _base64Idx[input.charCodeAt(i++) - 43]; - enc2 = _base64Idx[input.charCodeAt(i++) - 43]; - enc3 = _base64Idx[input.charCodeAt(i++) - 43]; - enc4 = _base64Idx[input.charCodeAt(i++) - 43]; - - out[j++] = (enc1 << 2) | (enc2 >> 4); - if(enc3 !== 64) { - // decoded at least 2 bytes - out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2); - if(enc4 !== 64) { - // decoded 3 bytes - out[j++] = ((enc3 & 3) << 6) | enc4; - } - } - } - - // make sure result is the exact decoded length - return output ? (j - offset) : out.subarray(0, j); -}; - -// add support for base58 encoding/decoding with Bitcoin alphabet -util.binary.base58.encode = function(input, maxline) { - return util.binary.baseN.encode(input, _base58, maxline); -}; -util.binary.base58.decode = function(input, maxline) { - return util.binary.baseN.decode(input, _base58, maxline); -}; - -// text encoding/decoding tools -// FIXME: Experimental. Do not use yet. -util.text = { - utf8: {}, - utf16: {} -}; - -/** - * Encodes the given string as UTF-8 in a Uint8Array. - * - * @param str the string to encode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.text.utf8.encode = function(str, output, offset) { - str = util.encodeUtf8(str); - var out = output; - if(!out) { - out = new Uint8Array(str.length); - } - offset = offset || 0; - var j = offset; - for(var i = 0; i < str.length; ++i) { - out[j++] = str.charCodeAt(i); - } - return output ? (j - offset) : out; -}; - -/** - * Decodes the UTF-8 contents from a Uint8Array. - * - * @param bytes the Uint8Array to decode. - * - * @return the resulting string. - */ -util.text.utf8.decode = function(bytes) { - return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); -}; - -/** - * Encodes the given string as UTF-16 in a Uint8Array. - * - * @param str the string to encode. - * @param [output] an optional Uint8Array to write the output to; if it - * is too small, an exception will be thrown. - * @param [offset] the start offset for writing to the output (default: 0). - * - * @return the Uint8Array or the number of bytes written if output was given. - */ -util.text.utf16.encode = function(str, output, offset) { - var out = output; - if(!out) { - out = new Uint8Array(str.length * 2); - } - var view = new Uint16Array(out.buffer); - offset = offset || 0; - var j = offset; - var k = offset; - for(var i = 0; i < str.length; ++i) { - view[k++] = str.charCodeAt(i); - j += 2; - } - return output ? (j - offset) : out; -}; - -/** - * Decodes the UTF-16 contents from a Uint8Array. - * - * @param bytes the Uint8Array to decode. - * - * @return the resulting string. - */ -util.text.utf16.decode = function(bytes) { - return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); -}; - -/** - * Deflates the given data using a flash interface. - * - * @param api the flash interface. - * @param bytes the data. - * @param raw true to return only raw deflate data, false to include zlib - * header and trailer. - * - * @return the deflated data as a string. - */ -util.deflate = function(api, bytes, raw) { - bytes = util.decode64(api.deflate(util.encode64(bytes)).rval); - - // strip zlib header and trailer if necessary - if(raw) { - // zlib header is 2 bytes (CMF,FLG) where FLG indicates that - // there is a 4-byte DICT (alder-32) block before the data if - // its 5th bit is set - var start = 2; - var flg = bytes.charCodeAt(1); - if(flg & 0x20) { - start = 6; - } - // zlib trailer is 4 bytes of adler-32 - bytes = bytes.substring(start, bytes.length - 4); - } - - return bytes; -}; - -/** - * Inflates the given data using a flash interface. - * - * @param api the flash interface. - * @param bytes the data. - * @param raw true if the incoming data has no zlib header or trailer and is - * raw DEFLATE data. - * - * @return the inflated data as a string, null on error. - */ -util.inflate = function(api, bytes, raw) { - // TODO: add zlib header and trailer if necessary/possible - var rval = api.inflate(util.encode64(bytes)).rval; - return (rval === null) ? null : util.decode64(rval); -}; - -/** - * Sets a storage object. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param obj the storage object, null to remove. - */ -var _setStorageObject = function(api, id, obj) { - if(!api) { - throw new Error('WebStorage not available.'); - } - - var rval; - if(obj === null) { - rval = api.removeItem(id); - } else { - // json-encode and base64-encode object - obj = util.encode64(JSON.stringify(obj)); - rval = api.setItem(id, obj); - } - - // handle potential flash error - if(typeof(rval) !== 'undefined' && rval.rval !== true) { - var error = new Error(rval.error.message); - error.id = rval.error.id; - error.name = rval.error.name; - throw error; - } -}; - -/** - * Gets a storage object. - * - * @param api the storage interface. - * @param id the storage ID to use. - * - * @return the storage object entry or null if none exists. - */ -var _getStorageObject = function(api, id) { - if(!api) { - throw new Error('WebStorage not available.'); - } - - // get the existing entry - var rval = api.getItem(id); - - /* Note: We check api.init because we can't do (api == localStorage) - on IE because of "Class doesn't support Automation" exception. Only - the flash api has an init method so this works too, but we need a - better solution in the future. */ - - // flash returns item wrapped in an object, handle special case - if(api.init) { - if(rval.rval === null) { - if(rval.error) { - var error = new Error(rval.error.message); - error.id = rval.error.id; - error.name = rval.error.name; - throw error; - } - // no error, but also no item - rval = null; - } else { - rval = rval.rval; - } - } - - // handle decoding - if(rval !== null) { - // base64-decode and json-decode data - rval = JSON.parse(util.decode64(rval)); - } - - return rval; -}; - -/** - * Stores an item in local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - * @param data the data for the item (any javascript object/primitive). - */ -var _setItem = function(api, id, key, data) { - // get storage object - var obj = _getStorageObject(api, id); - if(obj === null) { - // create a new storage object - obj = {}; - } - // update key - obj[key] = data; - - // set storage object - _setStorageObject(api, id, obj); -}; - -/** - * Gets an item from local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - * - * @return the item. - */ -var _getItem = function(api, id, key) { - // get storage object - var rval = _getStorageObject(api, id); - if(rval !== null) { - // return data at key - rval = (key in rval) ? rval[key] : null; - } - - return rval; -}; - -/** - * Removes an item from local storage. - * - * @param api the storage interface. - * @param id the storage ID to use. - * @param key the key for the item. - */ -var _removeItem = function(api, id, key) { - // get storage object - var obj = _getStorageObject(api, id); - if(obj !== null && key in obj) { - // remove key - delete obj[key]; - - // see if entry has no keys remaining - var empty = true; - for(var prop in obj) { - empty = false; - break; - } - if(empty) { - // remove entry entirely if no keys are left - obj = null; - } - - // set storage object - _setStorageObject(api, id, obj); - } -}; - -/** - * Clears the local disk storage identified by the given ID. - * - * @param api the storage interface. - * @param id the storage ID to use. - */ -var _clearItems = function(api, id) { - _setStorageObject(api, id, null); -}; - -/** - * Calls a storage function. - * - * @param func the function to call. - * @param args the arguments for the function. - * @param location the location argument. - * - * @return the return value from the function. - */ -var _callStorageFunction = function(func, args, location) { - var rval = null; - - // default storage types - if(typeof(location) === 'undefined') { - location = ['web', 'flash']; - } - - // apply storage types in order of preference - var type; - var done = false; - var exception = null; - for(var idx in location) { - type = location[idx]; - try { - if(type === 'flash' || type === 'both') { - if(args[0] === null) { - throw new Error('Flash local storage not available.'); - } - rval = func.apply(this, args); - done = (type === 'flash'); - } - if(type === 'web' || type === 'both') { - args[0] = localStorage; - rval = func.apply(this, args); - done = true; - } - } catch(ex) { - exception = ex; - } - if(done) { - break; - } - } - - if(!done) { - throw exception; - } - - return rval; -}; - -/** - * Stores an item on local disk. - * - * The available types of local storage include 'flash', 'web', and 'both'. - * - * The type 'flash' refers to flash local storage (SharedObject). In order - * to use flash local storage, the 'api' parameter must be valid. The type - * 'web' refers to WebStorage, if supported by the browser. The type 'both' - * refers to storing using both 'flash' and 'web', not just one or the - * other. - * - * The location array should list the storage types to use in order of - * preference: - * - * ['flash']: flash only storage - * ['web']: web only storage - * ['both']: try to store in both - * ['flash','web']: store in flash first, but if not available, 'web' - * ['web','flash']: store in web first, but if not available, 'flash' - * - * The location array defaults to: ['web', 'flash'] - * - * @param api the flash interface, null to use only WebStorage. - * @param id the storage ID to use. - * @param key the key for the item. - * @param data the data for the item (any javascript object/primitive). - * @param location an array with the preferred types of storage to use. - */ -util.setItem = function(api, id, key, data, location) { - _callStorageFunction(_setItem, arguments, location); -}; - -/** - * Gets an item on local disk. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface, null to use only WebStorage. - * @param id the storage ID to use. - * @param key the key for the item. - * @param location an array with the preferred types of storage to use. - * - * @return the item. - */ -util.getItem = function(api, id, key, location) { - return _callStorageFunction(_getItem, arguments, location); -}; - -/** - * Removes an item on local disk. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface. - * @param id the storage ID to use. - * @param key the key for the item. - * @param location an array with the preferred types of storage to use. - */ -util.removeItem = function(api, id, key, location) { - _callStorageFunction(_removeItem, arguments, location); -}; - -/** - * Clears the local disk storage identified by the given ID. - * - * Set setItem() for details on storage types. - * - * @param api the flash interface if flash is available. - * @param id the storage ID to use. - * @param location an array with the preferred types of storage to use. - */ -util.clearItems = function(api, id, location) { - _callStorageFunction(_clearItems, arguments, location); -}; - -/** - * Parses the scheme, host, and port from an http(s) url. - * - * @param str the url string. - * - * @return the parsed url object or null if the url is invalid. - */ -util.parseUrl = function(str) { - // FIXME: this regex looks a bit broken - var regex = /^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g; - regex.lastIndex = 0; - var m = regex.exec(str); - var url = (m === null) ? null : { - full: str, - scheme: m[1], - host: m[2], - port: m[3], - path: m[4] - }; - if(url) { - url.fullHost = url.host; - if(url.port) { - if(url.port !== 80 && url.scheme === 'http') { - url.fullHost += ':' + url.port; - } else if(url.port !== 443 && url.scheme === 'https') { - url.fullHost += ':' + url.port; - } - } else if(url.scheme === 'http') { - url.port = 80; - } else if(url.scheme === 'https') { - url.port = 443; - } - url.full = url.scheme + '://' + url.fullHost; - } - return url; -}; - -/* Storage for query variables */ -var _queryVariables = null; - -/** - * Returns the window location query variables. Query is parsed on the first - * call and the same object is returned on subsequent calls. The mapping - * is from keys to an array of values. Parameters without values will have - * an object key set but no value added to the value array. Values are - * unescaped. - * - * ...?k1=v1&k2=v2: - * { - * "k1": ["v1"], - * "k2": ["v2"] - * } - * - * ...?k1=v1&k1=v2: - * { - * "k1": ["v1", "v2"] - * } - * - * ...?k1=v1&k2: - * { - * "k1": ["v1"], - * "k2": [] - * } - * - * ...?k1=v1&k1: - * { - * "k1": ["v1"] - * } - * - * ...?k1&k1: - * { - * "k1": [] - * } - * - * @param query the query string to parse (optional, default to cached - * results from parsing window location search query). - * - * @return object mapping keys to variables. - */ -util.getQueryVariables = function(query) { - var parse = function(q) { - var rval = {}; - var kvpairs = q.split('&'); - for(var i = 0; i < kvpairs.length; i++) { - var pos = kvpairs[i].indexOf('='); - var key; - var val; - if(pos > 0) { - key = kvpairs[i].substring(0, pos); - val = kvpairs[i].substring(pos + 1); - } else { - key = kvpairs[i]; - val = null; - } - if(!(key in rval)) { - rval[key] = []; - } - // disallow overriding object prototype keys - if(!(key in Object.prototype) && val !== null) { - rval[key].push(unescape(val)); - } - } - return rval; - }; - - var rval; - if(typeof(query) === 'undefined') { - // set cached variables if needed - if(_queryVariables === null) { - if(typeof(window) !== 'undefined' && window.location && window.location.search) { - // parse window search query - _queryVariables = parse(window.location.search.substring(1)); - } else { - // no query variables available - _queryVariables = {}; - } - } - rval = _queryVariables; - } else { - // parse given query - rval = parse(query); - } - return rval; -}; - -/** - * Parses a fragment into a path and query. This method will take a URI - * fragment and break it up as if it were the main URI. For example: - * /bar/baz?a=1&b=2 - * results in: - * { - * path: ["bar", "baz"], - * query: {"k1": ["v1"], "k2": ["v2"]} - * } - * - * @return object with a path array and query object. - */ -util.parseFragment = function(fragment) { - // default to whole fragment - var fp = fragment; - var fq = ''; - // split into path and query if possible at the first '?' - var pos = fragment.indexOf('?'); - if(pos > 0) { - fp = fragment.substring(0, pos); - fq = fragment.substring(pos + 1); - } - // split path based on '/' and ignore first element if empty - var path = fp.split('/'); - if(path.length > 0 && path[0] === '') { - path.shift(); - } - // convert query into object - var query = (fq === '') ? {} : util.getQueryVariables(fq); - - return { - pathString: fp, - queryString: fq, - path: path, - query: query - }; -}; - -/** - * Makes a request out of a URI-like request string. This is intended to - * be used where a fragment id (after a URI '#') is parsed as a URI with - * path and query parts. The string should have a path beginning and - * delimited by '/' and optional query parameters following a '?'. The - * query should be a standard URL set of key value pairs delimited by - * '&'. For backwards compatibility the initial '/' on the path is not - * required. The request object has the following API, (fully described - * in the method code): - * { - * path: . - * query: , - * getPath(i): get part or all of the split path array, - * getQuery(k, i): get part or all of a query key array, - * getQueryLast(k, _default): get last element of a query key array. - * } - * - * @return object with request parameters. - */ -util.makeRequest = function(reqString) { - var frag = util.parseFragment(reqString); - var req = { - // full path string - path: frag.pathString, - // full query string - query: frag.queryString, - /** - * Get path or element in path. - * - * @param i optional path index. - * - * @return path or part of path if i provided. - */ - getPath: function(i) { - return (typeof(i) === 'undefined') ? frag.path : frag.path[i]; - }, - /** - * Get query, values for a key, or value for a key index. - * - * @param k optional query key. - * @param i optional query key index. - * - * @return query, values for a key, or value for a key index. - */ - getQuery: function(k, i) { - var rval; - if(typeof(k) === 'undefined') { - rval = frag.query; - } else { - rval = frag.query[k]; - if(rval && typeof(i) !== 'undefined') { - rval = rval[i]; - } - } - return rval; - }, - getQueryLast: function(k, _default) { - var rval; - var vals = req.getQuery(k); - if(vals) { - rval = vals[vals.length - 1]; - } else { - rval = _default; - } - return rval; - } - }; - return req; -}; - -/** - * Makes a URI out of a path, an object with query parameters, and a - * fragment. Uses jQuery.param() internally for query string creation. - * If the path is an array, it will be joined with '/'. - * - * @param path string path or array of strings. - * @param query object with query parameters. (optional) - * @param fragment fragment string. (optional) - * - * @return string object with request parameters. - */ -util.makeLink = function(path, query, fragment) { - // join path parts if needed - path = jQuery.isArray(path) ? path.join('/') : path; - - var qstr = jQuery.param(query || {}); - fragment = fragment || ''; - return path + - ((qstr.length > 0) ? ('?' + qstr) : '') + - ((fragment.length > 0) ? ('#' + fragment) : ''); -}; - -/** - * Check if an object is empty. - * - * Taken from: - * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937 - * - * @param object the object to check. - */ -util.isEmpty = function(obj) { - for(var prop in obj) { - if(obj.hasOwnProperty(prop)) { - return false; - } - } - return true; -}; - -/** - * Format with simple printf-style interpolation. - * - * %%: literal '%' - * %s,%o: convert next argument into a string. - * - * @param format the string to format. - * @param ... arguments to interpolate into the format string. - */ -util.format = function(format) { - var re = /%./g; - // current match - var match; - // current part - var part; - // current arg index - var argi = 0; - // collected parts to recombine later - var parts = []; - // last index found - var last = 0; - // loop while matches remain - while((match = re.exec(format))) { - part = format.substring(last, re.lastIndex - 2); - // don't add empty strings (ie, parts between %s%s) - if(part.length > 0) { - parts.push(part); - } - last = re.lastIndex; - // switch on % code - var code = match[0][1]; - switch(code) { - case 's': - case 'o': - // check if enough arguments were given - if(argi < arguments.length) { - parts.push(arguments[argi++ + 1]); - } else { - parts.push(''); - } - break; - // FIXME: do proper formating for numbers, etc - //case 'f': - //case 'd': - case '%': - parts.push('%'); - break; - default: - parts.push('<%' + code + '?>'); - } - } - // add trailing part of format string - parts.push(format.substring(last)); - return parts.join(''); -}; - -/** - * Formats a number. - * - * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/ - */ -util.formatNumber = function(number, decimals, dec_point, thousands_sep) { - // http://kevin.vanzonneveld.net - // + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) - // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) - // + bugfix by: Michael White (http://crestidg.com) - // + bugfix by: Benjamin Lupton - // + bugfix by: Allan Jensen (http://www.winternet.no) - // + revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) - // * example 1: number_format(1234.5678, 2, '.', ''); - // * returns 1: 1234.57 - - var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals; - var d = dec_point === undefined ? ',' : dec_point; - var t = thousands_sep === undefined ? - '.' : thousands_sep, s = n < 0 ? '-' : ''; - var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + ''; - var j = (i.length > 3) ? i.length % 3 : 0; - return s + (j ? i.substr(0, j) + t : '') + - i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + - (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); -}; - -/** - * Formats a byte size. - * - * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/ - */ -util.formatSize = function(size) { - if(size >= 1073741824) { - size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB'; - } else if(size >= 1048576) { - size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB'; - } else if(size >= 1024) { - size = util.formatNumber(size / 1024, 0) + ' KiB'; - } else { - size = util.formatNumber(size, 0) + ' bytes'; - } - return size; -}; - -/** - * Converts an IPv4 or IPv6 string representation into bytes (in network order). - * - * @param ip the IPv4 or IPv6 address to convert. - * - * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't - * be parsed. - */ -util.bytesFromIP = function(ip) { - if(ip.indexOf('.') !== -1) { - return util.bytesFromIPv4(ip); - } - if(ip.indexOf(':') !== -1) { - return util.bytesFromIPv6(ip); - } - return null; -}; - -/** - * Converts an IPv4 string representation into bytes (in network order). - * - * @param ip the IPv4 address to convert. - * - * @return the 4-byte address or null if the address can't be parsed. - */ -util.bytesFromIPv4 = function(ip) { - ip = ip.split('.'); - if(ip.length !== 4) { - return null; - } - var b = util.createBuffer(); - for(var i = 0; i < ip.length; ++i) { - var num = parseInt(ip[i], 10); - if(isNaN(num)) { - return null; - } - b.putByte(num); - } - return b.getBytes(); -}; - -/** - * Converts an IPv6 string representation into bytes (in network order). - * - * @param ip the IPv6 address to convert. - * - * @return the 16-byte address or null if the address can't be parsed. - */ -util.bytesFromIPv6 = function(ip) { - var blanks = 0; - ip = ip.split(':').filter(function(e) { - if(e.length === 0) ++blanks; - return true; - }); - var zeros = (8 - ip.length + blanks) * 2; - var b = util.createBuffer(); - for(var i = 0; i < 8; ++i) { - if(!ip[i] || ip[i].length === 0) { - b.fillWithByte(0, zeros); - zeros = 0; - continue; - } - var bytes = util.hexToBytes(ip[i]); - if(bytes.length < 2) { - b.putByte(0); - } - b.putBytes(bytes); - } - return b.getBytes(); -}; - -/** - * Converts 4-bytes into an IPv4 string representation or 16-bytes into - * an IPv6 string representation. The bytes must be in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv4 or IPv6 string representation if 4 or 16 bytes, - * respectively, are given, otherwise null. - */ -util.bytesToIP = function(bytes) { - if(bytes.length === 4) { - return util.bytesToIPv4(bytes); - } - if(bytes.length === 16) { - return util.bytesToIPv6(bytes); - } - return null; -}; - -/** - * Converts 4-bytes into an IPv4 string representation. The bytes must be - * in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv4 string representation or null for an invalid # of bytes. - */ -util.bytesToIPv4 = function(bytes) { - if(bytes.length !== 4) { - return null; - } - var ip = []; - for(var i = 0; i < bytes.length; ++i) { - ip.push(bytes.charCodeAt(i)); - } - return ip.join('.'); -}; - -/** - * Converts 16-bytes into an IPv16 string representation. The bytes must be - * in network order. - * - * @param bytes the bytes to convert. - * - * @return the IPv16 string representation or null for an invalid # of bytes. - */ -util.bytesToIPv6 = function(bytes) { - if(bytes.length !== 16) { - return null; - } - var ip = []; - var zeroGroups = []; - var zeroMaxGroup = 0; - for(var i = 0; i < bytes.length; i += 2) { - var hex = util.bytesToHex(bytes[i] + bytes[i + 1]); - // canonicalize zero representation - while(hex[0] === '0' && hex !== '0') { - hex = hex.substr(1); - } - if(hex === '0') { - var last = zeroGroups[zeroGroups.length - 1]; - var idx = ip.length; - if(!last || idx !== last.end + 1) { - zeroGroups.push({start: idx, end: idx}); - } else { - last.end = idx; - if((last.end - last.start) > - (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) { - zeroMaxGroup = zeroGroups.length - 1; - } - } - } - ip.push(hex); - } - if(zeroGroups.length > 0) { - var group = zeroGroups[zeroMaxGroup]; - // only shorten group of length > 0 - if(group.end - group.start > 0) { - ip.splice(group.start, group.end - group.start + 1, ''); - if(group.start === 0) { - ip.unshift(''); - } - if(group.end === 7) { - ip.push(''); - } - } - } - return ip.join(':'); -}; - -/** - * Estimates the number of processes that can be run concurrently. If - * creating Web Workers, keep in mind that the main JavaScript process needs - * its own core. - * - * @param options the options to use: - * update true to force an update (not use the cached value). - * @param callback(err, max) called once the operation completes. - */ -util.estimateCores = function(options, callback) { - if(typeof options === 'function') { - callback = options; - options = {}; - } - options = options || {}; - if('cores' in util && !options.update) { - return callback(null, util.cores); - } - if(typeof navigator !== 'undefined' && - 'hardwareConcurrency' in navigator && - navigator.hardwareConcurrency > 0) { - util.cores = navigator.hardwareConcurrency; - return callback(null, util.cores); - } - if(typeof Worker === 'undefined') { - // workers not available - util.cores = 1; - return callback(null, util.cores); - } - if(typeof Blob === 'undefined') { - // can't estimate, default to 2 - util.cores = 2; - return callback(null, util.cores); - } - - // create worker concurrency estimation code as blob - var blobUrl = URL.createObjectURL(new Blob(['(', - function() { - self.addEventListener('message', function(e) { - // run worker for 4 ms - var st = Date.now(); - var et = st + 4; - while(Date.now() < et); - self.postMessage({st: st, et: et}); - }); - }.toString(), - ')()'], {type: 'application/javascript'})); - - // take 5 samples using 16 workers - sample([], 5, 16); - - function sample(max, samples, numWorkers) { - if(samples === 0) { - // get overlap average - var avg = Math.floor(max.reduce(function(avg, x) { - return avg + x; - }, 0) / max.length); - util.cores = Math.max(1, avg); - URL.revokeObjectURL(blobUrl); - return callback(null, util.cores); - } - map(numWorkers, function(err, results) { - max.push(reduce(numWorkers, results)); - sample(max, samples - 1, numWorkers); - }); - } - - function map(numWorkers, callback) { - var workers = []; - var results = []; - for(var i = 0; i < numWorkers; ++i) { - var worker = new Worker(blobUrl); - worker.addEventListener('message', function(e) { - results.push(e.data); - if(results.length === numWorkers) { - for(var i = 0; i < numWorkers; ++i) { - workers[i].terminate(); - } - callback(null, results); - } - }); - workers.push(worker); - } - for(var i = 0; i < numWorkers; ++i) { - workers[i].postMessage(i); - } - } - - function reduce(numWorkers, results) { - // find overlapping time windows - var overlaps = []; - for(var n = 0; n < numWorkers; ++n) { - var r1 = results[n]; - var overlap = overlaps[n] = []; - for(var i = 0; i < numWorkers; ++i) { - if(n === i) { - continue; - } - var r2 = results[i]; - if((r1.st > r2.st && r1.st < r2.et) || - (r2.st > r1.st && r2.st < r1.et)) { - overlap.push(i); - } - } - } - // get maximum overlaps ... don't include overlapping worker itself - // as the main JS process was also being scheduled during the work and - // would have to be subtracted from the estimate anyway - return overlaps.reduce(function(max, overlap) { - return Math.max(max, overlap.length); - }, 0); - } -}; diff --git a/node_modules/node-forge/lib/x509.js b/node_modules/node-forge/lib/x509.js deleted file mode 100644 index 95dbc29..0000000 --- a/node_modules/node-forge/lib/x509.js +++ /dev/null @@ -1,3333 +0,0 @@ -/** - * Javascript implementation of X.509 and related components (such as - * Certification Signing Requests) of a Public Key Infrastructure. - * - * @author Dave Longley - * - * Copyright (c) 2010-2014 Digital Bazaar, Inc. - * - * The ASN.1 representation of an X.509v3 certificate is as follows - * (see RFC 2459): - * - * Certificate ::= SEQUENCE { - * tbsCertificate TBSCertificate, - * signatureAlgorithm AlgorithmIdentifier, - * signatureValue BIT STRING - * } - * - * TBSCertificate ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * serialNumber CertificateSerialNumber, - * signature AlgorithmIdentifier, - * issuer Name, - * validity Validity, - * subject Name, - * subjectPublicKeyInfo SubjectPublicKeyInfo, - * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, - * -- If present, version shall be v2 or v3 - * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, - * -- If present, version shall be v2 or v3 - * extensions [3] EXPLICIT Extensions OPTIONAL - * -- If present, version shall be v3 - * } - * - * Version ::= INTEGER { v1(0), v2(1), v3(2) } - * - * CertificateSerialNumber ::= INTEGER - * - * Name ::= CHOICE { - * // only one possible choice for now - * RDNSequence - * } - * - * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName - * - * RelativeDistinguishedName ::= SET OF AttributeTypeAndValue - * - * AttributeTypeAndValue ::= SEQUENCE { - * type AttributeType, - * value AttributeValue - * } - * AttributeType ::= OBJECT IDENTIFIER - * AttributeValue ::= ANY DEFINED BY AttributeType - * - * Validity ::= SEQUENCE { - * notBefore Time, - * notAfter Time - * } - * - * Time ::= CHOICE { - * utcTime UTCTime, - * generalTime GeneralizedTime - * } - * - * UniqueIdentifier ::= BIT STRING - * - * SubjectPublicKeyInfo ::= SEQUENCE { - * algorithm AlgorithmIdentifier, - * subjectPublicKey BIT STRING - * } - * - * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension - * - * Extension ::= SEQUENCE { - * extnID OBJECT IDENTIFIER, - * critical BOOLEAN DEFAULT FALSE, - * extnValue OCTET STRING - * } - * - * The only key algorithm currently supported for PKI is RSA. - * - * RSASSA-PSS signatures are described in RFC 3447 and RFC 4055. - * - * PKCS#10 v1.7 describes certificate signing requests: - * - * CertificationRequestInfo: - * - * CertificationRequestInfo ::= SEQUENCE { - * version INTEGER { v1(0) } (v1,...), - * subject Name, - * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, - * attributes [0] Attributes{{ CRIAttributes }} - * } - * - * Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }} - * - * CRIAttributes ATTRIBUTE ::= { - * ... -- add any locally defined attributes here -- } - * - * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE { - * type ATTRIBUTE.&id({IOSet}), - * values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type}) - * } - * - * CertificationRequest ::= SEQUENCE { - * certificationRequestInfo CertificationRequestInfo, - * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, - * signature BIT STRING - * } - */ -var forge = require('./forge'); -require('./aes'); -require('./asn1'); -require('./des'); -require('./md'); -require('./mgf'); -require('./oids'); -require('./pem'); -require('./pss'); -require('./rsa'); -require('./util'); - -// shortcut for asn.1 API -var asn1 = forge.asn1; - -/* Public Key Infrastructure (PKI) implementation. */ -var pki = module.exports = forge.pki = forge.pki || {}; -var oids = pki.oids; - -// short name OID mappings -var _shortNames = {}; -_shortNames['CN'] = oids['commonName']; -_shortNames['commonName'] = 'CN'; -_shortNames['C'] = oids['countryName']; -_shortNames['countryName'] = 'C'; -_shortNames['L'] = oids['localityName']; -_shortNames['localityName'] = 'L'; -_shortNames['ST'] = oids['stateOrProvinceName']; -_shortNames['stateOrProvinceName'] = 'ST'; -_shortNames['O'] = oids['organizationName']; -_shortNames['organizationName'] = 'O'; -_shortNames['OU'] = oids['organizationalUnitName']; -_shortNames['organizationalUnitName'] = 'OU'; -_shortNames['E'] = oids['emailAddress']; -_shortNames['emailAddress'] = 'E'; - -// validator for an SubjectPublicKeyInfo structure -// Note: Currently only works with an RSA public key -var publicKeyValidator = forge.pki.rsa.publicKeyValidator; - -// validator for an X.509v3 certificate -var x509CertificateValidator = { - name: 'Certificate', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'Certificate.TBSCertificate', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'tbsCertificate', - value: [{ - name: 'Certificate.TBSCertificate.version', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - value: [{ - name: 'Certificate.TBSCertificate.version.integer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'certVersion' - }] - }, { - name: 'Certificate.TBSCertificate.serialNumber', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'certSerialNumber' - }, { - name: 'Certificate.TBSCertificate.signature', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'Certificate.TBSCertificate.signature.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'certinfoSignatureOid' - }, { - name: 'Certificate.TBSCertificate.signature.parameters', - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: 'certinfoSignatureParams' - }] - }, { - name: 'Certificate.TBSCertificate.issuer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certIssuer' - }, { - name: 'Certificate.TBSCertificate.validity', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - // Note: UTC and generalized times may both appear so the capture - // names are based on their detected order, the names used below - // are only for the common case, which validity time really means - // "notBefore" and which means "notAfter" will be determined by order - value: [{ - // notBefore (Time) (UTC time case) - name: 'Certificate.TBSCertificate.validity.notBefore (utc)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.UTCTIME, - constructed: false, - optional: true, - capture: 'certValidity1UTCTime' - }, { - // notBefore (Time) (generalized time case) - name: 'Certificate.TBSCertificate.validity.notBefore (generalized)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.GENERALIZEDTIME, - constructed: false, - optional: true, - capture: 'certValidity2GeneralizedTime' - }, { - // notAfter (Time) (only UTC time is supported) - name: 'Certificate.TBSCertificate.validity.notAfter (utc)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.UTCTIME, - constructed: false, - optional: true, - capture: 'certValidity3UTCTime' - }, { - // notAfter (Time) (only UTC time is supported) - name: 'Certificate.TBSCertificate.validity.notAfter (generalized)', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.GENERALIZEDTIME, - constructed: false, - optional: true, - capture: 'certValidity4GeneralizedTime' - }] - }, { - // Name (subject) (RDNSequence) - name: 'Certificate.TBSCertificate.subject', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certSubject' - }, - // SubjectPublicKeyInfo - publicKeyValidator, - { - // issuerUniqueID (optional) - name: 'Certificate.TBSCertificate.issuerUniqueID', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - optional: true, - value: [{ - name: 'Certificate.TBSCertificate.issuerUniqueID.id', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - // TODO: support arbitrary bit length ids - captureBitStringValue: 'certIssuerUniqueId' - }] - }, { - // subjectUniqueID (optional) - name: 'Certificate.TBSCertificate.subjectUniqueID', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 2, - constructed: true, - optional: true, - value: [{ - name: 'Certificate.TBSCertificate.subjectUniqueID.id', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - // TODO: support arbitrary bit length ids - captureBitStringValue: 'certSubjectUniqueId' - }] - }, { - // Extensions (optional) - name: 'Certificate.TBSCertificate.extensions', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 3, - constructed: true, - captureAsn1: 'certExtensions', - optional: true - }] - }, { - // AlgorithmIdentifier (signature algorithm) - name: 'Certificate.signatureAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // algorithm - name: 'Certificate.signatureAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'certSignatureOid' - }, { - name: 'Certificate.TBSCertificate.signature.parameters', - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: 'certSignatureParams' - }] - }, { - // SignatureValue - name: 'Certificate.signatureValue', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - captureBitStringValue: 'certSignature' - }] -}; - -var rsassaPssParameterValidator = { - name: 'rsapss', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'rsapss.hashAlgorithm', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - value: [{ - name: 'rsapss.hashAlgorithm.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'hashOid' - /* parameter block omitted, for SHA1 NULL anyhow. */ - }] - }] - }, { - name: 'rsapss.maskGenAlgorithm', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 1, - constructed: true, - value: [{ - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.SEQUENCE, - constructed: true, - optional: true, - value: [{ - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'maskGenOid' - }, { - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'maskGenHashOid' - /* parameter block omitted, for SHA1 NULL anyhow. */ - }] - }] - }] - }, { - name: 'rsapss.saltLength', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 2, - optional: true, - value: [{ - name: 'rsapss.saltLength.saltLength', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.INTEGER, - constructed: false, - capture: 'saltLength' - }] - }, { - name: 'rsapss.trailerField', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 3, - optional: true, - value: [{ - name: 'rsapss.trailer.trailer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.INTEGER, - constructed: false, - capture: 'trailer' - }] - }] -}; - -// validator for a CertificationRequestInfo structure -var certificationRequestInfoValidator = { - name: 'CertificationRequestInfo', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certificationRequestInfo', - value: [{ - name: 'CertificationRequestInfo.integer', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, - constructed: false, - capture: 'certificationRequestInfoVersion' - }, { - // Name (subject) (RDNSequence) - name: 'CertificationRequestInfo.subject', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'certificationRequestInfoSubject' - }, - // SubjectPublicKeyInfo - publicKeyValidator, - { - name: 'CertificationRequestInfo.attributes', - tagClass: asn1.Class.CONTEXT_SPECIFIC, - type: 0, - constructed: true, - optional: true, - capture: 'certificationRequestInfoAttributes', - value: [{ - name: 'CertificationRequestInfo.attributes', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - name: 'CertificationRequestInfo.attributes.type', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false - }, { - name: 'CertificationRequestInfo.attributes.value', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, - constructed: true - }] - }] - }] -}; - -// validator for a CertificationRequest structure -var certificationRequestValidator = { - name: 'CertificationRequest', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - captureAsn1: 'csr', - value: [ - certificationRequestInfoValidator, { - // AlgorithmIdentifier (signature algorithm) - name: 'CertificationRequest.signatureAlgorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, - constructed: true, - value: [{ - // algorithm - name: 'CertificationRequest.signatureAlgorithm.algorithm', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, - constructed: false, - capture: 'csrSignatureOid' - }, { - name: 'CertificationRequest.signatureAlgorithm.parameters', - tagClass: asn1.Class.UNIVERSAL, - optional: true, - captureAsn1: 'csrSignatureParams' - }] - }, { - // signature - name: 'CertificationRequest.signature', - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, - constructed: false, - captureBitStringValue: 'csrSignature' - } - ] -}; - -/** - * Converts an RDNSequence of ASN.1 DER-encoded RelativeDistinguishedName - * sets into an array with objects that have type and value properties. - * - * @param rdn the RDNSequence to convert. - * @param md a message digest to append type and value to if provided. - */ -pki.RDNAttributesAsArray = function(rdn, md) { - var rval = []; - - // each value in 'rdn' in is a SET of RelativeDistinguishedName - var set, attr, obj; - for(var si = 0; si < rdn.value.length; ++si) { - // get the RelativeDistinguishedName set - set = rdn.value[si]; - - // each value in the SET is an AttributeTypeAndValue sequence - // containing first a type (an OID) and second a value (defined by - // the OID) - for(var i = 0; i < set.value.length; ++i) { - obj = {}; - attr = set.value[i]; - obj.type = asn1.derToOid(attr.value[0].value); - obj.value = attr.value[1].value; - obj.valueTagClass = attr.value[1].type; - // if the OID is known, get its name and short name - if(obj.type in oids) { - obj.name = oids[obj.type]; - if(obj.name in _shortNames) { - obj.shortName = _shortNames[obj.name]; - } - } - if(md) { - md.update(obj.type); - md.update(obj.value); - } - rval.push(obj); - } - } - - return rval; -}; - -/** - * Converts ASN.1 CRIAttributes into an array with objects that have type and - * value properties. - * - * @param attributes the CRIAttributes to convert. - */ -pki.CRIAttributesAsArray = function(attributes) { - var rval = []; - - // each value in 'attributes' in is a SEQUENCE with an OID and a SET - for(var si = 0; si < attributes.length; ++si) { - // get the attribute sequence - var seq = attributes[si]; - - // each value in the SEQUENCE containing first a type (an OID) and - // second a set of values (defined by the OID) - var type = asn1.derToOid(seq.value[0].value); - var values = seq.value[1].value; - for(var vi = 0; vi < values.length; ++vi) { - var obj = {}; - obj.type = type; - obj.value = values[vi].value; - obj.valueTagClass = values[vi].type; - // if the OID is known, get its name and short name - if(obj.type in oids) { - obj.name = oids[obj.type]; - if(obj.name in _shortNames) { - obj.shortName = _shortNames[obj.name]; - } - } - // parse extensions - if(obj.type === oids.extensionRequest) { - obj.extensions = []; - for(var ei = 0; ei < obj.value.length; ++ei) { - obj.extensions.push(pki.certificateExtensionFromAsn1(obj.value[ei])); - } - } - rval.push(obj); - } - } - - return rval; -}; - -/** - * Gets an issuer or subject attribute from its name, type, or short name. - * - * @param obj the issuer or subject object. - * @param options a short name string or an object with: - * shortName the short name for the attribute. - * name the name for the attribute. - * type the type for the attribute. - * - * @return the attribute. - */ -function _getAttribute(obj, options) { - if(typeof options === 'string') { - options = {shortName: options}; - } - - var rval = null; - var attr; - for(var i = 0; rval === null && i < obj.attributes.length; ++i) { - attr = obj.attributes[i]; - if(options.type && options.type === attr.type) { - rval = attr; - } else if(options.name && options.name === attr.name) { - rval = attr; - } else if(options.shortName && options.shortName === attr.shortName) { - rval = attr; - } - } - return rval; -} - -/** - * Converts signature parameters from ASN.1 structure. - * - * Currently only RSASSA-PSS supported. The PKCS#1 v1.5 signature scheme had - * no parameters. - * - * RSASSA-PSS-params ::= SEQUENCE { - * hashAlgorithm [0] HashAlgorithm DEFAULT - * sha1Identifier, - * maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT - * mgf1SHA1Identifier, - * saltLength [2] INTEGER DEFAULT 20, - * trailerField [3] INTEGER DEFAULT 1 - * } - * - * HashAlgorithm ::= AlgorithmIdentifier - * - * MaskGenAlgorithm ::= AlgorithmIdentifier - * - * AlgorithmIdentifer ::= SEQUENCE { - * algorithm OBJECT IDENTIFIER, - * parameters ANY DEFINED BY algorithm OPTIONAL - * } - * - * @param oid The OID specifying the signature algorithm - * @param obj The ASN.1 structure holding the parameters - * @param fillDefaults Whether to use return default values where omitted - * @return signature parameter object - */ -var _readSignatureParameters = function(oid, obj, fillDefaults) { - var params = {}; - - if(oid !== oids['RSASSA-PSS']) { - return params; - } - - if(fillDefaults) { - params = { - hash: { - algorithmOid: oids['sha1'] - }, - mgf: { - algorithmOid: oids['mgf1'], - hash: { - algorithmOid: oids['sha1'] - } - }, - saltLength: 20 - }; - } - - var capture = {}; - var errors = []; - if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) { - var error = new Error('Cannot read RSASSA-PSS parameter block.'); - error.errors = errors; - throw error; - } - - if(capture.hashOid !== undefined) { - params.hash = params.hash || {}; - params.hash.algorithmOid = asn1.derToOid(capture.hashOid); - } - - if(capture.maskGenOid !== undefined) { - params.mgf = params.mgf || {}; - params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid); - params.mgf.hash = params.mgf.hash || {}; - params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid); - } - - if(capture.saltLength !== undefined) { - params.saltLength = capture.saltLength.charCodeAt(0); - } - - return params; -}; - -/** - * Converts an X.509 certificate from PEM format. - * - * Note: If the certificate is to be verified then compute hash should - * be set to true. This will scan the TBSCertificate part of the ASN.1 - * object while it is converted so it doesn't need to be converted back - * to ASN.1-DER-encoding later. - * - * @param pem the PEM-formatted certificate. - * @param computeHash true to compute the hash for verification. - * @param strict true to be strict when checking ASN.1 value lengths, false to - * allow truncated values (default: true). - * - * @return the certificate. - */ -pki.certificateFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'CERTIFICATE' && - msg.type !== 'X509 CERTIFICATE' && - msg.type !== 'TRUSTED CERTIFICATE') { - var error = new Error( - 'Could not convert certificate from PEM; PEM header type ' + - 'is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error( - 'Could not convert certificate from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body, strict); - - return pki.certificateFromAsn1(obj, computeHash); -}; - -/** - * Converts an X.509 certificate to PEM format. - * - * @param cert the certificate. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted certificate. - */ -pki.certificateToPem = function(cert, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'CERTIFICATE', - body: asn1.toDer(pki.certificateToAsn1(cert)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts an RSA public key from PEM format. - * - * @param pem the PEM-formatted public key. - * - * @return the public key. - */ -pki.publicKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'PUBLIC KEY' && msg.type !== 'RSA PUBLIC KEY') { - var error = new Error('Could not convert public key from PEM; PEM header ' + - 'type is not "PUBLIC KEY" or "RSA PUBLIC KEY".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert public key from PEM; PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body); - - return pki.publicKeyFromAsn1(obj); -}; - -/** - * Converts an RSA public key to PEM format (using a SubjectPublicKeyInfo). - * - * @param key the public key. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted public key. - */ -pki.publicKeyToPem = function(key, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'PUBLIC KEY', - body: asn1.toDer(pki.publicKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Converts an RSA public key to PEM format (using an RSAPublicKey). - * - * @param key the public key. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted public key. - */ -pki.publicKeyToRSAPublicKeyPem = function(key, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'RSA PUBLIC KEY', - body: asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Gets a fingerprint for the given public key. - * - * @param options the options to use. - * [md] the message digest object to use (defaults to forge.md.sha1). - * [type] the type of fingerprint, such as 'RSAPublicKey', - * 'SubjectPublicKeyInfo' (defaults to 'RSAPublicKey'). - * [encoding] an alternative output encoding, such as 'hex' - * (defaults to none, outputs a byte buffer). - * [delimiter] the delimiter to use between bytes for 'hex' encoded - * output, eg: ':' (defaults to none). - * - * @return the fingerprint as a byte buffer or other encoding based on options. - */ -pki.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md = options.md || forge.md.sha1.create(); - var type = options.type || 'RSAPublicKey'; - - var bytes; - switch(type) { - case 'RSAPublicKey': - bytes = asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes(); - break; - case 'SubjectPublicKeyInfo': - bytes = asn1.toDer(pki.publicKeyToAsn1(key)).getBytes(); - break; - default: - throw new Error('Unknown fingerprint type "' + options.type + '".'); - } - - // hash public key bytes - md.start(); - md.update(bytes); - var digest = md.digest(); - if(options.encoding === 'hex') { - var hex = digest.toHex(); - if(options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); - } - return hex; - } else if(options.encoding === 'binary') { - return digest.getBytes(); - } else if(options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); - } - return digest; -}; - -/** - * Converts a PKCS#10 certification request (CSR) from PEM format. - * - * Note: If the certification request is to be verified then compute hash - * should be set to true. This will scan the CertificationRequestInfo part of - * the ASN.1 object while it is converted so it doesn't need to be converted - * back to ASN.1-DER-encoding later. - * - * @param pem the PEM-formatted certificate. - * @param computeHash true to compute the hash for verification. - * @param strict true to be strict when checking ASN.1 value lengths, false to - * allow truncated values (default: true). - * - * @return the certification request (CSR). - */ -pki.certificationRequestFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - - if(msg.type !== 'CERTIFICATE REQUEST') { - var error = new Error('Could not convert certification request from PEM; ' + - 'PEM header type is not "CERTIFICATE REQUEST".'); - error.headerType = msg.type; - throw error; - } - if(msg.procType && msg.procType.type === 'ENCRYPTED') { - throw new Error('Could not convert certification request from PEM; ' + - 'PEM is encrypted.'); - } - - // convert DER to ASN.1 object - var obj = asn1.fromDer(msg.body, strict); - - return pki.certificationRequestFromAsn1(obj, computeHash); -}; - -/** - * Converts a PKCS#10 certification request (CSR) to PEM format. - * - * @param csr the certification request. - * @param maxline the maximum characters per line, defaults to 64. - * - * @return the PEM-formatted certification request. - */ -pki.certificationRequestToPem = function(csr, maxline) { - // convert to ASN.1, then DER, then PEM-encode - var msg = { - type: 'CERTIFICATE REQUEST', - body: asn1.toDer(pki.certificationRequestToAsn1(csr)).getBytes() - }; - return forge.pem.encode(msg, {maxline: maxline}); -}; - -/** - * Creates an empty X.509v3 RSA certificate. - * - * @return the certificate. - */ -pki.createCertificate = function() { - var cert = {}; - cert.version = 0x02; - cert.serialNumber = '00'; - cert.signatureOid = null; - cert.signature = null; - cert.siginfo = {}; - cert.siginfo.algorithmOid = null; - cert.validity = {}; - cert.validity.notBefore = new Date(); - cert.validity.notAfter = new Date(); - - cert.issuer = {}; - cert.issuer.getField = function(sn) { - return _getAttribute(cert.issuer, sn); - }; - cert.issuer.addField = function(attr) { - _fillMissingFields([attr]); - cert.issuer.attributes.push(attr); - }; - cert.issuer.attributes = []; - cert.issuer.hash = null; - - cert.subject = {}; - cert.subject.getField = function(sn) { - return _getAttribute(cert.subject, sn); - }; - cert.subject.addField = function(attr) { - _fillMissingFields([attr]); - cert.subject.attributes.push(attr); - }; - cert.subject.attributes = []; - cert.subject.hash = null; - - cert.extensions = []; - cert.publicKey = null; - cert.md = null; - - /** - * Sets the subject of this certificate. - * - * @param attrs the array of subject attributes to use. - * @param uniqueId an optional a unique ID to use. - */ - cert.setSubject = function(attrs, uniqueId) { - // set new attributes, clear hash - _fillMissingFields(attrs); - cert.subject.attributes = attrs; - delete cert.subject.uniqueId; - if(uniqueId) { - // TODO: support arbitrary bit length ids - cert.subject.uniqueId = uniqueId; - } - cert.subject.hash = null; - }; - - /** - * Sets the issuer of this certificate. - * - * @param attrs the array of issuer attributes to use. - * @param uniqueId an optional a unique ID to use. - */ - cert.setIssuer = function(attrs, uniqueId) { - // set new attributes, clear hash - _fillMissingFields(attrs); - cert.issuer.attributes = attrs; - delete cert.issuer.uniqueId; - if(uniqueId) { - // TODO: support arbitrary bit length ids - cert.issuer.uniqueId = uniqueId; - } - cert.issuer.hash = null; - }; - - /** - * Sets the extensions of this certificate. - * - * @param exts the array of extensions to use. - */ - cert.setExtensions = function(exts) { - for(var i = 0; i < exts.length; ++i) { - _fillMissingExtensionFields(exts[i], {cert: cert}); - } - // set new extensions - cert.extensions = exts; - }; - - /** - * Gets an extension by its name or id. - * - * @param options the name to use or an object with: - * name the name to use. - * id the id to use. - * - * @return the extension or null if not found. - */ - cert.getExtension = function(options) { - if(typeof options === 'string') { - options = {name: options}; - } - - var rval = null; - var ext; - for(var i = 0; rval === null && i < cert.extensions.length; ++i) { - ext = cert.extensions[i]; - if(options.id && ext.id === options.id) { - rval = ext; - } else if(options.name && ext.name === options.name) { - rval = ext; - } - } - return rval; - }; - - /** - * Signs this certificate using the given private key. - * - * @param key the private key to sign with. - * @param md the message digest object to use (defaults to forge.md.sha1). - */ - cert.sign = function(key, md) { - // TODO: get signature OID from private key - cert.md = md || forge.md.sha1.create(); - var algorithmOid = oids[cert.md.algorithm + 'WithRSAEncryption']; - if(!algorithmOid) { - var error = new Error('Could not compute certificate digest. ' + - 'Unknown message digest algorithm OID.'); - error.algorithm = cert.md.algorithm; - throw error; - } - cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid; - - // get TBSCertificate, convert to DER - cert.tbsCertificate = pki.getTBSCertificate(cert); - var bytes = asn1.toDer(cert.tbsCertificate); - - // digest and sign - cert.md.update(bytes.getBytes()); - cert.signature = key.sign(cert.md); - }; - - /** - * Attempts verify the signature on the passed certificate using this - * certificate's public key. - * - * @param child the certificate to verify. - * - * @return true if verified, false if not. - */ - cert.verify = function(child) { - var rval = false; - - if(!cert.issued(child)) { - var issuer = child.issuer; - var subject = cert.subject; - var error = new Error( - 'The parent certificate did not issue the given child ' + - 'certificate; the child certificate\'s issuer does not match the ' + - 'parent\'s subject.'); - error.expectedIssuer = issuer.attributes; - error.actualIssuer = subject.attributes; - throw error; - } - - var md = child.md; - if(md === null) { - // check signature OID for supported signature types - if(child.signatureOid in oids) { - var oid = oids[child.signatureOid]; - switch(oid) { - case 'sha1WithRSAEncryption': - md = forge.md.sha1.create(); - break; - case 'md5WithRSAEncryption': - md = forge.md.md5.create(); - break; - case 'sha256WithRSAEncryption': - md = forge.md.sha256.create(); - break; - case 'sha384WithRSAEncryption': - md = forge.md.sha384.create(); - break; - case 'sha512WithRSAEncryption': - md = forge.md.sha512.create(); - break; - case 'RSASSA-PSS': - md = forge.md.sha256.create(); - break; - } - } - if(md === null) { - var error = new Error('Could not compute certificate digest. ' + - 'Unknown signature OID.'); - error.signatureOid = child.signatureOid; - throw error; - } - - // produce DER formatted TBSCertificate and digest it - var tbsCertificate = child.tbsCertificate || pki.getTBSCertificate(child); - var bytes = asn1.toDer(tbsCertificate); - md.update(bytes.getBytes()); - } - - if(md !== null) { - var scheme; - - switch(child.signatureOid) { - case oids.sha1WithRSAEncryption: - scheme = undefined; /* use PKCS#1 v1.5 padding scheme */ - break; - case oids['RSASSA-PSS']: - var hash, mgf; - - /* initialize mgf */ - hash = oids[child.signatureParameters.mgf.hash.algorithmOid]; - if(hash === undefined || forge.md[hash] === undefined) { - var error = new Error('Unsupported MGF hash function.'); - error.oid = child.signatureParameters.mgf.hash.algorithmOid; - error.name = hash; - throw error; - } - - mgf = oids[child.signatureParameters.mgf.algorithmOid]; - if(mgf === undefined || forge.mgf[mgf] === undefined) { - var error = new Error('Unsupported MGF function.'); - error.oid = child.signatureParameters.mgf.algorithmOid; - error.name = mgf; - throw error; - } - - mgf = forge.mgf[mgf].create(forge.md[hash].create()); - - /* initialize hash function */ - hash = oids[child.signatureParameters.hash.algorithmOid]; - if(hash === undefined || forge.md[hash] === undefined) { - throw { - message: 'Unsupported RSASSA-PSS hash function.', - oid: child.signatureParameters.hash.algorithmOid, - name: hash - }; - } - - scheme = forge.pss.create(forge.md[hash].create(), mgf, - child.signatureParameters.saltLength); - break; - } - - // verify signature on cert using public key - rval = cert.publicKey.verify( - md.digest().getBytes(), child.signature, scheme); - } - - return rval; - }; - - /** - * Returns true if this certificate's issuer matches the passed - * certificate's subject. Note that no signature check is performed. - * - * @param parent the certificate to check. - * - * @return true if this certificate's issuer matches the passed certificate's - * subject. - */ - cert.isIssuer = function(parent) { - var rval = false; - - var i = cert.issuer; - var s = parent.subject; - - // compare hashes if present - if(i.hash && s.hash) { - rval = (i.hash === s.hash); - } else if(i.attributes.length === s.attributes.length) { - // all attributes are the same so issuer matches subject - rval = true; - var iattr, sattr; - for(var n = 0; rval && n < i.attributes.length; ++n) { - iattr = i.attributes[n]; - sattr = s.attributes[n]; - if(iattr.type !== sattr.type || iattr.value !== sattr.value) { - // attribute mismatch - rval = false; - } - } - } - - return rval; - }; - - /** - * Returns true if this certificate's subject matches the issuer of the - * given certificate). Note that not signature check is performed. - * - * @param child the certificate to check. - * - * @return true if this certificate's subject matches the passed - * certificate's issuer. - */ - cert.issued = function(child) { - return child.isIssuer(cert); - }; - - /** - * Generates the subjectKeyIdentifier for this certificate as byte buffer. - * - * @return the subjectKeyIdentifier for this certificate as byte buffer. - */ - cert.generateSubjectKeyIdentifier = function() { - /* See: 4.2.1.2 section of the the RFC3280, keyIdentifier is either: - - (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the - value of the BIT STRING subjectPublicKey (excluding the tag, - length, and number of unused bits). - - (2) The keyIdentifier is composed of a four bit type field with - the value 0100 followed by the least significant 60 bits of the - SHA-1 hash of the value of the BIT STRING subjectPublicKey - (excluding the tag, length, and number of unused bit string bits). - */ - - // skipping the tag, length, and number of unused bits is the same - // as just using the RSAPublicKey (for RSA keys, which are the - // only ones supported) - return pki.getPublicKeyFingerprint(cert.publicKey, {type: 'RSAPublicKey'}); - }; - - /** - * Verifies the subjectKeyIdentifier extension value for this certificate - * against its public key. If no extension is found, false will be - * returned. - * - * @return true if verified, false if not. - */ - cert.verifySubjectKeyIdentifier = function() { - var oid = oids['subjectKeyIdentifier']; - for(var i = 0; i < cert.extensions.length; ++i) { - var ext = cert.extensions[i]; - if(ext.id === oid) { - var ski = cert.generateSubjectKeyIdentifier().getBytes(); - return (forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski); - } - } - return false; - }; - - return cert; -}; - -/** - * Converts an X.509v3 RSA certificate from an ASN.1 object. - * - * Note: If the certificate is to be verified then compute hash should - * be set to true. There is currently no implementation for converting - * a certificate back to ASN.1 so the TBSCertificate part of the ASN.1 - * object needs to be scanned before the cert object is created. - * - * @param obj the asn1 representation of an X.509v3 RSA certificate. - * @param computeHash true to compute the hash for verification. - * - * @return the certificate. - */ -pki.certificateFromAsn1 = function(obj, computeHash) { - // validate certificate and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, x509CertificateValidator, capture, errors)) { - var error = new Error('Cannot read X.509 certificate. ' + - 'ASN.1 object is not an X509v3 Certificate.'); - error.errors = errors; - throw error; - } - - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - throw new Error('Cannot read public key. OID is not RSA.'); - } - - // create certificate - var cert = pki.createCertificate(); - cert.version = capture.certVersion ? - capture.certVersion.charCodeAt(0) : 0; - var serial = forge.util.createBuffer(capture.certSerialNumber); - cert.serialNumber = serial.toHex(); - cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid); - cert.signatureParameters = _readSignatureParameters( - cert.signatureOid, capture.certSignatureParams, true); - cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid); - cert.siginfo.parameters = _readSignatureParameters(cert.siginfo.algorithmOid, - capture.certinfoSignatureParams, false); - cert.signature = capture.certSignature; - - var validity = []; - if(capture.certValidity1UTCTime !== undefined) { - validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime)); - } - if(capture.certValidity2GeneralizedTime !== undefined) { - validity.push(asn1.generalizedTimeToDate( - capture.certValidity2GeneralizedTime)); - } - if(capture.certValidity3UTCTime !== undefined) { - validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime)); - } - if(capture.certValidity4GeneralizedTime !== undefined) { - validity.push(asn1.generalizedTimeToDate( - capture.certValidity4GeneralizedTime)); - } - if(validity.length > 2) { - throw new Error('Cannot read notBefore/notAfter validity times; more ' + - 'than two times were provided in the certificate.'); - } - if(validity.length < 2) { - throw new Error('Cannot read notBefore/notAfter validity times; they ' + - 'were not provided as either UTCTime or GeneralizedTime.'); - } - cert.validity.notBefore = validity[0]; - cert.validity.notAfter = validity[1]; - - // keep TBSCertificate to preserve signature when exporting - cert.tbsCertificate = capture.tbsCertificate; - - if(computeHash) { - // check signature OID for supported signature types - cert.md = null; - if(cert.signatureOid in oids) { - var oid = oids[cert.signatureOid]; - switch(oid) { - case 'sha1WithRSAEncryption': - cert.md = forge.md.sha1.create(); - break; - case 'md5WithRSAEncryption': - cert.md = forge.md.md5.create(); - break; - case 'sha256WithRSAEncryption': - cert.md = forge.md.sha256.create(); - break; - case 'sha384WithRSAEncryption': - cert.md = forge.md.sha384.create(); - break; - case 'sha512WithRSAEncryption': - cert.md = forge.md.sha512.create(); - break; - case 'RSASSA-PSS': - cert.md = forge.md.sha256.create(); - break; - } - } - if(cert.md === null) { - var error = new Error('Could not compute certificate digest. ' + - 'Unknown signature OID.'); - error.signatureOid = cert.signatureOid; - throw error; - } - - // produce DER formatted TBSCertificate and digest it - var bytes = asn1.toDer(cert.tbsCertificate); - cert.md.update(bytes.getBytes()); - } - - // handle issuer, build issuer message digest - var imd = forge.md.sha1.create(); - cert.issuer.getField = function(sn) { - return _getAttribute(cert.issuer, sn); - }; - cert.issuer.addField = function(attr) { - _fillMissingFields([attr]); - cert.issuer.attributes.push(attr); - }; - cert.issuer.attributes = pki.RDNAttributesAsArray(capture.certIssuer, imd); - if(capture.certIssuerUniqueId) { - cert.issuer.uniqueId = capture.certIssuerUniqueId; - } - cert.issuer.hash = imd.digest().toHex(); - - // handle subject, build subject message digest - var smd = forge.md.sha1.create(); - cert.subject.getField = function(sn) { - return _getAttribute(cert.subject, sn); - }; - cert.subject.addField = function(attr) { - _fillMissingFields([attr]); - cert.subject.attributes.push(attr); - }; - cert.subject.attributes = pki.RDNAttributesAsArray(capture.certSubject, smd); - if(capture.certSubjectUniqueId) { - cert.subject.uniqueId = capture.certSubjectUniqueId; - } - cert.subject.hash = smd.digest().toHex(); - - // handle extensions - if(capture.certExtensions) { - cert.extensions = pki.certificateExtensionsFromAsn1(capture.certExtensions); - } else { - cert.extensions = []; - } - - // convert RSA public key from ASN.1 - cert.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); - - return cert; -}; - -/** - * Converts an ASN.1 extensions object (with extension sequences as its - * values) into an array of extension objects with types and values. - * - * Supported extensions: - * - * id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 } - * KeyUsage ::= BIT STRING { - * digitalSignature (0), - * nonRepudiation (1), - * keyEncipherment (2), - * dataEncipherment (3), - * keyAgreement (4), - * keyCertSign (5), - * cRLSign (6), - * encipherOnly (7), - * decipherOnly (8) - * } - * - * id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 } - * BasicConstraints ::= SEQUENCE { - * cA BOOLEAN DEFAULT FALSE, - * pathLenConstraint INTEGER (0..MAX) OPTIONAL - * } - * - * subjectAltName EXTENSION ::= { - * SYNTAX GeneralNames - * IDENTIFIED BY id-ce-subjectAltName - * } - * - * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName - * - * GeneralName ::= CHOICE { - * otherName [0] INSTANCE OF OTHER-NAME, - * rfc822Name [1] IA5String, - * dNSName [2] IA5String, - * x400Address [3] ORAddress, - * directoryName [4] Name, - * ediPartyName [5] EDIPartyName, - * uniformResourceIdentifier [6] IA5String, - * IPAddress [7] OCTET STRING, - * registeredID [8] OBJECT IDENTIFIER - * } - * - * OTHER-NAME ::= TYPE-IDENTIFIER - * - * EDIPartyName ::= SEQUENCE { - * nameAssigner [0] DirectoryString {ub-name} OPTIONAL, - * partyName [1] DirectoryString {ub-name} - * } - * - * @param exts the extensions ASN.1 with extension sequences to parse. - * - * @return the array. - */ -pki.certificateExtensionsFromAsn1 = function(exts) { - var rval = []; - for(var i = 0; i < exts.value.length; ++i) { - // get extension sequence - var extseq = exts.value[i]; - for(var ei = 0; ei < extseq.value.length; ++ei) { - rval.push(pki.certificateExtensionFromAsn1(extseq.value[ei])); - } - } - - return rval; -}; - -/** - * Parses a single certificate extension from ASN.1. - * - * @param ext the extension in ASN.1 format. - * - * @return the parsed extension as an object. - */ -pki.certificateExtensionFromAsn1 = function(ext) { - // an extension has: - // [0] extnID OBJECT IDENTIFIER - // [1] critical BOOLEAN DEFAULT FALSE - // [2] extnValue OCTET STRING - var e = {}; - e.id = asn1.derToOid(ext.value[0].value); - e.critical = false; - if(ext.value[1].type === asn1.Type.BOOLEAN) { - e.critical = (ext.value[1].value.charCodeAt(0) !== 0x00); - e.value = ext.value[2].value; - } else { - e.value = ext.value[1].value; - } - // if the oid is known, get its name - if(e.id in oids) { - e.name = oids[e.id]; - - // handle key usage - if(e.name === 'keyUsage') { - // get value as BIT STRING - var ev = asn1.fromDer(e.value); - var b2 = 0x00; - var b3 = 0x00; - if(ev.value.length > 1) { - // skip first byte, just indicates unused bits which - // will be padded with 0s anyway - // get bytes with flag bits - b2 = ev.value.charCodeAt(1); - b3 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0; - } - // set flags - e.digitalSignature = (b2 & 0x80) === 0x80; - e.nonRepudiation = (b2 & 0x40) === 0x40; - e.keyEncipherment = (b2 & 0x20) === 0x20; - e.dataEncipherment = (b2 & 0x10) === 0x10; - e.keyAgreement = (b2 & 0x08) === 0x08; - e.keyCertSign = (b2 & 0x04) === 0x04; - e.cRLSign = (b2 & 0x02) === 0x02; - e.encipherOnly = (b2 & 0x01) === 0x01; - e.decipherOnly = (b3 & 0x80) === 0x80; - } else if(e.name === 'basicConstraints') { - // handle basic constraints - // get value as SEQUENCE - var ev = asn1.fromDer(e.value); - // get cA BOOLEAN flag (defaults to false) - if(ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) { - e.cA = (ev.value[0].value.charCodeAt(0) !== 0x00); - } else { - e.cA = false; - } - // get path length constraint - var value = null; - if(ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) { - value = ev.value[0].value; - } else if(ev.value.length > 1) { - value = ev.value[1].value; - } - if(value !== null) { - e.pathLenConstraint = asn1.derToInteger(value); - } - } else if(e.name === 'extKeyUsage') { - // handle extKeyUsage - // value is a SEQUENCE of OIDs - var ev = asn1.fromDer(e.value); - for(var vi = 0; vi < ev.value.length; ++vi) { - var oid = asn1.derToOid(ev.value[vi].value); - if(oid in oids) { - e[oids[oid]] = true; - } else { - e[oid] = true; - } - } - } else if(e.name === 'nsCertType') { - // handle nsCertType - // get value as BIT STRING - var ev = asn1.fromDer(e.value); - var b2 = 0x00; - if(ev.value.length > 1) { - // skip first byte, just indicates unused bits which - // will be padded with 0s anyway - // get bytes with flag bits - b2 = ev.value.charCodeAt(1); - } - // set flags - e.client = (b2 & 0x80) === 0x80; - e.server = (b2 & 0x40) === 0x40; - e.email = (b2 & 0x20) === 0x20; - e.objsign = (b2 & 0x10) === 0x10; - e.reserved = (b2 & 0x08) === 0x08; - e.sslCA = (b2 & 0x04) === 0x04; - e.emailCA = (b2 & 0x02) === 0x02; - e.objCA = (b2 & 0x01) === 0x01; - } else if( - e.name === 'subjectAltName' || - e.name === 'issuerAltName') { - // handle subjectAltName/issuerAltName - e.altNames = []; - - // ev is a SYNTAX SEQUENCE - var gn; - var ev = asn1.fromDer(e.value); - for(var n = 0; n < ev.value.length; ++n) { - // get GeneralName - gn = ev.value[n]; - - var altName = { - type: gn.type, - value: gn.value - }; - e.altNames.push(altName); - - // Note: Support for types 1,2,6,7,8 - switch(gn.type) { - // rfc822Name - case 1: - // dNSName - case 2: - // uniformResourceIdentifier (URI) - case 6: - break; - // IPAddress - case 7: - // convert to IPv4/IPv6 string representation - altName.ip = forge.util.bytesToIP(gn.value); - break; - // registeredID - case 8: - altName.oid = asn1.derToOid(gn.value); - break; - default: - // unsupported - } - } - } else if(e.name === 'subjectKeyIdentifier') { - // value is an OCTETSTRING w/the hash of the key-type specific - // public key structure (eg: RSAPublicKey) - var ev = asn1.fromDer(e.value); - e.subjectKeyIdentifier = forge.util.bytesToHex(ev.value); - } - } - return e; -}; - -/** - * Converts a PKCS#10 certification request (CSR) from an ASN.1 object. - * - * Note: If the certification request is to be verified then compute hash - * should be set to true. There is currently no implementation for converting - * a certificate back to ASN.1 so the CertificationRequestInfo part of the - * ASN.1 object needs to be scanned before the csr object is created. - * - * @param obj the asn1 representation of a PKCS#10 certification request (CSR). - * @param computeHash true to compute the hash for verification. - * - * @return the certification request (CSR). - */ -pki.certificationRequestFromAsn1 = function(obj, computeHash) { - // validate certification request and capture data - var capture = {}; - var errors = []; - if(!asn1.validate(obj, certificationRequestValidator, capture, errors)) { - var error = new Error('Cannot read PKCS#10 certificate request. ' + - 'ASN.1 object is not a PKCS#10 CertificationRequest.'); - error.errors = errors; - throw error; - } - - // get oid - var oid = asn1.derToOid(capture.publicKeyOid); - if(oid !== pki.oids.rsaEncryption) { - throw new Error('Cannot read public key. OID is not RSA.'); - } - - // create certification request - var csr = pki.createCertificationRequest(); - csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0; - csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid); - csr.signatureParameters = _readSignatureParameters( - csr.signatureOid, capture.csrSignatureParams, true); - csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid); - csr.siginfo.parameters = _readSignatureParameters( - csr.siginfo.algorithmOid, capture.csrSignatureParams, false); - csr.signature = capture.csrSignature; - - // keep CertificationRequestInfo to preserve signature when exporting - csr.certificationRequestInfo = capture.certificationRequestInfo; - - if(computeHash) { - // check signature OID for supported signature types - csr.md = null; - if(csr.signatureOid in oids) { - var oid = oids[csr.signatureOid]; - switch(oid) { - case 'sha1WithRSAEncryption': - csr.md = forge.md.sha1.create(); - break; - case 'md5WithRSAEncryption': - csr.md = forge.md.md5.create(); - break; - case 'sha256WithRSAEncryption': - csr.md = forge.md.sha256.create(); - break; - case 'sha384WithRSAEncryption': - csr.md = forge.md.sha384.create(); - break; - case 'sha512WithRSAEncryption': - csr.md = forge.md.sha512.create(); - break; - case 'RSASSA-PSS': - csr.md = forge.md.sha256.create(); - break; - } - } - if(csr.md === null) { - var error = new Error('Could not compute certification request digest. ' + - 'Unknown signature OID.'); - error.signatureOid = csr.signatureOid; - throw error; - } - - // produce DER formatted CertificationRequestInfo and digest it - var bytes = asn1.toDer(csr.certificationRequestInfo); - csr.md.update(bytes.getBytes()); - } - - // handle subject, build subject message digest - var smd = forge.md.sha1.create(); - csr.subject.getField = function(sn) { - return _getAttribute(csr.subject, sn); - }; - csr.subject.addField = function(attr) { - _fillMissingFields([attr]); - csr.subject.attributes.push(attr); - }; - csr.subject.attributes = pki.RDNAttributesAsArray( - capture.certificationRequestInfoSubject, smd); - csr.subject.hash = smd.digest().toHex(); - - // convert RSA public key from ASN.1 - csr.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo); - - // convert attributes from ASN.1 - csr.getAttribute = function(sn) { - return _getAttribute(csr, sn); - }; - csr.addAttribute = function(attr) { - _fillMissingFields([attr]); - csr.attributes.push(attr); - }; - csr.attributes = pki.CRIAttributesAsArray( - capture.certificationRequestInfoAttributes || []); - - return csr; -}; - -/** - * Creates an empty certification request (a CSR or certificate signing - * request). Once created, its public key and attributes can be set and then - * it can be signed. - * - * @return the empty certification request. - */ -pki.createCertificationRequest = function() { - var csr = {}; - csr.version = 0x00; - csr.signatureOid = null; - csr.signature = null; - csr.siginfo = {}; - csr.siginfo.algorithmOid = null; - - csr.subject = {}; - csr.subject.getField = function(sn) { - return _getAttribute(csr.subject, sn); - }; - csr.subject.addField = function(attr) { - _fillMissingFields([attr]); - csr.subject.attributes.push(attr); - }; - csr.subject.attributes = []; - csr.subject.hash = null; - - csr.publicKey = null; - csr.attributes = []; - csr.getAttribute = function(sn) { - return _getAttribute(csr, sn); - }; - csr.addAttribute = function(attr) { - _fillMissingFields([attr]); - csr.attributes.push(attr); - }; - csr.md = null; - - /** - * Sets the subject of this certification request. - * - * @param attrs the array of subject attributes to use. - */ - csr.setSubject = function(attrs) { - // set new attributes - _fillMissingFields(attrs); - csr.subject.attributes = attrs; - csr.subject.hash = null; - }; - - /** - * Sets the attributes of this certification request. - * - * @param attrs the array of attributes to use. - */ - csr.setAttributes = function(attrs) { - // set new attributes - _fillMissingFields(attrs); - csr.attributes = attrs; - }; - - /** - * Signs this certification request using the given private key. - * - * @param key the private key to sign with. - * @param md the message digest object to use (defaults to forge.md.sha1). - */ - csr.sign = function(key, md) { - // TODO: get signature OID from private key - csr.md = md || forge.md.sha1.create(); - var algorithmOid = oids[csr.md.algorithm + 'WithRSAEncryption']; - if(!algorithmOid) { - var error = new Error('Could not compute certification request digest. ' + - 'Unknown message digest algorithm OID.'); - error.algorithm = csr.md.algorithm; - throw error; - } - csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid; - - // get CertificationRequestInfo, convert to DER - csr.certificationRequestInfo = pki.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(csr.certificationRequestInfo); - - // digest and sign - csr.md.update(bytes.getBytes()); - csr.signature = key.sign(csr.md); - }; - - /** - * Attempts verify the signature on the passed certification request using - * its public key. - * - * A CSR that has been exported to a file in PEM format can be verified using - * OpenSSL using this command: - * - * openssl req -in -verify -noout -text - * - * @return true if verified, false if not. - */ - csr.verify = function() { - var rval = false; - - var md = csr.md; - if(md === null) { - // check signature OID for supported signature types - if(csr.signatureOid in oids) { - // TODO: create DRY `OID to md` function - var oid = oids[csr.signatureOid]; - switch(oid) { - case 'sha1WithRSAEncryption': - md = forge.md.sha1.create(); - break; - case 'md5WithRSAEncryption': - md = forge.md.md5.create(); - break; - case 'sha256WithRSAEncryption': - md = forge.md.sha256.create(); - break; - case 'sha384WithRSAEncryption': - md = forge.md.sha384.create(); - break; - case 'sha512WithRSAEncryption': - md = forge.md.sha512.create(); - break; - case 'RSASSA-PSS': - md = forge.md.sha256.create(); - break; - } - } - if(md === null) { - var error = new Error( - 'Could not compute certification request digest. ' + - 'Unknown signature OID.'); - error.signatureOid = csr.signatureOid; - throw error; - } - - // produce DER formatted CertificationRequestInfo and digest it - var cri = csr.certificationRequestInfo || - pki.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(cri); - md.update(bytes.getBytes()); - } - - if(md !== null) { - var scheme; - - switch(csr.signatureOid) { - case oids.sha1WithRSAEncryption: - /* use PKCS#1 v1.5 padding scheme */ - break; - case oids['RSASSA-PSS']: - var hash, mgf; - - /* initialize mgf */ - hash = oids[csr.signatureParameters.mgf.hash.algorithmOid]; - if(hash === undefined || forge.md[hash] === undefined) { - var error = new Error('Unsupported MGF hash function.'); - error.oid = csr.signatureParameters.mgf.hash.algorithmOid; - error.name = hash; - throw error; - } - - mgf = oids[csr.signatureParameters.mgf.algorithmOid]; - if(mgf === undefined || forge.mgf[mgf] === undefined) { - var error = new Error('Unsupported MGF function.'); - error.oid = csr.signatureParameters.mgf.algorithmOid; - error.name = mgf; - throw error; - } - - mgf = forge.mgf[mgf].create(forge.md[hash].create()); - - /* initialize hash function */ - hash = oids[csr.signatureParameters.hash.algorithmOid]; - if(hash === undefined || forge.md[hash] === undefined) { - var error = new Error('Unsupported RSASSA-PSS hash function.'); - error.oid = csr.signatureParameters.hash.algorithmOid; - error.name = hash; - throw error; - } - - scheme = forge.pss.create(forge.md[hash].create(), mgf, - csr.signatureParameters.saltLength); - break; - } - - // verify signature on csr using its public key - rval = csr.publicKey.verify( - md.digest().getBytes(), csr.signature, scheme); - } - - return rval; - }; - - return csr; -}; - -/** - * Converts an X.509 subject or issuer to an ASN.1 RDNSequence. - * - * @param obj the subject or issuer (distinguished name). - * - * @return the ASN.1 RDNSequence. - */ -function _dnToAsn1(obj) { - // create an empty RDNSequence - var rval = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - // iterate over attributes - var attr, set; - var attrs = obj.attributes; - for(var i = 0; i < attrs.length; ++i) { - attr = attrs[i]; - var value = attr.value; - - // reuse tag class for attribute value if available - var valueTagClass = asn1.Type.PRINTABLESTRING; - if('valueTagClass' in attr) { - valueTagClass = attr.valueTagClass; - - if(valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(value); - } - // FIXME: handle more encodings - } - - // create a RelativeDistinguishedName set - // each value in the set is an AttributeTypeAndValue first - // containing the type (an OID) and second the value - set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.type).getBytes()), - // AttributeValue - asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value) - ]) - ]); - rval.value.push(set); - } - - return rval; -} - -/** - * Gets all printable attributes (typically of an issuer or subject) in a - * simplified JSON format for display. - * - * @param attrs the attributes. - * - * @return the JSON for display. - */ -function _getAttributesAsJson(attrs) { - var rval = {}; - for(var i = 0; i < attrs.length; ++i) { - var attr = attrs[i]; - if(attr.shortName && ( - attr.valueTagClass === asn1.Type.UTF8 || - attr.valueTagClass === asn1.Type.PRINTABLESTRING || - attr.valueTagClass === asn1.Type.IA5STRING)) { - var value = attr.value; - if(attr.valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(attr.value); - } - if(!(attr.shortName in rval)) { - rval[attr.shortName] = value; - } else if(forge.util.isArray(rval[attr.shortName])) { - rval[attr.shortName].push(value); - } else { - rval[attr.shortName] = [rval[attr.shortName], value]; - } - } - } - return rval; -} - -/** - * Fills in missing fields in attributes. - * - * @param attrs the attributes to fill missing fields in. - */ -function _fillMissingFields(attrs) { - var attr; - for(var i = 0; i < attrs.length; ++i) { - attr = attrs[i]; - - // populate missing name - if(typeof attr.name === 'undefined') { - if(attr.type && attr.type in pki.oids) { - attr.name = pki.oids[attr.type]; - } else if(attr.shortName && attr.shortName in _shortNames) { - attr.name = pki.oids[_shortNames[attr.shortName]]; - } - } - - // populate missing type (OID) - if(typeof attr.type === 'undefined') { - if(attr.name && attr.name in pki.oids) { - attr.type = pki.oids[attr.name]; - } else { - var error = new Error('Attribute type not specified.'); - error.attribute = attr; - throw error; - } - } - - // populate missing shortname - if(typeof attr.shortName === 'undefined') { - if(attr.name && attr.name in _shortNames) { - attr.shortName = _shortNames[attr.name]; - } - } - - // convert extensions to value - if(attr.type === oids.extensionRequest) { - attr.valueConstructed = true; - attr.valueTagClass = asn1.Type.SEQUENCE; - if(!attr.value && attr.extensions) { - attr.value = []; - for(var ei = 0; ei < attr.extensions.length; ++ei) { - attr.value.push(pki.certificateExtensionToAsn1( - _fillMissingExtensionFields(attr.extensions[ei]))); - } - } - } - - if(typeof attr.value === 'undefined') { - var error = new Error('Attribute value not specified.'); - error.attribute = attr; - throw error; - } - } -} - -/** - * Fills in missing fields in certificate extensions. - * - * @param e the extension. - * @param [options] the options to use. - * [cert] the certificate the extensions are for. - * - * @return the extension. - */ -function _fillMissingExtensionFields(e, options) { - options = options || {}; - - // populate missing name - if(typeof e.name === 'undefined') { - if(e.id && e.id in pki.oids) { - e.name = pki.oids[e.id]; - } - } - - // populate missing id - if(typeof e.id === 'undefined') { - if(e.name && e.name in pki.oids) { - e.id = pki.oids[e.name]; - } else { - var error = new Error('Extension ID not specified.'); - error.extension = e; - throw error; - } - } - - if(typeof e.value !== 'undefined') { - return e; - } - - // handle missing value: - - // value is a BIT STRING - if(e.name === 'keyUsage') { - // build flags - var unused = 0; - var b2 = 0x00; - var b3 = 0x00; - if(e.digitalSignature) { - b2 |= 0x80; - unused = 7; - } - if(e.nonRepudiation) { - b2 |= 0x40; - unused = 6; - } - if(e.keyEncipherment) { - b2 |= 0x20; - unused = 5; - } - if(e.dataEncipherment) { - b2 |= 0x10; - unused = 4; - } - if(e.keyAgreement) { - b2 |= 0x08; - unused = 3; - } - if(e.keyCertSign) { - b2 |= 0x04; - unused = 2; - } - if(e.cRLSign) { - b2 |= 0x02; - unused = 1; - } - if(e.encipherOnly) { - b2 |= 0x01; - unused = 0; - } - if(e.decipherOnly) { - b3 |= 0x80; - unused = 7; - } - - // create bit string - var value = String.fromCharCode(unused); - if(b3 !== 0) { - value += String.fromCharCode(b2) + String.fromCharCode(b3); - } else if(b2 !== 0) { - value += String.fromCharCode(b2); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value); - } else if(e.name === 'basicConstraints') { - // basicConstraints is a SEQUENCE - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - // cA BOOLEAN flag defaults to false - if(e.cA) { - e.value.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, - String.fromCharCode(0xFF))); - } - if('pathLenConstraint' in e) { - e.value.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(e.pathLenConstraint).getBytes())); - } - } else if(e.name === 'extKeyUsage') { - // extKeyUsage is a SEQUENCE of OIDs - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - for(var key in e) { - if(e[key] !== true) { - continue; - } - // key is name in OID map - if(key in oids) { - seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, - false, asn1.oidToDer(oids[key]).getBytes())); - } else if(key.indexOf('.') !== -1) { - // assume key is an OID - seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, - false, asn1.oidToDer(key).getBytes())); - } - } - } else if(e.name === 'nsCertType') { - // nsCertType is a BIT STRING - // build flags - var unused = 0; - var b2 = 0x00; - - if(e.client) { - b2 |= 0x80; - unused = 7; - } - if(e.server) { - b2 |= 0x40; - unused = 6; - } - if(e.email) { - b2 |= 0x20; - unused = 5; - } - if(e.objsign) { - b2 |= 0x10; - unused = 4; - } - if(e.reserved) { - b2 |= 0x08; - unused = 3; - } - if(e.sslCA) { - b2 |= 0x04; - unused = 2; - } - if(e.emailCA) { - b2 |= 0x02; - unused = 1; - } - if(e.objCA) { - b2 |= 0x01; - unused = 0; - } - - // create bit string - var value = String.fromCharCode(unused); - if(b2 !== 0) { - value += String.fromCharCode(b2); - } - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value); - } else if(e.name === 'subjectAltName' || e.name === 'issuerAltName') { - // SYNTAX SEQUENCE - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - var altName; - for(var n = 0; n < e.altNames.length; ++n) { - altName = e.altNames[n]; - var value = altName.value; - // handle IP - if(altName.type === 7 && altName.ip) { - value = forge.util.bytesFromIP(altName.ip); - if(value === null) { - var error = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.'); - error.extension = e; - throw error; - } - } else if(altName.type === 8) { - // handle OID - if(altName.oid) { - value = asn1.oidToDer(asn1.oidToDer(altName.oid)); - } else { - // deprecated ... convert value to OID - value = asn1.oidToDer(value); - } - } - e.value.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, altName.type, false, - value)); - } - } else if(e.name === 'nsComment' && options.cert) { - // sanity check value is ASCII (req'd) and not too big - if(!(/^[\x00-\x7F]*$/.test(e.comment)) || - (e.comment.length < 1) || (e.comment.length > 128)) { - throw new Error('Invalid "nsComment" content.'); - } - // IA5STRING opaque comment - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.IA5STRING, false, e.comment); - } else if(e.name === 'subjectKeyIdentifier' && options.cert) { - var ski = options.cert.generateSubjectKeyIdentifier(); - e.subjectKeyIdentifier = ski.toHex(); - // OCTETSTRING w/digest - e.value = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ski.getBytes()); - } else if(e.name === 'authorityKeyIdentifier' && options.cert) { - // SYNTAX SEQUENCE - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - - if(e.keyIdentifier) { - var keyIdentifier = (e.keyIdentifier === true ? - options.cert.generateSubjectKeyIdentifier().getBytes() : - e.keyIdentifier); - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier)); - } - - if(e.authorityCertIssuer) { - var authorityCertIssuer = [ - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [ - _dnToAsn1(e.authorityCertIssuer === true ? - options.cert.issuer : e.authorityCertIssuer) - ]) - ]; - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer)); - } - - if(e.serialNumber) { - var serialNumber = forge.util.hexToBytes(e.serialNumber === true ? - options.cert.serialNumber : e.serialNumber); - seq.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber)); - } - } else if(e.name === 'cRLDistributionPoints') { - e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - var seq = e.value.value; - - // Create sub SEQUENCE of DistributionPointName - var subSeq = asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - // Create fullName CHOICE - var fullNameGeneralNames = asn1.create( - asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - var altName; - for(var n = 0; n < e.altNames.length; ++n) { - altName = e.altNames[n]; - var value = altName.value; - // handle IP - if(altName.type === 7 && altName.ip) { - value = forge.util.bytesFromIP(altName.ip); - if(value === null) { - var error = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.'); - error.extension = e; - throw error; - } - } else if(altName.type === 8) { - // handle OID - if(altName.oid) { - value = asn1.oidToDer(asn1.oidToDer(altName.oid)); - } else { - // deprecated ... convert value to OID - value = asn1.oidToDer(value); - } - } - fullNameGeneralNames.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, altName.type, false, - value)); - } - - // Add to the parent SEQUENCE - subSeq.value.push(asn1.create( - asn1.Class.CONTEXT_SPECIFIC, 0, true, [fullNameGeneralNames])); - seq.push(subSeq); - } - - // ensure value has been defined by now - if(typeof e.value === 'undefined') { - var error = new Error('Extension value not specified.'); - error.extension = e; - throw error; - } - - return e; -} - -/** - * Convert signature parameters object to ASN.1 - * - * @param {String} oid Signature algorithm OID - * @param params The signature parametrs object - * @return ASN.1 object representing signature parameters - */ -function _signatureParametersToAsn1(oid, params) { - switch(oid) { - case oids['RSASSA-PSS']: - var parts = []; - - if(params.hash.algorithmOid !== undefined) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(params.hash.algorithmOid).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]) - ])); - } - - if(params.mgf.algorithmOid !== undefined) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(params.mgf.algorithmOid).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '') - ]) - ]) - ])); - } - - if(params.saltLength !== undefined) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(params.saltLength).getBytes()) - ])); - } - - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts); - - default: - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ''); - } -} - -/** - * Converts a certification request's attributes to an ASN.1 set of - * CRIAttributes. - * - * @param csr certification request. - * - * @return the ASN.1 set of CRIAttributes. - */ -function _CRIAttributesToAsn1(csr) { - // create an empty context-specific container - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []); - - // no attributes, return empty container - if(csr.attributes.length === 0) { - return rval; - } - - // each attribute has a sequence with a type and a set of values - var attrs = csr.attributes; - for(var i = 0; i < attrs.length; ++i) { - var attr = attrs[i]; - var value = attr.value; - - // reuse tag class for attribute value if available - var valueTagClass = asn1.Type.UTF8; - if('valueTagClass' in attr) { - valueTagClass = attr.valueTagClass; - } - if(valueTagClass === asn1.Type.UTF8) { - value = forge.util.encodeUtf8(value); - } - var valueConstructed = false; - if('valueConstructed' in attr) { - valueConstructed = attr.valueConstructed; - } - // FIXME: handle more encodings - - // create a RelativeDistinguishedName set - // each value in the set is an AttributeTypeAndValue first - // containing the type (an OID) and second the value - var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // AttributeType - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(attr.type).getBytes()), - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [ - // AttributeValue - asn1.create( - asn1.Class.UNIVERSAL, valueTagClass, valueConstructed, value) - ]) - ]); - rval.value.push(seq); - } - - return rval; -} - -var jan_1_1950 = new Date('1950-01-01T00:00:00Z'); -var jan_1_2050 = new Date('2050-01-01T00:00:00Z'); - -/** - * Converts a Date object to ASN.1 - * Handles the different format before and after 1st January 2050 - * - * @param date date object. - * - * @return the ASN.1 object representing the date. - */ -function _dateToAsn1(date) { - if(date >= jan_1_1950 && date < jan_1_2050) { - return asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false, - asn1.dateToUtcTime(date)); - } else { - return asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false, - asn1.dateToGeneralizedTime(date)); - } -} - -/** - * Gets the ASN.1 TBSCertificate part of an X.509v3 certificate. - * - * @param cert the certificate. - * - * @return the asn1 TBSCertificate. - */ -pki.getTBSCertificate = function(cert) { - // TBSCertificate - var notBefore = _dateToAsn1(cert.validity.notBefore); - var notAfter = _dateToAsn1(cert.validity.notAfter); - var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [ - // integer - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(cert.version).getBytes()) - ]), - // serialNumber - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - forge.util.hexToBytes(cert.serialNumber)), - // signature - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(cert.siginfo.algorithmOid).getBytes()), - // parameters - _signatureParametersToAsn1( - cert.siginfo.algorithmOid, cert.siginfo.parameters) - ]), - // issuer - _dnToAsn1(cert.issuer), - // validity - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - notBefore, - notAfter - ]), - // subject - _dnToAsn1(cert.subject), - // SubjectPublicKeyInfo - pki.publicKeyToAsn1(cert.publicKey) - ]); - - if(cert.issuer.uniqueId) { - // issuerUniqueID (optional) - tbs.value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - // TODO: support arbitrary bit length ids - String.fromCharCode(0x00) + - cert.issuer.uniqueId - ) - ]) - ); - } - if(cert.subject.uniqueId) { - // subjectUniqueID (optional) - tbs.value.push( - asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - // TODO: support arbitrary bit length ids - String.fromCharCode(0x00) + - cert.subject.uniqueId - ) - ]) - ); - } - - if(cert.extensions.length > 0) { - // extensions (optional) - tbs.value.push(pki.certificateExtensionsToAsn1(cert.extensions)); - } - - return tbs; -}; - -/** - * Gets the ASN.1 CertificationRequestInfo part of a - * PKCS#10 CertificationRequest. - * - * @param csr the certification request. - * - * @return the asn1 CertificationRequestInfo. - */ -pki.getCertificationRequestInfo = function(csr) { - // CertificationRequestInfo - var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // version - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false, - asn1.integerToDer(csr.version).getBytes()), - // subject - _dnToAsn1(csr.subject), - // SubjectPublicKeyInfo - pki.publicKeyToAsn1(csr.publicKey), - // attributes - _CRIAttributesToAsn1(csr) - ]); - - return cri; -}; - -/** - * Converts a DistinguishedName (subject or issuer) to an ASN.1 object. - * - * @param dn the DistinguishedName. - * - * @return the asn1 representation of a DistinguishedName. - */ -pki.distinguishedNameToAsn1 = function(dn) { - return _dnToAsn1(dn); -}; - -/** - * Converts an X.509v3 RSA certificate to an ASN.1 object. - * - * @param cert the certificate. - * - * @return the asn1 representation of an X.509v3 RSA certificate. - */ -pki.certificateToAsn1 = function(cert) { - // prefer cached TBSCertificate over generating one - var tbsCertificate = cert.tbsCertificate || pki.getTBSCertificate(cert); - - // Certificate - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // TBSCertificate - tbsCertificate, - // AlgorithmIdentifier (signature algorithm) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(cert.signatureOid).getBytes()), - // parameters - _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters) - ]), - // SignatureValue - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - String.fromCharCode(0x00) + cert.signature) - ]); -}; - -/** - * Converts X.509v3 certificate extensions to ASN.1. - * - * @param exts the extensions to convert. - * - * @return the extensions in ASN.1 format. - */ -pki.certificateExtensionsToAsn1 = function(exts) { - // create top-level extension container - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []); - - // create extension sequence (stores a sequence for each extension) - var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - rval.value.push(seq); - - for(var i = 0; i < exts.length; ++i) { - seq.value.push(pki.certificateExtensionToAsn1(exts[i])); - } - - return rval; -}; - -/** - * Converts a single certificate extension to ASN.1. - * - * @param ext the extension to convert. - * - * @return the extension in ASN.1 format. - */ -pki.certificateExtensionToAsn1 = function(ext) { - // create a sequence for each extension - var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - - // extnID (OID) - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(ext.id).getBytes())); - - // critical defaults to false - if(ext.critical) { - // critical BOOLEAN DEFAULT FALSE - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false, - String.fromCharCode(0xFF))); - } - - var value = ext.value; - if(typeof ext.value !== 'string') { - // value is asn.1 - value = asn1.toDer(value).getBytes(); - } - - // extnValue (OCTET STRING) - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, value)); - - return extseq; -}; - -/** - * Converts a PKCS#10 certification request to an ASN.1 object. - * - * @param csr the certification request. - * - * @return the asn1 representation of a certification request. - */ -pki.certificationRequestToAsn1 = function(csr) { - // prefer cached CertificationRequestInfo over generating one - var cri = csr.certificationRequestInfo || - pki.getCertificationRequestInfo(csr); - - // Certificate - return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // CertificationRequestInfo - cri, - // AlgorithmIdentifier (signature algorithm) - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ - // algorithm - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false, - asn1.oidToDer(csr.signatureOid).getBytes()), - // parameters - _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters) - ]), - // signature - asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, - String.fromCharCode(0x00) + csr.signature) - ]); -}; - -/** - * Creates a CA store. - * - * @param certs an optional array of certificate objects or PEM-formatted - * certificate strings to add to the CA store. - * - * @return the CA store. - */ -pki.createCaStore = function(certs) { - // create CA store - var caStore = { - // stored certificates - certs: {} - }; - - /** - * Gets the certificate that issued the passed certificate or its - * 'parent'. - * - * @param cert the certificate to get the parent for. - * - * @return the parent certificate or null if none was found. - */ - caStore.getIssuer = function(cert) { - var rval = getBySubject(cert.issuer); - - // see if there are multiple matches - /*if(forge.util.isArray(rval)) { - // TODO: resolve multiple matches by checking - // authorityKey/subjectKey/issuerUniqueID/other identifiers, etc. - // FIXME: or alternatively do authority key mapping - // if possible (X.509v1 certs can't work?) - throw new Error('Resolving multiple issuer matches not implemented yet.'); - }*/ - - return rval; - }; - - /** - * Adds a trusted certificate to the store. - * - * @param cert the certificate to add as a trusted certificate (either a - * pki.certificate object or a PEM-formatted certificate). - */ - caStore.addCertificate = function(cert) { - // convert from pem if necessary - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - - ensureSubjectHasHash(cert.subject); - - if(!caStore.hasCertificate(cert)) { // avoid duplicate certificates in store - if(cert.subject.hash in caStore.certs) { - // subject hash already exists, append to array - var tmp = caStore.certs[cert.subject.hash]; - if(!forge.util.isArray(tmp)) { - tmp = [tmp]; - } - tmp.push(cert); - caStore.certs[cert.subject.hash] = tmp; - } else { - caStore.certs[cert.subject.hash] = cert; - } - } - }; - - /** - * Checks to see if the given certificate is in the store. - * - * @param cert the certificate to check (either a pki.certificate or a - * PEM-formatted certificate). - * - * @return true if the certificate is in the store, false if not. - */ - caStore.hasCertificate = function(cert) { - // convert from pem if necessary - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - - var match = getBySubject(cert.subject); - if(!match) { - return false; - } - if(!forge.util.isArray(match)) { - match = [match]; - } - // compare DER-encoding of certificates - var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes(); - for(var i = 0; i < match.length; ++i) { - var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes(); - if(der1 === der2) { - return true; - } - } - return false; - }; - - /** - * Lists all of the certificates kept in the store. - * - * @return an array of all of the pki.certificate objects in the store. - */ - caStore.listAllCertificates = function() { - var certList = []; - - for(var hash in caStore.certs) { - if(caStore.certs.hasOwnProperty(hash)) { - var value = caStore.certs[hash]; - if(!forge.util.isArray(value)) { - certList.push(value); - } else { - for(var i = 0; i < value.length; ++i) { - certList.push(value[i]); - } - } - } - } - - return certList; - }; - - /** - * Removes a certificate from the store. - * - * @param cert the certificate to remove (either a pki.certificate or a - * PEM-formatted certificate). - * - * @return the certificate that was removed or null if the certificate - * wasn't in store. - */ - caStore.removeCertificate = function(cert) { - var result; - - // convert from pem if necessary - if(typeof cert === 'string') { - cert = forge.pki.certificateFromPem(cert); - } - ensureSubjectHasHash(cert.subject); - if(!caStore.hasCertificate(cert)) { - return null; - } - - var match = getBySubject(cert.subject); - - if(!forge.util.isArray(match)) { - result = caStore.certs[cert.subject.hash]; - delete caStore.certs[cert.subject.hash]; - return result; - } - - // compare DER-encoding of certificates - var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes(); - for(var i = 0; i < match.length; ++i) { - var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes(); - if(der1 === der2) { - result = match[i]; - match.splice(i, 1); - } - } - if(match.length === 0) { - delete caStore.certs[cert.subject.hash]; - } - - return result; - }; - - function getBySubject(subject) { - ensureSubjectHasHash(subject); - return caStore.certs[subject.hash] || null; - } - - function ensureSubjectHasHash(subject) { - // produce subject hash if it doesn't exist - if(!subject.hash) { - var md = forge.md.sha1.create(); - subject.attributes = pki.RDNAttributesAsArray(_dnToAsn1(subject), md); - subject.hash = md.digest().toHex(); - } - } - - // auto-add passed in certs - if(certs) { - // parse PEM-formatted certificates as necessary - for(var i = 0; i < certs.length; ++i) { - var cert = certs[i]; - caStore.addCertificate(cert); - } - } - - return caStore; -}; - -/** - * Certificate verification errors, based on TLS. - */ -pki.certificateError = { - bad_certificate: 'forge.pki.BadCertificate', - unsupported_certificate: 'forge.pki.UnsupportedCertificate', - certificate_revoked: 'forge.pki.CertificateRevoked', - certificate_expired: 'forge.pki.CertificateExpired', - certificate_unknown: 'forge.pki.CertificateUnknown', - unknown_ca: 'forge.pki.UnknownCertificateAuthority' -}; - -/** - * Verifies a certificate chain against the given Certificate Authority store - * with an optional custom verify callback. - * - * @param caStore a certificate store to verify against. - * @param chain the certificate chain to verify, with the root or highest - * authority at the end (an array of certificates). - * @param options a callback to be called for every certificate in the chain or - * an object with: - * verify a callback to be called for every certificate in the - * chain - * validityCheckDate the date against which the certificate - * validity period should be checked. Pass null to not check - * the validity period. By default, the current date is used. - * - * The verify callback has the following signature: - * - * verified - Set to true if certificate was verified, otherwise the - * pki.certificateError for why the certificate failed. - * depth - The current index in the chain, where 0 is the end point's cert. - * certs - The certificate chain, *NOTE* an empty chain indicates an anonymous - * end point. - * - * The function returns true on success and on failure either the appropriate - * pki.certificateError or an object with 'error' set to the appropriate - * pki.certificateError and 'message' set to a custom error message. - * - * @return true if successful, error thrown if not. - */ -pki.verifyCertificateChain = function(caStore, chain, options) { - /* From: RFC3280 - Internet X.509 Public Key Infrastructure Certificate - Section 6: Certification Path Validation - See inline parentheticals related to this particular implementation. - - The primary goal of path validation is to verify the binding between - a subject distinguished name or a subject alternative name and subject - public key, as represented in the end entity certificate, based on the - public key of the trust anchor. This requires obtaining a sequence of - certificates that support that binding. That sequence should be provided - in the passed 'chain'. The trust anchor should be in the given CA - store. The 'end entity' certificate is the certificate provided by the - end point (typically a server) and is the first in the chain. - - To meet this goal, the path validation process verifies, among other - things, that a prospective certification path (a sequence of n - certificates or a 'chain') satisfies the following conditions: - - (a) for all x in {1, ..., n-1}, the subject of certificate x is - the issuer of certificate x+1; - - (b) certificate 1 is issued by the trust anchor; - - (c) certificate n is the certificate to be validated; and - - (d) for all x in {1, ..., n}, the certificate was valid at the - time in question. - - Note that here 'n' is index 0 in the chain and 1 is the last certificate - in the chain and it must be signed by a certificate in the connection's - CA store. - - The path validation process also determines the set of certificate - policies that are valid for this path, based on the certificate policies - extension, policy mapping extension, policy constraints extension, and - inhibit any-policy extension. - - Note: Policy mapping extension not supported (Not Required). - - Note: If the certificate has an unsupported critical extension, then it - must be rejected. - - Note: A certificate is self-issued if the DNs that appear in the subject - and issuer fields are identical and are not empty. - - The path validation algorithm assumes the following seven inputs are - provided to the path processing logic. What this specific implementation - will use is provided parenthetically: - - (a) a prospective certification path of length n (the 'chain') - (b) the current date/time: ('now'). - (c) user-initial-policy-set: A set of certificate policy identifiers - naming the policies that are acceptable to the certificate user. - The user-initial-policy-set contains the special value any-policy - if the user is not concerned about certificate policy - (Not implemented. Any policy is accepted). - (d) trust anchor information, describing a CA that serves as a trust - anchor for the certification path. The trust anchor information - includes: - - (1) the trusted issuer name, - (2) the trusted public key algorithm, - (3) the trusted public key, and - (4) optionally, the trusted public key parameters associated - with the public key. - - (Trust anchors are provided via certificates in the CA store). - - The trust anchor information may be provided to the path processing - procedure in the form of a self-signed certificate. The trusted anchor - information is trusted because it was delivered to the path processing - procedure by some trustworthy out-of-band procedure. If the trusted - public key algorithm requires parameters, then the parameters are - provided along with the trusted public key (No parameters used in this - implementation). - - (e) initial-policy-mapping-inhibit, which indicates if policy mapping is - allowed in the certification path. - (Not implemented, no policy checking) - - (f) initial-explicit-policy, which indicates if the path must be valid - for at least one of the certificate policies in the user-initial- - policy-set. - (Not implemented, no policy checking) - - (g) initial-any-policy-inhibit, which indicates whether the - anyPolicy OID should be processed if it is included in a - certificate. - (Not implemented, so any policy is valid provided that it is - not marked as critical) */ - - /* Basic Path Processing: - - For each certificate in the 'chain', the following is checked: - - 1. The certificate validity period includes the current time. - 2. The certificate was signed by its parent (where the parent is either - the next in the chain or from the CA store). Allow processing to - continue to the next step if no parent is found but the certificate is - in the CA store. - 3. TODO: The certificate has not been revoked. - 4. The certificate issuer name matches the parent's subject name. - 5. TODO: If the certificate is self-issued and not the final certificate - in the chain, skip this step, otherwise verify that the subject name - is within one of the permitted subtrees of X.500 distinguished names - and that each of the alternative names in the subjectAltName extension - (critical or non-critical) is within one of the permitted subtrees for - that name type. - 6. TODO: If the certificate is self-issued and not the final certificate - in the chain, skip this step, otherwise verify that the subject name - is not within one of the excluded subtrees for X.500 distinguished - names and none of the subjectAltName extension names are excluded for - that name type. - 7. The other steps in the algorithm for basic path processing involve - handling the policy extension which is not presently supported in this - implementation. Instead, if a critical policy extension is found, the - certificate is rejected as not supported. - 8. If the certificate is not the first or if its the only certificate in - the chain (having no parent from the CA store or is self-signed) and it - has a critical key usage extension, verify that the keyCertSign bit is - set. If the key usage extension exists, verify that the basic - constraints extension exists. If the basic constraints extension exists, - verify that the cA flag is set. If pathLenConstraint is set, ensure that - the number of certificates that precede in the chain (come earlier - in the chain as implemented below), excluding the very first in the - chain (typically the end-entity one), isn't greater than the - pathLenConstraint. This constraint limits the number of intermediate - CAs that may appear below a CA before only end-entity certificates - may be issued. */ - - // if a verify callback is passed as the third parameter, package it within - // the options object. This is to support a legacy function signature that - // expected the verify callback as the third parameter. - if(typeof options === 'function') { - options = {verify: options}; - } - options = options || {}; - - // copy cert chain references to another array to protect against changes - // in verify callback - chain = chain.slice(0); - var certs = chain.slice(0); - - var validityCheckDate = options.validityCheckDate; - // if no validityCheckDate is specified, default to the current date. Make - // sure to maintain the value null because it indicates that the validity - // period should not be checked. - if(typeof validityCheckDate === 'undefined') { - validityCheckDate = new Date(); - } - - // verify each cert in the chain using its parent, where the parent - // is either the next in the chain or from the CA store - var first = true; - var error = null; - var depth = 0; - do { - var cert = chain.shift(); - var parent = null; - var selfSigned = false; - - if(validityCheckDate) { - // 1. check valid time - if(validityCheckDate < cert.validity.notBefore || - validityCheckDate > cert.validity.notAfter) { - error = { - message: 'Certificate is not valid yet or has expired.', - error: pki.certificateError.certificate_expired, - notBefore: cert.validity.notBefore, - notAfter: cert.validity.notAfter, - // TODO: we might want to reconsider renaming 'now' to - // 'validityCheckDate' should this API be changed in the future. - now: validityCheckDate - }; - } - } - - // 2. verify with parent from chain or CA store - if(error === null) { - parent = chain[0] || caStore.getIssuer(cert); - if(parent === null) { - // check for self-signed cert - if(cert.isIssuer(cert)) { - selfSigned = true; - parent = cert; - } - } - - if(parent) { - // FIXME: current CA store implementation might have multiple - // certificates where the issuer can't be determined from the - // certificate (happens rarely with, eg: old certificates) so normalize - // by always putting parents into an array - // TODO: there's may be an extreme degenerate case currently uncovered - // where an old intermediate certificate seems to have a matching parent - // but none of the parents actually verify ... but the intermediate - // is in the CA and it should pass this check; needs investigation - var parents = parent; - if(!forge.util.isArray(parents)) { - parents = [parents]; - } - - // try to verify with each possible parent (typically only one) - var verified = false; - while(!verified && parents.length > 0) { - parent = parents.shift(); - try { - verified = parent.verify(cert); - } catch(ex) { - // failure to verify, don't care why, try next one - } - } - - if(!verified) { - error = { - message: 'Certificate signature is invalid.', - error: pki.certificateError.bad_certificate - }; - } - } - - if(error === null && (!parent || selfSigned) && - !caStore.hasCertificate(cert)) { - // no parent issuer and certificate itself is not trusted - error = { - message: 'Certificate is not trusted.', - error: pki.certificateError.unknown_ca - }; - } - } - - // TODO: 3. check revoked - - // 4. check for matching issuer/subject - if(error === null && parent && !cert.isIssuer(parent)) { - // parent is not issuer - error = { - message: 'Certificate issuer is invalid.', - error: pki.certificateError.bad_certificate - }; - } - - // 5. TODO: check names with permitted names tree - - // 6. TODO: check names against excluded names tree - - // 7. check for unsupported critical extensions - if(error === null) { - // supported extensions - var se = { - keyUsage: true, - basicConstraints: true - }; - for(var i = 0; error === null && i < cert.extensions.length; ++i) { - var ext = cert.extensions[i]; - if(ext.critical && !(ext.name in se)) { - error = { - message: - 'Certificate has an unsupported critical extension.', - error: pki.certificateError.unsupported_certificate - }; - } - } - } - - // 8. check for CA if cert is not first or is the only certificate - // remaining in chain with no parent or is self-signed - if(error === null && - (!first || (chain.length === 0 && (!parent || selfSigned)))) { - // first check keyUsage extension and then basic constraints - var bcExt = cert.getExtension('basicConstraints'); - var keyUsageExt = cert.getExtension('keyUsage'); - if(keyUsageExt !== null) { - // keyCertSign must be true and there must be a basic - // constraints extension - if(!keyUsageExt.keyCertSign || bcExt === null) { - // bad certificate - error = { - message: - 'Certificate keyUsage or basicConstraints conflict ' + - 'or indicate that the certificate is not a CA. ' + - 'If the certificate is the only one in the chain or ' + - 'isn\'t the first then the certificate must be a ' + - 'valid CA.', - error: pki.certificateError.bad_certificate - }; - } - } - // basic constraints cA flag must be set - if(error === null && bcExt !== null && !bcExt.cA) { - // bad certificate - error = { - message: - 'Certificate basicConstraints indicates the certificate ' + - 'is not a CA.', - error: pki.certificateError.bad_certificate - }; - } - // if error is not null and keyUsage is available, then we know it - // has keyCertSign and there is a basic constraints extension too, - // which means we can check pathLenConstraint (if it exists) - if(error === null && keyUsageExt !== null && - 'pathLenConstraint' in bcExt) { - // pathLen is the maximum # of intermediate CA certs that can be - // found between the current certificate and the end-entity (depth 0) - // certificate; this number does not include the end-entity (depth 0, - // last in the chain) even if it happens to be a CA certificate itself - var pathLen = depth - 1; - if(pathLen > bcExt.pathLenConstraint) { - // pathLenConstraint violated, bad certificate - error = { - message: - 'Certificate basicConstraints pathLenConstraint violated.', - error: pki.certificateError.bad_certificate - }; - } - } - } - - // call application callback - var vfd = (error === null) ? true : error.error; - var ret = options.verify ? options.verify(vfd, depth, certs) : vfd; - if(ret === true) { - // clear any set error - error = null; - } else { - // if passed basic tests, set default message and alert - if(vfd === true) { - error = { - message: 'The application rejected the certificate.', - error: pki.certificateError.bad_certificate - }; - } - - // check for custom error info - if(ret || ret === 0) { - // set custom message and error - if(typeof ret === 'object' && !forge.util.isArray(ret)) { - if(ret.message) { - error.message = ret.message; - } - if(ret.error) { - error.error = ret.error; - } - } else if(typeof ret === 'string') { - // set custom error - error.error = ret; - } - } - - // throw error - throw error; - } - - // no longer first cert in chain - first = false; - ++depth; - } while(chain.length > 0); - - return true; -}; diff --git a/node_modules/node-forge/lib/xhr.js b/node_modules/node-forge/lib/xhr.js deleted file mode 100644 index e493c3b..0000000 --- a/node_modules/node-forge/lib/xhr.js +++ /dev/null @@ -1,736 +0,0 @@ -/** - * XmlHttpRequest implementation that uses TLS and flash SocketPool. - * - * @author Dave Longley - * - * Copyright (c) 2010-2013 Digital Bazaar, Inc. - */ -var forge = require('./forge'); -require('./socket'); -require('./http'); - -/* XHR API */ -var xhrApi = module.exports = forge.xhr = forge.xhr || {}; - -(function($) { - -// logging category -var cat = 'forge.xhr'; - -/* -XMLHttpRequest interface definition from: -http://www.w3.org/TR/XMLHttpRequest - -interface XMLHttpRequest { - // event handler - attribute EventListener onreadystatechange; - - // state - const unsigned short UNSENT = 0; - const unsigned short OPENED = 1; - const unsigned short HEADERS_RECEIVED = 2; - const unsigned short LOADING = 3; - const unsigned short DONE = 4; - readonly attribute unsigned short readyState; - - // request - void open(in DOMString method, in DOMString url); - void open(in DOMString method, in DOMString url, in boolean async); - void open(in DOMString method, in DOMString url, - in boolean async, in DOMString user); - void open(in DOMString method, in DOMString url, - in boolean async, in DOMString user, in DOMString password); - void setRequestHeader(in DOMString header, in DOMString value); - void send(); - void send(in DOMString data); - void send(in Document data); - void abort(); - - // response - DOMString getAllResponseHeaders(); - DOMString getResponseHeader(in DOMString header); - readonly attribute DOMString responseText; - readonly attribute Document responseXML; - readonly attribute unsigned short status; - readonly attribute DOMString statusText; -}; -*/ - -// readyStates -var UNSENT = 0; -var OPENED = 1; -var HEADERS_RECEIVED = 2; -var LOADING = 3; -var DONE = 4; - -// exceptions -var INVALID_STATE_ERR = 11; -var SYNTAX_ERR = 12; -var SECURITY_ERR = 18; -var NETWORK_ERR = 19; -var ABORT_ERR = 20; - -// private flash socket pool vars -var _sp = null; -var _policyPort = 0; -var _policyUrl = null; - -// default client (used if no special URL provided when creating an XHR) -var _client = null; - -// all clients including the default, key'd by full base url -// (multiple cross-domain http clients are permitted so there may be more -// than one client in this map) -// TODO: provide optional clean up API for non-default clients -var _clients = {}; - -// the default maximum number of concurrents connections per client -var _maxConnections = 10; - -var net = forge.net; -var http = forge.http; - -/** - * Initializes flash XHR support. - * - * @param options: - * url: the default base URL to connect to if xhr URLs are relative, - * ie: https://myserver.com. - * flashId: the dom ID of the flash SocketPool. - * policyPort: the port that provides the server's flash policy, 0 to use - * the flash default. - * policyUrl: the policy file URL to use instead of a policy port. - * msie: true if browser is internet explorer, false if not. - * connections: the maximum number of concurrent connections. - * caCerts: a list of PEM-formatted certificates to trust. - * cipherSuites: an optional array of cipher suites to use, - * see forge.tls.CipherSuites. - * verify: optional TLS certificate verify callback to use (see forge.tls - * for details). - * getCertificate: an optional callback used to get a client-side - * certificate (see forge.tls for details). - * getPrivateKey: an optional callback used to get a client-side private - * key (see forge.tls for details). - * getSignature: an optional callback used to get a client-side signature - * (see forge.tls for details). - * persistCookies: true to use persistent cookies via flash local storage, - * false to only keep cookies in javascript. - * primeTlsSockets: true to immediately connect TLS sockets on their - * creation so that they will cache TLS sessions for reuse. - */ -xhrApi.init = function(options) { - forge.log.debug(cat, 'initializing', options); - - // update default policy port and max connections - _policyPort = options.policyPort || _policyPort; - _policyUrl = options.policyUrl || _policyUrl; - _maxConnections = options.connections || _maxConnections; - - // create the flash socket pool - _sp = net.createSocketPool({ - flashId: options.flashId, - policyPort: _policyPort, - policyUrl: _policyUrl, - msie: options.msie || false - }); - - // create default http client - _client = http.createClient({ - url: options.url || ( - window.location.protocol + '//' + window.location.host), - socketPool: _sp, - policyPort: _policyPort, - policyUrl: _policyUrl, - connections: options.connections || _maxConnections, - caCerts: options.caCerts, - cipherSuites: options.cipherSuites, - persistCookies: options.persistCookies || true, - primeTlsSockets: options.primeTlsSockets || false, - verify: options.verify, - getCertificate: options.getCertificate, - getPrivateKey: options.getPrivateKey, - getSignature: options.getSignature - }); - _clients[_client.url.full] = _client; - - forge.log.debug(cat, 'ready'); -}; - -/** - * Called to clean up the clients and socket pool. - */ -xhrApi.cleanup = function() { - // destroy all clients - for(var key in _clients) { - _clients[key].destroy(); - } - _clients = {}; - _client = null; - - // destroy socket pool - _sp.destroy(); - _sp = null; -}; - -/** - * Sets a cookie. - * - * @param cookie the cookie with parameters: - * name: the name of the cookie. - * value: the value of the cookie. - * comment: an optional comment string. - * maxAge: the age of the cookie in seconds relative to created time. - * secure: true if the cookie must be sent over a secure protocol. - * httpOnly: true to restrict access to the cookie from javascript - * (inaffective since the cookies are stored in javascript). - * path: the path for the cookie. - * domain: optional domain the cookie belongs to (must start with dot). - * version: optional version of the cookie. - * created: creation time, in UTC seconds, of the cookie. - */ -xhrApi.setCookie = function(cookie) { - // default cookie expiration to never - cookie.maxAge = cookie.maxAge || -1; - - // if the cookie's domain is set, use the appropriate client - if(cookie.domain) { - // add the cookies to the applicable domains - for(var key in _clients) { - var client = _clients[key]; - if(http.withinCookieDomain(client.url, cookie) && - client.secure === cookie.secure) { - client.setCookie(cookie); - } - } - } else { - // use the default domain - // FIXME: should a null domain cookie be added to all clients? should - // this be an option? - _client.setCookie(cookie); - } -}; - -/** - * Gets a cookie. - * - * @param name the name of the cookie. - * @param path an optional path for the cookie (if there are multiple cookies - * with the same name but different paths). - * @param domain an optional domain for the cookie (if not using the default - * domain). - * - * @return the cookie, cookies (if multiple matches), or null if not found. - */ -xhrApi.getCookie = function(name, path, domain) { - var rval = null; - - if(domain) { - // get the cookies from the applicable domains - for(var key in _clients) { - var client = _clients[key]; - if(http.withinCookieDomain(client.url, domain)) { - var cookie = client.getCookie(name, path); - if(cookie !== null) { - if(rval === null) { - rval = cookie; - } else if(!forge.util.isArray(rval)) { - rval = [rval, cookie]; - } else { - rval.push(cookie); - } - } - } - } - } else { - // get cookie from default domain - rval = _client.getCookie(name, path); - } - - return rval; -}; - -/** - * Removes a cookie. - * - * @param name the name of the cookie. - * @param path an optional path for the cookie (if there are multiple cookies - * with the same name but different paths). - * @param domain an optional domain for the cookie (if not using the default - * domain). - * - * @return true if a cookie was removed, false if not. - */ -xhrApi.removeCookie = function(name, path, domain) { - var rval = false; - - if(domain) { - // remove the cookies from the applicable domains - for(var key in _clients) { - var client = _clients[key]; - if(http.withinCookieDomain(client.url, domain)) { - if(client.removeCookie(name, path)) { - rval = true; - } - } - } - } else { - // remove cookie from default domain - rval = _client.removeCookie(name, path); - } - - return rval; -}; - -/** - * Creates a new XmlHttpRequest. By default the base URL, flash policy port, - * etc, will be used. However, an XHR can be created to point at another - * cross-domain URL. - * - * @param options: - * logWarningOnError: If true and an HTTP error status code is received then - * log a warning, otherwise log a verbose message. - * verbose: If true be very verbose in the output including the response - * event and response body, otherwise only include status, timing, and - * data size. - * logError: a multi-var log function for warnings that takes the log - * category as the first var. - * logWarning: a multi-var log function for warnings that takes the log - * category as the first var. - * logDebug: a multi-var log function for warnings that takes the log - * category as the first var. - * logVerbose: a multi-var log function for warnings that takes the log - * category as the first var. - * url: the default base URL to connect to if xhr URLs are relative, - * eg: https://myserver.com, and note that the following options will be - * ignored if the URL is absent or the same as the default base URL. - * policyPort: the port that provides the server's flash policy, 0 to use - * the flash default. - * policyUrl: the policy file URL to use instead of a policy port. - * connections: the maximum number of concurrent connections. - * caCerts: a list of PEM-formatted certificates to trust. - * cipherSuites: an optional array of cipher suites to use, see - * forge.tls.CipherSuites. - * verify: optional TLS certificate verify callback to use (see forge.tls - * for details). - * getCertificate: an optional callback used to get a client-side - * certificate. - * getPrivateKey: an optional callback used to get a client-side private key. - * getSignature: an optional callback used to get a client-side signature. - * persistCookies: true to use persistent cookies via flash local storage, - * false to only keep cookies in javascript. - * primeTlsSockets: true to immediately connect TLS sockets on their - * creation so that they will cache TLS sessions for reuse. - * - * @return the XmlHttpRequest. - */ -xhrApi.create = function(options) { - // set option defaults - options = $.extend({ - logWarningOnError: true, - verbose: false, - logError: function() {}, - logWarning: function() {}, - logDebug: function() {}, - logVerbose: function() {}, - url: null - }, options || {}); - - // private xhr state - var _state = { - // the http client to use - client: null, - // request storage - request: null, - // response storage - response: null, - // asynchronous, true if doing asynchronous communication - asynchronous: true, - // sendFlag, true if send has been called - sendFlag: false, - // errorFlag, true if a network error occurred - errorFlag: false - }; - - // private log functions - var _log = { - error: options.logError || forge.log.error, - warning: options.logWarning || forge.log.warning, - debug: options.logDebug || forge.log.debug, - verbose: options.logVerbose || forge.log.verbose - }; - - // create public xhr interface - var xhr = { - // an EventListener - onreadystatechange: null, - // readonly, the current readyState - readyState: UNSENT, - // a string with the response entity-body - responseText: '', - // a Document for response entity-bodies that are XML - responseXML: null, - // readonly, returns the HTTP status code (i.e. 404) - status: 0, - // readonly, returns the HTTP status message (i.e. 'Not Found') - statusText: '' - }; - - // determine which http client to use - if(options.url === null) { - // use default - _state.client = _client; - } else { - var url = http.parseUrl(options.url); - if(!url) { - var error = new Error('Invalid url.'); - error.details = { - url: options.url - }; - } - - // find client - if(url.full in _clients) { - // client found - _state.client = _clients[url.full]; - } else { - // create client - _state.client = http.createClient({ - url: options.url, - socketPool: _sp, - policyPort: options.policyPort || _policyPort, - policyUrl: options.policyUrl || _policyUrl, - connections: options.connections || _maxConnections, - caCerts: options.caCerts, - cipherSuites: options.cipherSuites, - persistCookies: options.persistCookies || true, - primeTlsSockets: options.primeTlsSockets || false, - verify: options.verify, - getCertificate: options.getCertificate, - getPrivateKey: options.getPrivateKey, - getSignature: options.getSignature - }); - _clients[url.full] = _state.client; - } - } - - /** - * Opens the request. This method will create the HTTP request to send. - * - * @param method the HTTP method (i.e. 'GET'). - * @param url the relative url (the HTTP request path). - * @param async always true, ignored. - * @param user always null, ignored. - * @param password always null, ignored. - */ - xhr.open = function(method, url, async, user, password) { - // 1. validate Document if one is associated - // TODO: not implemented (not used yet) - - // 2. validate method token - // 3. change method to uppercase if it matches a known - // method (here we just require it to be uppercase, and - // we do not allow the standard methods) - // 4. disallow CONNECT, TRACE, or TRACK with a security error - switch(method) { - case 'DELETE': - case 'GET': - case 'HEAD': - case 'OPTIONS': - case 'PATCH': - case 'POST': - case 'PUT': - // valid method - break; - case 'CONNECT': - case 'TRACE': - case 'TRACK': - throw new Error('CONNECT, TRACE and TRACK methods are disallowed'); - default: - throw new Error('Invalid method: ' + method); - } - - // TODO: other validation steps in algorithm are not implemented - - // 19. set send flag to false - // set response body to null - // empty list of request headers - // set request method to given method - // set request URL - // set username, password - // set asychronous flag - _state.sendFlag = false; - xhr.responseText = ''; - xhr.responseXML = null; - - // custom: reset status and statusText - xhr.status = 0; - xhr.statusText = ''; - - // create the HTTP request - _state.request = http.createRequest({ - method: method, - path: url - }); - - // 20. set state to OPENED - xhr.readyState = OPENED; - - // 21. dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - }; - - /** - * Adds an HTTP header field to the request. - * - * @param header the name of the header field. - * @param value the value of the header field. - */ - xhr.setRequestHeader = function(header, value) { - // 1. if state is not OPENED or send flag is true, raise exception - if(xhr.readyState != OPENED || _state.sendFlag) { - throw new Error('XHR not open or sending'); - } - - // TODO: other validation steps in spec aren't implemented - - // set header - _state.request.setField(header, value); - }; - - /** - * Sends the request and any associated data. - * - * @param data a string or Document object to send, null to send no data. - */ - xhr.send = function(data) { - // 1. if state is not OPENED or 2. send flag is true, raise - // an invalid state exception - if(xhr.readyState != OPENED || _state.sendFlag) { - throw new Error('XHR not open or sending'); - } - - // 3. ignore data if method is GET or HEAD - if(data && - _state.request.method !== 'GET' && - _state.request.method !== 'HEAD') { - // handle non-IE case - if(typeof(XMLSerializer) !== 'undefined') { - if(data instanceof Document) { - var xs = new XMLSerializer(); - _state.request.body = xs.serializeToString(data); - } else { - _state.request.body = data; - } - } else { - // poorly implemented IE case - if(typeof(data.xml) !== 'undefined') { - _state.request.body = data.xml; - } else { - _state.request.body = data; - } - } - } - - // 4. release storage mutex (not used) - - // 5. set error flag to false - _state.errorFlag = false; - - // 6. if asynchronous is true (must be in this implementation) - - // 6.1 set send flag to true - _state.sendFlag = true; - - // 6.2 dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - - // create send options - var options = {}; - options.request = _state.request; - options.headerReady = function(e) { - // make cookies available for ease of use/iteration - xhr.cookies = _state.client.cookies; - - // TODO: update document.cookie with any cookies where the - // script's domain matches - - // headers received - xhr.readyState = HEADERS_RECEIVED; - xhr.status = e.response.code; - xhr.statusText = e.response.message; - _state.response = e.response; - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - if(!_state.response.aborted) { - // now loading body - xhr.readyState = LOADING; - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - } - }; - options.bodyReady = function(e) { - xhr.readyState = DONE; - var ct = e.response.getField('Content-Type'); - // Note: this null/undefined check is done outside because IE - // dies otherwise on a "'null' is null" error - if(ct) { - if(ct.indexOf('text/xml') === 0 || - ct.indexOf('application/xml') === 0 || - ct.indexOf('+xml') !== -1) { - try { - var doc = new ActiveXObject('MicrosoftXMLDOM'); - doc.async = false; - doc.loadXML(e.response.body); - xhr.responseXML = doc; - } catch(ex) { - var parser = new DOMParser(); - xhr.responseXML = parser.parseFromString(ex.body, 'text/xml'); - } - } - } - - var length = 0; - if(e.response.body !== null) { - xhr.responseText = e.response.body; - length = e.response.body.length; - } - // build logging output - var req = _state.request; - var output = - req.method + ' ' + req.path + ' ' + - xhr.status + ' ' + xhr.statusText + ' ' + - length + 'B ' + - (e.request.connectTime + e.request.time + e.response.time) + - 'ms'; - var lFunc; - if(options.verbose) { - lFunc = (xhr.status >= 400 && options.logWarningOnError) ? - _log.warning : _log.verbose; - lFunc(cat, output, - e, e.response.body ? '\n' + e.response.body : '\nNo content'); - } else { - lFunc = (xhr.status >= 400 && options.logWarningOnError) ? - _log.warning : _log.debug; - lFunc(cat, output); - } - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - }; - options.error = function(e) { - var req = _state.request; - _log.error(cat, req.method + ' ' + req.path, e); - - // 1. set response body to null - xhr.responseText = ''; - xhr.responseXML = null; - - // 2. set error flag to true (and reset status) - _state.errorFlag = true; - xhr.status = 0; - xhr.statusText = ''; - - // 3. set state to done - xhr.readyState = DONE; - - // 4. asyc flag is always true, so dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - }; - - // 7. send request - _state.client.send(options); - }; - - /** - * Aborts the request. - */ - xhr.abort = function() { - // 1. abort send - // 2. stop network activity - _state.request.abort(); - - // 3. set response to null - xhr.responseText = ''; - xhr.responseXML = null; - - // 4. set error flag to true (and reset status) - _state.errorFlag = true; - xhr.status = 0; - xhr.statusText = ''; - - // 5. clear user headers - _state.request = null; - _state.response = null; - - // 6. if state is DONE or UNSENT, or if OPENED and send flag is false - if(xhr.readyState === DONE || xhr.readyState === UNSENT || - (xhr.readyState === OPENED && !_state.sendFlag)) { - // 7. set ready state to unsent - xhr.readyState = UNSENT; - } else { - // 6.1 set state to DONE - xhr.readyState = DONE; - - // 6.2 set send flag to false - _state.sendFlag = false; - - // 6.3 dispatch onreadystatechange - if(xhr.onreadystatechange) { - xhr.onreadystatechange(); - } - - // 7. set state to UNSENT - xhr.readyState = UNSENT; - } - }; - - /** - * Gets all response headers as a string. - * - * @return the HTTP-encoded response header fields. - */ - xhr.getAllResponseHeaders = function() { - var rval = ''; - if(_state.response !== null) { - var fields = _state.response.fields; - $.each(fields, function(name, array) { - $.each(array, function(i, value) { - rval += name + ': ' + value + '\r\n'; - }); - }); - } - return rval; - }; - - /** - * Gets a single header field value or, if there are multiple - * fields with the same name, a comma-separated list of header - * values. - * - * @return the header field value(s) or null. - */ - xhr.getResponseHeader = function(header) { - var rval = null; - if(_state.response !== null) { - if(header in _state.response.fields) { - rval = _state.response.fields[header]; - if(forge.util.isArray(rval)) { - rval = rval.join(); - } - } - } - return rval; - }; - - return xhr; -}; - -})(jQuery); diff --git a/node_modules/node-forge/package.json b/node_modules/node-forge/package.json deleted file mode 100644 index f5cc879..0000000 --- a/node_modules/node-forge/package.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "name": "node-forge", - "version": "0.10.0", - "description": "JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.", - "homepage": "https://github.com/digitalbazaar/forge", - "author": { - "name": "Digital Bazaar, Inc.", - "email": "support@digitalbazaar.com", - "url": "http://digitalbazaar.com/" - }, - "contributors": [ - "Dave Longley ", - "David I. Lehn ", - "Stefan Siegl ", - "Christoph Dorn " - ], - "devDependencies": { - "browserify": "^16.5.2", - "commander": "^2.20.0", - "cross-env": "^5.2.1", - "eslint": "^7.8.1", - "eslint-config-digitalbazaar": "^2.5.0", - "express": "^4.16.2", - "karma": "^4.4.1", - "karma-browserify": "^7.0.0", - "karma-chrome-launcher": "^3.1.0", - "karma-edge-launcher": "^0.4.2", - "karma-firefox-launcher": "^1.3.0", - "karma-ie-launcher": "^1.0.0", - "karma-mocha": "^1.3.0", - "karma-mocha-reporter": "^2.2.5", - "karma-safari-launcher": "^1.0.0", - "karma-sauce-launcher": "^2.0.2", - "karma-sourcemap-loader": "^0.3.8", - "karma-tap-reporter": "0.0.6", - "karma-webpack": "^4.0.2", - "mocha": "^5.2.0", - "mocha-lcov-reporter": "^1.2.0", - "nodejs-websocket": "^1.7.1", - "nyc": "^15.1.0", - "opts": "^1.2.7", - "webpack": "^4.44.1", - "webpack-cli": "^3.3.12", - "worker-loader": "^2.0.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/digitalbazaar/forge" - }, - "bugs": { - "url": "https://github.com/digitalbazaar/forge/issues", - "email": "support@digitalbazaar.com" - }, - "license": "(BSD-3-Clause OR GPL-2.0)", - "main": "lib/index.js", - "files": [ - "lib/*.js", - "flash/swf/*.swf", - "dist/*.min.js", - "dist/*.min.js.map" - ], - "engines": { - "node": ">= 6.0.0" - }, - "keywords": [ - "aes", - "asn", - "asn.1", - "cbc", - "crypto", - "cryptography", - "csr", - "des", - "gcm", - "hmac", - "http", - "https", - "md5", - "network", - "pkcs", - "pki", - "prng", - "rc2", - "rsa", - "sha1", - "sha256", - "sha384", - "sha512", - "ssh", - "tls", - "x.509", - "x509" - ], - "scripts": { - "prepublish": "npm run build", - "build": "webpack", - "test-build": "webpack --config webpack-tests.config.js", - "test": "cross-env NODE_ENV=test mocha -t 30000 -R ${REPORTER:-spec} tests/unit/index.js", - "test-karma": "karma start", - "test-karma-sauce": "karma start karma-sauce.conf", - "test-server": "node tests/server.js", - "test-server-ws": "node tests/websockets/server-ws.js", - "test-server-webid": "node tests/websockets/server-webid.js", - "coverage": "rm -rf coverage && nyc --reporter=lcov --reporter=text-summary npm test", - "coverage-report": "nyc report", - "lint": "eslint *.js lib/*.js tests/*.js tests/**/*.js examples/*.js flash/*.js" - }, - "nyc": { - "exclude": [ - "tests" - ] - }, - "jspm": { - "format": "amd" - }, - "browser": { - "buffer": false, - "crypto": false, - "process": false - } -} diff --git a/node_modules/normalize-url/index.js b/node_modules/normalize-url/index.js deleted file mode 100644 index ce70108..0000000 --- a/node_modules/normalize-url/index.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; -// TODO: Use the `URL` global when targeting Node.js 10 -const URLParser = typeof URL === 'undefined' ? require('url').URL : URL; - -const testParameter = (name, filters) => { - return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name); -}; - -module.exports = (urlString, opts) => { - opts = Object.assign({ - defaultProtocol: 'http:', - normalizeProtocol: true, - forceHttp: false, - forceHttps: false, - stripHash: true, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false, - sortQueryParameters: true - }, opts); - - // Backwards compatibility - if (Reflect.has(opts, 'normalizeHttps')) { - opts.forceHttp = opts.normalizeHttps; - } - - if (Reflect.has(opts, 'normalizeHttp')) { - opts.forceHttps = opts.normalizeHttp; - } - - if (Reflect.has(opts, 'stripFragment')) { - opts.stripHash = opts.stripFragment; - } - - urlString = urlString.trim(); - - const hasRelativeProtocol = urlString.startsWith('//'); - const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString); - - // Prepend protocol - if (!isRelativeUrl) { - urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, opts.defaultProtocol); - } - - const urlObj = new URLParser(urlString); - - if (opts.forceHttp && opts.forceHttps) { - throw new Error('The `forceHttp` and `forceHttps` options cannot be used together'); - } - - if (opts.forceHttp && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; - } - - if (opts.forceHttps && urlObj.protocol === 'http:') { - urlObj.protocol = 'https:'; - } - - // Remove hash - if (opts.stripHash) { - urlObj.hash = ''; - } - - // Remove duplicate slashes if not preceded by a protocol - if (urlObj.pathname) { - // TODO: Use the following instead when targeting Node.js 10 - // `urlObj.pathname = urlObj.pathname.replace(/(? { - if (/^(?!\/)/g.test(p1)) { - return `${p1}/`; - } - return '/'; - }); - } - - // Decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); - } - - // Remove directory index - if (opts.removeDirectoryIndex === true) { - opts.removeDirectoryIndex = [/^index\.[a-z]+$/]; - } - - if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length > 0) { - let pathComponents = urlObj.pathname.split('/'); - const lastComponent = pathComponents[pathComponents.length - 1]; - - if (testParameter(lastComponent, opts.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; - } - } - - if (urlObj.hostname) { - // Remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); - - // Remove `www.` - // eslint-disable-next-line no-useless-escape - if (opts.stripWWW && /^www\.([a-z\-\d]{2,63})\.([a-z\.]{2,5})$/.test(urlObj.hostname)) { - // Each label should be max 63 at length (min: 2). - // The extension should be max 5 at length (min: 2). - // Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); - } - } - - // Remove query unwanted parameters - if (Array.isArray(opts.removeQueryParameters)) { - for (const key of [...urlObj.searchParams.keys()]) { - if (testParameter(key, opts.removeQueryParameters)) { - urlObj.searchParams.delete(key); - } - } - } - - // Sort query parameters - if (opts.sortQueryParameters) { - urlObj.searchParams.sort(); - } - - // Take advantage of many of the Node `url` normalizations - urlString = urlObj.toString(); - - // Remove ending `/` - if (opts.removeTrailingSlash || urlObj.pathname === '/') { - urlString = urlString.replace(/\/$/, ''); - } - - // Restore relative protocol, if applicable - if (hasRelativeProtocol && !opts.normalizeProtocol) { - urlString = urlString.replace(/^http:\/\//, '//'); - } - - return urlString; -}; diff --git a/node_modules/normalize-url/license b/node_modules/normalize-url/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/normalize-url/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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/normalize-url/package.json b/node_modules/normalize-url/package.json deleted file mode 100644 index 0bbfb04..0000000 --- a/node_modules/normalize-url/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "normalize-url", - "version": "3.3.0", - "description": "Normalize a URL", - "license": "MIT", - "repository": "sindresorhus/normalize-url", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "normalize", - "url", - "uri", - "address", - "string", - "normalization", - "normalisation", - "query", - "querystring", - "simplify", - "strip", - "trim", - "canonical" - ], - "devDependencies": { - "ava": "*", - "coveralls": "^3.0.0", - "nyc": "^12.0.2", - "xo": "*" - } -} diff --git a/node_modules/normalize-url/readme.md b/node_modules/normalize-url/readme.md deleted file mode 100644 index d051aaf..0000000 --- a/node_modules/normalize-url/readme.md +++ /dev/null @@ -1,194 +0,0 @@ -# normalize-url [![Build Status](https://travis-ci.org/sindresorhus/normalize-url.svg?branch=master)](https://travis-ci.org/sindresorhus/normalize-url) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/normalize-url/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/normalize-url?branch=master) - -> [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL - -Useful when you need to display, store, deduplicate, sort, compare, etc, URLs. - - -## Install - -``` -$ npm install normalize-url -``` - - -## Usage - -```js -const normalizeUrl = require('normalize-url'); - -normalizeUrl('sindresorhus.com'); -//=> 'http://sindresorhus.com' - -normalizeUrl('HTTP://xn--xample-hva.com:80/?b=bar&a=foo'); -//=> 'http://êxample.com/?a=foo&b=bar' -``` - - -## API - -### normalizeUrl(url, [options]) - -#### url - -Type: `string` - -URL to normalize. - -#### options - -Type: `Object` - -##### defaultProtocol - -Type: `string`
-Default: `http:` - -##### normalizeProtocol - -Type: `boolean`
-Default: `true` - -Prepends `defaultProtocol` to the URL if it's protocol-relative. - -```js -normalizeUrl('//sindresorhus.com:80/'); -//=> 'http://sindresorhus.com' - -normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false}); -//=> '//sindresorhus.com' -``` - -##### forceHttp - -Type: `boolean`
-Default: `false` - -Normalizes `https:` URLs to `http:`. - -```js -normalizeUrl('https://sindresorhus.com:80/'); -//=> 'https://sindresorhus.com' - -normalizeUrl('https://sindresorhus.com:80/', {normalizeHttps: true}); -//=> 'http://sindresorhus.com' -``` - -##### forceHttps - -Type: `boolean`
-Default: `false` - -Normalizes `http:` URLs to `https:`. - -```js -normalizeUrl('https://sindresorhus.com:80/'); -//=> 'https://sindresorhus.com' - -normalizeUrl('http://sindresorhus.com:80/', {normalizeHttp: true}); -//=> 'https://sindresorhus.com' -``` - -This option can't be used with the `forceHttp` option at the same time. - -##### stripHash - -Type: `boolean`
-Default: `true` - -Removes hash from the URL. - -```js -normalizeUrl('sindresorhus.com/about.html#contact'); -//=> 'http://sindresorhus.com/about.html' - -normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: false}); -//=> 'http://sindresorhus.com/about.html#contact' -``` - -##### stripWWW - -Type: `boolean`
-Default: `true` - -Removes `www.` from the URL. - -```js -normalizeUrl('http://www.sindresorhus.com/about.html#contact'); -//=> 'http://sindresorhus.com/about.html#contact' - -normalizeUrl('http://www.sindresorhus.com/about.html#contact', {stripWWW: false}); -//=> 'http://www.sindresorhus.com/about.html#contact' -``` - -##### removeQueryParameters - -Type: `Array`
-Default: `[/^utm_\w+/i]` - -Removes query parameters that matches any of the provided strings or regexes. - -```js -normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', { - removeQueryParameters: ['ref'] -}); -//=> 'http://sindresorhus.com/?foo=bar' -``` - -##### removeTrailingSlash - -Type: `boolean`
-Default: `true` - -Removes trailing slash. - -**Note:** Trailing slash is always removed if the URL doesn't have a pathname. - -```js -normalizeUrl('http://sindresorhus.com/redirect/'); -//=> 'http://sindresorhus.com/redirect' - -normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false}); -//=> 'http://sindresorhus.com/redirect/' - -normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false}); -//=> 'http://sindresorhus.com' -``` - -##### removeDirectoryIndex - -Type: `boolean` `Array`
-Default: `false` - -Removes the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\.[a-z]+$/` is used. - -```js -normalizeUrl('www.sindresorhus.com/foo/default.php', { - removeDirectoryIndex: [/^default\.[a-z]+$/] -}); -//=> 'http://sindresorhus.com/foo' -``` - -##### sortQueryParameters - -Type: `boolean`
-Default: `true` - -Sorts the query parameters alphabetically by key. - -```js -normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', { - sortQueryParameters: false -}); -//=> 'http://sindresorhus.com/?b=two&a=one&c=three' -``` - - -## Related - -- [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object-inspect/.eslintignore b/node_modules/object-inspect/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/object-inspect/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/object-inspect/.eslintrc b/node_modules/object-inspect/.eslintrc deleted file mode 100644 index 8a2d30e..0000000 --- a/node_modules/object-inspect/.eslintrc +++ /dev/null @@ -1,64 +0,0 @@ -{ - "root": true, - "extends": "@ljharb", - "rules": { - "complexity": 0, - "func-style": [2, "declaration"], - "indent": [2, 4], - "max-lines": 1, - "max-lines-per-function": 1, - "max-params": [2, 4], - "max-statements": 0, - "max-statements-per-line": [2, { "max": 2 }], - "no-magic-numbers": 0, - "no-param-reassign": 1, - "operator-linebreak": [2, "before"], - "strict": 0, // TODO - }, - "globals": { - "BigInt": false, - "WeakSet": false, - "WeakMap": false, - }, - "overrides": [ - { - "files": ["test/**", "test-*", "example/**"], - "rules": { - "array-bracket-newline": 0, - "id-length": 0, - "max-params": 0, - "max-statements": 0, - "max-statements-per-line": 0, - "object-curly-newline": 0, - "sort-keys": 0, - }, - }, - { - "files": ["example/**"], - "rules": { - "no-console": 0, - }, - }, - { - "files": ["test/browser/**"], - "env": { - "browser": true, - }, - }, - { - "files": ["test/bigint*"], - "rules": { - "new-cap": [2, { "capIsNewExceptions": ["BigInt"] }], - }, - }, - { - "files": "index.js", - "globals": { - "HTMLElement": false, - }, - "rules": { - "no-use-before-define": 1, - }, - }, - ], -} diff --git a/node_modules/object-inspect/.github/FUNDING.yml b/node_modules/object-inspect/.github/FUNDING.yml deleted file mode 100644 index 730276b..0000000 --- a/node_modules/object-inspect/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/object-inspect -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/object-inspect/.nycrc b/node_modules/object-inspect/.nycrc deleted file mode 100644 index 58a5db7..0000000 --- a/node_modules/object-inspect/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "instrumentation": false, - "sourceMap": false, - "reporter": ["text-summary", "text", "html", "json"], - "exclude": [ - "coverage", - "example", - "test", - "test-core-js.js" - ] -} diff --git a/node_modules/object-inspect/LICENSE b/node_modules/object-inspect/LICENSE deleted file mode 100644 index ca64cc1..0000000 --- a/node_modules/object-inspect/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 James Halliday - -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/object-inspect/example/all.js b/node_modules/object-inspect/example/all.js deleted file mode 100644 index 2f3355c..0000000 --- a/node_modules/object-inspect/example/all.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var Buffer = require('safer-buffer').Buffer; - -var holes = ['a', 'b']; -holes[4] = 'e'; -holes[6] = 'g'; - -var obj = { - a: 1, - b: [3, 4, undefined, null], - c: undefined, - d: null, - e: { - regex: /^x/i, - buf: Buffer.from('abc'), - holes: holes - }, - now: new Date() -}; -obj.self = obj; -console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/circular.js b/node_modules/object-inspect/example/circular.js deleted file mode 100644 index 487a7c1..0000000 --- a/node_modules/object-inspect/example/circular.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var obj = { a: 1, b: [3, 4] }; -obj.c = obj; -console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/fn.js b/node_modules/object-inspect/example/fn.js deleted file mode 100644 index 9b5db8d..0000000 --- a/node_modules/object-inspect/example/fn.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var obj = [1, 2, function f(n) { return n + 5; }, 4]; -console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/inspect.js b/node_modules/object-inspect/example/inspect.js deleted file mode 100644 index e2df7c9..0000000 --- a/node_modules/object-inspect/example/inspect.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -/* eslint-env browser */ -var inspect = require('../'); - -var d = document.createElement('div'); -d.setAttribute('id', 'beep'); -d.innerHTML = 'woooiiiii'; - -console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/node_modules/object-inspect/index.js b/node_modules/object-inspect/index.js deleted file mode 100644 index c85ca5a..0000000 --- a/node_modules/object-inspect/index.js +++ /dev/null @@ -1,468 +0,0 @@ -var hasMap = typeof Map === 'function' && Map.prototype; -var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; -var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; -var mapForEach = hasMap && Map.prototype.forEach; -var hasSet = typeof Set === 'function' && Set.prototype; -var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; -var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; -var setForEach = hasSet && Set.prototype.forEach; -var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; -var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; -var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; -var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; -var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; -var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; -var booleanValueOf = Boolean.prototype.valueOf; -var objectToString = Object.prototype.toString; -var functionToString = Function.prototype.toString; -var match = String.prototype.match; -var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; -var gOPS = Object.getOwnPropertySymbols; -var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; -var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; -var isEnumerable = Object.prototype.propertyIsEnumerable; - -var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( - [].__proto__ === Array.prototype // eslint-disable-line no-proto - ? function (O) { - return O.__proto__; // eslint-disable-line no-proto - } - : null -); - -var inspectCustom = require('./util.inspect').custom; -var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; -var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null; - -module.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; - - if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if ( - has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' - ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity - : opts.maxStringLength !== null - ) - ) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; - if (typeof customInspect !== 'boolean') { - throw new TypeError('option "customInspect", if provided, must be `true` or `false`'); - } - - if ( - has(opts, 'indent') - && opts.indent !== null - && opts.indent !== '\t' - && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) - ) { - throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); - } - - if (typeof obj === 'undefined') { - return 'undefined'; - } - if (obj === null) { - return 'null'; - } - if (typeof obj === 'boolean') { - return obj ? 'true' : 'false'; - } - - if (typeof obj === 'string') { - return inspectString(obj, opts); - } - if (typeof obj === 'number') { - if (obj === 0) { - return Infinity / obj > 0 ? '0' : '-0'; - } - return String(obj); - } - if (typeof obj === 'bigint') { - return String(obj) + 'n'; - } - - var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; - if (typeof depth === 'undefined') { depth = 0; } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { - return isArray(obj) ? '[Array]' : '[Object]'; - } - - var indent = getIndent(opts, depth); - - if (typeof seen === 'undefined') { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return '[Circular]'; - } - - function inspect(value, from, noIndent) { - if (from) { - seen = seen.slice(); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, 'quoteStyle')) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } - - if (typeof obj === 'function') { - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : ''); - } - if (isSymbol(obj)) { - var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); - return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = '<' + String(obj.nodeName).toLowerCase(); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); - } - s += '>'; - if (obj.childNodes && obj.childNodes.length) { s += '...'; } - s += ''; - return s; - } - if (isArray(obj)) { - if (obj.length === 0) { return '[]'; } - var xs = arrObjKeys(obj, inspect); - if (indent && !singleLineValues(xs)) { - return '[' + indentedJoin(xs, indent) + ']'; - } - return '[ ' + xs.join(', ') + ' ]'; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (parts.length === 0) { return '[' + String(obj) + ']'; } - return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; - } - if (typeof obj === 'object' && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { - return obj[inspectSymbol](); - } else if (typeof obj.inspect === 'function') { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - mapForEach.call(obj, function (value, key) { - mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); - }); - return collectionOf('Map', mapSize.call(obj), mapParts, indent); - } - if (isSet(obj)) { - var setParts = []; - setForEach.call(obj, function (value) { - setParts.push(inspect(value, obj)); - }); - return collectionOf('Set', setSize.call(obj), setParts, indent); - } - if (isWeakMap(obj)) { - return weakCollectionOf('WeakMap'); - } - if (isWeakSet(obj)) { - return weakCollectionOf('WeakSet'); - } - if (isWeakRef(obj)) { - return weakCollectionOf('WeakRef'); - } - if (isNumber(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString(obj)) { - return markBoxed(inspect(String(obj))); - } - if (!isDate(obj) && !isRegExp(obj)) { - var ys = arrObjKeys(obj, inspect); - var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; - var protoTag = obj instanceof Object ? '' : 'null prototype'; - var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : ''; - var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; - var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : ''); - if (ys.length === 0) { return tag + '{}'; } - if (indent) { - return tag + '{' + indentedJoin(ys, indent) + '}'; - } - return tag + '{ ' + ys.join(', ') + ' }'; - } - return String(obj); -}; - -function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; - return quoteChar + s + quoteChar; -} - -function quote(s) { - return String(s).replace(/"/g, '"'); -} - -function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } -function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); } - -// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives -function isSymbol(obj) { - if (hasShammedSymbols) { - return obj && typeof obj === 'object' && obj instanceof Symbol; - } - if (typeof obj === 'symbol') { - return true; - } - if (!obj || typeof obj !== 'object' || !symToString) { - return false; - } - try { - symToString.call(obj); - return true; - } catch (e) {} - return false; -} - -function isBigInt(obj) { - if (!obj || typeof obj !== 'object' || !bigIntValueOf) { - return false; - } - try { - bigIntValueOf.call(obj); - return true; - } catch (e) {} - return false; -} - -var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; -function has(obj, key) { - return hasOwn.call(obj, key); -} - -function toStr(obj) { - return objectToString.call(obj); -} - -function nameOf(f) { - if (f.name) { return f.name; } - var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { return m[1]; } - return null; -} - -function indexOf(xs, x) { - if (xs.indexOf) { return xs.indexOf(x); } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { return i; } - } - return -1; -} - -function isMap(x) { - if (!mapSize || !x || typeof x !== 'object') { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== 'object') { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakRef(x) { - if (!weakRefDeref || !x || typeof x !== 'object') { - return false; - } - try { - weakRefDeref.call(x); - return true; - } catch (e) {} - return false; -} - -function isSet(x) { - if (!setSize || !x || typeof x !== 'object') { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== 'object') { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isElement(x) { - if (!x || typeof x !== 'object') { return false; } - if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; -} - -function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); - return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; - } - // eslint-disable-next-line no-control-regex - var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, 'single', opts); -} - -function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: 'b', - 9: 't', - 10: 'n', - 12: 'f', - 13: 'r' - }[n]; - if (x) { return '\\' + x; } - return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase(); -} - -function markBoxed(str) { - return 'Object(' + str + ')'; -} - -function weakCollectionOf(type) { - return type + ' { ? }'; -} - -function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); - return type + ' (' + size + ') {' + joinedEntries + '}'; -} - -function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], '\n') >= 0) { - return false; - } - } - return true; -} - -function getIndent(opts, depth) { - var baseIndent; - if (opts.indent === '\t') { - baseIndent = '\t'; - } else if (typeof opts.indent === 'number' && opts.indent > 0) { - baseIndent = Array(opts.indent + 1).join(' '); - } else { - return null; - } - return { - base: baseIndent, - prev: Array(depth + 1).join(baseIndent) - }; -} - -function indentedJoin(xs, indent) { - if (xs.length === 0) { return ''; } - var lineJoiner = '\n' + indent.prev + indent.base; - return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; -} - -function arrObjKeys(obj, inspect) { - var isArr = isArray(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; - } - } - var syms = typeof gOPS === 'function' ? gOPS(obj) : []; - var symMap; - if (hasShammedSymbols) { - symMap = {}; - for (var k = 0; k < syms.length; k++) { - symMap['$' + syms[k]] = syms[k]; - } - } - - for (var key in obj) { // eslint-disable-line no-restricted-syntax - if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { - // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section - continue; // eslint-disable-line no-restricted-syntax, no-continue - } else if ((/[^\w$]/).test(key)) { - xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); - } else { - xs.push(key + ': ' + inspect(obj[key], obj)); - } - } - if (typeof gOPS === 'function') { - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); - } - } - } - return xs; -} diff --git a/node_modules/object-inspect/package.json b/node_modules/object-inspect/package.json deleted file mode 100644 index 014e189..0000000 --- a/node_modules/object-inspect/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "object-inspect", - "version": "1.10.3", - "description": "string representations of objects in node and the browser", - "main": "index.js", - "devDependencies": { - "@ljharb/eslint-config": "^17.6.0", - "aud": "^1.1.5", - "core-js": "^2.6.12", - "eslint": "^7.26.0", - "for-each": "^0.3.3", - "functions-have-names": "^1.2.2", - "make-arrow-function": "^1.2.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "string.prototype.repeat": "^1.0.0", - "tape": "^5.2.2" - }, - "scripts": { - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "pretest": "npm run lint", - "lint": "eslint .", - "test": "npm run tests-only && npm run test:corejs", - "tests-only": "nyc tape 'test/*.js'", - "test:corejs": "nyc tape test-core-js.js 'test/*.js'", - "posttest": "npx aud --production" - }, - "testling": { - "files": [ - "test/*.js", - "test/browser/*.js" - ], - "browsers": [ - "ie/6..latest", - "chrome/latest", - "firefox/latest", - "safari/latest", - "opera/latest", - "iphone/latest", - "ipad/latest", - "android/latest" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/inspect-js/object-inspect.git" - }, - "homepage": "https://github.com/inspect-js/object-inspect", - "keywords": [ - "inspect", - "util.inspect", - "object", - "stringify", - "pretty" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "browser": { - "./util.inspect.js": false - }, - "greenkeeper": { - "ignore": [ - "nyc", - "core-js" - ] - } -} diff --git a/node_modules/object-inspect/readme.markdown b/node_modules/object-inspect/readme.markdown deleted file mode 100644 index 00fdb7e..0000000 --- a/node_modules/object-inspect/readme.markdown +++ /dev/null @@ -1,85 +0,0 @@ -# object-inspect [![Version Badge][2]][1] - -string representations of objects in node and the browser - -[![github actions][actions-image]][actions-url] -[![coverage][codecov-image]][codecov-url] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -# example - -## circular - -``` js -var inspect = require('object-inspect'); -var obj = { a: 1, b: [3,4] }; -obj.c = obj; -console.log(inspect(obj)); -``` - -## dom element - -``` js -var inspect = require('object-inspect'); - -var d = document.createElement('div'); -d.setAttribute('id', 'beep'); -d.innerHTML = 'woooiiiii'; - -console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); -``` - -output: - -``` -[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] -``` - -# methods - -``` js -var inspect = require('object-inspect') -``` - -## var s = inspect(obj, opts={}) - -Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`. - -Additional options: - - `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements. - - `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`. - - `customInspect`: When `true`, a custom inspect method function will be invoked. Default `true`. - - `indent`: must be "\t", `null`, or a positive integer. Default `null`. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install object-inspect -``` - -# license - -MIT - -[1]: https://npmjs.org/package/object-inspect -[2]: https://versionbadg.es/inspect-js/object-inspect.svg -[5]: https://david-dm.org/inspect-js/object-inspect.svg -[6]: https://david-dm.org/inspect-js/object-inspect -[7]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg -[8]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies -[11]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/object-inspect.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg -[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect -[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg -[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/ -[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect -[actions-url]: https://github.com/inspect-js/object-inspect/actions diff --git a/node_modules/object-inspect/test-core-js.js b/node_modules/object-inspect/test-core-js.js deleted file mode 100644 index e53c400..0000000 --- a/node_modules/object-inspect/test-core-js.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -require('core-js'); - -var inspect = require('./'); -var test = require('tape'); - -test('Maps', function (t) { - t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); - t.end(); -}); - -test('WeakMaps', function (t) { - t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); - t.end(); -}); - -test('Sets', function (t) { - t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); - t.end(); -}); - -test('WeakSets', function (t) { - t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); - t.end(); -}); diff --git a/node_modules/object-inspect/test/bigint.js b/node_modules/object-inspect/test/bigint.js deleted file mode 100644 index 9056435..0000000 --- a/node_modules/object-inspect/test/bigint.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var hasSymbols = require('has-symbols/shams')(); - -test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) { - t.test('primitives', function (st) { - st.plan(3); - - st.equal(inspect(BigInt(-256)), '-256n'); - st.equal(inspect(BigInt(0)), '0n'); - st.equal(inspect(BigInt(256)), '256n'); - }); - - t.test('objects', function (st) { - st.plan(3); - - st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)'); - st.equal(inspect(Object(BigInt(0))), 'Object(0n)'); - st.equal(inspect(Object(BigInt(256))), 'Object(256n)'); - }); - - t.test('syntactic primitives', function (st) { - st.plan(3); - - /* eslint-disable no-new-func */ - st.equal(inspect(Function('return -256n')()), '-256n'); - st.equal(inspect(Function('return 0n')()), '0n'); - st.equal(inspect(Function('return 256n')()), '256n'); - }); - - t.test('toStringTag', { skip: !hasSymbols || typeof Symbol.toStringTag === 'undefined' }, function (st) { - st.plan(1); - - var faker = {}; - faker[Symbol.toStringTag] = 'BigInt'; - st.equal( - inspect(faker), - '{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }', - 'object lying about being a BigInt inspects as an object' - ); - }); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/browser/dom.js b/node_modules/object-inspect/test/browser/dom.js deleted file mode 100644 index 210c0b2..0000000 --- a/node_modules/object-inspect/test/browser/dom.js +++ /dev/null @@ -1,15 +0,0 @@ -var inspect = require('../../'); -var test = require('tape'); - -test('dom element', function (t) { - t.plan(1); - - var d = document.createElement('div'); - d.setAttribute('id', 'beep'); - d.innerHTML = 'woooiiiii'; - - t.equal( - inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), - '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' - ); -}); diff --git a/node_modules/object-inspect/test/circular.js b/node_modules/object-inspect/test/circular.js deleted file mode 100644 index 5df4233..0000000 --- a/node_modules/object-inspect/test/circular.js +++ /dev/null @@ -1,16 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('circular', function (t) { - t.plan(2); - var obj = { a: 1, b: [3, 4] }; - obj.c = obj; - t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); - - var double = {}; - double.a = [double]; - double.b = {}; - double.b.inner = double.b; - double.b.obj = double; - t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'); -}); diff --git a/node_modules/object-inspect/test/deep.js b/node_modules/object-inspect/test/deep.js deleted file mode 100644 index 99ce32a..0000000 --- a/node_modules/object-inspect/test/deep.js +++ /dev/null @@ -1,12 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('deep', function (t) { - t.plan(4); - var obj = [[[[[[500]]]]]]; - t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); - t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]'); - t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); - - t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]'); -}); diff --git a/node_modules/object-inspect/test/element.js b/node_modules/object-inspect/test/element.js deleted file mode 100644 index 47fa9e2..0000000 --- a/node_modules/object-inspect/test/element.js +++ /dev/null @@ -1,53 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('element', function (t) { - t.plan(3); - var elem = { - nodeName: 'div', - attributes: [{ name: 'class', value: 'row' }], - getAttribute: function (key) { return key; }, - childNodes: [] - }; - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); - t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1,
, 3 ]"); - t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1,
, 3 ]'); -}); - -test('element no attr', function (t) { - t.plan(1); - var elem = { - nodeName: 'div', - getAttribute: function (key) { return key; }, - childNodes: [] - }; - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); -}); - -test('element with contents', function (t) { - t.plan(1); - var elem = { - nodeName: 'div', - getAttribute: function (key) { return key; }, - childNodes: [{ nodeName: 'b' }] - }; - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
...
, 3 ]'); -}); - -test('element instance', function (t) { - t.plan(1); - var h = global.HTMLElement; - global.HTMLElement = function (name, attr) { - this.nodeName = name; - this.attributes = attr; - }; - global.HTMLElement.prototype.getAttribute = function () {}; - - var elem = new global.HTMLElement('div', []); - var obj = [1, elem, 3]; - t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); - global.HTMLElement = h; -}); diff --git a/node_modules/object-inspect/test/err.js b/node_modules/object-inspect/test/err.js deleted file mode 100644 index db96338..0000000 --- a/node_modules/object-inspect/test/err.js +++ /dev/null @@ -1,31 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('type error', function (t) { - t.plan(1); - var aerr = new TypeError(); - aerr.foo = 555; - aerr.bar = [1, 2, 3]; - - var berr = new TypeError('tuv'); - berr.baz = 555; - - var cerr = new SyntaxError(); - cerr.message = 'whoa'; - cerr['a-b'] = 5; - - var obj = [ - new TypeError(), - new TypeError('xxx'), - aerr, - berr, - cerr - ]; - t.equal(inspect(obj), '[ ' + [ - '[TypeError]', - '[TypeError: xxx]', - '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', - '{ [TypeError: tuv] baz: 555 }', - '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }' - ].join(', ') + ' ]'); -}); diff --git a/node_modules/object-inspect/test/fakes.js b/node_modules/object-inspect/test/fakes.js deleted file mode 100644 index 17225e2..0000000 --- a/node_modules/object-inspect/test/fakes.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var hasSymbols = require('has-symbols/shams')(); -var forEach = require('for-each'); - -test('fakes', { skip: !hasSymbols || typeof Symbol.toStringTag === 'undefined' }, function (t) { - forEach([ - 'Array', - 'Boolean', - 'Date', - 'Error', - 'Number', - 'RegExp', - 'String' - ], function (expected) { - var faker = {}; - faker[Symbol.toStringTag] = expected; - - t.equal( - inspect(faker), - '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', - 'faker masquerading as ' + expected + ' is not shown as one' - ); - }); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/fn.js b/node_modules/object-inspect/test/fn.js deleted file mode 100644 index de3ca62..0000000 --- a/node_modules/object-inspect/test/fn.js +++ /dev/null @@ -1,76 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); -var arrow = require('make-arrow-function')(); -var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); - -test('function', function (t) { - t.plan(1); - var obj = [1, 2, function f(n) { return n; }, 4]; - t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); -}); - -test('function name', function (t) { - t.plan(1); - var f = (function () { - return function () {}; - }()); - f.toString = function toStr() { return 'function xxx () {}'; }; - var obj = [1, 2, f, 4]; - t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]'); -}); - -test('anon function', function (t) { - var f = (function () { - return function () {}; - }()); - var obj = [1, 2, f, 4]; - t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); - - t.end(); -}); - -test('arrow function', { skip: !arrow }, function (t) { - t.equal(inspect(arrow), '[Function (anonymous)]'); - - t.end(); -}); - -test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) { - function f() {} - Object.defineProperty(f, 'name', { value: false }); - t.equal(f.name, false); - t.equal( - inspect(f), - '[Function: f]', - 'named function with falsy `.name` does not hide its original name' - ); - - function g() {} - Object.defineProperty(g, 'name', { value: true }); - t.equal(g.name, true); - t.equal( - inspect(g), - '[Function: true]', - 'named function with truthy `.name` hides its original name' - ); - - var anon = function () {}; // eslint-disable-line func-style - Object.defineProperty(anon, 'name', { value: null }); - t.equal(anon.name, null); - t.equal( - inspect(anon), - '[Function (anonymous)]', - 'anon function with falsy `.name` does not hide its anonymity' - ); - - var anon2 = function () {}; // eslint-disable-line func-style - Object.defineProperty(anon2, 'name', { value: 1 }); - t.equal(anon2.name, 1); - t.equal( - inspect(anon2), - '[Function: 1]', - 'anon function with truthy `.name` hides its anonymity' - ); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/has.js b/node_modules/object-inspect/test/has.js deleted file mode 100644 index 026d6d5..0000000 --- a/node_modules/object-inspect/test/has.js +++ /dev/null @@ -1,34 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -function withoutProperty(object, property, fn) { - var original; - if (Object.getOwnPropertyDescriptor) { - original = Object.getOwnPropertyDescriptor(object, property); - } else { - original = object[property]; - } - delete object[property]; - try { - fn(); - } finally { - if (Object.getOwnPropertyDescriptor) { - Object.defineProperty(object, property, original); - } else { - object[property] = original; - } - } -} - -test('when Object#hasOwnProperty is deleted', function (t) { - t.plan(1); - var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays - - // eslint-disable-next-line no-extend-native - Array.prototype[1] = 2; // this is needed to account for "in" vs "hasOwnProperty" - - withoutProperty(Object.prototype, 'hasOwnProperty', function () { - t.equal(inspect(arr), '[ 1, , 3 ]'); - }); - delete Array.prototype[1]; -}); diff --git a/node_modules/object-inspect/test/holes.js b/node_modules/object-inspect/test/holes.js deleted file mode 100644 index 87fc8c8..0000000 --- a/node_modules/object-inspect/test/holes.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var inspect = require('../'); - -var xs = ['a', 'b']; -xs[5] = 'f'; -xs[7] = 'j'; -xs[8] = 'k'; - -test('holes', function (t) { - t.plan(1); - t.equal( - inspect(xs), - "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" - ); -}); diff --git a/node_modules/object-inspect/test/indent-option.js b/node_modules/object-inspect/test/indent-option.js deleted file mode 100644 index 89d8fce..0000000 --- a/node_modules/object-inspect/test/indent-option.js +++ /dev/null @@ -1,271 +0,0 @@ -var test = require('tape'); -var forEach = require('for-each'); - -var inspect = require('../'); - -test('bad indent options', function (t) { - forEach([ - undefined, - true, - false, - -1, - 1.2, - Infinity, - -Infinity, - NaN - ], function (indent) { - t['throws']( - function () { inspect('', { indent: indent }); }, - TypeError, - inspect(indent) + ' is invalid' - ); - }); - - t.end(); -}); - -test('simple object with indent', function (t) { - t.plan(2); - - var obj = { a: 1, b: 2 }; - - var expectedSpaces = [ - '{', - ' a: 1,', - ' b: 2', - '}' - ].join('\n'); - var expectedTabs = [ - '{', - ' a: 1,', - ' b: 2', - '}' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('two deep object with indent', function (t) { - t.plan(2); - - var obj = { a: 1, b: { c: 3, d: 4 } }; - - var expectedSpaces = [ - '{', - ' a: 1,', - ' b: {', - ' c: 3,', - ' d: 4', - ' }', - '}' - ].join('\n'); - var expectedTabs = [ - '{', - ' a: 1,', - ' b: {', - ' c: 3,', - ' d: 4', - ' }', - '}' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('simple array with all single line elements', function (t) { - t.plan(2); - - var obj = [1, 2, 3, 'asdf\nsdf']; - - var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; - - t.equal(inspect(obj, { indent: 2 }), expected, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); -}); - -test('array with complex elements', function (t) { - t.plan(2); - - var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; - - var expectedSpaces = [ - '[', - ' 1,', - ' {', - ' a: 1,', - ' b: {', - ' c: 1', - ' }', - ' },', - ' \'asdf\\nsdf\'', - ']' - ].join('\n'); - var expectedTabs = [ - '[', - ' 1,', - ' {', - ' a: 1,', - ' b: {', - ' c: 1', - ' }', - ' },', - ' \'asdf\\nsdf\'', - ']' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('values', function (t) { - t.plan(2); - var obj = [{}, [], { 'a-b': 5 }]; - - var expectedSpaces = [ - '[', - ' {},', - ' [],', - ' {', - ' \'a-b\': 5', - ' }', - ']' - ].join('\n'); - var expectedTabs = [ - '[', - ' {},', - ' [],', - ' {', - ' \'a-b\': 5', - ' }', - ']' - ].join('\n'); - - t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); - t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); -}); - -test('Map', { skip: typeof Map !== 'function' }, function (t) { - var map = new Map(); - map.set({ a: 1 }, ['b']); - map.set(3, NaN); - - var expectedStringSpaces = [ - 'Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - '}' - ].join('\n'); - var expectedStringTabs = [ - 'Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - '}' - ].join('\n'); - var expectedStringTabsDoubleQuotes = [ - 'Map (2) {', - ' { a: 1 } => [ "b" ],', - ' 3 => NaN', - '}' - ].join('\n'); - - t.equal( - inspect(map, { indent: 2 }), - expectedStringSpaces, - 'Map keys are not indented (two)' - ); - t.equal( - inspect(map, { indent: '\t' }), - expectedStringTabs, - 'Map keys are not indented (tabs)' - ); - t.equal( - inspect(map, { indent: '\t', quoteStyle: 'double' }), - expectedStringTabsDoubleQuotes, - 'Map keys are not indented (tabs + double quotes)' - ); - - t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); - t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); - - var nestedMap = new Map(); - nestedMap.set(nestedMap, map); - var expectedNestedSpaces = [ - 'Map (1) {', - ' [Circular] => Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - ' }', - '}' - ].join('\n'); - var expectedNestedTabs = [ - 'Map (1) {', - ' [Circular] => Map (2) {', - ' { a: 1 } => [ \'b\' ],', - ' 3 => NaN', - ' }', - '}' - ].join('\n'); - t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); - t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); - - t.end(); -}); - -test('Set', { skip: typeof Set !== 'function' }, function (t) { - var set = new Set(); - set.add({ a: 1 }); - set.add(['b']); - var expectedStringSpaces = [ - 'Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - '}' - ].join('\n'); - var expectedStringTabs = [ - 'Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - '}' - ].join('\n'); - t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); - t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); - - t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); - t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); - - var nestedSet = new Set(); - nestedSet.add(set); - nestedSet.add(nestedSet); - var expectedNestedSpaces = [ - 'Set (2) {', - ' Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - ' },', - ' [Circular]', - '}' - ].join('\n'); - var expectedNestedTabs = [ - 'Set (2) {', - ' Set (2) {', - ' {', - ' a: 1', - ' },', - ' [ \'b\' ]', - ' },', - ' [Circular]', - '}' - ].join('\n'); - t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); - t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/inspect.js b/node_modules/object-inspect/test/inspect.js deleted file mode 100644 index 54c6f46..0000000 --- a/node_modules/object-inspect/test/inspect.js +++ /dev/null @@ -1,92 +0,0 @@ -var test = require('tape'); -var hasSymbols = require('has-symbols/shams')(); -var utilInspect = require('../util.inspect'); -var repeat = require('string.prototype.repeat'); - -var inspect = require('..'); - -test('inspect', function (t) { - t.plan(4); - var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []]; - t.equal(inspect(obj), '[ !XYZ¡, [] ]'); - t.equal(inspect(obj, { customInspect: true }), '[ !XYZ¡, [] ]'); - t.equal(inspect(obj, { customInspect: false }), '[ { inspect: [Function: xyzInspect] }, [] ]'); - t['throws']( - function () { inspect(obj, { customInspect: 'not a boolean' }); }, - TypeError, - '`customInspect` must be a boolean' - ); -}); - -test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) { - t.plan(3); - - var obj = { inspect: function stringInspect() { return 'string'; } }; - obj[utilInspect.custom] = function custom() { return 'symbol'; }; - - t.equal(inspect([obj, []]), '[ ' + (utilInspect.custom ? 'symbol' : 'string') + ', [] ]'); - t.equal(inspect([obj, []], { customInspect: true }), '[ ' + (utilInspect.custom ? 'symbol' : 'string') + ', [] ]'); - t.equal( - inspect([obj, []], { customInspect: false }), - '[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]' - ); -}); - -test('symbols', { skip: !hasSymbols }, function (t) { - t.plan(2); - - var obj = { a: 1 }; - obj[Symbol('test')] = 2; - obj[Symbol.iterator] = 3; - Object.defineProperty(obj, Symbol('non-enum'), { - enumerable: false, - value: 4 - }); - - if (typeof Symbol.iterator === 'symbol') { - t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols'); - t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols in array'); - } else { - // symbol sham key ordering is unreliable - t.match( - inspect(obj), - /^(?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 })$/, - 'object with symbols (nondeterministic symbol sham key ordering)' - ); - t.match( - inspect([obj, []]), - /^\[ (?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 }), \[\] \]$/, - 'object with symbols in array (nondeterministic symbol sham key ordering)' - ); - } -}); - -test('maxStringLength', function (t) { - t['throws']( - function () { inspect('', { maxStringLength: -1 }); }, - TypeError, - 'maxStringLength must be >= 0, or Infinity, not negative' - ); - - var str = repeat('a', 1e8); - - t.equal( - inspect([str], { maxStringLength: 10 }), - '[ \'aaaaaaaaaa\'... 99999990 more characters ]', - 'maxStringLength option limits output' - ); - - t.equal( - inspect(['f'], { maxStringLength: null }), - '[ \'\'... 1 more character ]', - 'maxStringLength option accepts `null`' - ); - - t.equal( - inspect([str], { maxStringLength: Infinity }), - '[ \'' + str + '\' ]', - 'maxStringLength option accepts ∞' - ); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/lowbyte.js b/node_modules/object-inspect/test/lowbyte.js deleted file mode 100644 index 68a345d..0000000 --- a/node_modules/object-inspect/test/lowbyte.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tape'); -var inspect = require('../'); - -var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; - -test('interpolate low bytes', function (t) { - t.plan(1); - t.equal( - inspect(obj), - "{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }" - ); -}); diff --git a/node_modules/object-inspect/test/number.js b/node_modules/object-inspect/test/number.js deleted file mode 100644 index 448304e..0000000 --- a/node_modules/object-inspect/test/number.js +++ /dev/null @@ -1,12 +0,0 @@ -var inspect = require('../'); -var test = require('tape'); - -test('negative zero', function (t) { - t.equal(inspect(0), '0', 'inspect(0) === "0"'); - t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); - - t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); - t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/quoteStyle.js b/node_modules/object-inspect/test/quoteStyle.js deleted file mode 100644 index ae4d734..0000000 --- a/node_modules/object-inspect/test/quoteStyle.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); - -test('quoteStyle option', function (t) { - t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); - t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); - - t.end(); -}); diff --git a/node_modules/object-inspect/test/toStringTag.js b/node_modules/object-inspect/test/toStringTag.js deleted file mode 100644 index b7ddad3..0000000 --- a/node_modules/object-inspect/test/toStringTag.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var test = require('tape'); -var hasSymbols = require('has-symbols/shams')(); - -var inspect = require('../'); - -test('Symbol.toStringTag', { skip: !hasSymbols || typeof Symbol.toStringTag === 'undefined' }, function (t) { - t.plan(4); - - var obj = { a: 1 }; - t.equal(inspect(obj), '{ a: 1 }', 'object, no Symbol.toStringTag'); - - obj[Symbol.toStringTag] = 'foo'; - t.equal(inspect(obj), '{ a: 1, [Symbol(Symbol.toStringTag)]: \'foo\' }', 'object with Symbol.toStringTag'); - - t.test('null objects', { skip: 'toString' in { __proto__: null } }, function (st) { - st.plan(2); - - var dict = { __proto__: null, a: 1 }; - st.equal(inspect(dict), '[Object: null prototype] { a: 1 }', 'null object with Symbol.toStringTag'); - - dict[Symbol.toStringTag] = 'Dict'; - st.equal(inspect(dict), '[Dict: null prototype] { a: 1, [Symbol(Symbol.toStringTag)]: \'Dict\' }', 'null object with Symbol.toStringTag'); - }); - - t.test('instances', function (st) { - st.plan(4); - - function C() { - this.a = 1; - } - st.equal(Object.prototype.toString.call(new C()), '[object Object]', 'instance, no toStringTag, Object.prototype.toString'); - st.equal(inspect(new C()), 'C { a: 1 }', 'instance, no toStringTag'); - - C.prototype[Symbol.toStringTag] = 'Class!'; - st.equal(Object.prototype.toString.call(new C()), '[object Class!]', 'instance, with toStringTag, Object.prototype.toString'); - st.equal(inspect(new C()), 'C [Class!] { a: 1 }', 'instance, with toStringTag'); - }); -}); diff --git a/node_modules/object-inspect/test/undef.js b/node_modules/object-inspect/test/undef.js deleted file mode 100644 index e3f4961..0000000 --- a/node_modules/object-inspect/test/undef.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tape'); -var inspect = require('../'); - -var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; - -test('undef and null', function (t) { - t.plan(1); - t.equal( - inspect(obj), - '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' - ); -}); diff --git a/node_modules/object-inspect/test/values.js b/node_modules/object-inspect/test/values.js deleted file mode 100644 index ee64681..0000000 --- a/node_modules/object-inspect/test/values.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; - -var inspect = require('../'); -var test = require('tape'); -var hasSymbols = require('has-symbols/shams')(); - -test('values', function (t) { - t.plan(1); - var obj = [{}, [], { 'a-b': 5 }]; - t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); -}); - -test('arrays with properties', function (t) { - t.plan(1); - var arr = [3]; - arr.foo = 'bar'; - var obj = [1, 2, arr]; - obj.baz = 'quux'; - obj.index = -1; - t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); -}); - -test('has', function (t) { - t.plan(1); - var has = Object.prototype.hasOwnProperty; - delete Object.prototype.hasOwnProperty; - t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); - Object.prototype.hasOwnProperty = has; // eslint-disable-line no-extend-native -}); - -test('indexOf seen', function (t) { - t.plan(1); - var xs = [1, 2, 3, {}]; - xs.push(xs); - - var seen = []; - seen.indexOf = undefined; - - t.equal( - inspect(xs, {}, 0, seen), - '[ 1, 2, 3, {}, [Circular] ]' - ); -}); - -test('seen seen', function (t) { - t.plan(1); - var xs = [1, 2, 3]; - - var seen = [xs]; - seen.indexOf = undefined; - - t.equal( - inspect(xs, {}, 0, seen), - '[Circular]' - ); -}); - -test('seen seen seen', function (t) { - t.plan(1); - var xs = [1, 2, 3]; - - var seen = [5, xs]; - seen.indexOf = undefined; - - t.equal( - inspect(xs, {}, 0, seen), - '[Circular]' - ); -}); - -test('symbols', { skip: !hasSymbols }, function (t) { - var sym = Symbol('foo'); - t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); - if (typeof sym === 'symbol') { - // Symbol shams are incapable of differentiating boxed from unboxed symbols - t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); - } - - t.test('toStringTag', { skip: !hasSymbols || typeof Symbol.toStringTag === 'undefined' }, function (st) { - st.plan(1); - - var faker = {}; - faker[Symbol.toStringTag] = 'Symbol'; - st.equal( - inspect(faker), - '{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }', - 'object lying about being a Symbol inspects as an object' - ); - }); - - t.end(); -}); - -test('Map', { skip: typeof Map !== 'function' }, function (t) { - var map = new Map(); - map.set({ a: 1 }, ['b']); - map.set(3, NaN); - var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; - t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); - t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); - - var nestedMap = new Map(); - nestedMap.set(nestedMap, map); - t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); - - t.end(); -}); - -test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { - var map = new WeakMap(); - map.set({ a: 1 }, ['b']); - var expectedString = 'WeakMap { ? }'; - t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); - t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); - - t.end(); -}); - -test('Set', { skip: typeof Set !== 'function' }, function (t) { - var set = new Set(); - set.add({ a: 1 }); - set.add(['b']); - var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; - t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); - t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); - - var nestedSet = new Set(); - nestedSet.add(set); - nestedSet.add(nestedSet); - t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); - - t.end(); -}); - -test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { - var map = new WeakSet(); - map.add({ a: 1 }); - var expectedString = 'WeakSet { ? }'; - t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); - t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); - - t.end(); -}); - -test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) { - var ref = new WeakRef({ a: 1 }); - var expectedString = 'WeakRef { ? }'; - t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents'); - - t.end(); -}); - -test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) { - var registry = new FinalizationRegistry(function () {}); - var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}'; - t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys'); - - t.end(); -}); - -test('Strings', function (t) { - var str = 'abc'; - - t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); - t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); - t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); - t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); - t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); - t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); - - t.end(); -}); - -test('Numbers', function (t) { - var num = 42; - - t.equal(inspect(num), String(num), 'primitive number shows as such'); - t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); - - t.end(); -}); - -test('Booleans', function (t) { - t.equal(inspect(true), String(true), 'primitive true shows as such'); - t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); - - t.equal(inspect(false), String(false), 'primitive false shows as such'); - t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); - - t.end(); -}); - -test('Date', function (t) { - var now = new Date(); - t.equal(inspect(now), String(now), 'Date shows properly'); - t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); - - t.end(); -}); - -test('RegExps', function (t) { - t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); - t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); - - var match = 'abc abc'.match(/[ab]+/); - delete match.groups; // for node < 10 - t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly'); - - t.end(); -}); diff --git a/node_modules/object-inspect/util.inspect.js b/node_modules/object-inspect/util.inspect.js deleted file mode 100644 index 7784fab..0000000 --- a/node_modules/object-inspect/util.inspect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inspect; diff --git a/node_modules/parse-path/LICENSE b/node_modules/parse-path/LICENSE deleted file mode 100644 index 0b759fc..0000000 --- a/node_modules/parse-path/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-21 Ionică Bizău (https://ionicabizau.net) - -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/parse-path/README.md b/node_modules/parse-path/README.md deleted file mode 100644 index 8741afb..0000000 --- a/node_modules/parse-path/README.md +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - - - - - - - - - -# parse-path - - [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Travis](https://img.shields.io/travis/IonicaBizau/parse-path.svg)](https://travis-ci.org/IonicaBizau/parse-path/) [![Version](https://img.shields.io/npm/v/parse-path.svg)](https://www.npmjs.com/package/parse-path) [![Downloads](https://img.shields.io/npm/dt/parse-path.svg)](https://www.npmjs.com/package/parse-path) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github) - -
Buy Me A Coffee - - - - - - - -> Parse paths (local paths, urls: ssh/git/etc) - - - - - - - - - - - - - - - - - -## :cloud: Installation - -```sh -# Using npm -npm install --save parse-path - -# Using yarn -yarn add parse-path -``` - - - - - - - - - - - - - -## :clipboard: Example - - - -```js -// Dependencies -const parsePath = require("parse-path") - -console.log(parsePath("http://ionicabizau.net/blog")) -// { protocols: [ 'http' ], -// protocol: 'http', -// port: null, -// resource: 'ionicabizau.net', -// user: '', -// pathname: '/blog', -// hash: '', -// search: '', -// href: 'http://ionicabizau.net/blog' } - -console.log(parsePath("http://domain.com/path/name?foo=bar&bar=42#some-hash")) -// { protocols: [ 'http' ], -// protocol: 'http', -// port: null, -// resource: 'domain.com', -// user: '', -// pathname: '/path/name', -// hash: 'some-hash', -// search: 'foo=bar&bar=42', -// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' } - -console.log(parsePath("git+ssh://git@host.xz/path/name.git")) -// { protocols: [ 'git', 'ssh' ], -// protocol: 'git', -// port: null, -// resource: 'host.xz', -// user: 'git', -// pathname: '/path/name.git', -// hash: '', -// search: '', -// href: 'git+ssh://git@host.xz/path/name.git' } - -console.log(parsePath("git@github.com:IonicaBizau/git-stats.git")) -// { protocols: [], -// protocol: 'ssh', -// port: null, -// resource: 'github.com', -// user: 'git', -// pathname: '/IonicaBizau/git-stats.git', -// hash: '', -// search: '', -// href: 'git@github.com:IonicaBizau/git-stats.git' } -``` - - - - - - - - - - - -## :question: Get Help - -There are few ways to get help: - - - - 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question. - 2. For bug reports and feature requests, open issues. :bug: - 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket: - - - - - -## :memo: Documentation - - -### `parsePath(url)` -Parses the input url. - -#### Params - -- **String** `url`: The input url. - -#### Return -- **Object** An object containing the following fields: - - `protocols` (Array): An array with the url protocols (usually it has one element). - - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. - - `port` (null|Number): The domain port. - - `resource` (String): The url domain (including subdomains). - - `user` (String): The authentication user (usually for ssh urls). - - `pathname` (String): The url pathname. - - `hash` (String): The url hash. - - `search` (String): The url querystring value. - - `href` (String): The input url. - - `query` (Object): The url querystring, parsed as object. - - - - - - - - - - - - - - -## :yum: How to contribute -Have an idea? Found a bug? See [how to contribute][contributing]. - - -## :sparkling_heart: Support my projects -I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, -this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it). - -However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: - - - - Starring and sharing the projects you like :rocket: - - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book: - - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: - - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone). - - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` - - ![](https://i.imgur.com/z6OQI95.png) - - -Thanks! :heart: - - - - - - - - - - - - - - - - -## :dizzy: Where is this library used? -If you are using this library in one of your projects, add it in this list. :sparkles: - - - `parse-url` - - `@semantic-release/gitlab` - - `@hawkingnetwork/react-native-tab-view` - - `eleventy-plugin-embed-soundcloud` - - `eleventy-plugin-embed-twitter` - - `tria-prima` - - `react-fsm-router` - - `@tjoussen/semantic-release-gitlab-mr` - - `@devdiary/semantic-devdiary-release` - - `semantic-release-gitlab-plugin` - - `reddit-title-has-verbatim-quote` - - `@apardellass/react-native-audio-stream` - - `l2forlerna` - - `react-native-plugpag-wrapper` - - `@alphy11/semantic-release-gitlab` - - `react-native-pulsator-native` - - `react-native-kakao-maps` - - `@geeky-apo/react-native-advanced-clipboard` - - `native-apple-login` - - `native-google-login` - - `native-kakao-login` - - `@hemith/react-native-tnk` - - `react-native-contact-list` - - `@corelmax/react-native-my2c2p-sdk` - - `@cloudoki/donderflow` - - `electron-info` - - `@tru_id/tru-sdk-react-native` - - `@datalogic/react-native-datalogic-module` - - `react-native-responsive-size` - - `react-native-flyy` - - `react-native-esc-pos-sahaab` - - - - - - - - - - - -## :scroll: License - -[MIT][license] © [Ionică Bizău][website] - - - - - - -[license]: /LICENSE -[website]: https://ionicabizau.net -[contributing]: /CONTRIBUTING.md -[docs]: /DOCUMENTATION.md -[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg -[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg -[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg -[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg -[patreon]: https://www.patreon.com/ionicabizau -[amazon]: http://amzn.eu/hRo9sIZ -[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW diff --git a/node_modules/parse-path/lib/index.js b/node_modules/parse-path/lib/index.js deleted file mode 100644 index 3ae4bb7..0000000 --- a/node_modules/parse-path/lib/index.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; - -// Dependencies -var protocols = require("protocols"), - isSsh = require("is-ssh"), - qs = require("query-string"); - -/** - * parsePath - * Parses the input url. - * - * @name parsePath - * @function - * @param {String} url The input url. - * @return {Object} An object containing the following fields: - * - * - `protocols` (Array): An array with the url protocols (usually it has one element). - * - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. - * - `port` (null|Number): The domain port. - * - `resource` (String): The url domain (including subdomains). - * - `user` (String): The authentication user (usually for ssh urls). - * - `pathname` (String): The url pathname. - * - `hash` (String): The url hash. - * - `search` (String): The url querystring value. - * - `href` (String): The input url. - * - `query` (Object): The url querystring, parsed as object. - */ -function parsePath(url) { - url = (url || "").trim(); - var output = { - protocols: protocols(url), - protocol: null, - port: null, - resource: "", - user: "", - pathname: "", - hash: "", - search: "", - href: url, - query: Object.create(null) - }, - protocolIndex = url.indexOf("://"), - resourceIndex = -1, - splits = null, - parts = null; - - if (url.startsWith(".")) { - if (url.startsWith("./")) { - url = url.substring(2); - } - output.pathname = url; - output.protocol = "file"; - } - - var firstChar = url.charAt(1); - if (!output.protocol) { - output.protocol = output.protocols[0]; - if (!output.protocol) { - if (isSsh(url)) { - output.protocol = "ssh"; - } else if (firstChar === "/" || firstChar === "~") { - url = url.substring(2); - output.protocol = "file"; - } else { - output.protocol = "file"; - } - } - } - - if (protocolIndex !== -1) { - url = url.substring(protocolIndex + 3); - } - - parts = url.split(/\/|\\/); - if (output.protocol !== "file") { - output.resource = parts.shift(); - } else { - output.resource = ""; - } - - // user@domain - splits = output.resource.split("@"); - if (splits.length === 2) { - output.user = splits[0]; - output.resource = splits[1]; - } - - // domain.com:port - splits = output.resource.split(":"); - if (splits.length === 2) { - output.resource = splits[0]; - if (splits[1]) { - output.port = Number(splits[1]); - if (isNaN(output.port)) { - output.port = null; - parts.unshift(splits[1]); - } - } else { - output.port = null; - } - } - - // Remove empty elements - parts = parts.filter(Boolean); - - // Stringify the pathname - if (output.protocol === "file") { - output.pathname = output.href; - } else { - output.pathname = output.pathname || (output.protocol !== "file" || output.href[0] === "/" ? "/" : "") + parts.join("/"); - } - - // #some-hash - splits = output.pathname.split("#"); - if (splits.length === 2) { - output.pathname = splits[0]; - output.hash = splits[1]; - } - - // ?foo=bar - splits = output.pathname.split("?"); - if (splits.length === 2) { - output.pathname = splits[0]; - output.search = splits[1]; - } - - output.query = qs.parse(output.search); - output.href = output.href.replace(/\/$/, ""); - output.pathname = output.pathname.replace(/\/$/, ""); - return output; -} - -module.exports = parsePath; \ No newline at end of file diff --git a/node_modules/parse-path/package.json b/node_modules/parse-path/package.json deleted file mode 100644 index 27af7f6..0000000 --- a/node_modules/parse-path/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "parse-path", - "version": "4.0.3", - "description": "Parse paths (local paths, urls: ssh/git/etc)", - "main": "lib/index.js", - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "node test" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/IonicaBizau/parse-path.git" - }, - "keywords": [ - "parse", - "path", - "url", - "node", - "git", - "advanced" - ], - "author": "Ionică Bizău (https://ionicabizau.net)", - "license": "MIT", - "bugs": { - "url": "https://github.com/IonicaBizau/parse-path/issues" - }, - "homepage": "https://github.com/IonicaBizau/parse-path", - "devDependencies": { - "tester": "^1.3.1" - }, - "dependencies": { - "is-ssh": "^1.3.0", - "protocols": "^1.4.0", - "qs": "^6.9.4", - "query-string": "^6.13.8" - }, - "files": [ - "bin/", - "app/", - "lib/", - "dist/", - "src/", - "scripts/", - "resources/", - "menu/", - "cli.js", - "index.js", - "bloggify.js", - "bloggify.json", - "bloggify/" - ] -} diff --git a/node_modules/parse-url/LICENSE b/node_modules/parse-url/LICENSE deleted file mode 100755 index f43e830..0000000 --- a/node_modules/parse-url/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-20 Ionică Bizău (https://ionicabizau.net) - -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/parse-url/README.md b/node_modules/parse-url/README.md deleted file mode 100755 index a06cdda..0000000 --- a/node_modules/parse-url/README.md +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - - - - - - - - - - - - - -# parse-url - - [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Travis](https://img.shields.io/travis/IonicaBizau/parse-url.svg)](https://travis-ci.org/IonicaBizau/parse-url/) [![Version](https://img.shields.io/npm/v/parse-url.svg)](https://www.npmjs.com/package/parse-url) [![Downloads](https://img.shields.io/npm/dt/parse-url.svg)](https://www.npmjs.com/package/parse-url) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github) - -Buy Me A Coffee - - - - - - - -> An advanced url parser supporting git urls too. - - - - - - -For low-level path parsing, check out [`parse-path`](https://github.com/IonicaBizau/parse-path). This very module is designed to parse urls. By default the urls are normalized. - - - - - - - - - - - - -## :cloud: Installation - -```sh -# Using npm -npm install --save parse-url - -# Using yarn -yarn add parse-url -``` - - - - - - - - - - - - - -## :clipboard: Example - - - -```js -// Dependencies -const parseUrl = require("parse-url") - -console.log(parseUrl("http://ionicabizau.net/blog")) -// { protocols: [ 'http' ], -// protocol: 'http', -// port: null, -// resource: 'ionicabizau.net', -// user: '', -// pathname: '/blog', -// hash: '', -// search: '', -// href: 'http://ionicabizau.net/blog' } - -console.log(parseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash")) -// { protocols: [ 'http' ], -// protocol: 'http', -// port: null, -// resource: 'domain.com', -// user: '', -// pathname: '/path/name', -// hash: 'some-hash', -// search: 'foo=bar&bar=42', -// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' } - -// If you want to parse fancy Git urls, turn off the automatic url normalization -console.log(parseUrl("git+ssh://git@host.xz/path/name.git", false)) -// { protocols: [ 'git', 'ssh' ], -// protocol: 'git', -// port: null, -// resource: 'host.xz', -// user: 'git', -// pathname: '/path/name.git', -// hash: '', -// search: '', -// href: 'git+ssh://git@host.xz/path/name.git' } - -console.log(parseUrl("git@github.com:IonicaBizau/git-stats.git", false)) -// { protocols: [], -// protocol: 'ssh', -// port: null, -// resource: 'github.com', -// user: 'git', -// pathname: '/IonicaBizau/git-stats.git', -// hash: '', -// search: '', -// href: 'git@github.com:IonicaBizau/git-stats.git' } -``` - - - - - - - - - - - -## :question: Get Help - -There are few ways to get help: - - - - 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question. - 2. For bug reports and feature requests, open issues. :bug: - 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket: - - - - - -## :memo: Documentation - - -### `parseUrl(url, normalize)` -Parses the input url. - -**Note**: This *throws* if invalid urls are provided. - -#### Params - -- **String** `url`: The input url. -- **Boolean|Object** `normalize`: Wheter to normalize the url or not. Default is `false`. If `true`, the url will - be normalized. If an object, it will be the - options object sent to [`normalize-url`](https://github.com/sindresorhus/normalize-url). - - For SSH urls, normalize won't work. - -#### Return -- **Object** An object containing the following fields: - - `protocols` (Array): An array with the url protocols (usually it has one element). - - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. - - `port` (null|Number): The domain port. - - `resource` (String): The url domain (including subdomains). - - `user` (String): The authentication user (usually for ssh urls). - - `pathname` (String): The url pathname. - - `hash` (String): The url hash. - - `search` (String): The url querystring value. - - `href` (String): The input url. - - `query` (Object): The url querystring, parsed as object. - - - - - - - - - - - - - - -## :yum: How to contribute -Have an idea? Found a bug? See [how to contribute][contributing]. - - -## :sparkling_heart: Support my projects -I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, -this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it). - -However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: - - - - Starring and sharing the projects you like :rocket: - - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book: - - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: - - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone). - - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` - - ![](https://i.imgur.com/z6OQI95.png) - - -Thanks! :heart: - - - - - - - - - - - - - - - - -## :dizzy: Where is this library used? -If you are using this library in one of your projects, add it in this list. :sparkles: - - - `lien` - - `git-up` - - `stun` - - `kakapo` - - `url-local` - - `fuge-runner` - - `parse-db-uri` - - `warp-api` - - `warp-server` - - `robots-agent` - - `normalize-ssh` - - `xl-git-up` - - `@hawkingnetwork/react-native-tab-view` - - `miguelcostero-ng2-toasty` - - `vue-cli-plugin-ut-builder` - - `normalize-id` - - `hologit` - - `vrt-cli` - - `native-zip` - - `delta-screen` - - `normalize-ssh-url` - - `eval-spider` - - `ts-scraper` - - `microbe.js` - - `hubot-will-it-connect` - - `deploy-versioning` - - `xbuilder-forms` - - `tumblr-text` - - `ssh-host-manager` - - `blitzzz` - - `heroku-wp-environment-sync` - - `wander-cli` - - `graphmilker` - - `api-reach-react-native-fix` - - `@roshub/api` - - `@jimengio/mocked-proxy` - - `@ndla/source-map-resolver` - - `verify-aws-sns-signature` - - `@hstech/utils` - - `@dataparty/api` - - `@apardellass/react-native-audio-stream` - - `l2forlerna` - - `react-native-plugpag-wrapper` - - `soajs.repositories` - - - - - - - - - - - -## :scroll: License - -[MIT][license] © [Ionică Bizău][website] - - - - - - -[license]: /LICENSE -[website]: https://ionicabizau.net -[contributing]: /CONTRIBUTING.md -[docs]: /DOCUMENTATION.md -[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg -[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg -[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg -[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg -[patreon]: https://www.patreon.com/ionicabizau -[amazon]: http://amzn.eu/hRo9sIZ -[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW diff --git a/node_modules/parse-url/lib/index.js b/node_modules/parse-url/lib/index.js deleted file mode 100755 index 6bcf3b1..0000000 --- a/node_modules/parse-url/lib/index.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var parsePath = require("parse-path"), - normalizeUrl = require("normalize-url"); - -/** - * parseUrl - * Parses the input url. - * - * **Note**: This *throws* if invalid urls are provided. - * - * @name parseUrl - * @function - * @param {String} url The input url. - * @param {Boolean|Object} normalize Wheter to normalize the url or not. - * Default is `false`. If `true`, the url will - * be normalized. If an object, it will be the - * options object sent to [`normalize-url`](https://github.com/sindresorhus/normalize-url). - * - * For SSH urls, normalize won't work. - * - * @return {Object} An object containing the following fields: - * - * - `protocols` (Array): An array with the url protocols (usually it has one element). - * - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. - * - `port` (null|Number): The domain port. - * - `resource` (String): The url domain (including subdomains). - * - `user` (String): The authentication user (usually for ssh urls). - * - `pathname` (String): The url pathname. - * - `hash` (String): The url hash. - * - `search` (String): The url querystring value. - * - `href` (String): The input url. - * - `query` (Object): The url querystring, parsed as object. - */ -function parseUrl(url) { - var normalize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (typeof url !== "string" || !url.trim()) { - throw new Error("Invalid url."); - } - if (normalize) { - if ((typeof normalize === "undefined" ? "undefined" : _typeof(normalize)) !== "object") { - normalize = { - stripFragment: false - }; - } - url = normalizeUrl(url, normalize); - } - var parsed = parsePath(url); - return parsed; -} - -module.exports = parseUrl; \ No newline at end of file diff --git a/node_modules/parse-url/package.json b/node_modules/parse-url/package.json deleted file mode 100755 index 6443fbe..0000000 --- a/node_modules/parse-url/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "parse-url", - "version": "5.0.2", - "description": "An advanced url parser supporting git urls too.", - "main": "lib/index.js", - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "node test" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/IonicaBizau/parse-url.git" - }, - "keywords": [ - "parse", - "url", - "node", - "git", - "advanced" - ], - "author": "Ionică Bizău (https://ionicabizau.net)", - "license": "MIT", - "bugs": { - "url": "https://github.com/IonicaBizau/parse-url/issues" - }, - "homepage": "https://github.com/IonicaBizau/parse-url", - "devDependencies": { - "tester": "^1.3.1" - }, - "dependencies": { - "is-ssh": "^1.3.0", - "normalize-url": "^3.3.0", - "parse-path": "^4.0.0", - "protocols": "^1.4.0" - }, - "files": [ - "bin/", - "app/", - "lib/", - "dist/", - "src/", - "scripts/", - "resources/", - "menu/", - "cli.js", - "index.js", - "bloggify.js", - "bloggify.json", - "bloggify/" - ], - "blah": { - "description": [ - "For low-level path parsing, check out [`parse-path`](https://github.com/IonicaBizau/parse-path). This very module is designed to parse urls. By default the urls are normalized." - ] - } -} diff --git a/node_modules/post-me/CHANGELOG.md b/node_modules/post-me/CHANGELOG.md new file mode 100644 index 0000000..3c4534b --- /dev/null +++ b/node_modules/post-me/CHANGELOG.md @@ -0,0 +1,16 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [0.4.5](https://github.com/alesgenova/post-me/compare/post-me@0.4.4...post-me@0.4.5) (2021-02-19) + +**Note:** Version bump only for package post-me + + + + + +## 0.4.4 (2021-02-10) + +**Note:** Version bump only for package post-me diff --git a/node_modules/post-me/dist/common.d.ts b/node_modules/post-me/dist/common.d.ts new file mode 100644 index 0000000..688f255 --- /dev/null +++ b/node_modules/post-me/dist/common.d.ts @@ -0,0 +1,42 @@ +export declare const MARKER = "@post-me"; +export declare type IdType = number; +export declare type KeyType = string; +/** + * The options that can be passed when calling a method on the other context with RemoteHandle.customCall() + * + * @public + * + */ +export declare type CallOptions = { + transfer?: Transferable[]; +}; +/** + * The options that can be passed when emitting an event to the other context with LocalHandle.emit() + * + * @public + * + */ +export declare type EmitOptions = { + transfer?: Transferable[]; +}; +/** + * @internal + */ +export declare type MethodsType = Record>>; +/** + * @internal + */ +export declare type EventsType = Record; +/** + * @internal + */ +export declare type Callable, R> = (...args: A) => R; +/** + * @internal + */ +export declare type ValueOrPromise = T | Promise; +/** + * @internal + */ +export declare type InnerType> = T extends Promise ? U : T; +export declare function createUniqueIdFn(): () => number; diff --git a/node_modules/post-me/dist/connection.d.ts b/node_modules/post-me/dist/connection.d.ts new file mode 100644 index 0000000..a7c1998 --- /dev/null +++ b/node_modules/post-me/dist/connection.d.ts @@ -0,0 +1,41 @@ +import { MethodsType, EventsType } from './common'; +import { Dispatcher } from './dispatcher'; +import { ConcreteLocalHandle, ConcreteRemoteHandle, LocalHandle, RemoteHandle } from './handles'; +/** + * An active connection between two contexts + * + * @typeParam M0 - The methods exposed by this context + * @typeParam E0 - The events exposed by this context + * @typeParam M1 - The methods exposed by the other context + * @typeParam E1 - The events exposed by the other context + * + * @public + * + */ +export interface Connection { + /** + * Get a handle to the local end of the connection + * + * @returns A {@link LocalHandle} to the local side of the Connection + */ + localHandle(): LocalHandle; + /** + * Get a handle to the other end of the connection + * + * @returns A {@link RemoteHandle} to the other side of the Connection + */ + remoteHandle(): RemoteHandle; + /** + * Stop listening to incoming message from the other side + */ + close(): void; +} +export declare class ConcreteConnection implements Connection { + private _dispatcher; + private _remoteHandle; + private _localHandle; + constructor(dispatcher: Dispatcher, localMethods: M0); + close(): void; + localHandle(): ConcreteLocalHandle; + remoteHandle(): ConcreteRemoteHandle; +} diff --git a/node_modules/post-me/dist/dispatcher.d.ts b/node_modules/post-me/dist/dispatcher.d.ts new file mode 100644 index 0000000..12d074f --- /dev/null +++ b/node_modules/post-me/dist/dispatcher.d.ts @@ -0,0 +1,48 @@ +import { IdType, KeyType } from './common'; +import { Messenger } from './messenger'; +import { ConcreteEmitter } from './emitter'; +import { MessageType, CallMessage, EventMessage, ResponseMessage, CallbackMessage, HandshakeResponseMessage, HandshakeRequestMessage } from './messages'; +export declare type DispatcherEvents = { + [x: string]: CallMessage | EventMessage | CallbackMessage | ResponseMessage; + [MessageType.Call]: CallMessage; + [MessageType.Event]: EventMessage; +}; +export declare class Dispatcher extends ConcreteEmitter { + private messenger; + private sessionId; + private removeMessengerListener; + private uniqueId; + constructor(messenger: Messenger, sessionId: IdType); + private messengerListener; + callOnRemote(methodName: KeyType, args: any[], transfer?: Transferable[]): { + callbackEvent: string; + responseEvent: string; + }; + respondToRemote(requestId: IdType, value: any, error: any, transfer?: Transferable[]): void; + callbackToRemote(requestId: IdType, callbackId: IdType, args: any[]): void; + emitToRemote(eventName: KeyType, payload: any, transfer?: Transferable[]): void; + close(): void; +} +export declare type ParentHandshakeDispatcherEvents = { + [x: number]: HandshakeResponseMessage; +}; +export declare class ParentHandshakeDispatcher extends ConcreteEmitter { + private messenger; + private sessionId; + private removeMessengerListener; + constructor(messenger: Messenger, sessionId: IdType); + private messengerListener; + initiateHandshake(): IdType; + close(): void; +} +export declare type ChildHandshakeDispatcherEvents = { + [MessageType.HandshakeRequest]: HandshakeRequestMessage; +}; +export declare class ChildHandshakeDispatcher extends ConcreteEmitter { + private messenger; + private removeMessengerListener; + constructor(messenger: Messenger); + private messengerListener; + acceptHandshake(sessionId: IdType): void; + close(): void; +} diff --git a/node_modules/post-me/dist/emitter.d.ts b/node_modules/post-me/dist/emitter.d.ts new file mode 100644 index 0000000..dbd8ede --- /dev/null +++ b/node_modules/post-me/dist/emitter.d.ts @@ -0,0 +1,54 @@ +import { EventsType } from './common'; +/** + * A simple event emitter interface used to implement the observer pattern throughout the codebase. + * + * @public + * + */ +export interface Emitter { + /** + * Add a listener to a specific event. + * + * @param eventName - The name of the event + * @param listener - A listener function that takes as parameter the payload of the event + */ + addEventListener(eventName: K, listener: (data: E[K]) => void): void; + /** + * Remove a listener from a specific event. + * + * @param eventName - The name of the event + * @param listener - A listener function that had been added previously + */ + removeEventListener(eventName: K, listener: (data: E[K]) => void): void; + /** + * Add a listener to a specific event, that will only be invoked once + * + * @remarks + * + * After the first occurrence of the specified event, the listener will be invoked and + * immediately removed. + * + * @param eventName - The name of the event + * @param listener - A listener function that had been added previously + */ + once(eventName: K): Promise; +} +/** + * A concrete implementation of the {@link Emitter} interface + * + * @public + */ +export declare class ConcreteEmitter implements Emitter { + private _listeners; + constructor(); + /** {@inheritDoc Emitter.addEventListener} */ + addEventListener(eventName: K, listener: (data: E[K]) => void): void; + /** {@inheritDoc Emitter.removeEventListener} */ + removeEventListener(eventName: K, listener: (data: E[K]) => void): void; + /** {@inheritDoc Emitter.once} */ + once(eventName: K): Promise; + /** @internal */ + protected emit(eventName: K, data: E[K]): void; + /** @internal */ + protected removeAllListeners(): void; +} diff --git a/node_modules/post-me/dist/handles.d.ts b/node_modules/post-me/dist/handles.d.ts new file mode 100644 index 0000000..a18f341 --- /dev/null +++ b/node_modules/post-me/dist/handles.d.ts @@ -0,0 +1,149 @@ +import { InnerType, MethodsType, EventsType, EmitOptions, CallOptions } from './common'; +import { Emitter, ConcreteEmitter } from './emitter'; +import { Dispatcher } from './dispatcher'; +/** + * A handle to the other end of the connection + * + * @remarks + * + * Use this handle to: + * + * - Call methods exposed by the other end + * + * - Add listeners to custom events emitted by the other end + * + * @typeParam M - The methods exposed by the other context + * @typeParam E - The events exposed by the other context + * + * @public + * + */ +export interface RemoteHandle extends Emitter { + /** + * Call a method exposed by the other end. + * + * @param methodName - The name of the method + * @param args - The list of arguments passed to the method + * @returns A Promise of the value returned by the method + * + */ + call(methodName: K, ...args: Parameters): Promise>>; + /** + * Call a method exposed by the other end. + * + * @param methodName - The name of the method + * @param args - The list of arguments passed to the method + * @param options - The {@link CallOptions} to customize this method call + * @returns A Promise of the value returned by the method + * + */ + customCall(methodName: K, args: Parameters, options?: CallOptions): Promise>>; + /** + * Specify which parts of the arguments of a given method call should be transferred + * into the other context instead of cloned. + * + * @remarks + * + * You only need to call setCallTransfer once per method. After the transfer function is set, + * it will automatically be used by all subsequent calls to the specified method. + * + * @param methodName - The name of the method + * @param transfer - A function that takes as parameters the arguments of a method call, and returns a list of transferable objects. + * + */ + setCallTransfer(methodName: K, transfer: (...args: Parameters) => Transferable[]): void; +} +/** + * A handle to the local end of the connection + * + * @remarks + * + * Use this handle to: + * + * - Emit custom events to the other end + * + * - Set the methods that are exposed to the other end + * + * @typeParam M - The methods exposed by this context + * @typeParam E - The events exposed by this context + * + * @public + * + */ +export interface LocalHandle { + /** + * Emit a custom event with a payload. The event can be captured by the other context. + * + * @param eventName - The name of the event + * @param data - The payload associated with the event + * @param options - The {@link EmitOptions} to customize this emit call + * + */ + emit(eventName: K, data: E[K], options?: EmitOptions): void; + /** + * Set the methods that will be exposed to the other end of the connection. + * + * @param methods - An object mapping method names to functions + * + */ + setMethods(methods: M): void; + /** + * Set a specific method that will be exposed to the other end of the connection. + * + * @param methodName - The name of the method + * @param method - The function that will be exposed + * + */ + setMethod(methodName: K, method: M[K]): void; + /** + * Specify which parts of the return value of a given method call should be transferred + * into the other context instead of cloned. + * + * @remarks + * + * You only need to call setReturnTransfer once per method. After the transfer function is set, + * it will automatically be used every time a value is returned by the specified method. + * + * @param methodName - The name of the method + * @param transfer - A function that takes as parameter the return value of a method call, and returns a list of transferable objects. + * + */ + setReturnTransfer(methodName: K, transfer: (result: InnerType>) => Transferable[]): void; + /** + * Specify which parts of the payload of a given event should be transferred + * into the other context instead of cloned. + * + * @remarks + * + * You only need to call setEmitTransfer once per event type. After the transfer function is set, + * it will automatically be used every time a payload is attached to the specific event. + * + * @param eventName - The name of the method + * @param transfer - A function that takes as parameter the payload of an event, and returns a list of transferable objects. + * + */ + setEmitTransfer(eventName: K, transfer: (payload: E[K]) => Transferable[]): void; +} +export declare class ConcreteRemoteHandle extends ConcreteEmitter implements RemoteHandle { + private _dispatcher; + private _callTransfer; + constructor(dispatcher: Dispatcher); + close(): void; + setCallTransfer(methodName: K, transfer: (...args: Parameters) => Transferable[]): void; + call(methodName: K, ...args: Parameters): Promise>>; + customCall(methodName: K, args: Parameters, options?: CallOptions): Promise>>; + private _handleEvent; +} +export declare class ConcreteLocalHandle implements LocalHandle { + private _dispatcher; + private _methods; + private _returnTransfer; + private _emitTransfer; + constructor(dispatcher: Dispatcher, localMethods: M); + emit(eventName: K, payload: E[K], options?: EmitOptions): void; + setMethods(methods: M): void; + setMethod(methodName: K, method: M[K]): void; + setReturnTransfer(methodName: K, transfer: (result: InnerType>) => Transferable[]): void; + setEmitTransfer(eventName: K, transfer: (payload: E[K]) => Transferable[]): void; + private _handleCall; +} diff --git a/node_modules/post-me/dist/handshake.d.ts b/node_modules/post-me/dist/handshake.d.ts new file mode 100644 index 0000000..2279ad6 --- /dev/null +++ b/node_modules/post-me/dist/handshake.d.ts @@ -0,0 +1,25 @@ +import { MethodsType } from './common'; +import { Messenger } from './messenger'; +import { Connection } from './connection'; +/** + * Initiate the handshake from the Parent side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @param maxAttempts - The maximum number of handshake attempts + * @param attemptsInterval - The interval between handshake attempts + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ +export declare function ParentHandshake(messenger: Messenger, localMethods?: M0, maxAttempts?: number, attemptsInterval?: number): Promise; +/** + * Initiate the handshake from the Child side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ +export declare function ChildHandshake(messenger: Messenger, localMethods?: M): Promise; diff --git a/node_modules/post-me/dist/index.d.ts b/node_modules/post-me/dist/index.d.ts new file mode 100644 index 0000000..e9e7c1a --- /dev/null +++ b/node_modules/post-me/dist/index.d.ts @@ -0,0 +1,10 @@ +/** + * @packageDocumentation Use web Workers and other Windows through a simple Promise API + */ +import { ParentHandshake, ChildHandshake } from './handshake'; +import { Connection } from './connection'; +import { Emitter, ConcreteEmitter } from './emitter'; +import { Messenger, WindowMessenger, WorkerMessenger, PortMessenger, BareMessenger, DebugMessenger, debug } from './messenger'; +import { RemoteHandle, LocalHandle } from './handles'; +import { CallOptions, EmitOptions, MethodsType, EventsType, Callable, ValueOrPromise, InnerType } from './common'; +export { Connection, Emitter, RemoteHandle, LocalHandle, Messenger, ParentHandshake, ChildHandshake, DebugMessenger, debug, ConcreteEmitter, WindowMessenger, WorkerMessenger, PortMessenger, BareMessenger, CallOptions, EmitOptions, MethodsType, EventsType, Callable, ValueOrPromise, InnerType, }; diff --git a/node_modules/post-me/dist/index.esnext.mjs b/node_modules/post-me/dist/index.esnext.mjs new file mode 100644 index 0000000..dd2cb00 --- /dev/null +++ b/node_modules/post-me/dist/index.esnext.mjs @@ -0,0 +1,627 @@ +const MARKER = '@post-me'; +function createUniqueIdFn() { + let __id = 0; + return function () { + const id = __id; + __id += 1; + return id; + }; +} + +/** + * A concrete implementation of the {@link Emitter} interface + * + * @public + */ +class ConcreteEmitter { + constructor() { + this._listeners = {}; + } + /** {@inheritDoc Emitter.addEventListener} */ + addEventListener(eventName, listener) { + let listeners = this._listeners[eventName]; + if (!listeners) { + listeners = new Set(); + this._listeners[eventName] = listeners; + } + listeners.add(listener); + } + /** {@inheritDoc Emitter.removeEventListener} */ + removeEventListener(eventName, listener) { + let listeners = this._listeners[eventName]; + if (!listeners) { + return; + } + listeners.delete(listener); + } + /** {@inheritDoc Emitter.once} */ + once(eventName) { + return new Promise((resolve) => { + const listener = (data) => { + this.removeEventListener(eventName, listener); + resolve(data); + }; + this.addEventListener(eventName, listener); + }); + } + /** @internal */ + emit(eventName, data) { + let listeners = this._listeners[eventName]; + if (!listeners) { + return; + } + listeners.forEach((listener) => { + listener(data); + }); + } + /** @internal */ + removeAllListeners() { + Object.values(this._listeners).forEach((listeners) => { + if (listeners) { + listeners.clear(); + } + }); + } +} + +var MessageType; +(function (MessageType) { + MessageType["HandshakeRequest"] = "handshake-request"; + MessageType["HandshakeResponse"] = "handshake-response"; + MessageType["Call"] = "call"; + MessageType["Response"] = "response"; + MessageType["Error"] = "error"; + MessageType["Event"] = "event"; + MessageType["Callback"] = "callback"; +})(MessageType || (MessageType = {})); +// Message Creators +function createHandshakeRequestMessage(sessionId) { + return { + type: MARKER, + action: MessageType.HandshakeRequest, + sessionId, + }; +} +function createHandshakeResponseMessage(sessionId) { + return { + type: MARKER, + action: MessageType.HandshakeResponse, + sessionId, + }; +} +function createCallMessage(sessionId, requestId, methodName, args) { + return { + type: MARKER, + action: MessageType.Call, + sessionId, + requestId, + methodName, + args, + }; +} +function createResponsMessage(sessionId, requestId, result, error) { + const message = { + type: MARKER, + action: MessageType.Response, + sessionId, + requestId, + }; + if (result !== undefined) { + message.result = result; + } + if (error !== undefined) { + message.error = error; + } + return message; +} +function createCallbackMessage(sessionId, requestId, callbackId, args) { + return { + type: MARKER, + action: MessageType.Callback, + sessionId, + requestId, + callbackId, + args, + }; +} +function createEventMessage(sessionId, eventName, payload) { + return { + type: MARKER, + action: MessageType.Event, + sessionId, + eventName, + payload, + }; +} +// Type Guards +function isMessage(m) { + return m && m.type === MARKER; +} +function isHandshakeRequestMessage(m) { + return isMessage(m) && m.action === MessageType.HandshakeRequest; +} +function isHandshakeResponseMessage(m) { + return isMessage(m) && m.action === MessageType.HandshakeResponse; +} +function isCallMessage(m) { + return isMessage(m) && m.action === MessageType.Call; +} +function isResponseMessage(m) { + return isMessage(m) && m.action === MessageType.Response; +} +function isCallbackMessage(m) { + return isMessage(m) && m.action === MessageType.Callback; +} +function isEventMessage(m) { + return isMessage(m) && m.action === MessageType.Event; +} + +function makeCallbackEvent(requestId) { + return `callback_${requestId}`; +} +function makeResponseEvent(requestId) { + return `response_${requestId}`; +} +class Dispatcher extends ConcreteEmitter { + constructor(messenger, sessionId) { + super(); + this.uniqueId = createUniqueIdFn(); + this.messenger = messenger; + this.sessionId = sessionId; + this.removeMessengerListener = this.messenger.addMessageListener(this.messengerListener.bind(this)); + } + messengerListener(event) { + const { data } = event; + if (!isMessage(data)) { + return; + } + if (this.sessionId !== data.sessionId) { + return; + } + if (isCallMessage(data)) { + this.emit(MessageType.Call, data); + } + else if (isResponseMessage(data)) { + this.emit(makeResponseEvent(data.requestId), data); + } + else if (isEventMessage(data)) { + this.emit(MessageType.Event, data); + } + else if (isCallbackMessage(data)) { + this.emit(makeCallbackEvent(data.requestId), data); + } + } + callOnRemote(methodName, args, transfer) { + const requestId = this.uniqueId(); + const callbackEvent = makeCallbackEvent(requestId); + const responseEvent = makeResponseEvent(requestId); + const message = createCallMessage(this.sessionId, requestId, methodName, args); + this.messenger.postMessage(message, transfer); + return { callbackEvent, responseEvent }; + } + respondToRemote(requestId, value, error, transfer) { + if (error instanceof Error) { + error = { + name: error.name, + message: error.message, + }; + } + const message = createResponsMessage(this.sessionId, requestId, value, error); + this.messenger.postMessage(message, transfer); + } + callbackToRemote(requestId, callbackId, args) { + const message = createCallbackMessage(this.sessionId, requestId, callbackId, args); + this.messenger.postMessage(message); + } + emitToRemote(eventName, payload, transfer) { + const message = createEventMessage(this.sessionId, eventName, payload); + this.messenger.postMessage(message, transfer); + } + close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } +} +class ParentHandshakeDispatcher extends ConcreteEmitter { + constructor(messenger, sessionId) { + super(); + this.messenger = messenger; + this.sessionId = sessionId; + this.removeMessengerListener = this.messenger.addMessageListener(this.messengerListener.bind(this)); + } + messengerListener(event) { + const { data } = event; + if (!isMessage(data)) { + return; + } + if (this.sessionId !== data.sessionId) { + return; + } + if (isHandshakeResponseMessage(data)) { + this.emit(data.sessionId, data); + } + } + initiateHandshake() { + const message = createHandshakeRequestMessage(this.sessionId); + this.messenger.postMessage(message); + return this.sessionId; + } + close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } +} +class ChildHandshakeDispatcher extends ConcreteEmitter { + constructor(messenger) { + super(); + this.messenger = messenger; + this.removeMessengerListener = this.messenger.addMessageListener(this.messengerListener.bind(this)); + } + messengerListener(event) { + const { data } = event; + if (isHandshakeRequestMessage(data)) { + this.emit(MessageType.HandshakeRequest, data); + } + } + acceptHandshake(sessionId) { + const message = createHandshakeResponseMessage(sessionId); + this.messenger.postMessage(message); + } + close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } +} + +var ProxyType; +(function (ProxyType) { + ProxyType["Callback"] = "callback"; +})(ProxyType || (ProxyType = {})); +function createCallbackProxy(callbackId) { + return { + type: MARKER, + proxy: ProxyType.Callback, + callbackId, + }; +} +function isCallbackProxy(p) { + return p && p.type === MARKER && p.proxy === ProxyType.Callback; +} + +class ConcreteRemoteHandle extends ConcreteEmitter { + constructor(dispatcher) { + super(); + this._dispatcher = dispatcher; + this._callTransfer = {}; + this._dispatcher.addEventListener(MessageType.Event, this._handleEvent.bind(this)); + } + close() { + this.removeAllListeners(); + } + setCallTransfer(methodName, transfer) { + this._callTransfer[methodName] = transfer; + } + call(methodName, ...args) { + return this.customCall(methodName, args); + } + customCall(methodName, args, options = {}) { + return new Promise((resolve, reject) => { + const sanitizedArgs = []; + const callbacks = []; + let callbackId = 0; + args.forEach((arg) => { + if (typeof arg === 'function') { + callbacks.push(arg); + sanitizedArgs.push(createCallbackProxy(callbackId)); + callbackId += 1; + } + else { + sanitizedArgs.push(arg); + } + }); + const hasCallbacks = callbacks.length > 0; + let callbackListener = undefined; + if (hasCallbacks) { + callbackListener = (data) => { + const { callbackId, args } = data; + callbacks[callbackId](...args); + }; + } + let transfer = options.transfer; + if (transfer === undefined && this._callTransfer[methodName]) { + transfer = this._callTransfer[methodName](...sanitizedArgs); + } + const { callbackEvent, responseEvent } = this._dispatcher.callOnRemote(methodName, sanitizedArgs, transfer); + if (hasCallbacks) { + this._dispatcher.addEventListener(callbackEvent, callbackListener); + } + this._dispatcher.once(responseEvent).then((response) => { + if (callbackListener) { + this._dispatcher.removeEventListener(callbackEvent, callbackListener); + } + const { result, error } = response; + if (error !== undefined) { + reject(error); + } + else { + resolve(result); + } + }); + }); + } + _handleEvent(data) { + const { eventName, payload } = data; + this.emit(eventName, payload); + } +} +class ConcreteLocalHandle { + constructor(dispatcher, localMethods) { + this._dispatcher = dispatcher; + this._methods = localMethods; + this._returnTransfer = {}; + this._emitTransfer = {}; + this._dispatcher.addEventListener(MessageType.Call, this._handleCall.bind(this)); + } + emit(eventName, payload, options = {}) { + let transfer = options.transfer; + if (transfer === undefined && this._emitTransfer[eventName]) { + transfer = this._emitTransfer[eventName](payload); + } + this._dispatcher.emitToRemote(eventName, payload, transfer); + } + setMethods(methods) { + this._methods = methods; + } + setMethod(methodName, method) { + this._methods[methodName] = method; + } + setReturnTransfer(methodName, transfer) { + this._returnTransfer[methodName] = transfer; + } + setEmitTransfer(eventName, transfer) { + this._emitTransfer[eventName] = transfer; + } + _handleCall(data) { + const { requestId, methodName, args } = data; + const callMethod = new Promise((resolve, reject) => { + const method = this._methods[methodName]; + if (typeof method !== 'function') { + reject(new Error(`The method "${methodName}" has not been implemented.`)); + return; + } + const desanitizedArgs = args.map((arg) => { + if (isCallbackProxy(arg)) { + const { callbackId } = arg; + return (...args) => { + this._dispatcher.callbackToRemote(requestId, callbackId, args); + }; + } + else { + return arg; + } + }); + Promise.resolve(this._methods[methodName](...desanitizedArgs)) + .then(resolve) + .catch(reject); + }); + callMethod + .then((result) => { + let transfer; + if (this._returnTransfer[methodName]) { + transfer = this._returnTransfer[methodName](result); + } + this._dispatcher.respondToRemote(requestId, result, undefined, transfer); + }) + .catch((error) => { + this._dispatcher.respondToRemote(requestId, undefined, error); + }); + } +} + +class ConcreteConnection { + constructor(dispatcher, localMethods) { + this._dispatcher = dispatcher; + this._localHandle = new ConcreteLocalHandle(dispatcher, localMethods); + this._remoteHandle = new ConcreteRemoteHandle(dispatcher); + } + close() { + this._dispatcher.close(); + this.remoteHandle().close(); + } + localHandle() { + return this._localHandle; + } + remoteHandle() { + return this._remoteHandle; + } +} + +const uniqueSessionId = createUniqueIdFn(); +const runUntil = (worker, condition, unfulfilled, maxAttempts, attemptInterval) => { + let attempt = 0; + const fn = () => { + if (!condition() && (attempt < maxAttempts || maxAttempts < 1)) { + worker(); + attempt += 1; + setTimeout(fn, attemptInterval); + } + else if (!condition() && attempt >= maxAttempts && maxAttempts >= 1) { + unfulfilled(); + } + }; + fn(); +}; +/** + * Initiate the handshake from the Parent side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @param maxAttempts - The maximum number of handshake attempts + * @param attemptsInterval - The interval between handshake attempts + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ +function ParentHandshake(messenger, localMethods = {}, maxAttempts = 5, attemptsInterval = 100) { + const thisSessionId = uniqueSessionId(); + let connected = false; + return new Promise((resolve, reject) => { + const handshakeDispatcher = new ParentHandshakeDispatcher(messenger, thisSessionId); + handshakeDispatcher.once(thisSessionId).then((response) => { + connected = true; + handshakeDispatcher.close(); + const { sessionId } = response; + const dispatcher = new Dispatcher(messenger, sessionId); + const connection = new ConcreteConnection(dispatcher, localMethods); + resolve(connection); + }); + runUntil(() => handshakeDispatcher.initiateHandshake(), () => connected, () => reject(new Error(`Handshake failed, reached maximum number of attempts`)), maxAttempts, attemptsInterval); + }); +} +/** + * Initiate the handshake from the Child side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ +function ChildHandshake(messenger, localMethods = {}) { + return new Promise((resolve, reject) => { + const handshakeDispatcher = new ChildHandshakeDispatcher(messenger); + handshakeDispatcher.once(MessageType.HandshakeRequest).then((response) => { + const { sessionId } = response; + handshakeDispatcher.acceptHandshake(sessionId); + handshakeDispatcher.close(); + const dispatcher = new Dispatcher(messenger, sessionId); + const connection = new ConcreteConnection(dispatcher, localMethods); + resolve(connection); + }); + }); +} + +const acceptableMessageEvent = (event, remoteWindow, acceptedOrigin) => { + const { source, origin } = event; + if (source !== remoteWindow) { + return false; + } + if (origin !== acceptedOrigin && acceptedOrigin !== '*') { + return false; + } + return true; +}; +/** + * A concrete implementation of {@link Messenger} used to communicate with another Window. + * + * @public + * + */ +class WindowMessenger { + constructor({ localWindow, remoteWindow, remoteOrigin, }) { + localWindow = localWindow || window; + this.postMessage = (message, transfer) => { + remoteWindow.postMessage(message, remoteOrigin, transfer); + }; + this.addMessageListener = (listener) => { + const outerListener = (event) => { + if (acceptableMessageEvent(event, remoteWindow, remoteOrigin)) { + listener(event); + } + }; + localWindow.addEventListener('message', outerListener); + const removeListener = () => { + localWindow.removeEventListener('message', outerListener); + }; + return removeListener; + }; + } +} +/** @public */ +class BareMessenger { + constructor(postable) { + this.postMessage = (message, transfer = []) => { + postable.postMessage(message, transfer); + }; + this.addMessageListener = (listener) => { + const outerListener = (event) => { + listener(event); + }; + postable.addEventListener('message', outerListener); + const removeListener = () => { + postable.removeEventListener('message', outerListener); + }; + return removeListener; + }; + } +} +/** + * A concrete implementation of {@link Messenger} used to communicate with a Worker. + * + * Takes a {@link Postable} representing the `Worker` (when calling from + * the parent context) or the `self` `DedicatedWorkerGlobalScope` object + * (when calling from the child context). + * + * @public + * + */ +class WorkerMessenger extends BareMessenger { + constructor({ worker }) { + super(worker); + } +} +/** + * A concrete implementation of {@link Messenger} used to communicate with a MessagePort. + * + * @public + * + */ +class PortMessenger extends BareMessenger { + constructor({ port }) { + port.start(); + super(port); + } +} +/** + * Create a logger function with a specific namespace + * + * @param namespace - The namespace will be prepended to all the arguments passed to the logger function + * @param log - The underlying logger (`console.log` by default) + * + * @public + * + */ +function debug(namespace, log) { + log = log || console.debug || console.log || (() => { }); + return (...data) => { + log(namespace, ...data); + }; +} +/** + * Decorate a {@link Messenger} so that it will log any message exchanged + * @param messenger - The Messenger that will be decorated + * @param log - The logger function that will receive each message + * @returns A decorated Messenger + * + * @public + * + */ +function DebugMessenger(messenger, log) { + log = log || debug('post-me'); + const debugListener = function (event) { + const { data } = event; + log('⬅️ received message', data); + }; + messenger.addMessageListener(debugListener); + return { + postMessage: function (message, transfer) { + log('➡️ sending message', message); + messenger.postMessage(message, transfer); + }, + addMessageListener: function (listener) { + return messenger.addMessageListener(listener); + }, + }; +} + +export { BareMessenger, ChildHandshake, ConcreteEmitter, DebugMessenger, ParentHandshake, PortMessenger, WindowMessenger, WorkerMessenger, debug }; diff --git a/node_modules/post-me/dist/index.js b/node_modules/post-me/dist/index.js new file mode 100644 index 0000000..a0c1a5d --- /dev/null +++ b/node_modules/post-me/dist/index.js @@ -0,0 +1,984 @@ +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define("PostMe", ["exports"], factory); + } else if (typeof exports !== "undefined") { + factory(exports); + } else { + var mod = { + exports: {} + }; + factory(mod.exports); + global.PostMe = mod.exports; + } +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.ChildHandshake = ChildHandshake; + _exports.DebugMessenger = DebugMessenger; + _exports.ParentHandshake = ParentHandshake; + _exports.debug = debug; + _exports.WorkerMessenger = _exports.WindowMessenger = _exports.PortMessenger = _exports.ConcreteEmitter = _exports.BareMessenger = void 0; + + function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + + function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + + function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + + function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + + function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + + function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + + function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + + function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + + function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + + var MARKER = '@post-me'; + + function createUniqueIdFn() { + var __id = 0; + return function () { + var id = __id; + __id += 1; + return id; + }; + } + /** + * A concrete implementation of the {@link Emitter} interface + * + * @public + */ + + + var ConcreteEmitter = /*#__PURE__*/function () { + function ConcreteEmitter() { + _classCallCheck(this, ConcreteEmitter); + + this._listeners = {}; + } + /** {@inheritDoc Emitter.addEventListener} */ + + + _createClass(ConcreteEmitter, [{ + key: "addEventListener", + value: function addEventListener(eventName, listener) { + var listeners = this._listeners[eventName]; + + if (!listeners) { + listeners = new Set(); + this._listeners[eventName] = listeners; + } + + listeners.add(listener); + } + /** {@inheritDoc Emitter.removeEventListener} */ + + }, { + key: "removeEventListener", + value: function removeEventListener(eventName, listener) { + var listeners = this._listeners[eventName]; + + if (!listeners) { + return; + } + + listeners["delete"](listener); + } + /** {@inheritDoc Emitter.once} */ + + }, { + key: "once", + value: function once(eventName) { + var _this = this; + + return new Promise(function (resolve) { + var listener = function listener(data) { + _this.removeEventListener(eventName, listener); + + resolve(data); + }; + + _this.addEventListener(eventName, listener); + }); + } + /** @internal */ + + }, { + key: "emit", + value: function emit(eventName, data) { + var listeners = this._listeners[eventName]; + + if (!listeners) { + return; + } + + listeners.forEach(function (listener) { + listener(data); + }); + } + /** @internal */ + + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + Object.values(this._listeners).forEach(function (listeners) { + if (listeners) { + listeners.clear(); + } + }); + } + }]); + + return ConcreteEmitter; + }(); + + _exports.ConcreteEmitter = ConcreteEmitter; + var MessageType; + + (function (MessageType) { + MessageType["HandshakeRequest"] = "handshake-request"; + MessageType["HandshakeResponse"] = "handshake-response"; + MessageType["Call"] = "call"; + MessageType["Response"] = "response"; + MessageType["Error"] = "error"; + MessageType["Event"] = "event"; + MessageType["Callback"] = "callback"; + })(MessageType || (MessageType = {})); // Message Creators + + + function createHandshakeRequestMessage(sessionId) { + return { + type: MARKER, + action: MessageType.HandshakeRequest, + sessionId: sessionId + }; + } + + function createHandshakeResponseMessage(sessionId) { + return { + type: MARKER, + action: MessageType.HandshakeResponse, + sessionId: sessionId + }; + } + + function createCallMessage(sessionId, requestId, methodName, args) { + return { + type: MARKER, + action: MessageType.Call, + sessionId: sessionId, + requestId: requestId, + methodName: methodName, + args: args + }; + } + + function createResponsMessage(sessionId, requestId, result, error) { + var message = { + type: MARKER, + action: MessageType.Response, + sessionId: sessionId, + requestId: requestId + }; + + if (result !== undefined) { + message.result = result; + } + + if (error !== undefined) { + message.error = error; + } + + return message; + } + + function createCallbackMessage(sessionId, requestId, callbackId, args) { + return { + type: MARKER, + action: MessageType.Callback, + sessionId: sessionId, + requestId: requestId, + callbackId: callbackId, + args: args + }; + } + + function createEventMessage(sessionId, eventName, payload) { + return { + type: MARKER, + action: MessageType.Event, + sessionId: sessionId, + eventName: eventName, + payload: payload + }; + } // Type Guards + + + function isMessage(m) { + return m && m.type === MARKER; + } + + function isHandshakeRequestMessage(m) { + return isMessage(m) && m.action === MessageType.HandshakeRequest; + } + + function isHandshakeResponseMessage(m) { + return isMessage(m) && m.action === MessageType.HandshakeResponse; + } + + function isCallMessage(m) { + return isMessage(m) && m.action === MessageType.Call; + } + + function isResponseMessage(m) { + return isMessage(m) && m.action === MessageType.Response; + } + + function isCallbackMessage(m) { + return isMessage(m) && m.action === MessageType.Callback; + } + + function isEventMessage(m) { + return isMessage(m) && m.action === MessageType.Event; + } + + function makeCallbackEvent(requestId) { + return "callback_".concat(requestId); + } + + function makeResponseEvent(requestId) { + return "response_".concat(requestId); + } + + var Dispatcher = /*#__PURE__*/function (_ConcreteEmitter) { + _inherits(Dispatcher, _ConcreteEmitter); + + var _super = _createSuper(Dispatcher); + + function Dispatcher(messenger, sessionId) { + var _this2; + + _classCallCheck(this, Dispatcher); + + _this2 = _super.call(this); + _this2.uniqueId = createUniqueIdFn(); + _this2.messenger = messenger; + _this2.sessionId = sessionId; + _this2.removeMessengerListener = _this2.messenger.addMessageListener(_this2.messengerListener.bind(_assertThisInitialized(_this2))); + return _this2; + } + + _createClass(Dispatcher, [{ + key: "messengerListener", + value: function messengerListener(event) { + var data = event.data; + + if (!isMessage(data)) { + return; + } + + if (this.sessionId !== data.sessionId) { + return; + } + + if (isCallMessage(data)) { + this.emit(MessageType.Call, data); + } else if (isResponseMessage(data)) { + this.emit(makeResponseEvent(data.requestId), data); + } else if (isEventMessage(data)) { + this.emit(MessageType.Event, data); + } else if (isCallbackMessage(data)) { + this.emit(makeCallbackEvent(data.requestId), data); + } + } + }, { + key: "callOnRemote", + value: function callOnRemote(methodName, args, transfer) { + var requestId = this.uniqueId(); + var callbackEvent = makeCallbackEvent(requestId); + var responseEvent = makeResponseEvent(requestId); + var message = createCallMessage(this.sessionId, requestId, methodName, args); + this.messenger.postMessage(message, transfer); + return { + callbackEvent: callbackEvent, + responseEvent: responseEvent + }; + } + }, { + key: "respondToRemote", + value: function respondToRemote(requestId, value, error, transfer) { + if (error instanceof Error) { + error = { + name: error.name, + message: error.message + }; + } + + var message = createResponsMessage(this.sessionId, requestId, value, error); + this.messenger.postMessage(message, transfer); + } + }, { + key: "callbackToRemote", + value: function callbackToRemote(requestId, callbackId, args) { + var message = createCallbackMessage(this.sessionId, requestId, callbackId, args); + this.messenger.postMessage(message); + } + }, { + key: "emitToRemote", + value: function emitToRemote(eventName, payload, transfer) { + var message = createEventMessage(this.sessionId, eventName, payload); + this.messenger.postMessage(message, transfer); + } + }, { + key: "close", + value: function close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } + }]); + + return Dispatcher; + }(ConcreteEmitter); + + var ParentHandshakeDispatcher = /*#__PURE__*/function (_ConcreteEmitter2) { + _inherits(ParentHandshakeDispatcher, _ConcreteEmitter2); + + var _super2 = _createSuper(ParentHandshakeDispatcher); + + function ParentHandshakeDispatcher(messenger, sessionId) { + var _this3; + + _classCallCheck(this, ParentHandshakeDispatcher); + + _this3 = _super2.call(this); + _this3.messenger = messenger; + _this3.sessionId = sessionId; + _this3.removeMessengerListener = _this3.messenger.addMessageListener(_this3.messengerListener.bind(_assertThisInitialized(_this3))); + return _this3; + } + + _createClass(ParentHandshakeDispatcher, [{ + key: "messengerListener", + value: function messengerListener(event) { + var data = event.data; + + if (!isMessage(data)) { + return; + } + + if (this.sessionId !== data.sessionId) { + return; + } + + if (isHandshakeResponseMessage(data)) { + this.emit(data.sessionId, data); + } + } + }, { + key: "initiateHandshake", + value: function initiateHandshake() { + var message = createHandshakeRequestMessage(this.sessionId); + this.messenger.postMessage(message); + return this.sessionId; + } + }, { + key: "close", + value: function close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } + }]); + + return ParentHandshakeDispatcher; + }(ConcreteEmitter); + + var ChildHandshakeDispatcher = /*#__PURE__*/function (_ConcreteEmitter3) { + _inherits(ChildHandshakeDispatcher, _ConcreteEmitter3); + + var _super3 = _createSuper(ChildHandshakeDispatcher); + + function ChildHandshakeDispatcher(messenger) { + var _this4; + + _classCallCheck(this, ChildHandshakeDispatcher); + + _this4 = _super3.call(this); + _this4.messenger = messenger; + _this4.removeMessengerListener = _this4.messenger.addMessageListener(_this4.messengerListener.bind(_assertThisInitialized(_this4))); + return _this4; + } + + _createClass(ChildHandshakeDispatcher, [{ + key: "messengerListener", + value: function messengerListener(event) { + var data = event.data; + + if (isHandshakeRequestMessage(data)) { + this.emit(MessageType.HandshakeRequest, data); + } + } + }, { + key: "acceptHandshake", + value: function acceptHandshake(sessionId) { + var message = createHandshakeResponseMessage(sessionId); + this.messenger.postMessage(message); + } + }, { + key: "close", + value: function close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } + }]); + + return ChildHandshakeDispatcher; + }(ConcreteEmitter); + + var ProxyType; + + (function (ProxyType) { + ProxyType["Callback"] = "callback"; + })(ProxyType || (ProxyType = {})); + + function createCallbackProxy(callbackId) { + return { + type: MARKER, + proxy: ProxyType.Callback, + callbackId: callbackId + }; + } + + function isCallbackProxy(p) { + return p && p.type === MARKER && p.proxy === ProxyType.Callback; + } + + var ConcreteRemoteHandle = /*#__PURE__*/function (_ConcreteEmitter4) { + _inherits(ConcreteRemoteHandle, _ConcreteEmitter4); + + var _super4 = _createSuper(ConcreteRemoteHandle); + + function ConcreteRemoteHandle(dispatcher) { + var _this5; + + _classCallCheck(this, ConcreteRemoteHandle); + + _this5 = _super4.call(this); + _this5._dispatcher = dispatcher; + _this5._callTransfer = {}; + + _this5._dispatcher.addEventListener(MessageType.Event, _this5._handleEvent.bind(_assertThisInitialized(_this5))); + + return _this5; + } + + _createClass(ConcreteRemoteHandle, [{ + key: "close", + value: function close() { + this.removeAllListeners(); + } + }, { + key: "setCallTransfer", + value: function setCallTransfer(methodName, transfer) { + this._callTransfer[methodName] = transfer; + } + }, { + key: "call", + value: function call(methodName) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return this.customCall(methodName, args); + } + }, { + key: "customCall", + value: function customCall(methodName, args) { + var _this6 = this; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return new Promise(function (resolve, reject) { + var sanitizedArgs = []; + var callbacks = []; + var callbackId = 0; + args.forEach(function (arg) { + if (typeof arg === 'function') { + callbacks.push(arg); + sanitizedArgs.push(createCallbackProxy(callbackId)); + callbackId += 1; + } else { + sanitizedArgs.push(arg); + } + }); + var hasCallbacks = callbacks.length > 0; + var callbackListener = undefined; + + if (hasCallbacks) { + callbackListener = function callbackListener(data) { + var callbackId = data.callbackId, + args = data.args; + callbacks[callbackId].apply(callbacks, _toConsumableArray(args)); + }; + } + + var transfer = options.transfer; + + if (transfer === undefined && _this6._callTransfer[methodName]) { + var _this6$_callTransfer; + + transfer = (_this6$_callTransfer = _this6._callTransfer)[methodName].apply(_this6$_callTransfer, sanitizedArgs); + } + + var _this6$_dispatcher$ca = _this6._dispatcher.callOnRemote(methodName, sanitizedArgs, transfer), + callbackEvent = _this6$_dispatcher$ca.callbackEvent, + responseEvent = _this6$_dispatcher$ca.responseEvent; + + if (hasCallbacks) { + _this6._dispatcher.addEventListener(callbackEvent, callbackListener); + } + + _this6._dispatcher.once(responseEvent).then(function (response) { + if (callbackListener) { + _this6._dispatcher.removeEventListener(callbackEvent, callbackListener); + } + + var result = response.result, + error = response.error; + + if (error !== undefined) { + reject(error); + } else { + resolve(result); + } + }); + }); + } + }, { + key: "_handleEvent", + value: function _handleEvent(data) { + var eventName = data.eventName, + payload = data.payload; + this.emit(eventName, payload); + } + }]); + + return ConcreteRemoteHandle; + }(ConcreteEmitter); + + var ConcreteLocalHandle = /*#__PURE__*/function () { + function ConcreteLocalHandle(dispatcher, localMethods) { + _classCallCheck(this, ConcreteLocalHandle); + + this._dispatcher = dispatcher; + this._methods = localMethods; + this._returnTransfer = {}; + this._emitTransfer = {}; + + this._dispatcher.addEventListener(MessageType.Call, this._handleCall.bind(this)); + } + + _createClass(ConcreteLocalHandle, [{ + key: "emit", + value: function emit(eventName, payload) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var transfer = options.transfer; + + if (transfer === undefined && this._emitTransfer[eventName]) { + transfer = this._emitTransfer[eventName](payload); + } + + this._dispatcher.emitToRemote(eventName, payload, transfer); + } + }, { + key: "setMethods", + value: function setMethods(methods) { + this._methods = methods; + } + }, { + key: "setMethod", + value: function setMethod(methodName, method) { + this._methods[methodName] = method; + } + }, { + key: "setReturnTransfer", + value: function setReturnTransfer(methodName, transfer) { + this._returnTransfer[methodName] = transfer; + } + }, { + key: "setEmitTransfer", + value: function setEmitTransfer(eventName, transfer) { + this._emitTransfer[eventName] = transfer; + } + }, { + key: "_handleCall", + value: function _handleCall(data) { + var _this7 = this; + + var requestId = data.requestId, + methodName = data.methodName, + args = data.args; + var callMethod = new Promise(function (resolve, reject) { + var _this7$_methods; + + var method = _this7._methods[methodName]; + + if (typeof method !== 'function') { + reject(new Error("The method \"".concat(methodName, "\" has not been implemented."))); + return; + } + + var desanitizedArgs = args.map(function (arg) { + if (isCallbackProxy(arg)) { + var callbackId = arg.callbackId; + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this7._dispatcher.callbackToRemote(requestId, callbackId, args); + }; + } else { + return arg; + } + }); + Promise.resolve((_this7$_methods = _this7._methods)[methodName].apply(_this7$_methods, _toConsumableArray(desanitizedArgs))).then(resolve)["catch"](reject); + }); + callMethod.then(function (result) { + var transfer; + + if (_this7._returnTransfer[methodName]) { + transfer = _this7._returnTransfer[methodName](result); + } + + _this7._dispatcher.respondToRemote(requestId, result, undefined, transfer); + })["catch"](function (error) { + _this7._dispatcher.respondToRemote(requestId, undefined, error); + }); + } + }]); + + return ConcreteLocalHandle; + }(); + + var ConcreteConnection = /*#__PURE__*/function () { + function ConcreteConnection(dispatcher, localMethods) { + _classCallCheck(this, ConcreteConnection); + + this._dispatcher = dispatcher; + this._localHandle = new ConcreteLocalHandle(dispatcher, localMethods); + this._remoteHandle = new ConcreteRemoteHandle(dispatcher); + } + + _createClass(ConcreteConnection, [{ + key: "close", + value: function close() { + this._dispatcher.close(); + + this.remoteHandle().close(); + } + }, { + key: "localHandle", + value: function localHandle() { + return this._localHandle; + } + }, { + key: "remoteHandle", + value: function remoteHandle() { + return this._remoteHandle; + } + }]); + + return ConcreteConnection; + }(); + + var uniqueSessionId = createUniqueIdFn(); + + var runUntil = function runUntil(worker, condition, unfulfilled, maxAttempts, attemptInterval) { + var attempt = 0; + + var fn = function fn() { + if (!condition() && (attempt < maxAttempts || maxAttempts < 1)) { + worker(); + attempt += 1; + setTimeout(fn, attemptInterval); + } else if (!condition() && attempt >= maxAttempts && maxAttempts >= 1) { + unfulfilled(); + } + }; + + fn(); + }; + /** + * Initiate the handshake from the Parent side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @param maxAttempts - The maximum number of handshake attempts + * @param attemptsInterval - The interval between handshake attempts + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ + + + function ParentHandshake(messenger) { + var localMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var maxAttempts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5; + var attemptsInterval = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100; + var thisSessionId = uniqueSessionId(); + var connected = false; + return new Promise(function (resolve, reject) { + var handshakeDispatcher = new ParentHandshakeDispatcher(messenger, thisSessionId); + handshakeDispatcher.once(thisSessionId).then(function (response) { + connected = true; + handshakeDispatcher.close(); + var sessionId = response.sessionId; + var dispatcher = new Dispatcher(messenger, sessionId); + var connection = new ConcreteConnection(dispatcher, localMethods); + resolve(connection); + }); + runUntil(function () { + return handshakeDispatcher.initiateHandshake(); + }, function () { + return connected; + }, function () { + return reject(new Error("Handshake failed, reached maximum number of attempts")); + }, maxAttempts, attemptsInterval); + }); + } + /** + * Initiate the handshake from the Child side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ + + + function ChildHandshake(messenger) { + var localMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return new Promise(function (resolve, reject) { + var handshakeDispatcher = new ChildHandshakeDispatcher(messenger); + handshakeDispatcher.once(MessageType.HandshakeRequest).then(function (response) { + var sessionId = response.sessionId; + handshakeDispatcher.acceptHandshake(sessionId); + handshakeDispatcher.close(); + var dispatcher = new Dispatcher(messenger, sessionId); + var connection = new ConcreteConnection(dispatcher, localMethods); + resolve(connection); + }); + }); + } + + var acceptableMessageEvent = function acceptableMessageEvent(event, remoteWindow, acceptedOrigin) { + var source = event.source, + origin = event.origin; + + if (source !== remoteWindow) { + return false; + } + + if (origin !== acceptedOrigin && acceptedOrigin !== '*') { + return false; + } + + return true; + }; + /** + * A concrete implementation of {@link Messenger} used to communicate with another Window. + * + * @public + * + */ + + + var WindowMessenger = function WindowMessenger(_ref) { + var localWindow = _ref.localWindow, + remoteWindow = _ref.remoteWindow, + remoteOrigin = _ref.remoteOrigin; + + _classCallCheck(this, WindowMessenger); + + localWindow = localWindow || window; + + this.postMessage = function (message, transfer) { + remoteWindow.postMessage(message, remoteOrigin, transfer); + }; + + this.addMessageListener = function (listener) { + var outerListener = function outerListener(event) { + if (acceptableMessageEvent(event, remoteWindow, remoteOrigin)) { + listener(event); + } + }; + + localWindow.addEventListener('message', outerListener); + + var removeListener = function removeListener() { + localWindow.removeEventListener('message', outerListener); + }; + + return removeListener; + }; + }; + /** @public */ + + + _exports.WindowMessenger = WindowMessenger; + + var BareMessenger = function BareMessenger(postable) { + _classCallCheck(this, BareMessenger); + + this.postMessage = function (message) { + var transfer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + postable.postMessage(message, transfer); + }; + + this.addMessageListener = function (listener) { + var outerListener = function outerListener(event) { + listener(event); + }; + + postable.addEventListener('message', outerListener); + + var removeListener = function removeListener() { + postable.removeEventListener('message', outerListener); + }; + + return removeListener; + }; + }; + /** + * A concrete implementation of {@link Messenger} used to communicate with a Worker. + * + * Takes a {@link Postable} representing the `Worker` (when calling from + * the parent context) or the `self` `DedicatedWorkerGlobalScope` object + * (when calling from the child context). + * + * @public + * + */ + + + _exports.BareMessenger = BareMessenger; + + var WorkerMessenger = /*#__PURE__*/function (_BareMessenger) { + _inherits(WorkerMessenger, _BareMessenger); + + var _super5 = _createSuper(WorkerMessenger); + + function WorkerMessenger(_ref2) { + var worker = _ref2.worker; + + _classCallCheck(this, WorkerMessenger); + + return _super5.call(this, worker); + } + + return WorkerMessenger; + }(BareMessenger); + /** + * A concrete implementation of {@link Messenger} used to communicate with a MessagePort. + * + * @public + * + */ + + + _exports.WorkerMessenger = WorkerMessenger; + + var PortMessenger = /*#__PURE__*/function (_BareMessenger2) { + _inherits(PortMessenger, _BareMessenger2); + + var _super6 = _createSuper(PortMessenger); + + function PortMessenger(_ref3) { + var port = _ref3.port; + + _classCallCheck(this, PortMessenger); + + port.start(); + return _super6.call(this, port); + } + + return PortMessenger; + }(BareMessenger); + /** + * Create a logger function with a specific namespace + * + * @param namespace - The namespace will be prepended to all the arguments passed to the logger function + * @param log - The underlying logger (`console.log` by default) + * + * @public + * + */ + + + _exports.PortMessenger = PortMessenger; + + function debug(namespace, log) { + log = log || console.debug || console.log || function () {}; + + return function () { + for (var _len3 = arguments.length, data = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + data[_key3] = arguments[_key3]; + } + + log.apply(void 0, [namespace].concat(data)); + }; + } + /** + * Decorate a {@link Messenger} so that it will log any message exchanged + * @param messenger - The Messenger that will be decorated + * @param log - The logger function that will receive each message + * @returns A decorated Messenger + * + * @public + * + */ + + + function DebugMessenger(messenger, log) { + log = log || debug('post-me'); + + var debugListener = function debugListener(event) { + var data = event.data; + log('⬅️ received message', data); + }; + + messenger.addMessageListener(debugListener); + return { + postMessage: function postMessage(message, transfer) { + log('➡️ sending message', message); + messenger.postMessage(message, transfer); + }, + addMessageListener: function addMessageListener(listener) { + return messenger.addMessageListener(listener); + } + }; + } +}); diff --git a/node_modules/post-me/dist/index.min.js b/node_modules/post-me/dist/index.min.js new file mode 100644 index 0000000..a586985 --- /dev/null +++ b/node_modules/post-me/dist/index.min.js @@ -0,0 +1 @@ +function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}(function(global,factory){if(typeof define==="function"&&define.amd){define("PostMe",["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{var mod={exports:{}};factory(mod.exports);global.PostMe=mod.exports}})(typeof globalThis!=="undefined"?globalThis:typeof self!=="undefined"?self:this,function(_exports){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.ChildHandshake=ChildHandshake;_exports.DebugMessenger=DebugMessenger;_exports.ParentHandshake=ParentHandshake;_exports.debug=debug;_exports.WorkerMessenger=_exports.WindowMessenger=_exports.PortMessenger=_exports.ConcreteEmitter=_exports.BareMessenger=void 0;function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return this.customCall(methodName,args)}},{key:"customCall",value:function customCall(methodName,args){var _this6=this;var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return new Promise(function(resolve,reject){var sanitizedArgs=[];var callbacks=[];var callbackId=0;args.forEach(function(arg){if(typeof arg==="function"){callbacks.push(arg);sanitizedArgs.push(createCallbackProxy(callbackId));callbackId+=1}else{sanitizedArgs.push(arg)}});var hasCallbacks=callbacks.length>0;var callbackListener=undefined;if(hasCallbacks){callbackListener=function callbackListener(data){var callbackId=data.callbackId,args=data.args;callbacks[callbackId].apply(callbacks,_toConsumableArray(args))}}var transfer=options.transfer;if(transfer===undefined&&_this6._callTransfer[methodName]){var _this6$_callTransfer;transfer=(_this6$_callTransfer=_this6._callTransfer)[methodName].apply(_this6$_callTransfer,sanitizedArgs)}var _this6$_dispatcher$ca=_this6._dispatcher.callOnRemote(methodName,sanitizedArgs,transfer),callbackEvent=_this6$_dispatcher$ca.callbackEvent,responseEvent=_this6$_dispatcher$ca.responseEvent;if(hasCallbacks){_this6._dispatcher.addEventListener(callbackEvent,callbackListener)}_this6._dispatcher.once(responseEvent).then(function(response){if(callbackListener){_this6._dispatcher.removeEventListener(callbackEvent,callbackListener)}var result=response.result,error=response.error;if(error!==undefined){reject(error)}else{resolve(result)}})})}},{key:"_handleEvent",value:function _handleEvent(data){var eventName=data.eventName,payload=data.payload;this.emit(eventName,payload)}}]);return ConcreteRemoteHandle}(ConcreteEmitter);var ConcreteLocalHandle=function(){function ConcreteLocalHandle(dispatcher,localMethods){_classCallCheck(this,ConcreteLocalHandle);this._dispatcher=dispatcher;this._methods=localMethods;this._returnTransfer={};this._emitTransfer={};this._dispatcher.addEventListener(MessageType.Call,this._handleCall.bind(this))}_createClass(ConcreteLocalHandle,[{key:"emit",value:function emit(eventName,payload){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var transfer=options.transfer;if(transfer===undefined&&this._emitTransfer[eventName]){transfer=this._emitTransfer[eventName](payload)}this._dispatcher.emitToRemote(eventName,payload,transfer)}},{key:"setMethods",value:function setMethods(methods){this._methods=methods}},{key:"setMethod",value:function setMethod(methodName,method){this._methods[methodName]=method}},{key:"setReturnTransfer",value:function setReturnTransfer(methodName,transfer){this._returnTransfer[methodName]=transfer}},{key:"setEmitTransfer",value:function setEmitTransfer(eventName,transfer){this._emitTransfer[eventName]=transfer}},{key:"_handleCall",value:function _handleCall(data){var _this7=this;var requestId=data.requestId,methodName=data.methodName,args=data.args;var callMethod=new Promise(function(resolve,reject){var method=_this7._methods[methodName];if(typeof method!=="function"){reject(new Error('The method "'.concat(methodName,'" has not been implemented.')));return}var desanitizedArgs=args.map(function(arg){if(isCallbackProxy(arg)){var callbackId=arg.callbackId;return function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}_this7._dispatcher.callbackToRemote(requestId,callbackId,args)}}else{return arg}});Promise.resolve(method.apply(void 0,_toConsumableArray(desanitizedArgs))).then(resolve)["catch"](reject)});callMethod.then(function(result){var transfer;if(_this7._returnTransfer[methodName]){transfer=_this7._returnTransfer[methodName](result)}_this7._dispatcher.respondToRemote(requestId,result,undefined,transfer)})["catch"](function(error){_this7._dispatcher.respondToRemote(requestId,undefined,error)})}}]);return ConcreteLocalHandle}();var ConcreteConnection=function(){function ConcreteConnection(dispatcher,localMethods){_classCallCheck(this,ConcreteConnection);this._dispatcher=dispatcher;this._localHandle=new ConcreteLocalHandle(dispatcher,localMethods);this._remoteHandle=new ConcreteRemoteHandle(dispatcher)}_createClass(ConcreteConnection,[{key:"close",value:function close(){this._dispatcher.close();this.remoteHandle().close()}},{key:"localHandle",value:function localHandle(){return this._localHandle}},{key:"remoteHandle",value:function remoteHandle(){return this._remoteHandle}}]);return ConcreteConnection}();var uniqueSessionId=createUniqueIdFn();var runUntil=function runUntil(worker,condition,unfulfilled,maxAttempts,attemptInterval){var attempt=0;var fn=function fn(){if(!condition()&&(attempt=maxAttempts&&maxAttempts>=1){unfulfilled()}};fn()};function ParentHandshake(messenger){var localMethods=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var maxAttempts=arguments.length>2&&arguments[2]!==undefined?arguments[2]:5;var attemptsInterval=arguments.length>3&&arguments[3]!==undefined?arguments[3]:100;var thisSessionId=uniqueSessionId();var connected=false;return new Promise(function(resolve,reject){var handshakeDispatcher=new ParentHandshakeDispatcher(messenger,thisSessionId);handshakeDispatcher.once(thisSessionId).then(function(response){connected=true;handshakeDispatcher.close();var sessionId=response.sessionId;var dispatcher=new Dispatcher(messenger,sessionId);var connection=new ConcreteConnection(dispatcher,localMethods);resolve(connection)});runUntil(function(){return handshakeDispatcher.initiateHandshake()},function(){return connected},function(){return reject(new Error("Handshake failed, reached maximum number of attempts"))},maxAttempts,attemptsInterval)})}function ChildHandshake(messenger){var localMethods=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(resolve,reject){var handshakeDispatcher=new ChildHandshakeDispatcher(messenger);handshakeDispatcher.once(MessageType.HandshakeRequest).then(function(response){var sessionId=response.sessionId;handshakeDispatcher.acceptHandshake(sessionId);handshakeDispatcher.close();var dispatcher=new Dispatcher(messenger,sessionId);var connection=new ConcreteConnection(dispatcher,localMethods);resolve(connection)})})}var acceptableMessageEvent=function acceptableMessageEvent(event,remoteWindow,acceptedOrigin){var source=event.source,origin=event.origin;if(source!==remoteWindow){return false}if(origin!==acceptedOrigin&&acceptedOrigin!=="*"){return false}return true};var WindowMessenger=function WindowMessenger(_ref){var localWindow=_ref.localWindow,remoteWindow=_ref.remoteWindow,remoteOrigin=_ref.remoteOrigin;_classCallCheck(this,WindowMessenger);localWindow=localWindow||window;this.postMessage=function(message,transfer){remoteWindow.postMessage(message,remoteOrigin,transfer)};this.addMessageListener=function(listener){var outerListener=function outerListener(event){if(acceptableMessageEvent(event,remoteWindow,remoteOrigin)){listener(event)}};localWindow.addEventListener("message",outerListener);var removeListener=function removeListener(){localWindow.removeEventListener("message",outerListener)};return removeListener}};_exports.WindowMessenger=WindowMessenger;var BareMessenger=function BareMessenger(postable){_classCallCheck(this,BareMessenger);this.postMessage=function(message){var transfer=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];postable.postMessage(message,transfer)};this.addMessageListener=function(listener){var outerListener=function outerListener(event){listener(event)};postable.addEventListener("message",outerListener);var removeListener=function removeListener(){postable.removeEventListener("message",outerListener)};return removeListener}};_exports.BareMessenger=BareMessenger;var WorkerMessenger=function(_BareMessenger){_inherits(WorkerMessenger,_BareMessenger);var _super5=_createSuper(WorkerMessenger);function WorkerMessenger(_ref2){var worker=_ref2.worker;_classCallCheck(this,WorkerMessenger);return _super5.call(this,worker)}return WorkerMessenger}(BareMessenger);_exports.WorkerMessenger=WorkerMessenger;var PortMessenger=function(_BareMessenger2){_inherits(PortMessenger,_BareMessenger2);var _super6=_createSuper(PortMessenger);function PortMessenger(_ref3){var port=_ref3.port;_classCallCheck(this,PortMessenger);port.start();return _super6.call(this,port)}return PortMessenger}(BareMessenger);_exports.PortMessenger=PortMessenger;function debug(namespace,log){log=log||console.debug||console.log||function(){};return function(){for(var _len3=arguments.length,data=new Array(_len3),_key3=0;_key3<_len3;_key3++){data[_key3]=arguments[_key3]}log.apply(void 0,[namespace].concat(data))}}function DebugMessenger(messenger,log){log=log||debug("post-me");var debugListener=function debugListener(event){var data=event.data;log("⬅️ received message",data)};messenger.addMessageListener(debugListener);return{postMessage:function postMessage(message,transfer){log("➡️ sending message",message);messenger.postMessage(message,transfer)},addMessageListener:function addMessageListener(listener){return messenger.addMessageListener(listener)}}}}); \ No newline at end of file diff --git a/node_modules/post-me/dist/index.mjs b/node_modules/post-me/dist/index.mjs new file mode 100644 index 0000000..338be2b --- /dev/null +++ b/node_modules/post-me/dist/index.mjs @@ -0,0 +1,952 @@ +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var MARKER = '@post-me'; + +function createUniqueIdFn() { + var __id = 0; + return function () { + var id = __id; + __id += 1; + return id; + }; +} +/** + * A concrete implementation of the {@link Emitter} interface + * + * @public + */ + + +var ConcreteEmitter = /*#__PURE__*/function () { + function ConcreteEmitter() { + _classCallCheck(this, ConcreteEmitter); + + this._listeners = {}; + } + /** {@inheritDoc Emitter.addEventListener} */ + + + _createClass(ConcreteEmitter, [{ + key: "addEventListener", + value: function addEventListener(eventName, listener) { + var listeners = this._listeners[eventName]; + + if (!listeners) { + listeners = new Set(); + this._listeners[eventName] = listeners; + } + + listeners.add(listener); + } + /** {@inheritDoc Emitter.removeEventListener} */ + + }, { + key: "removeEventListener", + value: function removeEventListener(eventName, listener) { + var listeners = this._listeners[eventName]; + + if (!listeners) { + return; + } + + listeners["delete"](listener); + } + /** {@inheritDoc Emitter.once} */ + + }, { + key: "once", + value: function once(eventName) { + var _this = this; + + return new Promise(function (resolve) { + var listener = function listener(data) { + _this.removeEventListener(eventName, listener); + + resolve(data); + }; + + _this.addEventListener(eventName, listener); + }); + } + /** @internal */ + + }, { + key: "emit", + value: function emit(eventName, data) { + var listeners = this._listeners[eventName]; + + if (!listeners) { + return; + } + + listeners.forEach(function (listener) { + listener(data); + }); + } + /** @internal */ + + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + Object.values(this._listeners).forEach(function (listeners) { + if (listeners) { + listeners.clear(); + } + }); + } + }]); + + return ConcreteEmitter; +}(); + +var MessageType; + +(function (MessageType) { + MessageType["HandshakeRequest"] = "handshake-request"; + MessageType["HandshakeResponse"] = "handshake-response"; + MessageType["Call"] = "call"; + MessageType["Response"] = "response"; + MessageType["Error"] = "error"; + MessageType["Event"] = "event"; + MessageType["Callback"] = "callback"; +})(MessageType || (MessageType = {})); // Message Creators + + +function createHandshakeRequestMessage(sessionId) { + return { + type: MARKER, + action: MessageType.HandshakeRequest, + sessionId: sessionId + }; +} + +function createHandshakeResponseMessage(sessionId) { + return { + type: MARKER, + action: MessageType.HandshakeResponse, + sessionId: sessionId + }; +} + +function createCallMessage(sessionId, requestId, methodName, args) { + return { + type: MARKER, + action: MessageType.Call, + sessionId: sessionId, + requestId: requestId, + methodName: methodName, + args: args + }; +} + +function createResponsMessage(sessionId, requestId, result, error) { + var message = { + type: MARKER, + action: MessageType.Response, + sessionId: sessionId, + requestId: requestId + }; + + if (result !== undefined) { + message.result = result; + } + + if (error !== undefined) { + message.error = error; + } + + return message; +} + +function createCallbackMessage(sessionId, requestId, callbackId, args) { + return { + type: MARKER, + action: MessageType.Callback, + sessionId: sessionId, + requestId: requestId, + callbackId: callbackId, + args: args + }; +} + +function createEventMessage(sessionId, eventName, payload) { + return { + type: MARKER, + action: MessageType.Event, + sessionId: sessionId, + eventName: eventName, + payload: payload + }; +} // Type Guards + + +function isMessage(m) { + return m && m.type === MARKER; +} + +function isHandshakeRequestMessage(m) { + return isMessage(m) && m.action === MessageType.HandshakeRequest; +} + +function isHandshakeResponseMessage(m) { + return isMessage(m) && m.action === MessageType.HandshakeResponse; +} + +function isCallMessage(m) { + return isMessage(m) && m.action === MessageType.Call; +} + +function isResponseMessage(m) { + return isMessage(m) && m.action === MessageType.Response; +} + +function isCallbackMessage(m) { + return isMessage(m) && m.action === MessageType.Callback; +} + +function isEventMessage(m) { + return isMessage(m) && m.action === MessageType.Event; +} + +function makeCallbackEvent(requestId) { + return "callback_".concat(requestId); +} + +function makeResponseEvent(requestId) { + return "response_".concat(requestId); +} + +var Dispatcher = /*#__PURE__*/function (_ConcreteEmitter) { + _inherits(Dispatcher, _ConcreteEmitter); + + var _super = _createSuper(Dispatcher); + + function Dispatcher(messenger, sessionId) { + var _this2; + + _classCallCheck(this, Dispatcher); + + _this2 = _super.call(this); + _this2.uniqueId = createUniqueIdFn(); + _this2.messenger = messenger; + _this2.sessionId = sessionId; + _this2.removeMessengerListener = _this2.messenger.addMessageListener(_this2.messengerListener.bind(_assertThisInitialized(_this2))); + return _this2; + } + + _createClass(Dispatcher, [{ + key: "messengerListener", + value: function messengerListener(event) { + var data = event.data; + + if (!isMessage(data)) { + return; + } + + if (this.sessionId !== data.sessionId) { + return; + } + + if (isCallMessage(data)) { + this.emit(MessageType.Call, data); + } else if (isResponseMessage(data)) { + this.emit(makeResponseEvent(data.requestId), data); + } else if (isEventMessage(data)) { + this.emit(MessageType.Event, data); + } else if (isCallbackMessage(data)) { + this.emit(makeCallbackEvent(data.requestId), data); + } + } + }, { + key: "callOnRemote", + value: function callOnRemote(methodName, args, transfer) { + var requestId = this.uniqueId(); + var callbackEvent = makeCallbackEvent(requestId); + var responseEvent = makeResponseEvent(requestId); + var message = createCallMessage(this.sessionId, requestId, methodName, args); + this.messenger.postMessage(message, transfer); + return { + callbackEvent: callbackEvent, + responseEvent: responseEvent + }; + } + }, { + key: "respondToRemote", + value: function respondToRemote(requestId, value, error, transfer) { + if (error instanceof Error) { + error = { + name: error.name, + message: error.message + }; + } + + var message = createResponsMessage(this.sessionId, requestId, value, error); + this.messenger.postMessage(message, transfer); + } + }, { + key: "callbackToRemote", + value: function callbackToRemote(requestId, callbackId, args) { + var message = createCallbackMessage(this.sessionId, requestId, callbackId, args); + this.messenger.postMessage(message); + } + }, { + key: "emitToRemote", + value: function emitToRemote(eventName, payload, transfer) { + var message = createEventMessage(this.sessionId, eventName, payload); + this.messenger.postMessage(message, transfer); + } + }, { + key: "close", + value: function close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } + }]); + + return Dispatcher; +}(ConcreteEmitter); + +var ParentHandshakeDispatcher = /*#__PURE__*/function (_ConcreteEmitter2) { + _inherits(ParentHandshakeDispatcher, _ConcreteEmitter2); + + var _super2 = _createSuper(ParentHandshakeDispatcher); + + function ParentHandshakeDispatcher(messenger, sessionId) { + var _this3; + + _classCallCheck(this, ParentHandshakeDispatcher); + + _this3 = _super2.call(this); + _this3.messenger = messenger; + _this3.sessionId = sessionId; + _this3.removeMessengerListener = _this3.messenger.addMessageListener(_this3.messengerListener.bind(_assertThisInitialized(_this3))); + return _this3; + } + + _createClass(ParentHandshakeDispatcher, [{ + key: "messengerListener", + value: function messengerListener(event) { + var data = event.data; + + if (!isMessage(data)) { + return; + } + + if (this.sessionId !== data.sessionId) { + return; + } + + if (isHandshakeResponseMessage(data)) { + this.emit(data.sessionId, data); + } + } + }, { + key: "initiateHandshake", + value: function initiateHandshake() { + var message = createHandshakeRequestMessage(this.sessionId); + this.messenger.postMessage(message); + return this.sessionId; + } + }, { + key: "close", + value: function close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } + }]); + + return ParentHandshakeDispatcher; +}(ConcreteEmitter); + +var ChildHandshakeDispatcher = /*#__PURE__*/function (_ConcreteEmitter3) { + _inherits(ChildHandshakeDispatcher, _ConcreteEmitter3); + + var _super3 = _createSuper(ChildHandshakeDispatcher); + + function ChildHandshakeDispatcher(messenger) { + var _this4; + + _classCallCheck(this, ChildHandshakeDispatcher); + + _this4 = _super3.call(this); + _this4.messenger = messenger; + _this4.removeMessengerListener = _this4.messenger.addMessageListener(_this4.messengerListener.bind(_assertThisInitialized(_this4))); + return _this4; + } + + _createClass(ChildHandshakeDispatcher, [{ + key: "messengerListener", + value: function messengerListener(event) { + var data = event.data; + + if (isHandshakeRequestMessage(data)) { + this.emit(MessageType.HandshakeRequest, data); + } + } + }, { + key: "acceptHandshake", + value: function acceptHandshake(sessionId) { + var message = createHandshakeResponseMessage(sessionId); + this.messenger.postMessage(message); + } + }, { + key: "close", + value: function close() { + this.removeMessengerListener(); + this.removeAllListeners(); + } + }]); + + return ChildHandshakeDispatcher; +}(ConcreteEmitter); + +var ProxyType; + +(function (ProxyType) { + ProxyType["Callback"] = "callback"; +})(ProxyType || (ProxyType = {})); + +function createCallbackProxy(callbackId) { + return { + type: MARKER, + proxy: ProxyType.Callback, + callbackId: callbackId + }; +} + +function isCallbackProxy(p) { + return p && p.type === MARKER && p.proxy === ProxyType.Callback; +} + +var ConcreteRemoteHandle = /*#__PURE__*/function (_ConcreteEmitter4) { + _inherits(ConcreteRemoteHandle, _ConcreteEmitter4); + + var _super4 = _createSuper(ConcreteRemoteHandle); + + function ConcreteRemoteHandle(dispatcher) { + var _this5; + + _classCallCheck(this, ConcreteRemoteHandle); + + _this5 = _super4.call(this); + _this5._dispatcher = dispatcher; + _this5._callTransfer = {}; + + _this5._dispatcher.addEventListener(MessageType.Event, _this5._handleEvent.bind(_assertThisInitialized(_this5))); + + return _this5; + } + + _createClass(ConcreteRemoteHandle, [{ + key: "close", + value: function close() { + this.removeAllListeners(); + } + }, { + key: "setCallTransfer", + value: function setCallTransfer(methodName, transfer) { + this._callTransfer[methodName] = transfer; + } + }, { + key: "call", + value: function call(methodName) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return this.customCall(methodName, args); + } + }, { + key: "customCall", + value: function customCall(methodName, args) { + var _this6 = this; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return new Promise(function (resolve, reject) { + var sanitizedArgs = []; + var callbacks = []; + var callbackId = 0; + args.forEach(function (arg) { + if (typeof arg === 'function') { + callbacks.push(arg); + sanitizedArgs.push(createCallbackProxy(callbackId)); + callbackId += 1; + } else { + sanitizedArgs.push(arg); + } + }); + var hasCallbacks = callbacks.length > 0; + var callbackListener = undefined; + + if (hasCallbacks) { + callbackListener = function callbackListener(data) { + var callbackId = data.callbackId, + args = data.args; + callbacks[callbackId].apply(callbacks, _toConsumableArray(args)); + }; + } + + var transfer = options.transfer; + + if (transfer === undefined && _this6._callTransfer[methodName]) { + var _this6$_callTransfer; + + transfer = (_this6$_callTransfer = _this6._callTransfer)[methodName].apply(_this6$_callTransfer, sanitizedArgs); + } + + var _this6$_dispatcher$ca = _this6._dispatcher.callOnRemote(methodName, sanitizedArgs, transfer), + callbackEvent = _this6$_dispatcher$ca.callbackEvent, + responseEvent = _this6$_dispatcher$ca.responseEvent; + + if (hasCallbacks) { + _this6._dispatcher.addEventListener(callbackEvent, callbackListener); + } + + _this6._dispatcher.once(responseEvent).then(function (response) { + if (callbackListener) { + _this6._dispatcher.removeEventListener(callbackEvent, callbackListener); + } + + var result = response.result, + error = response.error; + + if (error !== undefined) { + reject(error); + } else { + resolve(result); + } + }); + }); + } + }, { + key: "_handleEvent", + value: function _handleEvent(data) { + var eventName = data.eventName, + payload = data.payload; + this.emit(eventName, payload); + } + }]); + + return ConcreteRemoteHandle; +}(ConcreteEmitter); + +var ConcreteLocalHandle = /*#__PURE__*/function () { + function ConcreteLocalHandle(dispatcher, localMethods) { + _classCallCheck(this, ConcreteLocalHandle); + + this._dispatcher = dispatcher; + this._methods = localMethods; + this._returnTransfer = {}; + this._emitTransfer = {}; + + this._dispatcher.addEventListener(MessageType.Call, this._handleCall.bind(this)); + } + + _createClass(ConcreteLocalHandle, [{ + key: "emit", + value: function emit(eventName, payload) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var transfer = options.transfer; + + if (transfer === undefined && this._emitTransfer[eventName]) { + transfer = this._emitTransfer[eventName](payload); + } + + this._dispatcher.emitToRemote(eventName, payload, transfer); + } + }, { + key: "setMethods", + value: function setMethods(methods) { + this._methods = methods; + } + }, { + key: "setMethod", + value: function setMethod(methodName, method) { + this._methods[methodName] = method; + } + }, { + key: "setReturnTransfer", + value: function setReturnTransfer(methodName, transfer) { + this._returnTransfer[methodName] = transfer; + } + }, { + key: "setEmitTransfer", + value: function setEmitTransfer(eventName, transfer) { + this._emitTransfer[eventName] = transfer; + } + }, { + key: "_handleCall", + value: function _handleCall(data) { + var _this7 = this; + + var requestId = data.requestId, + methodName = data.methodName, + args = data.args; + var callMethod = new Promise(function (resolve, reject) { + var _this7$_methods; + + var method = _this7._methods[methodName]; + + if (typeof method !== 'function') { + reject(new Error("The method \"".concat(methodName, "\" has not been implemented."))); + return; + } + + var desanitizedArgs = args.map(function (arg) { + if (isCallbackProxy(arg)) { + var callbackId = arg.callbackId; + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this7._dispatcher.callbackToRemote(requestId, callbackId, args); + }; + } else { + return arg; + } + }); + Promise.resolve((_this7$_methods = _this7._methods)[methodName].apply(_this7$_methods, _toConsumableArray(desanitizedArgs))).then(resolve)["catch"](reject); + }); + callMethod.then(function (result) { + var transfer; + + if (_this7._returnTransfer[methodName]) { + transfer = _this7._returnTransfer[methodName](result); + } + + _this7._dispatcher.respondToRemote(requestId, result, undefined, transfer); + })["catch"](function (error) { + _this7._dispatcher.respondToRemote(requestId, undefined, error); + }); + } + }]); + + return ConcreteLocalHandle; +}(); + +var ConcreteConnection = /*#__PURE__*/function () { + function ConcreteConnection(dispatcher, localMethods) { + _classCallCheck(this, ConcreteConnection); + + this._dispatcher = dispatcher; + this._localHandle = new ConcreteLocalHandle(dispatcher, localMethods); + this._remoteHandle = new ConcreteRemoteHandle(dispatcher); + } + + _createClass(ConcreteConnection, [{ + key: "close", + value: function close() { + this._dispatcher.close(); + + this.remoteHandle().close(); + } + }, { + key: "localHandle", + value: function localHandle() { + return this._localHandle; + } + }, { + key: "remoteHandle", + value: function remoteHandle() { + return this._remoteHandle; + } + }]); + + return ConcreteConnection; +}(); + +var uniqueSessionId = createUniqueIdFn(); + +var runUntil = function runUntil(worker, condition, unfulfilled, maxAttempts, attemptInterval) { + var attempt = 0; + + var fn = function fn() { + if (!condition() && (attempt < maxAttempts || maxAttempts < 1)) { + worker(); + attempt += 1; + setTimeout(fn, attemptInterval); + } else if (!condition() && attempt >= maxAttempts && maxAttempts >= 1) { + unfulfilled(); + } + }; + + fn(); +}; +/** + * Initiate the handshake from the Parent side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @param maxAttempts - The maximum number of handshake attempts + * @param attemptsInterval - The interval between handshake attempts + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ + + +function ParentHandshake(messenger) { + var localMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var maxAttempts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5; + var attemptsInterval = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 100; + var thisSessionId = uniqueSessionId(); + var connected = false; + return new Promise(function (resolve, reject) { + var handshakeDispatcher = new ParentHandshakeDispatcher(messenger, thisSessionId); + handshakeDispatcher.once(thisSessionId).then(function (response) { + connected = true; + handshakeDispatcher.close(); + var sessionId = response.sessionId; + var dispatcher = new Dispatcher(messenger, sessionId); + var connection = new ConcreteConnection(dispatcher, localMethods); + resolve(connection); + }); + runUntil(function () { + return handshakeDispatcher.initiateHandshake(); + }, function () { + return connected; + }, function () { + return reject(new Error("Handshake failed, reached maximum number of attempts")); + }, maxAttempts, attemptsInterval); + }); +} +/** + * Initiate the handshake from the Child side + * + * @param messenger - The Messenger used to send and receive messages from the other end + * @param localMethods - The methods that will be exposed to the other end + * @returns A Promise to an active {@link Connection} to the other end + * + * @public + */ + + +function ChildHandshake(messenger) { + var localMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return new Promise(function (resolve, reject) { + var handshakeDispatcher = new ChildHandshakeDispatcher(messenger); + handshakeDispatcher.once(MessageType.HandshakeRequest).then(function (response) { + var sessionId = response.sessionId; + handshakeDispatcher.acceptHandshake(sessionId); + handshakeDispatcher.close(); + var dispatcher = new Dispatcher(messenger, sessionId); + var connection = new ConcreteConnection(dispatcher, localMethods); + resolve(connection); + }); + }); +} + +var acceptableMessageEvent = function acceptableMessageEvent(event, remoteWindow, acceptedOrigin) { + var source = event.source, + origin = event.origin; + + if (source !== remoteWindow) { + return false; + } + + if (origin !== acceptedOrigin && acceptedOrigin !== '*') { + return false; + } + + return true; +}; +/** + * A concrete implementation of {@link Messenger} used to communicate with another Window. + * + * @public + * + */ + + +var WindowMessenger = function WindowMessenger(_ref) { + var localWindow = _ref.localWindow, + remoteWindow = _ref.remoteWindow, + remoteOrigin = _ref.remoteOrigin; + + _classCallCheck(this, WindowMessenger); + + localWindow = localWindow || window; + + this.postMessage = function (message, transfer) { + remoteWindow.postMessage(message, remoteOrigin, transfer); + }; + + this.addMessageListener = function (listener) { + var outerListener = function outerListener(event) { + if (acceptableMessageEvent(event, remoteWindow, remoteOrigin)) { + listener(event); + } + }; + + localWindow.addEventListener('message', outerListener); + + var removeListener = function removeListener() { + localWindow.removeEventListener('message', outerListener); + }; + + return removeListener; + }; +}; +/** @public */ + + +var BareMessenger = function BareMessenger(postable) { + _classCallCheck(this, BareMessenger); + + this.postMessage = function (message) { + var transfer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + postable.postMessage(message, transfer); + }; + + this.addMessageListener = function (listener) { + var outerListener = function outerListener(event) { + listener(event); + }; + + postable.addEventListener('message', outerListener); + + var removeListener = function removeListener() { + postable.removeEventListener('message', outerListener); + }; + + return removeListener; + }; +}; +/** + * A concrete implementation of {@link Messenger} used to communicate with a Worker. + * + * Takes a {@link Postable} representing the `Worker` (when calling from + * the parent context) or the `self` `DedicatedWorkerGlobalScope` object + * (when calling from the child context). + * + * @public + * + */ + + +var WorkerMessenger = /*#__PURE__*/function (_BareMessenger) { + _inherits(WorkerMessenger, _BareMessenger); + + var _super5 = _createSuper(WorkerMessenger); + + function WorkerMessenger(_ref2) { + var worker = _ref2.worker; + + _classCallCheck(this, WorkerMessenger); + + return _super5.call(this, worker); + } + + return WorkerMessenger; +}(BareMessenger); +/** + * A concrete implementation of {@link Messenger} used to communicate with a MessagePort. + * + * @public + * + */ + + +var PortMessenger = /*#__PURE__*/function (_BareMessenger2) { + _inherits(PortMessenger, _BareMessenger2); + + var _super6 = _createSuper(PortMessenger); + + function PortMessenger(_ref3) { + var port = _ref3.port; + + _classCallCheck(this, PortMessenger); + + port.start(); + return _super6.call(this, port); + } + + return PortMessenger; +}(BareMessenger); +/** + * Create a logger function with a specific namespace + * + * @param namespace - The namespace will be prepended to all the arguments passed to the logger function + * @param log - The underlying logger (`console.log` by default) + * + * @public + * + */ + + +function debug(namespace, log) { + log = log || console.debug || console.log || function () {}; + + return function () { + for (var _len3 = arguments.length, data = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + data[_key3] = arguments[_key3]; + } + + log.apply(void 0, [namespace].concat(data)); + }; +} +/** + * Decorate a {@link Messenger} so that it will log any message exchanged + * @param messenger - The Messenger that will be decorated + * @param log - The logger function that will receive each message + * @returns A decorated Messenger + * + * @public + * + */ + + +function DebugMessenger(messenger, log) { + log = log || debug('post-me'); + + var debugListener = function debugListener(event) { + var data = event.data; + log('⬅️ received message', data); + }; + + messenger.addMessageListener(debugListener); + return { + postMessage: function postMessage(message, transfer) { + log('➡️ sending message', message); + messenger.postMessage(message, transfer); + }, + addMessageListener: function addMessageListener(listener) { + return messenger.addMessageListener(listener); + } + }; +} + +export { BareMessenger, ChildHandshake, ConcreteEmitter, DebugMessenger, ParentHandshake, PortMessenger, WindowMessenger, WorkerMessenger, debug }; diff --git a/node_modules/post-me/dist/messages.d.ts b/node_modules/post-me/dist/messages.d.ts new file mode 100644 index 0000000..edcb7d5 --- /dev/null +++ b/node_modules/post-me/dist/messages.d.ts @@ -0,0 +1,51 @@ +import { IdType, KeyType, MARKER } from './common'; +export declare enum MessageType { + HandshakeRequest = "handshake-request", + HandshakeResponse = "handshake-response", + Call = "call", + Response = "response", + Error = "error", + Event = "event", + Callback = "callback" +} +export interface Message { + type: typeof MARKER; + action: T; + sessionId: IdType; +} +export interface HandshakeRequestMessage extends Message { +} +export interface HandshakeResponseMessage extends Message { +} +export interface CallMessage> extends Message { + requestId: IdType; + methodName: KeyType; + args: A; +} +export interface ResponseMessage extends Message { + requestId: IdType; + result?: R; + error?: string; +} +export interface CallbackMessage> extends Message { + requestId: IdType; + callbackId: IdType; + args: A; +} +export interface EventMessage

extends Message { + eventName: KeyType; + payload: P; +} +export declare function createHandshakeRequestMessage(sessionId: IdType): HandshakeRequestMessage; +export declare function createHandshakeResponseMessage(sessionId: IdType): HandshakeResponseMessage; +export declare function createCallMessage>(sessionId: IdType, requestId: IdType, methodName: KeyType, args: A): CallMessage; +export declare function createResponsMessage(sessionId: IdType, requestId: IdType, result: R, error?: string): ResponseMessage; +export declare function createCallbackMessage>(sessionId: IdType, requestId: IdType, callbackId: IdType, args: A): CallbackMessage; +export declare function createEventMessage

(sessionId: IdType, eventName: KeyType, payload: P): EventMessage

; +export declare function isMessage(m: any): m is Message; +export declare function isHandshakeRequestMessage(m: Message): m is HandshakeRequestMessage; +export declare function isHandshakeResponseMessage(m: Message): m is HandshakeResponseMessage; +export declare function isCallMessage(m: Message): m is CallMessage; +export declare function isResponseMessage(m: Message): m is ResponseMessage; +export declare function isCallbackMessage(m: Message): m is CallbackMessage; +export declare function isEventMessage(m: Message): m is EventMessage; diff --git a/node_modules/post-me/dist/messenger.d.ts b/node_modules/post-me/dist/messenger.d.ts new file mode 100644 index 0000000..768aa28 --- /dev/null +++ b/node_modules/post-me/dist/messenger.d.ts @@ -0,0 +1,104 @@ +declare type MessageListener = (event: MessageEvent) => void; +declare type ListenerRemover = () => void; +/** + * An interface used internally to exchange low level messages across contexts. + * + * @remarks + * + * Having a single interface lets post-me deal with Workers, Windows, and MessagePorts + * without having to worry about their differences. + * + * A few concrete implementations of the Messenger interface are provided. + * + * @public + * + */ +export interface Messenger { + /** + * Send a message to the other context + * + * @param message - The payload of the message + * @param transfer - A list of Transferable objects that should be transferred to the other context instead of cloned. + */ + postMessage(message: any, transfer?: Transferable[]): void; + /** + * Add a listener to messages received by the other context + * + * @param listener - A listener that will receive the MessageEvent + * @returns A function that can be invoked to remove the listener + */ + addMessageListener(listener: MessageListener): ListenerRemover; +} +/** + * A concrete implementation of {@link Messenger} used to communicate with another Window. + * + * @public + * + */ +export declare class WindowMessenger implements Messenger { + postMessage: (message: any, transfer?: Transferable[]) => void; + addMessageListener: (listener: MessageListener) => ListenerRemover; + constructor({ localWindow, remoteWindow, remoteOrigin, }: { + localWindow?: Window; + remoteWindow: Window; + remoteOrigin: string; + }); +} +interface Postable { + postMessage(message: any, transfer?: Transferable[]): void; + addEventListener(eventName: 'message', listener: MessageListener): void; + removeEventListener(eventName: 'message', listener: MessageListener): void; +} +/** @public */ +export declare class BareMessenger implements Messenger { + postMessage: (message: any, transfer?: Transferable[]) => void; + addMessageListener: (listener: MessageListener) => ListenerRemover; + constructor(postable: Postable); +} +/** + * A concrete implementation of {@link Messenger} used to communicate with a Worker. + * + * Takes a {@link Postable} representing the `Worker` (when calling from + * the parent context) or the `self` `DedicatedWorkerGlobalScope` object + * (when calling from the child context). + * + * @public + * + */ +export declare class WorkerMessenger extends BareMessenger implements Messenger { + constructor({ worker }: { + worker: Postable; + }); +} +/** + * A concrete implementation of {@link Messenger} used to communicate with a MessagePort. + * + * @public + * + */ +export declare class PortMessenger extends BareMessenger implements Messenger { + constructor({ port }: { + port: MessagePort; + }); +} +/** + * Create a logger function with a specific namespace + * + * @param namespace - The namespace will be prepended to all the arguments passed to the logger function + * @param log - The underlying logger (`console.log` by default) + * + * @public + * + */ +export declare function debug(namespace: string, log?: (...data: any[]) => void): (...data: any[]) => void; +/** + * Decorate a {@link Messenger} so that it will log any message exchanged + * @param messenger - The Messenger that will be decorated + * @param log - The logger function that will receive each message + * @returns A decorated Messenger + * + * @public + * + */ +export declare function DebugMessenger(messenger: Messenger, log?: (...data: any[]) => void): Messenger; +export {}; diff --git a/node_modules/post-me/dist/proxy.d.ts b/node_modules/post-me/dist/proxy.d.ts new file mode 100644 index 0000000..60885d1 --- /dev/null +++ b/node_modules/post-me/dist/proxy.d.ts @@ -0,0 +1,13 @@ +import { MARKER, IdType } from './common'; +export declare enum ProxyType { + Callback = "callback" +} +export interface BaseProxy

{ + type: typeof MARKER; + proxy: P; +} +export interface CallbackProxy extends BaseProxy { + callbackId: IdType; +} +export declare function createCallbackProxy(callbackId: IdType): CallbackProxy; +export declare function isCallbackProxy(p: any): p is CallbackProxy; diff --git a/node_modules/post-me/package.json b/node_modules/post-me/package.json new file mode 100644 index 0000000..abbc6ad --- /dev/null +++ b/node_modules/post-me/package.json @@ -0,0 +1,92 @@ +{ + "name": "post-me", + "version": "0.4.5", + "description": "Use web Workers and other Windows through a simple Promise API", + "author": { + "name": "Alessandro Genova", + "email": "ales.genova@gmail.com", + "url": "https://github.com/alesgenova" + }, + "license": "MIT", + "homepage": "https://github.com/alesgenova/post-me", + "repository": { + "type": "git", + "url": "https://github.com/alesgenova/post-me.git", + "directory": "packages/core" + }, + "bugs": { + "url": "https://github.com/alesgenova/post-me/issues", + "email": "ales.genova@gmail.com" + }, + "main": "./dist/index.js", + "exports": { + "import": "./dist/index.esnext.mjs", + "require": "./dist/index.js" + }, + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "sideEffects": false, + "scripts": { + "build": "npm run build:src && npm run build:types", + "build:src": "rollup -c", + "build:types": "tsc --emitDeclarationOnly", + "build:docs": "npm run build:types && api-extractor run --local --verbose", + "build:demo": "npm run build:src && node demo/build.js www", + "prepublishOnly": "npm run build", + "demo": "npm run build:demo && npx serve www", + "deploy:demo": "npm run build:demo && gh-pages -d www", + "test": "jest --coverage tests", + "prettier:check-staged": "pretty-quick --staged --check --pattern '**/*.{js,jsx,ts,tsx,css,html}'", + "prettier:write-staged": "pretty-quick --staged --write --pattern '**/*.{js,jsx,ts,tsx,css,html}'", + "prettier:check-modified": "pretty-quick --check --pattern '**/*.{js,jsx,ts,tsx,css,html}'", + "prettier:write-modified": "pretty-quick --write --pattern '**/*.{js,jsx,ts,tsx,css,html}'", + "prettier:check-all": "prettier --check '**/*.{js,jsx,ts,tsx,css,html}'", + "prettier:write-all": "prettier --write '**/*.{js,jsx,ts,tsx,css,html}'" + }, + "devDependencies": { + "@babel/core": "^7.11.6", + "@babel/preset-env": "^7.12.11", + "@microsoft/api-extractor": "^7.13.0", + "@rollup/plugin-babel": "^5.2.2", + "@rollup/plugin-typescript": "^8.1.0", + "@types/jest": "^26.0.15", + "@types/jsdom": "^16.2.5", + "gh-pages": "^3.1.0", + "husky": "^4.3.0", + "jest": "^26.6.3", + "jsdom": "^16.4.0", + "prettier": "^2.2.1", + "pretty-quick": "^3.1.0", + "rollup": "^2.35.1", + "ts-jest": "^26.4.4", + "tslib": "^2.0.3", + "typescript": "^4.1.3" + }, + "husky": { + "hooks": { + "pre-commit": "npm run prettier:write-staged" + } + }, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "communication", + "postmessage", + "iframe", + "worker", + "workers", + "web-worker", + "web-workers", + "concurrency", + "parallel-computing", + "front-end", + "back-end", + "promise", + "typescript", + "postmate" + ] +} diff --git a/node_modules/proper-lockfile/LICENSE b/node_modules/proper-lockfile/LICENSE new file mode 100644 index 0000000..db5e914 --- /dev/null +++ b/node_modules/proper-lockfile/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 IndigoUnited + +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/proper-lockfile/README.md b/node_modules/proper-lockfile/README.md new file mode 100644 index 0000000..427e0ea --- /dev/null +++ b/node_modules/proper-lockfile/README.md @@ -0,0 +1,210 @@ +# proper-lockfile + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] + +[npm-url]:https://npmjs.org/package/proper-lockfile +[downloads-image]:http://img.shields.io/npm/dm/proper-lockfile.svg +[npm-image]:http://img.shields.io/npm/v/proper-lockfile.svg +[travis-url]:https://travis-ci.org/IndigoUnited/node-proper-lockfile +[travis-image]:http://img.shields.io/travis/IndigoUnited/node-proper-lockfile/master.svg +[coveralls-url]:https://coveralls.io/r/IndigoUnited/node-proper-lockfile +[coveralls-image]:https://img.shields.io/coveralls/IndigoUnited/node-proper-lockfile/master.svg +[david-dm-url]:https://david-dm.org/IndigoUnited/node-proper-lockfile +[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-proper-lockfile.svg +[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-proper-lockfile#info=devDependencies +[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/node-proper-lockfile.svg + +An inter-process and inter-machine lockfile utility that works on a local or network file system. + + +## Installation + +`$ npm install proper-lockfile` + + +## Design + +There are various ways to achieve [file locking](http://en.wikipedia.org/wiki/File_locking). + +This library utilizes the `mkdir` strategy which works atomically on any kind of file system, even network based ones. +The lockfile path is based on the file path you are trying to lock by suffixing it with `.lock`. + +When a lock is successfully acquired, the lockfile's `mtime` (modified time) is periodically updated to prevent staleness. This allows to effectively check if a lock is stale by checking its `mtime` against a stale threshold. If the update of the mtime fails several times, the lock might be compromised. The `mtime` is [supported](http://en.wikipedia.org/wiki/Comparison_of_file_systems) in almost every `filesystem`. + + +### Comparison + +This library is similar to [lockfile](https://github.com/isaacs/lockfile) but the later has some drawbacks: + +- It relies on `open` with `O_EXCL` flag which has problems in network file systems. `proper-lockfile` uses `mkdir` which doesn't have this issue. + +> O_EXCL is broken on NFS file systems; programs which rely on it for performing locking tasks will contain a race condition. + +- The lockfile staleness check is done via `ctime` (creation time) which is unsuitable for long running processes. `proper-lockfile` constantly updates lockfiles `mtime` to do proper staleness check. + +- It does not check if the lockfile was compromised which can led to undesirable situations. `proper-lockfile` checks the lockfile when updating the `mtime`. + + +### Compromised + +`proper-lockfile` does not detect cases in which: + +- A `lockfile` is manually removed and someone else acquires the lock right after +- Different `stale`/`update` values are being used for the same file, possibly causing two locks to be acquired on the same file + +`proper-lockfile` detects cases in which: + +- Updates to the `lockfile` fail +- Updates take longer than expected, possibly causing the lock to became stale for a certain amount of time + + +As you see, the first two are a consequence of bad usage. Technically, it was possible to detect the first two but it would introduce complexity and eventual race conditions. + + +## Usage + +### .lock(file, [options], [compromised], callback) + +Tries to acquire a lock on `file`. + +If the lock succeeds, a `release` function is provided that should be called when you want to release the lock. +If the lock gets compromised, the `compromised` function will be called. The default `compromised` function is a simple `throw err` which will probably cause the process to die. Specify it to handle the way you desire. + +Available options: + +- `stale`: Duration in milliseconds in which the lock is considered stale, defaults to `10000` (minimum value is `5000`) +- `update`: The interval in milliseconds in which the lockfile's `mtime` will be updated, defaults to `stale/2` (minimum value is `1000`, maximum value is `stale/2`) +- `retries`: The number of retries or a [retry](https://www.npmjs.org/package/retry) options object, defaults to `0` +- `realpath`: Resolve symlinks using realpath, defaults to `true` (note that if `true`, the `file` must exist previously) +- `fs`: A custom fs to use, defaults to `graceful-fs` + + +```js +const lockfile = require('proper-lockfile'); + +lockfile.lock('some/file', (err, release) => { + if (err) { + throw err; // Lock failed + } + + // Do something while the file is locked + + // Call the provided release function when you're done + release(); + + // Note that you can optionally handle release errors + // Though it's not mandatory since it will eventually stale + /*release((err) => { + // At this point the lock was effectively released or an error + // occurred while removing it + if (err) { + throw err; + } + });*/ +}); +``` + + +### .unlock(file, [options], [callback]) + +Releases a previously acquired lock on `file`. + +Whenever possible you should use the `release` function instead (as exemplified above). Still there are cases in which its hard to keep a reference to it around code. In those cases `unlock()` might be handy. + +The `callback` is optional because even if the removal of the lock failed, the lockfile's `mtime` will no longer be updated causing it to eventually stale. + +Available options: + +- `realpath`: Resolve symlinks using realpath, defaults to `true` (note that if `true`, the `file` must exist previously) +- `fs`: A custom fs to use, defaults to `graceful-fs` + + +```js +const lockfile = require('proper-lockfile'); + +lockfile.lock('some/file', (err) => { + if (err) { + throw err; + } + + // Later.. + lockfile.unlock('some/file'); + + // or.. + /*lockfile.unlock('some/file', (err) => { + // At this point the lock was effectively released or an error + // occurred while removing it + if (err) { + throw err; + } + });*/ +}); +``` + +### .check(file, [options], callback) + +Check if the file is locked and its lockfile is not stale. Callback is called with callback(error, isLocked). + +Available options: + +- `stale`: Duration in milliseconds in which the lock is considered stale, defaults to `10000` (minimum value is `5000`) +- `realpath`: Resolve symlinks using realpath, defaults to `true` (note that if `true`, the `file` must exist previously) +- `fs`: A custom fs to use, defaults to `graceful-fs` + + +```js +const lockfile = require('proper-lockfile'); + +lockfile.check('some/file', (err, isLocked) => { + if (err) { + throw err; + } + + // isLocked will be true if 'some/file' is locked, false otherwise +}); +``` + +### .lockSync(file, [options], [compromised]) + +Sync version of `.lock()`. +Returns the `release` function or throws on error. + + +### .unlockSync(file, [options]) + +Sync version of `.unlock()`. +Throws on error. + +### .checkSync(file, [options]) + +Sync version of `.check()`. +Returns a boolean or throws on error. + + +## Graceful exit + +`proper-lockfile` automatically remove locks if the process exists. Though, `SIGINT` and `SIGTERM` signals +are handled differently by `nodejs` in the sense that they do not fire a `exit` event on the `process`. +To avoid this common issue that `CLI` developers have, please do the following: + + +```js +// Map SIGINT & SIGTERM to process exit +// so that lockfile removes the lockfile automatically +process +.once('SIGINT', () => process.exit(1)) +.once('SIGTERM', () => process.exit(1)); +``` + + +## Tests + +`$ npm test` +`$ npm test-cov` to get coverage report + +The test suite is very extensive. There's even a stress test to guarantee exclusiveness of locks. + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/node_modules/proper-lockfile/index.js b/node_modules/proper-lockfile/index.js new file mode 100644 index 0000000..0f065f1 --- /dev/null +++ b/node_modules/proper-lockfile/index.js @@ -0,0 +1,380 @@ +'use strict'; + +const fs = require('graceful-fs'); +const path = require('path'); +const retry = require('retry'); +const syncFs = require('./lib/syncFs'); + +const locks = {}; + +function getLockFile(file) { + return `${file}.lock`; +} + +function canonicalPath(file, options, callback) { + if (!options.realpath) { + return callback(null, path.resolve(file)); + } + + // Use realpath to resolve symlinks + // It also resolves relative paths + options.fs.realpath(file, callback); +} + +function acquireLock(file, options, callback) { + // Use mkdir to create the lockfile (atomic operation) + options.fs.mkdir(getLockFile(file), (err) => { + // If successful, we are done + if (!err) { + return callback(); + } + + // If error is not EEXIST then some other error occurred while locking + if (err.code !== 'EEXIST') { + return callback(err); + } + + // Otherwise, check if lock is stale by analyzing the file mtime + if (options.stale <= 0) { + return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); + } + + options.fs.stat(getLockFile(file), (err, stat) => { + if (err) { + // Retry if the lockfile has been removed (meanwhile) + // Skip stale check to avoid recursiveness + if (err.code === 'ENOENT') { + return acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); + } + + return callback(err); + } + + if (!isLockStale(stat, options)) { + return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); + } + + // If it's stale, remove it and try again! + // Skip stale check to avoid recursiveness + removeLock(file, options, (err) => { + if (err) { + return callback(err); + } + + acquireLock(file, Object.assign({}, options, { stale: 0 }), callback); + }); + }); + }); +} + +function isLockStale(stat, options) { + return stat.mtime.getTime() < Date.now() - options.stale; +} + +function removeLock(file, options, callback) { + // Remove lockfile, ignoring ENOENT errors + options.fs.rmdir(getLockFile(file), (err) => { + if (err && err.code !== 'ENOENT') { + return callback(err); + } + + callback(); + }); +} + +function updateLock(file, options) { + const lock = locks[file]; + + /* istanbul ignore next */ + if (lock.updateTimeout) { + return; + } + + lock.updateDelay = lock.updateDelay || options.update; + lock.updateTimeout = setTimeout(() => { + const mtime = Date.now() / 1000; + + lock.updateTimeout = null; + + options.fs.utimes(getLockFile(file), mtime, mtime, (err) => { + // Ignore if the lock was released + if (lock.released) { + return; + } + + // Verify if we are within the stale threshold + if (lock.lastUpdate <= Date.now() - options.stale && + lock.lastUpdate > Date.now() - options.stale * 2) { + return compromisedLock(file, lock, Object.assign(new Error(lock.updateError || 'Unable to update lock within the stale \ +threshold'), { code: 'ECOMPROMISED' })); + } + + // If the file is older than (stale * 2), we assume the clock is moved manually, + // which we consider a valid case + + // If it failed to update the lockfile, keep trying unless + // the lockfile was deleted! + if (err) { + if (err.code === 'ENOENT') { + return compromisedLock(file, lock, Object.assign(err, { code: 'ECOMPROMISED' })); + } + + lock.updateError = err; + lock.updateDelay = 1000; + return updateLock(file, options); + } + + // All ok, keep updating.. + lock.lastUpdate = Date.now(); + lock.updateError = null; + lock.updateDelay = null; + updateLock(file, options); + }); + }, lock.updateDelay); + + // Unref the timer so that the nodejs process can exit freely + // This is safe because all acquired locks will be automatically released + // on process exit + + // We first check that `lock.updateTimeout.unref` exists because some users + // may be using this module outside of NodeJS (e.g., in an electron app), + // and in those cases `setTimeout` return an integer. + if (lock.updateTimeout.unref) { + lock.updateTimeout.unref(); + } +} + +function compromisedLock(file, lock, err) { + lock.released = true; // Signal the lock has been released + /* istanbul ignore next */ + lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + + if (locks[file] === lock) { + delete locks[file]; + } + + lock.compromised(err); +} + +// ----------------------------------------- + +function lock(file, options, compromised, callback) { + if (typeof options === 'function') { + callback = compromised; + compromised = options; + options = null; + } + + if (!callback) { + callback = compromised; + compromised = null; + } + + options = Object.assign({ + stale: 10000, + update: null, + realpath: true, + retries: 0, + fs, + }, options); + + options.retries = options.retries || 0; + options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + options.stale = Math.max(options.stale || 0, 2000); + options.update = options.update == null ? options.stale / 2 : options.update || 0; + options.update = Math.max(Math.min(options.update, options.stale / 2), 1000); + compromised = compromised || function (err) { throw err; }; + + // Resolve to a canonical file path + canonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Attempt to acquire the lock + const operation = retry.operation(options.retries); + + operation.attempt(() => { + acquireLock(file, options, (err) => { + if (operation.retry(err)) { + return; + } + + if (err) { + return callback(operation.mainError()); + } + + // We now own the lock + const lock = locks[file] = { + options, + compromised, + lastUpdate: Date.now(), + }; + + // We must keep the lock fresh to avoid staleness + updateLock(file, options); + + callback(null, (releasedCallback) => { + if (lock.released) { + return releasedCallback && + releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' })); + } + + // Not necessary to use realpath twice when unlocking + unlock(file, Object.assign({}, options, { realpath: false }), releasedCallback); + }); + }); + }); + }); +} + +function unlock(file, options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; + } + + options = Object.assign({ + fs, + realpath: true, + }, options); + + callback = callback || function () {}; + + // Resolve to a canonical file path + canonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Skip if the lock is not acquired + const lock = locks[file]; + + if (!lock) { + return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' })); + } + + lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update + lock.released = true; // Signal the lock has been released + delete locks[file]; // Delete from locks + + removeLock(file, options, callback); + }); +} + +function lockSync(file, options, compromised) { + if (typeof options === 'function') { + compromised = options; + options = null; + } + + options = options || {}; + options.fs = syncFs(options.fs || fs); + options.retries = options.retries || 0; + options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries; + + // Retries are not allowed because it requires the flow to be sync + if (options.retries.retries) { + throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' }); + } + + let err; + let release; + + lock(file, options, compromised, (_err, _release) => { + err = _err; + release = _release; + }); + + if (err) { + throw err; + } + + return release; +} + +function unlockSync(file, options) { + options = options || {}; + options.fs = syncFs(options.fs || fs); + + let err; + + unlock(file, options, (_err) => { + err = _err; + }); + + if (err) { + throw err; + } +} + +function check(file, options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; + } + + options = Object.assign({ + stale: 10000, + realpath: true, + fs, + }, options); + + options.stale = Math.max(options.stale || 0, 2000); + + // Resolve to a canonical file path + canonicalPath(file, options, (err, file) => { + if (err) { + return callback(err); + } + + // Check if lockfile exists + options.fs.stat(getLockFile(file), (err, stat) => { + if (err) { + // if does not exist, file is not locked. Otherwise, callback with error + return (err.code === 'ENOENT') ? callback(null, false) : callback(err); + } + + if (options.stale <= 0) { return callback(null, true); } + + // Otherwise, check if lock is stale by analyzing the file mtime + return callback(null, !isLockStale(stat, options)); + }); + }); +} + +function checkSync(file, options) { + options = options || {}; + options.fs = syncFs(options.fs || fs); + + let err; + let locked; + + check(file, options, (_err, _locked) => { + err = _err; + locked = _locked; + }); + + if (err) { + throw err; + } + + return locked; +} + + +// Remove acquired locks on exit +/* istanbul ignore next */ +process.on('exit', () => { + Object.keys(locks).forEach((file) => { + try { locks[file].options.fs.rmdirSync(getLockFile(file)); } catch (e) { /* empty */ } + }); +}); + +module.exports = lock; +module.exports.lock = lock; +module.exports.unlock = unlock; +module.exports.lockSync = lockSync; +module.exports.unlockSync = unlockSync; +module.exports.check = check; +module.exports.checkSync = checkSync; diff --git a/node_modules/proper-lockfile/lib/syncFs.js b/node_modules/proper-lockfile/lib/syncFs.js new file mode 100644 index 0000000..218ea1d --- /dev/null +++ b/node_modules/proper-lockfile/lib/syncFs.js @@ -0,0 +1,40 @@ +'use strict'; + +function makeSync(fs, name) { + const fn = fs[`${name}Sync`]; + + return function () { + const callback = arguments[arguments.length - 1]; + const args = Array.prototype.slice.call(arguments, 0, -1); + let ret; + + try { + ret = fn.apply(fs, args); + } catch (err) { + return callback(err); + } + + callback(null, ret); + }; +} + +function syncFs(fs) { + const fns = ['mkdir', 'realpath', 'stat', 'rmdir', 'utimes']; + const obj = {}; + + // Create the sync versions of the methods that we need + fns.forEach((name) => { + obj[name] = makeSync(fs, name); + }); + + // Copy the rest of the functions + for (const key in fs) { + if (!obj[key]) { + obj[key] = fs[key]; + } + } + + return obj; +} + +module.exports = syncFs; diff --git a/node_modules/proper-lockfile/package.json b/node_modules/proper-lockfile/package.json new file mode 100644 index 0000000..609b019 --- /dev/null +++ b/node_modules/proper-lockfile/package.json @@ -0,0 +1,51 @@ +{ + "name": "proper-lockfile", + "version": "2.0.1", + "description": "A inter-process and inter-machine lockfile utility that works on a local or network file system.", + "main": "index.js", + "scripts": { + "lint": "eslint '{*.js,lib/**/*.js,test/**/*.js}' --ignore-pattern=test/coverage", + "test": "mocha", + "test-cov": "istanbul cover --dir test/coverage _mocha && echo open test/coverage/lcov-report/index.html", + "test-travis": "istanbul cover _mocha --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" + }, + "bugs": { + "url": "https://github.com/IndigoUnited/node-proper-lockfile/issues/" + }, + "repository": { + "type": "git", + "url": "git://github.com/IndigoUnited/node-proper-lockfile.git" + }, + "keywords": [ + "lock", + "locking", + "file", + "lockfile", + "fs", + "rename", + "cross", + "machine" + ], + "author": "IndigoUnited (http://indigounited.com)", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "retry": "^0.10.0" + }, + "devDependencies": { + "@satazor/eslint-config": "^3.1.1", + "async": "^2.0.0", + "buffered-spawn": "^3.0.0", + "coveralls": "^2.11.6", + "eslint": "^3.5.0", + "eslint-plugin-react": "^6.2.0", + "expect.js": "^0.3.1", + "istanbul": "^0.4.1", + "mocha": "^3.0.2", + "rimraf": "^2.5.0", + "stable": "^0.1.5" + }, + "engines": { + "node": ">=4.0.0" + } +} diff --git a/node_modules/protocols/LICENSE b/node_modules/protocols/LICENSE deleted file mode 100755 index f43e830..0000000 --- a/node_modules/protocols/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-20 Ionică Bizău (https://ionicabizau.net) - -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/protocols/README.md b/node_modules/protocols/README.md deleted file mode 100755 index d5bb418..0000000 --- a/node_modules/protocols/README.md +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - -# protocols - - [![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Travis](https://img.shields.io/travis/IonicaBizau/protocols.svg)](https://travis-ci.org/IonicaBizau/protocols/) [![Version](https://img.shields.io/npm/v/protocols.svg)](https://www.npmjs.com/package/protocols) [![Downloads](https://img.shields.io/npm/dt/protocols.svg)](https://www.npmjs.com/package/protocols) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github) - -Buy Me A Coffee - - - - - - - -> Get the protocols of an input url. - - - - - - - - - - - - - - - - - -## :cloud: Installation - -```sh -# Using npm -npm install --save protocols - -# Using yarn -yarn add protocols -``` - - - - - - - - - - - - - -## :clipboard: Example - - - -```js -// Dependencies -const protocols = require("protocols"); - -console.log(protocols("git+ssh://git@some-host.com/and-the-path/name")); -// ["git", "ssh"] - -console.log(protocols("http://ionicabizau.net", true)); -// "http" -``` - - - - - - - - - - - -## :question: Get Help - -There are few ways to get help: - - - - 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question. - 2. For bug reports and feature requests, open issues. :bug: - 3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket: - - - - - -## :memo: Documentation - - -### `protocols(input, first)` -Returns the protocols of an input url. - -#### Params - -- **String** `input`: The input url. -- **Boolean|Number** `first`: If `true`, the first protocol will be returned. If number, it will represent the zero-based index of the protocols array. - -#### Return -- **Array|String** The array of protocols or the specified protocol. - - - - - - - - - - - - - - -## :yum: How to contribute -Have an idea? Found a bug? See [how to contribute][contributing]. - - -## :sparkling_heart: Support my projects -I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, -this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it). - -However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it: - - - - Starring and sharing the projects you like :rocket: - - [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book: - - [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea: - - [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone). - - **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6` - - ![](https://i.imgur.com/z6OQI95.png) - - -Thanks! :heart: - - - - - - - - - - - - - - - - -## :dizzy: Where is this library used? -If you are using this library in one of your projects, add it in this list. :sparkles: - - - `parse-url` - - `parse-path` - - `is-ssh` - - `bb-parse-url` - - `@hawkingnetwork/react-native-tab-view` - - `miguelcostero-ng2-toasty` - - `@apardellass/react-native-audio-stream` - - `l2forlerna` - - `react-native-plugpag-wrapper` - - - - - - - - - - - -## :scroll: License - -[MIT][license] © [Ionică Bizău][website] - - - - - - -[license]: /LICENSE -[website]: https://ionicabizau.net -[contributing]: /CONTRIBUTING.md -[docs]: /DOCUMENTATION.md -[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg -[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg -[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg -[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg -[patreon]: https://www.patreon.com/ionicabizau -[amazon]: http://amzn.eu/hRo9sIZ -[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW diff --git a/node_modules/protocols/lib/index.js b/node_modules/protocols/lib/index.js deleted file mode 100755 index 772bb28..0000000 --- a/node_modules/protocols/lib/index.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -/** - * protocols - * Returns the protocols of an input url. - * - * @name protocols - * @function - * @param {String} input The input url. - * @param {Boolean|Number} first If `true`, the first protocol will be returned. If number, it will represent the zero-based index of the protocols array. - * @return {Array|String} The array of protocols or the specified protocol. - */ -module.exports = function protocols(input, first) { - - if (first === true) { - first = 0; - } - - var index = input.indexOf("://"), - splits = input.substring(0, index).split("+").filter(Boolean); - - if (typeof first === "number") { - return splits[first]; - } - - return splits; -}; \ No newline at end of file diff --git a/node_modules/protocols/package.json b/node_modules/protocols/package.json deleted file mode 100755 index 863c3fe..0000000 --- a/node_modules/protocols/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "protocols", - "version": "1.4.8", - "description": "Get the protocols of an input url.", - "main": "lib/index.js", - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "node test" - }, - "repository": { - "type": "git", - "url": "git@github.com:IonicaBizau/protocols.git" - }, - "keywords": [ - "protocols", - "protocol", - "url", - "parse" - ], - "author": "Ionică Bizău (https://ionicabizau.net)", - "license": "MIT", - "bugs": { - "url": "https://github.com/IonicaBizau/protocols/issues" - }, - "homepage": "https://github.com/IonicaBizau/protocols", - "dependencies": {}, - "devDependencies": { - "tester": "^1.3.1" - }, - "files": [ - "bin/", - "app/", - "lib/", - "dist/", - "src/", - "scripts/", - "resources/", - "menu/", - "cli.js", - "index.js", - "bloggify.js", - "bloggify.json", - "bloggify/" - ] -} diff --git a/node_modules/qs/.editorconfig b/node_modules/qs/.editorconfig deleted file mode 100644 index 91040dd..0000000 --- a/node_modules/qs/.editorconfig +++ /dev/null @@ -1,39 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 160 - -[test/*] -max_line_length = off - -[LICENSE.md] -indent_size = off - -[*.md] -max_line_length = off - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[LICENSE] -indent_size = 2 -max_line_length = off - -[coverage/**/*] -indent_size = off -indent_style = off -indent = off -max_line_length = off diff --git a/node_modules/qs/.eslintignore b/node_modules/qs/.eslintignore deleted file mode 100644 index a60030e..0000000 --- a/node_modules/qs/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/ -coverage/ diff --git a/node_modules/qs/.eslintrc b/node_modules/qs/.eslintrc deleted file mode 100644 index 2c680d7..0000000 --- a/node_modules/qs/.eslintrc +++ /dev/null @@ -1,35 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "complexity": 0, - "consistent-return": 1, - "func-name-matching": 0, - "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], - "indent": [2, 4], - "max-lines-per-function": [2, { "max": 150 }], - "max-params": [2, 15], - "max-statements": [2, 52], - "multiline-comment-style": 0, - "no-continue": 1, - "no-magic-numbers": 0, - "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], - "operator-linebreak": [2, "before"], - }, - - "overrides": [ - { - "files": "test/**", - "rules": { - "function-paren-newline": 0, - "max-lines-per-function": 0, - "max-statements": 0, - "no-buffer-constructor": 0, - "no-extend-native": 0, - "no-throw-literal": 0, - } - } - ] -} diff --git a/node_modules/qs/.github/FUNDING.yml b/node_modules/qs/.github/FUNDING.yml deleted file mode 100644 index 0355f4f..0000000 --- a/node_modules/qs/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/qs -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/qs/.nycrc b/node_modules/qs/.nycrc deleted file mode 100644 index 1d57cab..0000000 --- a/node_modules/qs/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "dist" - ] -} diff --git a/node_modules/qs/CHANGELOG.md b/node_modules/qs/CHANGELOG.md deleted file mode 100644 index 74dda43..0000000 --- a/node_modules/qs/CHANGELOG.md +++ /dev/null @@ -1,372 +0,0 @@ -## **6.10.1** -- [Fix] `stringify`: avoid exception on repeated object values (#402) - -## **6.10.0** -- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) -- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) -- [meta] fix README.md (#399) -- [meta] only run `npm run dist` in publish, not install -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` -- [Tests] fix tests on node v0.6 -- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` -- [Tests] Revert "[meta] ignore eclint transitive audit warning" - -## **6.9.6** -- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 - -## **6.9.5** -- [Fix] `stringify`: do not encode parens for RFC1738 -- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) -- [Refactor] `format`: remove `util.assign` call -- [meta] add "Allow Edits" workflow; update rebase workflow -- [actions] switch Automatic Rebase workflow to `pull_request_target` event -- [Tests] `stringify`: add tests for #378 -- [Tests] migrate tests to Github Actions -- [Tests] run `nyc` on all tests; use `tape` runner -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` - -## **6.9.4** -- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) -- [Refactor] `stringify`: reduce branching (part of #350) -- [Refactor] move `maybeMap` to `utils` -- [Dev Deps] update `browserify`, `tape` - -## **6.9.3** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.9.2** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [meta] ignore eclint transitive audit warning -- [meta] fix indentation in package.json -- [meta] add tidelift marketing copy -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` -- [actions] add automatic rebasing / merge commit blocking - -## **6.9.1** -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [Fix] `parse`: with comma true, do not split non-string values (#334) -- [meta] add `funding` field -- [Dev Deps] update `eslint`, `@ljharb/eslint-config` -- [Tests] use shared travis-ci config - -## **6.9.0** -- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile -- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray - -## **6.8.2** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.8.1** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [fix] `parse`: with comma true, do not split non-string values (#334) -- [meta] add tidelift marketing copy -- [meta] add `funding` field -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] use shared travis-ci configs -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -- [actions] add automatic rebasing / merge commit blocking - -## **6.8.0** -- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) -- [New] [Fix] stringify symbols and bigints -- [Fix] ensure node 0.12 can stringify Symbols -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Refactor] `formats`: tiny bit of cleanup. -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` -- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) -- [Tests] use `eclint` instead of `editorconfig-tools` -- [docs] readme: add security note -- [meta] add github sponsorship -- [meta] add FUNDING.yml -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause - -## **6.7.2** -- [Fix] proper comma parsing of URL-encoded commas (#361) -- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) - -## **6.7.1** -- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) -- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) -- [fix] `parse`: with comma true, do not split non-string values (#334) -- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) -- [Fix] fix for an impossible situation: when the formatter is called with a non-string value -- [Refactor] `formats`: tiny bit of cleanup. -- readme: add security note -- [meta] add tidelift marketing copy -- [meta] add `funding` field -- [meta] add FUNDING.yml -- [meta] Clean up license text so it’s properly detected as BSD-3-Clause -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` -- [Tests] `parse`: add passing `arrayFormat` tests -- [Tests] use shared travis-ci configs -- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray -- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended -- [Tests] use `eclint` instead of `editorconfig-tools` -- [actions] add automatic rebasing / merge commit blocking - -## **6.7.0** -- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) -- [Fix] correctly parse nested arrays (#212) -- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source -- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` -- [Refactor] `utils`: `isBuffer`: small tweak; add tests -- [Refactor] use cached `Array.isArray` -- [Refactor] `parse`/`stringify`: make a function to normalize the options -- [Refactor] `utils`: reduce observable [[Get]]s -- [Refactor] `stringify`/`utils`: cache `Array.isArray` -- [Tests] always use `String(x)` over `x.toString()` -- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 -- [Tests] temporarily allow coverage to fail - -## **6.6.0** -- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) -- [New] move two-value combine to a `utils` function (#189) -- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) -- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) -- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` -- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided -- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) -- [Refactor] `parse`: only need to reassign the var once -- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults -- [Refactor] add missing defaults -- [Refactor] `parse`: one less `concat` call -- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` -- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS - -## **6.5.2** -- [Fix] use `safer-buffer` instead of `Buffer` constructor -- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) -- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` - -## **6.5.1** -- [Fix] Fix parsing & compacting very deep objects (#224) -- [Refactor] name utils functions -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` -- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node -- [Tests] Use precise dist for Node.js 0.6 runtime (#225) -- [Tests] make 0.6 required, now that it’s passing -- [Tests] on `node` `v8.2`; fix npm on node 0.6 - -## **6.5.0** -- [New] add `utils.assign` -- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) -- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) -- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) -- [Fix] do not mutate `options` argument (#207) -- [Refactor] `parse`: cache index to reuse in else statement (#182) -- [Docs] add various badges to readme (#208) -- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` -- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 -- [Tests] add `editorconfig-tools` - -## **6.4.0** -- [New] `qs.stringify`: add `encodeValuesOnly` option -- [Fix] follow `allowPrototypes` option during merge (#201, #201) -- [Fix] support keys starting with brackets (#202, #200) -- [Fix] chmod a-x -- [Dev Deps] update `eslint` -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds -- [eslint] reduce warnings - -## **6.3.2** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Dev Deps] update `eslint` -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.3.1** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` -- [Tests] on all node minors; improve test matrix -- [Docs] document stringify option `allowDots` (#195) -- [Docs] add empty object and array values example (#195) -- [Docs] Fix minor inconsistency/typo (#192) -- [Docs] document stringify option `sort` (#191) -- [Refactor] `stringify`: throw faster with an invalid encoder -- [Refactor] remove unnecessary escapes (#184) -- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) - -## **6.3.0** -- [New] Add support for RFC 1738 (#174, #173) -- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) -- [Fix] ensure `utils.merge` handles merging two arrays -- [Refactor] only constructors should be capitalized -- [Refactor] capitalized var names are for constructors only -- [Refactor] avoid using a sparse array -- [Robustness] `formats`: cache `String#replace` -- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` -- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix -- [Tests] flesh out arrayLimit/arrayFormat tests (#107) -- [Tests] skip Object.create tests when null objects are not available -- [Tests] Turn on eslint for test files (#175) - -## **6.2.3** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.2.2** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties - -## **6.2.1** -- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values -- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` -- [Tests] remove `parallelshell` since it does not reliably report failures -- [Tests] up to `node` `v6.3`, `v5.12` -- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` - -## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) -- [New] pass Buffers to the encoder/decoder directly (#161) -- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) -- [Fix] fix compacting of nested sparse arrays (#150) - -## **6.1.2 -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.1.1** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties - -## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) -- [New] allowDots option for `stringify` (#151) -- [Fix] "sort" option should work at a depth of 3 or more (#151) -- [Fix] Restore `dist` directory; will be removed in v7 (#148) - -## **6.0.4** -- [Fix] follow `allowPrototypes` option during merge (#201, #200) -- [Fix] chmod a-x -- [Fix] support keys starting with brackets (#202, #200) -- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds - -## **6.0.3** -- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties -- [Fix] Restore `dist` directory; will be removed in v7 (#148) - -## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) -- Revert ES6 requirement and restore support for node down to v0.8. - -## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) -- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json - -## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) -- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 - -## **5.2.1** -- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values - -## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) -- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string - -## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) -- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional -- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify - -## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) -- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false -- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm - -## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) -- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional - -## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) -- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" - -## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) -- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties -- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost -- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing -- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object -- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option -- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. -- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 -- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 -- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign -- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute - -## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) -- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function - -## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) -- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option - -## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) -- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 -- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader - -## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) -- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object - -## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) -- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". - -## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) -- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 - -## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) -- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? -- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 -- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 - -## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) -- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number - -## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) -- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array -- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x - -## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) -- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value -- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty -- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? - -## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) -- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 -- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects - -## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) -- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present -- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays -- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge -- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? - -## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) -- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter - -## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) -- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? -- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit -- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 - -## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) -- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values - -## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) -- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters -- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block - -## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) -- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument -- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed - -## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) -- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted -- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null -- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README - -## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) -- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/node_modules/qs/LICENSE.md b/node_modules/qs/LICENSE.md deleted file mode 100644 index fecf6b6..0000000 --- a/node_modules/qs/LICENSE.md +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/qs/README.md b/node_modules/qs/README.md deleted file mode 100644 index 09e2cc9..0000000 --- a/node_modules/qs/README.md +++ /dev/null @@ -1,611 +0,0 @@ -# qs [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -A querystring parsing and stringifying library with some added security. - -Lead Maintainer: [Jordan Harband](https://github.com/ljharb) - -The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). - -## Usage - -```javascript -var qs = require('qs'); -var assert = require('assert'); - -var obj = qs.parse('a=c'); -assert.deepEqual(obj, { a: 'c' }); - -var str = qs.stringify(obj); -assert.equal(str, 'a=c'); -``` - -### Parsing Objects - -[](#preventEval) -```javascript -qs.parse(string, [options]); -``` - -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. -For example, the string `'foo[bar]=baz'` converts to: - -```javascript -assert.deepEqual(qs.parse('foo[bar]=baz'), { - foo: { - bar: 'baz' - } -}); -``` - -When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: - -```javascript -var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); -assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); -``` - -By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. - -```javascript -var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); -assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); -``` - -URI encoded strings work too: - -```javascript -assert.deepEqual(qs.parse('a%5Bb%5D=c'), { - a: { b: 'c' } -}); -``` - -You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: - -```javascript -assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { - foo: { - bar: { - baz: 'foobarbaz' - } - } -}); -``` - -By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like -`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: - -```javascript -var expected = { - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } -}; -var string = 'a[b][c][d][e][f][g][h][i]=j'; -assert.deepEqual(qs.parse(string), expected); -``` - -This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: - -```javascript -var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); -assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); -``` - -The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. - -For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: - -```javascript -var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); -assert.deepEqual(limited, { a: 'b' }); -``` - -To bypass the leading question mark, use `ignoreQueryPrefix`: - -```javascript -var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); -assert.deepEqual(prefixed, { a: 'b', c: 'd' }); -``` - -An optional delimiter can also be passed: - -```javascript -var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); -assert.deepEqual(delimited, { a: 'b', c: 'd' }); -``` - -Delimiters can be a regular expression too: - -```javascript -var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); -assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); -``` - -Option `allowDots` can be used to enable dot notation: - -```javascript -var withDots = qs.parse('a.b=c', { allowDots: true }); -assert.deepEqual(withDots, { a: { b: 'c' } }); -``` - -If you have to deal with legacy browsers or services, there's -also support for decoding percent-encoded octets as iso-8859-1: - -```javascript -var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); -assert.deepEqual(oldCharset, { a: '§' }); -``` - -Some services add an initial `utf8=✓` value to forms so that old -Internet Explorer versions are more likely to submit the form as -utf-8. Additionally, the server can check the value against wrong -encodings of the checkmark character and detect that a query string -or `application/x-www-form-urlencoded` body was *not* sent as -utf-8, eg. if the form had an `accept-charset` parameter or the -containing page had a different character set. - -**qs** supports this mechanism via the `charsetSentinel` option. -If specified, the `utf8` parameter will be omitted from the -returned object. It will be used to switch to `iso-8859-1`/`utf-8` -mode depending on how the checkmark is encoded. - -**Important**: When you specify both the `charset` option and the -`charsetSentinel` option, the `charset` will be overridden when -the request contains a `utf8` parameter from which the actual -charset can be deduced. In that sense the `charset` will behave -as the default charset rather than the authoritative charset. - -```javascript -var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { - charset: 'iso-8859-1', - charsetSentinel: true -}); -assert.deepEqual(detectedAsUtf8, { a: 'ø' }); - -// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: -var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { - charset: 'utf-8', - charsetSentinel: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); -``` - -If you want to decode the `&#...;` syntax to the actual character, -you can specify the `interpretNumericEntities` option as well: - -```javascript -var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { - charset: 'iso-8859-1', - interpretNumericEntities: true -}); -assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); -``` - -It also works when the charset has been detected in `charsetSentinel` -mode. - -### Parsing Arrays - -**qs** can also parse arrays using a similar `[]` notation: - -```javascript -var withArray = qs.parse('a[]=b&a[]=c'); -assert.deepEqual(withArray, { a: ['b', 'c'] }); -``` - -You may specify an index as well: - -```javascript -var withIndexes = qs.parse('a[1]=c&a[0]=b'); -assert.deepEqual(withIndexes, { a: ['b', 'c'] }); -``` - -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number -to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving -their order: - -```javascript -var noSparse = qs.parse('a[1]=b&a[15]=c'); -assert.deepEqual(noSparse, { a: ['b', 'c'] }); -``` - -You may also use `allowSparse` option to parse sparse arrays: - -```javascript -var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); -assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); -``` - -Note that an empty string is also a value, and will be preserved: - -```javascript -var withEmptyString = qs.parse('a[]=&a[]=b'); -assert.deepEqual(withEmptyString, { a: ['', 'b'] }); - -var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); -assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); -``` - -**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will -instead be converted to an object with the index as the key. This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. - -```javascript -var withMaxIndex = qs.parse('a[100]=b'); -assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); -``` - -This limit can be overridden by passing an `arrayLimit` option: - -```javascript -var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); -assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); -``` - -To disable array parsing entirely, set `parseArrays` to `false`. - -```javascript -var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); -assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); -``` - -If you mix notations, **qs** will merge the two items into an object: - -```javascript -var mixedNotation = qs.parse('a[0]=b&a[b]=c'); -assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); -``` - -You can also create arrays of objects: - -```javascript -var arraysOfObjects = qs.parse('a[][b]=c'); -assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); -``` - -Some people use comma to join array, **qs** can parse it: -```javascript -var arraysOfObjects = qs.parse('a=b,c', { comma: true }) -assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) -``` -(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) - -### Stringifying - -[](#preventEval) -```javascript -qs.stringify(object, [options]); -``` - -When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: - -```javascript -assert.equal(qs.stringify({ a: 'b' }), 'a=b'); -assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); -``` - -This encoding can be disabled by setting the `encode` option to `false`: - -```javascript -var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); -assert.equal(unencoded, 'a[b]=c'); -``` - -Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: -```javascript -var encodedValues = qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true } -); -assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); -``` - -This encoding can also be replaced by a custom encoding method set as `encoder` option: - -```javascript -var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { - // Passed in values `a`, `b`, `c` - return // Return encoded string -}}) -``` - -_(Note: the `encoder` option does not apply if `encode` is `false`)_ - -Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: - -```javascript -var decoded = qs.parse('x=z', { decoder: function (str) { - // Passed in values `x`, `z` - return // Return decoded string -}}) -``` - -You can encode keys and values using different logic by using the type argument provided to the encoder: - -```javascript -var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return // Encoded key - } else if (type === 'value') { - return // Encoded value - } -}}) -``` - -The type argument is also provided to the decoder: - -```javascript -var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { - if (type === 'key') { - return // Decoded key - } else if (type === 'value') { - return // Decoded value - } -}}) -``` - -Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. - -When arrays are stringified, by default they are given explicit indices: - -```javascript -qs.stringify({ a: ['b', 'c', 'd'] }); -// 'a[0]=b&a[1]=c&a[2]=d' -``` - -You may override this by setting the `indices` option to `false`: - -```javascript -qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); -// 'a=b&a=c&a=d' -``` - -You may use the `arrayFormat` option to specify the format of the output array: - -```javascript -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) -// 'a[0]=b&a[1]=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) -// 'a[]=b&a[]=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) -// 'a=b&a=c' -qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) -// 'a=b,c' -``` - -When objects are stringified, by default they use bracket notation: - -```javascript -qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); -// 'a[b][c]=d&a[b][e]=f' -``` - -You may override this to use dot notation by setting the `allowDots` option to `true`: - -```javascript -qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); -// 'a.b.c=d&a.b.e=f' -``` - -Empty strings and null values will omit the value, but the equals sign (=) remains in place: - -```javascript -assert.equal(qs.stringify({ a: '' }), 'a='); -``` - -Key with no values (such as an empty object or array) will return nothing: - -```javascript -assert.equal(qs.stringify({ a: [] }), ''); -assert.equal(qs.stringify({ a: {} }), ''); -assert.equal(qs.stringify({ a: [{}] }), ''); -assert.equal(qs.stringify({ a: { b: []} }), ''); -assert.equal(qs.stringify({ a: { b: {}} }), ''); -``` - -Properties that are set to `undefined` will be omitted entirely: - -```javascript -assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); -``` - -The query string may optionally be prepended with a question mark: - -```javascript -assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); -``` - -The delimiter may be overridden with stringify as well: - -```javascript -assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); -``` - -If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: - -```javascript -var date = new Date(7); -assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); -assert.equal( - qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), - 'a=7' -); -``` - -You may use the `sort` option to affect the order of parameter keys: - -```javascript -function alphabeticalSort(a, b) { - return a.localeCompare(b); -} -assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); -``` - -Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. -If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you -pass an array, it will be used to select properties and array indices for stringification: - -```javascript -function filterFunc(prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; -} -qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); -// 'a=b&c=d&e[f]=123&e[g][0]=4' -qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); -// 'a=b&e=f' -qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); -// 'a[0]=b&a[2]=d' -``` - -### Handling of `null` values - -By default, `null` values are treated like empty strings: - -```javascript -var withNull = qs.stringify({ a: null, b: '' }); -assert.equal(withNull, 'a=&b='); -``` - -Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. - -```javascript -var equalsInsensitive = qs.parse('a&b='); -assert.deepEqual(equalsInsensitive, { a: '', b: '' }); -``` - -To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` -values have no `=` sign: - -```javascript -var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); -assert.equal(strictNull, 'a&b='); -``` - -To parse values without `=` back to `null` use the `strictNullHandling` flag: - -```javascript -var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); -assert.deepEqual(parsedStrictNull, { a: null, b: '' }); -``` - -To completely skip rendering keys with `null` values, use the `skipNulls` flag: - -```javascript -var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); -assert.equal(nullsSkipped, 'a=b'); -``` - -If you're communicating with legacy systems, you can switch to `iso-8859-1` -using the `charset` option: - -```javascript -var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); -assert.equal(iso, '%E6=%E6'); -``` - -Characters that don't exist in `iso-8859-1` will be converted to numeric -entities, similar to what browsers do: - -```javascript -var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); -assert.equal(numeric, 'a=%26%239786%3B'); -``` - -You can use the `charsetSentinel` option to announce the character by -including an `utf8=✓` parameter with the proper encoding if the checkmark, -similar to what Ruby on Rails and others do when submitting forms. - -```javascript -var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); -assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); - -var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); -assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); -``` - -### Dealing with special character sets - -By default the encoding and decoding of characters is done in `utf-8`, -and `iso-8859-1` support is also built in via the `charset` parameter. - -If you wish to encode querystrings to a different character set (i.e. -[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the -[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: - -```javascript -var encoder = require('qs-iconv/encoder')('shift_jis'); -var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); -assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); -``` - -This also works for decoding of query strings: - -```javascript -var decoder = require('qs-iconv/decoder')('shift_jis'); -var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); -assert.deepEqual(obj, { a: 'こんにちは!' }); -``` - -### RFC 3986 and RFC 1738 space encoding - -RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. -In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. - -``` -assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); -assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); -assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); -``` - -## Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. - -## qs for enterprise - -Available as part of the Tidelift Subscription - -The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - -[1]: https://npmjs.org/package/qs -[2]: http://versionbadg.es/ljharb/qs.svg -[3]: https://api.travis-ci.org/ljharb/qs.svg -[4]: https://travis-ci.org/ljharb/qs -[5]: https://david-dm.org/ljharb/qs.svg -[6]: https://david-dm.org/ljharb/qs -[7]: https://david-dm.org/ljharb/qs/dev-status.svg -[8]: https://david-dm.org/ljharb/qs?type=dev -[9]: https://ci.testling.com/ljharb/qs.png -[10]: https://ci.testling.com/ljharb/qs -[11]: https://nodei.co/npm/qs.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/qs.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/qs.svg -[downloads-url]: http://npm-stat.com/charts.html?package=qs diff --git a/node_modules/qs/dist/qs.js b/node_modules/qs/dist/qs.js deleted file mode 100644 index b9c1bf4..0000000 --- a/node_modules/qs/dist/qs.js +++ /dev/null @@ -1,1903 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i -1) { - return val.split(','); - } - - return val; -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - -var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset, 'key'); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); - val = utils.maybeMap( - parseArrayValue(part.slice(pos + 1), options), - function (encodedVal) { - return options.decoder(encodedVal, defaults.decoder, charset, 'value'); - } - ); - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); - } - - if (part.indexOf('[]=') > -1) { - val = isArray(val) ? [val] : val; - } - - if (has.call(obj, key)) { - obj[key] = utils.combine(obj[key], val); - } else { - obj[key] = val; - } - } - - return obj; -}; - -var parseObject = function (chain, val, options, valuesParsed) { - var leaf = valuesParsed ? val : parseArrayValue(val, options); - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { - obj = { 0: leaf }; - } else if ( - !isNaN(index) - && root !== cleanRoot - && String(index) === cleanRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else { - obj[cleanRoot] = leaf; - } - } - - leaf = obj; - } - - return leaf; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - // Get the parent - - var segment = options.depth > 0 && brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - // Stash the parent if it exists - - var keys = []; - if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(parent); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options, valuesParsed); -}; - -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); - obj = utils.merge(obj, newObj, options); - } - - if (options.allowSparse === true) { - return obj; - } - - return utils.compact(obj); -}; - -},{"./utils":5}],4:[function(require,module,exports){ -'use strict'; - -var getSideChannel = require('side-channel'); -var utils = require('./utils'); -var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - comma: 'comma', - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; - -var isArray = Array.isArray; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - -var toISO = Date.prototype.toISOString; - -var defaultFormat = formats['default']; -var defaults = { - addQueryPrefix: false, - allowDots: false, - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encoder: utils.encode, - encodeValuesOnly: false, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var isNonNullishPrimitive = function isNonNullishPrimitive(v) { - return typeof v === 'string' - || typeof v === 'number' - || typeof v === 'boolean' - || typeof v === 'symbol' - || typeof v === 'bigint'; -}; - -var stringify = function stringify( - object, - prefix, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel -) { - var obj = object; - - if (sideChannel.has(object)) { - throw new RangeError('Cyclic object value'); - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = utils.maybeMap(obj, function (value) { - if (value instanceof Date) { - return serializeDate(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; - } - - obj = ''; - } - - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }]; - } else if (isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key]; - - if (skipNulls && value === null) { - continue; - } - - var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix - : prefix + (allowDots ? '.' + key : '[' + key + ']'); - - sideChannel.set(object, true); - pushToArray(values, stringify( - value, - keyPrefix, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel - )); - } - - return values; -}; - -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - - var objKeys; - var filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (options.sort) { - objKeys.sort(options.sort); - } - - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (options.skipNulls && obj[key] === null) { - continue; - } - pushToArray(keys, stringify( - obj[key], - key, - generateArrayPrefix, - options.strictNullHandling, - options.skipNulls, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -}; - -},{"./formats":1,"./utils":5,"side-channel":16}],5:[function(require,module,exports){ -'use strict'; - -var formats = require('./formats'); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; - - if (isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } - } -}; - -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - /* eslint no-param-reassign: 0 */ - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (isArray(target) && !isArray(source)) { - mergeTarget = arrayToObject(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; - -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -}; - -var encode = function encode(str, defaultEncoder, charset, kind, format) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compactQueue(queue); - - return value; -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -var combine = function combine(a, b) { - return [].concat(a, b); -}; - -var maybeMap = function maybeMap(val, fn) { - if (isArray(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - combine: combine, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isRegExp: isRegExp, - maybeMap: maybeMap, - merge: merge -}; - -},{"./formats":1}],6:[function(require,module,exports){ - -},{}],7:[function(require,module,exports){ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; - -},{"./":8,"get-intrinsic":11}],8:[function(require,module,exports){ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} - -},{"function-bind":10,"get-intrinsic":11}],9:[function(require,module,exports){ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; - -},{}],10:[function(require,module,exports){ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; - -},{"./implementation":9}],11:[function(require,module,exports){ -'use strict'; - -var undefined; - -var $SyntaxError = SyntaxError; -var $Function = Function; -var $TypeError = TypeError; - -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} -}; - -var $gOPD = Object.getOwnPropertyDescriptor; -if ($gOPD) { - try { - $gOPD({}, ''); - } catch (e) { - $gOPD = null; // this is IE 8, which has a broken gOPD - } -} - -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; - -var hasSymbols = require('has-symbols')(); - -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto - -var needsEval = {}; - -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); - -var INTRINSICS = { - '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, - '%Array%': Array, - '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, - '%JSON%': typeof JSON === 'object' ? JSON : undefined, - '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': Object, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet -}; - -var doEval = function doEval(name) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen) { - value = getProto(gen.prototype); - } - } - - INTRINSICS[name] = value; - - return value; -}; - -var LEGACY_ALIASES = { - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; - -var bind = require('function-bind'); -var hasOwn = require('has'); -var $concat = bind.call(Function.call, Array.prototype.concat); -var $spliceApply = bind.call(Function.apply, Array.prototype.splice); -var $replace = bind.call(Function.call, String.prototype.replace); -var $strSlice = bind.call(Function.call, String.prototype.slice); - -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ - -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } - - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } - - return { - alias: alias, - name: intrinsicName, - value: value - }; - } - - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; - -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; - - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } - - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; - - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; - -},{"function-bind":10,"has":14,"has-symbols":12}],12:[function(require,module,exports){ -'use strict'; - -var origSymbol = typeof Symbol !== 'undefined' && Symbol; -var hasSymbolSham = require('./shams'); - -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } - - return hasSymbolSham(); -}; - -},{"./shams":13}],13:[function(require,module,exports){ -'use strict'; - -/* eslint complexity: [2, 18], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } - - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } - - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } - - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - - if (typeof Object.getOwnPropertyDescriptor === 'function') { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } - - return true; -}; - -},{}],14:[function(require,module,exports){ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); - -},{"function-bind":10}],15:[function(require,module,exports){ -var hasMap = typeof Map === 'function' && Map.prototype; -var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; -var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; -var mapForEach = hasMap && Map.prototype.forEach; -var hasSet = typeof Set === 'function' && Set.prototype; -var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; -var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; -var setForEach = hasSet && Set.prototype.forEach; -var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; -var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; -var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; -var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; -var booleanValueOf = Boolean.prototype.valueOf; -var objectToString = Object.prototype.toString; -var functionToString = Function.prototype.toString; -var match = String.prototype.match; -var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; -var gOPS = Object.getOwnPropertySymbols; -var symToString = typeof Symbol === 'function' ? Symbol.prototype.toString : null; -var isEnumerable = Object.prototype.propertyIsEnumerable; - -var inspectCustom = require('./util.inspect').custom; -var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; - -module.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; - - if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if ( - has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' - ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity - : opts.maxStringLength !== null - ) - ) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; - if (typeof customInspect !== 'boolean') { - throw new TypeError('option "customInspect", if provided, must be `true` or `false`'); - } - - if ( - has(opts, 'indent') - && opts.indent !== null - && opts.indent !== '\t' - && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) - ) { - throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`'); - } - - if (typeof obj === 'undefined') { - return 'undefined'; - } - if (obj === null) { - return 'null'; - } - if (typeof obj === 'boolean') { - return obj ? 'true' : 'false'; - } - - if (typeof obj === 'string') { - return inspectString(obj, opts); - } - if (typeof obj === 'number') { - if (obj === 0) { - return Infinity / obj > 0 ? '0' : '-0'; - } - return String(obj); - } - if (typeof obj === 'bigint') { - return String(obj) + 'n'; - } - - var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; - if (typeof depth === 'undefined') { depth = 0; } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { - return isArray(obj) ? '[Array]' : '[Object]'; - } - - var indent = getIndent(opts, depth); - - if (typeof seen === 'undefined') { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return '[Circular]'; - } - - function inspect(value, from, noIndent) { - if (from) { - seen = seen.slice(); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, 'quoteStyle')) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } - - if (typeof obj === 'function') { - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : ''); - } - if (isSymbol(obj)) { - var symString = symToString.call(obj); - return typeof obj === 'object' ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = '<' + String(obj.nodeName).toLowerCase(); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); - } - s += '>'; - if (obj.childNodes && obj.childNodes.length) { s += '...'; } - s += ''; - return s; - } - if (isArray(obj)) { - if (obj.length === 0) { return '[]'; } - var xs = arrObjKeys(obj, inspect); - if (indent && !singleLineValues(xs)) { - return '[' + indentedJoin(xs, indent) + ']'; - } - return '[ ' + xs.join(', ') + ' ]'; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (parts.length === 0) { return '[' + String(obj) + ']'; } - return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; - } - if (typeof obj === 'object' && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { - return obj[inspectSymbol](); - } else if (typeof obj.inspect === 'function') { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - mapForEach.call(obj, function (value, key) { - mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); - }); - return collectionOf('Map', mapSize.call(obj), mapParts, indent); - } - if (isSet(obj)) { - var setParts = []; - setForEach.call(obj, function (value) { - setParts.push(inspect(value, obj)); - }); - return collectionOf('Set', setSize.call(obj), setParts, indent); - } - if (isWeakMap(obj)) { - return weakCollectionOf('WeakMap'); - } - if (isWeakSet(obj)) { - return weakCollectionOf('WeakSet'); - } - if (isNumber(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString(obj)) { - return markBoxed(inspect(String(obj))); - } - if (!isDate(obj) && !isRegExp(obj)) { - var ys = arrObjKeys(obj, inspect); - if (ys.length === 0) { return '{}'; } - if (indent) { - return '{' + indentedJoin(ys, indent) + '}'; - } - return '{ ' + ys.join(', ') + ' }'; - } - return String(obj); -}; - -function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; - return quoteChar + s + quoteChar; -} - -function quote(s) { - return String(s).replace(/"/g, '"'); -} - -function isArray(obj) { return toStr(obj) === '[object Array]'; } -function isDate(obj) { return toStr(obj) === '[object Date]'; } -function isRegExp(obj) { return toStr(obj) === '[object RegExp]'; } -function isError(obj) { return toStr(obj) === '[object Error]'; } -function isSymbol(obj) { return toStr(obj) === '[object Symbol]'; } -function isString(obj) { return toStr(obj) === '[object String]'; } -function isNumber(obj) { return toStr(obj) === '[object Number]'; } -function isBigInt(obj) { return toStr(obj) === '[object BigInt]'; } -function isBoolean(obj) { return toStr(obj) === '[object Boolean]'; } - -var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; -function has(obj, key) { - return hasOwn.call(obj, key); -} - -function toStr(obj) { - return objectToString.call(obj); -} - -function nameOf(f) { - if (f.name) { return f.name; } - var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { return m[1]; } - return null; -} - -function indexOf(xs, x) { - if (xs.indexOf) { return xs.indexOf(x); } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { return i; } - } - return -1; -} - -function isMap(x) { - if (!mapSize || !x || typeof x !== 'object') { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== 'object') { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isSet(x) { - if (!setSize || !x || typeof x !== 'object') { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== 'object') { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 - } catch (e) {} - return false; -} - -function isElement(x) { - if (!x || typeof x !== 'object') { return false; } - if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; -} - -function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); - return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer; - } - // eslint-disable-next-line no-control-regex - var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, 'single', opts); -} - -function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: 'b', - 9: 't', - 10: 'n', - 12: 'f', - 13: 'r' - }[n]; - if (x) { return '\\' + x; } - return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase(); -} - -function markBoxed(str) { - return 'Object(' + str + ')'; -} - -function weakCollectionOf(type) { - return type + ' { ? }'; -} - -function collectionOf(type, size, entries, indent) { - var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', '); - return type + ' (' + size + ') {' + joinedEntries + '}'; -} - -function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], '\n') >= 0) { - return false; - } - } - return true; -} - -function getIndent(opts, depth) { - var baseIndent; - if (opts.indent === '\t') { - baseIndent = '\t'; - } else if (typeof opts.indent === 'number' && opts.indent > 0) { - baseIndent = Array(opts.indent + 1).join(' '); - } else { - return null; - } - return { - base: baseIndent, - prev: Array(depth + 1).join(baseIndent) - }; -} - -function indentedJoin(xs, indent) { - if (xs.length === 0) { return ''; } - var lineJoiner = '\n' + indent.prev + indent.base; - return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev; -} - -function arrObjKeys(obj, inspect) { - var isArr = isArray(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; - } - } - for (var key in obj) { // eslint-disable-line no-restricted-syntax - if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue - if ((/[^\w$]/).test(key)) { - xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); - } else { - xs.push(key + ': ' + inspect(obj[key], obj)); - } - } - if (typeof gOPS === 'function') { - var syms = gOPS(obj); - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); - } - } - } - return xs; -} - -},{"./util.inspect":6}],16:[function(require,module,exports){ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); -var callBound = require('call-bind/callBound'); -var inspect = require('object-inspect'); - -var $TypeError = GetIntrinsic('%TypeError%'); -var $WeakMap = GetIntrinsic('%WeakMap%', true); -var $Map = GetIntrinsic('%Map%', true); - -var $weakMapGet = callBound('WeakMap.prototype.get', true); -var $weakMapSet = callBound('WeakMap.prototype.set', true); -var $weakMapHas = callBound('WeakMap.prototype.has', true); -var $mapGet = callBound('Map.prototype.get', true); -var $mapSet = callBound('Map.prototype.set', true); -var $mapHas = callBound('Map.prototype.has', true); - -/* - * This function traverses the list returning the node corresponding to the - * given key. - * - * That node is also moved to the head of the list, so that if it's accessed - * again we don't need to traverse the whole list. By doing so, all the recently - * used nodes can be accessed relatively quickly. - */ -var listGetNode = function (list, key) { // eslint-disable-line consistent-return - for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { - if (curr.key === key) { - prev.next = curr.next; - curr.next = list.next; - list.next = curr; // eslint-disable-line no-param-reassign - return curr; - } - } -}; - -var listGet = function (objects, key) { - var node = listGetNode(objects, key); - return node && node.value; -}; -var listSet = function (objects, key, value) { - var node = listGetNode(objects, key); - if (node) { - node.value = value; - } else { - // Prepend the new node to the beginning of the list - objects.next = { // eslint-disable-line no-param-reassign - key: key, - next: objects.next, - value: value - }; - } -}; -var listHas = function (objects, key) { - return !!listGetNode(objects, key); -}; - -module.exports = function getSideChannel() { - var $wm; - var $m; - var $o; - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - get: function (key) { // eslint-disable-line consistent-return - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapGet($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapGet($m, key); - } - } else { - if ($o) { // eslint-disable-line no-lonely-if - return listGet($o, key); - } - } - }, - has: function (key) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapHas($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapHas($m, key); - } - } else { - if ($o) { // eslint-disable-line no-lonely-if - return listHas($o, key); - } - } - return false; - }, - set: function (key, value) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if (!$wm) { - $wm = new $WeakMap(); - } - $weakMapSet($wm, key, value); - } else if ($Map) { - if (!$m) { - $m = new $Map(); - } - $mapSet($m, key, value); - } else { - if (!$o) { - /* - * Initialize the linked list as an empty node, so that we don't have - * to special-case handling of the first node: we can always refer to - * it as (previous node).next, instead of something like (list).head - */ - $o = { key: {}, next: null }; - } - listSet($o, key, value); - } - } - }; - return channel; -}; - -},{"call-bind/callBound":7,"get-intrinsic":11,"object-inspect":15}]},{},[2])(2) -}); diff --git a/node_modules/qs/lib/formats.js b/node_modules/qs/lib/formats.js deleted file mode 100644 index f36cf20..0000000 --- a/node_modules/qs/lib/formats.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var replace = String.prototype.replace; -var percentTwenties = /%20/g; - -var Format = { - RFC1738: 'RFC1738', - RFC3986: 'RFC3986' -}; - -module.exports = { - 'default': Format.RFC3986, - formatters: { - RFC1738: function (value) { - return replace.call(value, percentTwenties, '+'); - }, - RFC3986: function (value) { - return String(value); - } - }, - RFC1738: Format.RFC1738, - RFC3986: Format.RFC3986 -}; diff --git a/node_modules/qs/lib/index.js b/node_modules/qs/lib/index.js deleted file mode 100644 index 0d6a97d..0000000 --- a/node_modules/qs/lib/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var stringify = require('./stringify'); -var parse = require('./parse'); -var formats = require('./formats'); - -module.exports = { - formats: formats, - parse: parse, - stringify: stringify -}; diff --git a/node_modules/qs/lib/parse.js b/node_modules/qs/lib/parse.js deleted file mode 100644 index c833315..0000000 --- a/node_modules/qs/lib/parse.js +++ /dev/null @@ -1,263 +0,0 @@ -'use strict'; - -var utils = require('./utils'); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -var defaults = { - allowDots: false, - allowPrototypes: false, - allowSparse: false, - arrayLimit: 20, - charset: 'utf-8', - charsetSentinel: false, - comma: false, - decoder: utils.decode, - delimiter: '&', - depth: 5, - ignoreQueryPrefix: false, - interpretNumericEntities: false, - parameterLimit: 1000, - parseArrays: true, - plainObjects: false, - strictNullHandling: false -}; - -var interpretNumericEntities = function (str) { - return str.replace(/&#(\d+);/g, function ($0, numberStr) { - return String.fromCharCode(parseInt(numberStr, 10)); - }); -}; - -var parseArrayValue = function (val, options) { - if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { - return val.split(','); - } - - return val; -}; - -// This is what browsers will submit when the ✓ character occurs in an -// application/x-www-form-urlencoded body and the encoding of the page containing -// the form is iso-8859-1, or when the submitted form has an accept-charset -// attribute of iso-8859-1. Presumably also with other charsets that do not contain -// the ✓ character, such as us-ascii. -var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') - -// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. -var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') - -var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - var skipIndex = -1; // Keep track of where the utf8 sentinel was found - var i; - - var charset = options.charset; - if (options.charsetSentinel) { - for (i = 0; i < parts.length; ++i) { - if (parts[i].indexOf('utf8=') === 0) { - if (parts[i] === charsetSentinel) { - charset = 'utf-8'; - } else if (parts[i] === isoSentinel) { - charset = 'iso-8859-1'; - } - skipIndex = i; - i = parts.length; // The eslint settings do not allow break; - } - } - } - - for (i = 0; i < parts.length; ++i) { - if (i === skipIndex) { - continue; - } - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder, charset, 'key'); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); - val = utils.maybeMap( - parseArrayValue(part.slice(pos + 1), options), - function (encodedVal) { - return options.decoder(encodedVal, defaults.decoder, charset, 'value'); - } - ); - } - - if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { - val = interpretNumericEntities(val); - } - - if (part.indexOf('[]=') > -1) { - val = isArray(val) ? [val] : val; - } - - if (has.call(obj, key)) { - obj[key] = utils.combine(obj[key], val); - } else { - obj[key] = val; - } - } - - return obj; -}; - -var parseObject = function (chain, val, options, valuesParsed) { - var leaf = valuesParsed ? val : parseArrayValue(val, options); - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]' && options.parseArrays) { - obj = [].concat(leaf); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if (!options.parseArrays && cleanRoot === '') { - obj = { 0: leaf }; - } else if ( - !isNaN(index) - && root !== cleanRoot - && String(index) === cleanRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else { - obj[cleanRoot] = leaf; - } - } - - leaf = obj; - } - - return leaf; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - // Get the parent - - var segment = options.depth > 0 && brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - // Stash the parent if it exists - - var keys = []; - if (parent) { - // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(parent); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options, valuesParsed); -}; - -var normalizeParseOptions = function normalizeParseOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; - - return { - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, - allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, - arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, - decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, - delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, - // eslint-disable-next-line no-implicit-coercion, no-extra-parens - depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, - ignoreQueryPrefix: opts.ignoreQueryPrefix === true, - interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, - parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, - parseArrays: opts.parseArrays !== false, - plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (str, opts) { - var options = normalizeParseOptions(opts); - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); - obj = utils.merge(obj, newObj, options); - } - - if (options.allowSparse === true) { - return obj; - } - - return utils.compact(obj); -}; diff --git a/node_modules/qs/lib/stringify.js b/node_modules/qs/lib/stringify.js deleted file mode 100644 index b8cee4b..0000000 --- a/node_modules/qs/lib/stringify.js +++ /dev/null @@ -1,290 +0,0 @@ -'use strict'; - -var getSideChannel = require('side-channel'); -var utils = require('./utils'); -var formats = require('./formats'); -var has = Object.prototype.hasOwnProperty; - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - comma: 'comma', - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; - -var isArray = Array.isArray; -var push = Array.prototype.push; -var pushToArray = function (arr, valueOrArray) { - push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); -}; - -var toISO = Date.prototype.toISOString; - -var defaultFormat = formats['default']; -var defaults = { - addQueryPrefix: false, - allowDots: false, - charset: 'utf-8', - charsetSentinel: false, - delimiter: '&', - encode: true, - encoder: utils.encode, - encodeValuesOnly: false, - format: defaultFormat, - formatter: formats.formatters[defaultFormat], - // deprecated - indices: false, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var isNonNullishPrimitive = function isNonNullishPrimitive(v) { - return typeof v === 'string' - || typeof v === 'number' - || typeof v === 'boolean' - || typeof v === 'symbol' - || typeof v === 'bigint'; -}; - -var stringify = function stringify( - object, - prefix, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - sideChannel -) { - var obj = object; - - if (sideChannel.has(object)) { - throw new RangeError('Cyclic object value'); - } - - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (generateArrayPrefix === 'comma' && isArray(obj)) { - obj = utils.maybeMap(obj, function (value) { - if (value instanceof Date) { - return serializeDate(value); - } - return value; - }); - } - - if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; - } - - obj = ''; - } - - if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (generateArrayPrefix === 'comma' && isArray(obj)) { - // we need to join elements in - objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }]; - } else if (isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key]; - - if (skipNulls && value === null) { - continue; - } - - var keyPrefix = isArray(obj) - ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix - : prefix + (allowDots ? '.' + key : '[' + key + ']'); - - sideChannel.set(object, true); - var valueSideChannel = getSideChannel(); - pushToArray(values, stringify( - value, - keyPrefix, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - format, - formatter, - encodeValuesOnly, - charset, - valueSideChannel - )); - } - - return values; -}; - -var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { - if (!opts) { - return defaults; - } - - if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - var charset = opts.charset || defaults.charset; - if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { - throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); - } - - var format = formats['default']; - if (typeof opts.format !== 'undefined') { - if (!has.call(formats.formatters, opts.format)) { - throw new TypeError('Unknown format option provided.'); - } - format = opts.format; - } - var formatter = formats.formatters[format]; - - var filter = defaults.filter; - if (typeof opts.filter === 'function' || isArray(opts.filter)) { - filter = opts.filter; - } - - return { - addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, - allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, - charset: charset, - charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, - delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, - encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, - encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, - encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, - filter: filter, - format: format, - formatter: formatter, - serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, - skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, - sort: typeof opts.sort === 'function' ? opts.sort : null, - strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling - }; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = normalizeStringifyOptions(opts); - - var objKeys; - var filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var arrayFormat; - if (opts && opts.arrayFormat in arrayPrefixGenerators) { - arrayFormat = opts.arrayFormat; - } else if (opts && 'indices' in opts) { - arrayFormat = opts.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (options.sort) { - objKeys.sort(options.sort); - } - - var sideChannel = getSideChannel(); - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (options.skipNulls && obj[key] === null) { - continue; - } - pushToArray(keys, stringify( - obj[key], - key, - generateArrayPrefix, - options.strictNullHandling, - options.skipNulls, - options.encode ? options.encoder : null, - options.filter, - options.sort, - options.allowDots, - options.serializeDate, - options.format, - options.formatter, - options.encodeValuesOnly, - options.charset, - sideChannel - )); - } - - var joined = keys.join(options.delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - if (options.charsetSentinel) { - if (options.charset === 'iso-8859-1') { - // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark - prefix += 'utf8=%26%2310003%3B&'; - } else { - // encodeURIComponent('✓') - prefix += 'utf8=%E2%9C%93&'; - } - } - - return joined.length > 0 ? prefix + joined : ''; -}; diff --git a/node_modules/qs/lib/utils.js b/node_modules/qs/lib/utils.js deleted file mode 100644 index 4ad6ea2..0000000 --- a/node_modules/qs/lib/utils.js +++ /dev/null @@ -1,251 +0,0 @@ -'use strict'; - -var formats = require('./formats'); - -var has = Object.prototype.hasOwnProperty; -var isArray = Array.isArray; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -var compactQueue = function compactQueue(queue) { - while (queue.length > 1) { - var item = queue.pop(); - var obj = item.obj[item.prop]; - - if (isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } - } -}; - -var arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -var merge = function merge(target, source, options) { - /* eslint no-param-reassign: 0 */ - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (isArray(target)) { - target.push(source); - } else if (target && typeof target === 'object') { - if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (!target || typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (isArray(target) && !isArray(source)) { - mergeTarget = arrayToObject(target, options); - } - - if (isArray(target) && isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - var targetItem = target[i]; - if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { - target[i] = merge(targetItem, item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -var assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; - -var decode = function (str, decoder, charset) { - var strWithoutPlus = str.replace(/\+/g, ' '); - if (charset === 'iso-8859-1') { - // unescape never throws, no try...catch needed: - return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); - } - // utf-8 - try { - return decodeURIComponent(strWithoutPlus); - } catch (e) { - return strWithoutPlus; - } -}; - -var encode = function encode(str, defaultEncoder, charset, kind, format) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = str; - if (typeof str === 'symbol') { - string = Symbol.prototype.toString.call(str); - } else if (typeof str !== 'string') { - string = String(str); - } - - if (charset === 'iso-8859-1') { - return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { - return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; - }); - } - - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -var compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - compactQueue(queue); - - return value; -}; - -var isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -var isBuffer = function isBuffer(obj) { - if (!obj || typeof obj !== 'object') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -var combine = function combine(a, b) { - return [].concat(a, b); -}; - -var maybeMap = function maybeMap(val, fn) { - if (isArray(val)) { - var mapped = []; - for (var i = 0; i < val.length; i += 1) { - mapped.push(fn(val[i])); - } - return mapped; - } - return fn(val); -}; - -module.exports = { - arrayToObject: arrayToObject, - assign: assign, - combine: combine, - compact: compact, - decode: decode, - encode: encode, - isBuffer: isBuffer, - isRegExp: isRegExp, - maybeMap: maybeMap, - merge: merge -}; diff --git a/node_modules/qs/package.json b/node_modules/qs/package.json deleted file mode 100644 index 2f1326e..0000000 --- a/node_modules/qs/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "qs", - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/ljharb/qs", - "version": "6.10.1", - "repository": { - "type": "git", - "url": "https://github.com/ljharb/qs.git" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "main": "lib/index.js", - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "keywords": [ - "querystring", - "qs", - "query", - "url", - "parse", - "stringify" - ], - "engines": { - "node": ">=0.6" - }, - "dependencies": { - "side-channel": "^1.0.4" - }, - "devDependencies": { - "@ljharb/eslint-config": "^17.5.1", - "aud": "^1.1.4", - "browserify": "^16.5.2", - "eclint": "^2.8.1", - "eslint": "^7.22.0", - "evalmd": "^0.0.19", - "for-each": "^0.3.3", - "has-symbols": "^1.0.2", - "iconv-lite": "^0.5.1", - "in-publish": "^2.0.1", - "mkdirp": "^0.5.5", - "nyc": "^10.3.2", - "object-inspect": "^1.9.0", - "qs-iconv": "^1.0.4", - "safe-publish-latest": "^1.1.4", - "safer-buffer": "^2.1.2", - "tape": "^5.2.2" - }, - "scripts": { - "prepublish": "safe-publish-latest && (not-in-publish || npm run dist)", - "pretest": "npm run --silent readme && npm run --silent lint", - "test": "npm run tests-only", - "tests-only": "nyc tape 'test/**/*.js'", - "posttest": "aud --production", - "readme": "evalmd README.md", - "postlint": "eclint check * lib/* test/* !dist/*", - "lint": "eslint lib/*.js test/*.js", - "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js" - }, - "license": "BSD-3-Clause", - "greenkeeper": { - "ignore": [ - "iconv-lite", - "mkdirp" - ] - } -} diff --git a/node_modules/qs/test/parse.js b/node_modules/qs/test/parse.js deleted file mode 100644 index 7a3cfde..0000000 --- a/node_modules/qs/test/parse.js +++ /dev/null @@ -1,781 +0,0 @@ -'use strict'; - -var test = require('tape'); -var qs = require('../'); -var utils = require('../lib/utils'); -var iconv = require('iconv-lite'); -var SaferBuffer = require('safer-buffer').Buffer; - -test('parse()', function (t) { - t.test('parses a simple string', function (st) { - st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); - st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); - st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); - st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); - st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); - st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); - st.deepEqual(qs.parse('foo'), { foo: '' }); - st.deepEqual(qs.parse('foo='), { foo: '' }); - st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); - st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); - st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); - st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); - st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); - st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); - st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); - st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { - cht: 'p3', - chd: 't:60,40', - chs: '250x100', - chl: 'Hello|World' - }); - st.end(); - }); - - t.test('arrayFormat: brackets allows only explicit arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'brackets' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('arrayFormat: indices allows only indexed arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'indices' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('arrayFormat: comma allows only comma-separated arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'comma' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('arrayFormat: repeat allows only repeated values', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'repeat' }), { a: 'b,c' }); - st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] }); - st.end(); - }); - - t.test('allows enabling dot notation', function (st) { - st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); - st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); - st.end(); - }); - - t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); - t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); - t.deepEqual( - qs.parse('a[b][c][d][e][f][g][h]=i'), - { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, - 'defaults to a depth of 5' - ); - - t.test('only parses one level when depth = 1', function (st) { - st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); - st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); - st.end(); - }); - - t.test('uses original key when depth = 0', function (st) { - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); - st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); - st.end(); - }); - - t.test('uses original key when depth = false', function (st) { - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); - st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); - st.end(); - }); - - t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); - - t.test('parses an explicit array', function (st) { - st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); - st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); - st.end(); - }); - - t.test('parses a mix of simple and explicit arrays', function (st) { - st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); - - st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); - - st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); - - st.end(); - }); - - t.test('parses a nested array', function (st) { - st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); - st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); - st.end(); - }); - - t.test('allows to specify array indices', function (st) { - st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); - st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); - st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); - st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); - st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); - st.end(); - }); - - t.test('limits specific array indices to arrayLimit', function (st) { - st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); - st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); - st.end(); - }); - - t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); - - t.test('supports encoded = signs', function (st) { - st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); - st.end(); - }); - - t.test('is ok with url encoded strings', function (st) { - st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); - st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); - st.end(); - }); - - t.test('allows brackets in the value', function (st) { - st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); - st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); - st.end(); - }); - - t.test('allows empty values', function (st) { - st.deepEqual(qs.parse(''), {}); - st.deepEqual(qs.parse(null), {}); - st.deepEqual(qs.parse(undefined), {}); - st.end(); - }); - - t.test('transforms arrays to objects', function (st) { - st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); - st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); - st.end(); - }); - - t.test('transforms arrays to objects (dot notation)', function (st) { - st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); - st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); - st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); - st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); - st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); - st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); - st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); - st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); - st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - st.end(); - }); - - t.test('correctly prunes undefined values when converting an array to an object', function (st) { - st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); - st.end(); - }); - - t.test('supports malformed uri characters', function (st) { - st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); - st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); - st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); - st.end(); - }); - - t.test('doesn\'t produce empty keys', function (st) { - st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); - st.end(); - }); - - t.test('cannot access Object prototype', function (st) { - qs.parse('constructor[prototype][bad]=bad'); - qs.parse('bad[constructor][prototype][bad]=bad'); - st.equal(typeof Object.prototype.bad, 'undefined'); - st.end(); - }); - - t.test('parses arrays of objects', function (st) { - st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); - st.end(); - }); - - t.test('allows for empty strings in arrays', function (st) { - st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); - - st.deepEqual( - qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), - { a: ['b', null, 'c', ''] }, - 'with arrayLimit 20 + array indices: null then empty string works' - ); - st.deepEqual( - qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), - { a: ['b', null, 'c', ''] }, - 'with arrayLimit 0 + array brackets: null then empty string works' - ); - - st.deepEqual( - qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), - { a: ['b', '', 'c', null] }, - 'with arrayLimit 20 + array indices: empty string then null works' - ); - st.deepEqual( - qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), - { a: ['b', '', 'c', null] }, - 'with arrayLimit 0 + array brackets: empty string then null works' - ); - - st.deepEqual( - qs.parse('a[]=&a[]=b&a[]=c'), - { a: ['', 'b', 'c'] }, - 'array brackets: empty strings work' - ); - st.end(); - }); - - t.test('compacts sparse arrays', function (st) { - st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); - st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); - st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); - st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); - st.end(); - }); - - t.test('parses sparse arrays', function (st) { - /* eslint no-sparse-arrays: 0 */ - st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); - st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); - st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); - st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); - st.end(); - }); - - t.test('parses semi-parsed strings', function (st) { - st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); - st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); - st.end(); - }); - - t.test('parses buffers correctly', function (st) { - var b = SaferBuffer.from('test'); - st.deepEqual(qs.parse({ a: b }), { a: b }); - st.end(); - }); - - t.test('parses jquery-param strings', function (st) { - // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' - var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; - var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; - st.deepEqual(qs.parse(encoded), expected); - st.end(); - }); - - t.test('continues parsing when no parent is found', function (st) { - st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); - st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); - st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); - st.end(); - }); - - t.test('does not error when parsing a very long array', function (st) { - var str = 'a[]=a'; - while (Buffer.byteLength(str) < 128 * 1024) { - str = str + '&' + str; - } - - st.doesNotThrow(function () { - qs.parse(str); - }); - - st.end(); - }); - - t.test('should not throw when a native prototype has an enumerable property', function (st) { - Object.prototype.crash = ''; - Array.prototype.crash = ''; - st.doesNotThrow(qs.parse.bind(null, 'a=b')); - st.deepEqual(qs.parse('a=b'), { a: 'b' }); - st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); - st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); - delete Object.prototype.crash; - delete Array.prototype.crash; - st.end(); - }); - - t.test('parses a string with an alternative string delimiter', function (st) { - st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('parses a string with an alternative RegExp delimiter', function (st) { - st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('does not use non-splittable objects as delimiters', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('allows overriding parameter limit', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); - st.end(); - }); - - t.test('allows setting the parameter limit to Infinity', function (st) { - st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('allows overriding array limit', function (st) { - st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); - st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); - st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); - st.end(); - }); - - t.test('allows disabling array parsing', function (st) { - var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); - st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); - st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); - - var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); - st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); - st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); - - st.end(); - }); - - t.test('allows for query string prefix', function (st) { - st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); - st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); - st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); - st.end(); - }); - - t.test('parses an object', function (st) { - var input = { - 'user[name]': { 'pop[bob]': 3 }, - 'user[email]': null - }; - - var expected = { - user: { - name: { 'pop[bob]': 3 }, - email: null - } - }; - - var result = qs.parse(input); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('parses string with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); - st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); - st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); - st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); - st.end(); - }); - - t.test('parses values with comma as array divider', function (st) { - st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); - st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); - st.end(); - }); - - t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { - var decoder = function (str, defaultDecoder, charset, type) { - if (!isNaN(Number(str))) { - return parseFloat(str); - } - return defaultDecoder(str, defaultDecoder, charset, type); - }; - - st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); - st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); - - st.end(); - }); - - t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); - st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); - - st.end(); - }); - - t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { - st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); - st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); - st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); - - st.end(); - }); - - t.test('parses an object in dot notation', function (st) { - var input = { - 'user.name': { 'pop[bob]': 3 }, - 'user.email.': null - }; - - var expected = { - user: { - name: { 'pop[bob]': 3 }, - email: null - } - }; - - var result = qs.parse(input, { allowDots: true }); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('parses an object and not child values', function (st) { - var input = { - 'user[name]': { 'pop[bob]': { test: 3 } }, - 'user[email]': null - }; - - var expected = { - user: { - name: { 'pop[bob]': { test: 3 } }, - email: null - } - }; - - var result = qs.parse(input); - - st.deepEqual(result, expected); - st.end(); - }); - - t.test('does not blow up when Buffer global is missing', function (st) { - var tempBuffer = global.Buffer; - delete global.Buffer; - var result = qs.parse('a=b&c=d'); - global.Buffer = tempBuffer; - st.deepEqual(result, { a: 'b', c: 'd' }); - st.end(); - }); - - t.test('does not crash when parsing circular references', function (st) { - var a = {}; - a.b = a; - - var parsed; - - st.doesNotThrow(function () { - parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }); - - st.equal('foo' in parsed, true, 'parsed has "foo" property'); - st.equal('bar' in parsed.foo, true); - st.equal('baz' in parsed.foo, true); - st.equal(parsed.foo.bar, 'baz'); - st.deepEqual(parsed.foo.baz, a); - st.end(); - }); - - t.test('does not crash when parsing deep objects', function (st) { - var parsed; - var str = 'foo'; - - for (var i = 0; i < 5000; i++) { - str += '[p]'; - } - - str += '=bar'; - - st.doesNotThrow(function () { - parsed = qs.parse(str, { depth: 5000 }); - }); - - st.equal('foo' in parsed, true, 'parsed has "foo" property'); - - var depth = 0; - var ref = parsed.foo; - while ((ref = ref.p)) { - depth += 1; - } - - st.equal(depth, 5000, 'parsed is 5000 properties deep'); - - st.end(); - }); - - t.test('parses null objects correctly', { skip: !Object.create }, function (st) { - var a = Object.create(null); - a.b = 'c'; - - st.deepEqual(qs.parse(a), { b: 'c' }); - var result = qs.parse({ a: a }); - st.equal('a' in result, true, 'result has "a" property'); - st.deepEqual(result.a, a); - st.end(); - }); - - t.test('parses dates correctly', function (st) { - var now = new Date(); - st.deepEqual(qs.parse({ a: now }), { a: now }); - st.end(); - }); - - t.test('parses regular expressions correctly', function (st) { - var re = /^test$/; - st.deepEqual(qs.parse({ a: re }), { a: re }); - st.end(); - }); - - t.test('does not allow overwriting prototype properties', function (st) { - st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); - st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); - - st.deepEqual( - qs.parse('toString', { allowPrototypes: false }), - {}, - 'bare "toString" results in {}' - ); - - st.end(); - }); - - t.test('can allow overwriting prototype properties', function (st) { - st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); - st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); - - st.deepEqual( - qs.parse('toString', { allowPrototypes: true }), - { toString: '' }, - 'bare "toString" results in { toString: "" }' - ); - - st.end(); - }); - - t.test('params starting with a closing bracket', function (st) { - st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); - st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); - st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); - st.end(); - }); - - t.test('params starting with a starting bracket', function (st) { - st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); - st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); - st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); - st.end(); - }); - - t.test('add keys to objects', function (st) { - st.deepEqual( - qs.parse('a[b]=c&a=d'), - { a: { b: 'c', d: true } }, - 'can add keys to objects' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString'), - { a: { b: 'c' } }, - 'can not overwrite prototype' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), - { a: { b: 'c', toString: true } }, - 'can overwrite prototype with allowPrototypes true' - ); - - st.deepEqual( - qs.parse('a[b]=c&a=toString', { plainObjects: true }), - { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, - 'can overwrite prototype with plainObjects true' - ); - - st.end(); - }); - - t.test('can return null objects', { skip: !Object.create }, function (st) { - var expected = Object.create(null); - expected.a = Object.create(null); - expected.a.b = 'c'; - expected.a.hasOwnProperty = 'd'; - st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); - st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null)); - var expectedArray = Object.create(null); - expectedArray.a = Object.create(null); - expectedArray.a[0] = 'b'; - expectedArray.a.c = 'd'; - st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); - st.end(); - }); - - t.test('can parse with custom encoding', function (st) { - st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { - decoder: function (str) { - var reg = /%([0-9A-F]{2})/ig; - var result = []; - var parts = reg.exec(str); - while (parts) { - result.push(parseInt(parts[1], 16)); - parts = reg.exec(str); - } - return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); - } - }), { 県: '大阪府' }); - st.end(); - }); - - t.test('receives the default decoder as a second argument', function (st) { - st.plan(1); - qs.parse('a', { - decoder: function (str, defaultDecoder) { - st.equal(defaultDecoder, utils.decode); - } - }); - st.end(); - }); - - t.test('throws error with wrong decoder', function (st) { - st['throws'](function () { - qs.parse({}, { decoder: 'string' }); - }, new TypeError('Decoder has to be a function.')); - st.end(); - }); - - t.test('does not mutate the options argument', function (st) { - var options = {}; - qs.parse('a[b]=true', options); - st.deepEqual(options, {}); - st.end(); - }); - - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.parse('a=b', { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('parses an iso-8859-1 string if asked to', function (st) { - st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); - st.end(); - }); - - var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; - var urlEncodedOSlashInUtf8 = '%C3%B8'; - var urlEncodedNumCheckmark = '%26%2310003%3B'; - var urlEncodedNumSmiley = '%26%239786%3B'; - - t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); - st.end(); - }); - - t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { - st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); - st.end(); - }); - - t.test('should ignore an utf8 sentinel with an unknown value', function (st) { - st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); - st.end(); - }); - - t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { - st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); - st.end(); - }); - - t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { - charset: 'iso-8859-1', - decoder: function (str, defaultDecoder, charset) { - return str ? defaultDecoder(str, defaultDecoder, charset) : null; - }, - interpretNumericEntities: true - }), { foo: null, bar: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { - st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); - st.end(); - }); - - t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { - st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); - st.end(); - }); - - t.test('allows for decoding keys and values differently', function (st) { - var decoder = function (str, defaultDecoder, charset, type) { - if (type === 'key') { - return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/qs/test/stringify.js b/node_modules/qs/test/stringify.js deleted file mode 100644 index 931ac0d..0000000 --- a/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,848 +0,0 @@ -'use strict'; - -var test = require('tape'); -var qs = require('../'); -var utils = require('../lib/utils'); -var iconv = require('iconv-lite'); -var SaferBuffer = require('safer-buffer').Buffer; -var hasSymbols = require('has-symbols'); -var hasBigInt = typeof BigInt === 'function'; - -test('stringify()', function (t) { - t.test('stringifies a querystring object', function (st) { - st.equal(qs.stringify({ a: 'b' }), 'a=b'); - st.equal(qs.stringify({ a: 1 }), 'a=1'); - st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); - st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); - st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); - st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); - st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); - st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); - st.end(); - }); - - t.test('stringifies falsy values', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(null, { strictNullHandling: true }), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(0), ''); - st.end(); - }); - - t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { - st.equal(qs.stringify(Symbol.iterator), ''); - st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); - st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); - st.equal( - qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[]=Symbol%28Symbol.iterator%29' - ); - st.end(); - }); - - t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { - var three = BigInt(3); - var encodeWithN = function (value, defaultEncoder, charset) { - var result = defaultEncoder(value, defaultEncoder, charset); - return typeof value === 'bigint' ? result + 'n' : result; - }; - st.equal(qs.stringify(three), ''); - st.equal(qs.stringify([three]), '0=3'); - st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); - st.equal(qs.stringify({ a: three }), 'a=3'); - st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); - st.equal( - qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), - 'a[]=3' - ); - st.equal( - qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), - 'a[]=3n' - ); - st.end(); - }); - - t.test('adds query prefix', function (st) { - st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); - st.end(); - }); - - t.test('with query prefix, outputs blank string given an empty object', function (st) { - st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); - st.end(); - }); - - t.test('stringifies nested falsy values', function (st) { - st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); - st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); - st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); - st.end(); - }); - - t.test('stringifies a nested object', function (st) { - st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - st.end(); - }); - - t.test('stringifies a nested object with dots notation', function (st) { - st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); - st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); - st.end(); - }); - - t.test('stringifies an array value', function (st) { - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), - 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), - 'a=b%2Cc%2Cd', - 'comma => comma' - ); - st.equal( - qs.stringify({ a: ['b', 'c', 'd'] }), - 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', - 'default => indices' - ); - st.end(); - }); - - t.test('omits nulls when asked', function (st) { - st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b'); - st.end(); - }); - - t.test('omits nested nulls when asked', function (st) { - st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('omits array indices when asked', function (st) { - st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); - st.end(); - }); - - t.test('stringifies a nested array value', function (st) { - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d'); - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'comma' }), 'a%5Bb%5D=c%2Cd'); // a[b]=c,d - st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); - st.end(); - }); - - t.test('stringifies a nested array value with dots notation', function (st) { - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a.b[0]=c&a.b[1]=d', - 'indices: stringifies with dots + indices' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a.b[]=c&a.b[]=d', - 'brackets: stringifies with dots + brackets' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encode: false, arrayFormat: 'comma' } - ), - 'a.b=c,d', - 'comma: stringifies with dots + comma' - ); - st.equal( - qs.stringify( - { a: { b: ['c', 'd'] } }, - { allowDots: true, encode: false } - ), - 'a.b[0]=c&a.b[1]=d', - 'default: stringifies with dots + indices' - ); - st.end(); - }); - - t.test('stringifies an object inside an array', function (st) { - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }), - 'a%5B0%5D%5Bb%5D=c', // a[0][b]=c - 'indices => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }), - 'a%5B%5D%5Bb%5D=c', // a[][b]=c - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 'c' }] }), - 'a%5B0%5D%5Bb%5D=c', - 'default => indices' - ); - - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }), - 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1', - 'indices => indices' - ); - - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }), - 'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1', - 'brackets => brackets' - ); - - st.equal( - qs.stringify({ a: [{ b: { c: [1] } }] }), - 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1', - 'default => indices' - ); - - st.end(); - }); - - t.test('stringifies an array with mixed objects and primitives', function (st) { - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }), - 'a[0][b]=1&a[1]=2&a[2]=3', - 'indices => indices' - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }), - 'a[][b]=1&a[]=2&a[]=3', - 'brackets => brackets' - ); - st.equal( - qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), - 'a[0][b]=1&a[1]=2&a[2]=3', - 'default => indices' - ); - - st.end(); - }); - - t.test('stringifies an object inside an array with dots notation', function (st) { - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a[0].b=c', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a[].b=c', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: [{ b: 'c' }] }, - { allowDots: true, encode: false } - ), - 'a[0].b=c', - 'default => indices' - ); - - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false, arrayFormat: 'indices' } - ), - 'a[0].b.c[0]=1', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false, arrayFormat: 'brackets' } - ), - 'a[].b.c[]=1', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: [{ b: { c: [1] } }] }, - { allowDots: true, encode: false } - ), - 'a[0].b.c[0]=1', - 'default => indices' - ); - - st.end(); - }); - - t.test('does not omit object keys when indices = false', function (st) { - st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when indices=true', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); - st.end(); - }); - - t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); - st.end(); - }); - - t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) { - st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); - st.end(); - }); - - t.test('stringifies a complicated object', function (st) { - st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); - st.end(); - }); - - t.test('stringifies an empty value', function (st) { - st.equal(qs.stringify({ a: '' }), 'a='); - st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); - - st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); - st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); - - st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); - st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); - st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); - - st.end(); - }); - - t.test('stringifies an empty array in different arrayFormat', function (st) { - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); - // arrayFormat default - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); - // with strictNullHandling - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); - // with skipNulls - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); - st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); - - st.end(); - }); - - t.test('stringifies a null object', { skip: !Object.create }, function (st) { - var obj = Object.create(null); - obj.a = 'b'; - st.equal(qs.stringify(obj), 'a=b'); - st.end(); - }); - - t.test('returns an empty string for invalid input', function (st) { - st.equal(qs.stringify(undefined), ''); - st.equal(qs.stringify(false), ''); - st.equal(qs.stringify(null), ''); - st.equal(qs.stringify(''), ''); - st.end(); - }); - - t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) { - var obj = { a: Object.create(null) }; - - obj.a.b = 'c'; - st.equal(qs.stringify(obj), 'a%5Bb%5D=c'); - st.end(); - }); - - t.test('drops keys with a value of undefined', function (st) { - st.equal(qs.stringify({ a: undefined }), ''); - - st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); - st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); - st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); - st.end(); - }); - - t.test('url encodes values', function (st) { - st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); - st.end(); - }); - - t.test('stringifies a date', function (st) { - var now = new Date(); - var str = 'a=' + encodeURIComponent(now.toISOString()); - st.equal(qs.stringify({ a: now }), str); - st.end(); - }); - - t.test('stringifies the weird object from qs', function (st) { - st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); - st.end(); - }); - - t.test('skips properties that are part of the object prototype', function (st) { - Object.prototype.crash = 'test'; - st.equal(qs.stringify({ a: 'b' }), 'a=b'); - st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); - delete Object.prototype.crash; - st.end(); - }); - - t.test('stringifies boolean values', function (st) { - st.equal(qs.stringify({ a: true }), 'a=true'); - st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); - st.equal(qs.stringify({ b: false }), 'b=false'); - st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); - st.end(); - }); - - t.test('stringifies buffer values', function (st) { - st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); - st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); - st.end(); - }); - - t.test('stringifies an object using an alternative delimiter', function (st) { - st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); - st.end(); - }); - - t.test('does not blow up when Buffer global is missing', function (st) { - var tempBuffer = global.Buffer; - delete global.Buffer; - var result = qs.stringify({ a: 'b', c: 'd' }); - global.Buffer = tempBuffer; - st.equal(result, 'a=b&c=d'); - st.end(); - }); - - t.test('does not crash when parsing circular references', function (st) { - var a = {}; - a.b = a; - - st['throws']( - function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, - RangeError, - 'cyclic values throw' - ); - - var circular = { - a: 'value' - }; - circular.a = circular; - st['throws']( - function () { qs.stringify(circular); }, - RangeError, - 'cyclic values throw' - ); - - st.end(); - }); - - t.test('non-circular duplicated references can still work', function (st) { - var hourOfDay = { - 'function': 'hour_of_day' - }; - - var p1 = { - 'function': 'gte', - arguments: [hourOfDay, 0] - }; - var p2 = { - 'function': 'lte', - arguments: [hourOfDay, 23] - }; - - st.equal( - qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true }), - 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' - ); - - st.end(); - }); - - t.test('selects properties when filter=array', function (st) { - st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); - st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); - - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } - ), - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - 'indices => indices' - ); - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } - ), - 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', - 'brackets => brackets' - ); - st.equal( - qs.stringify( - { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, - { filter: ['a', 'b', 0, 2] } - ), - 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', - 'default => indices' - ); - - st.end(); - }); - - t.test('supports custom representations when filter=function', function (st) { - var calls = 0; - var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; - var filterFunc = function (prefix, value) { - calls += 1; - if (calls === 1) { - st.equal(prefix, '', 'prefix is empty'); - st.equal(value, obj); - } else if (prefix === 'c') { - return void 0; - } else if (value instanceof Date) { - st.equal(prefix, 'e[f]'); - return value.getTime(); - } - return value; - }; - - st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); - st.equal(calls, 5); - st.end(); - }); - - t.test('can disable uri encoding', function (st) { - st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); - st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); - st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); - st.end(); - }); - - t.test('can sort the keys', function (st) { - var sort = function (a, b) { - return a.localeCompare(b); - }; - st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); - st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); - st.end(); - }); - - t.test('can sort the keys at depth 3 or more too', function (st) { - var sort = function (a, b) { - return a.localeCompare(b); - }; - st.equal( - qs.stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: sort, encode: false } - ), - 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' - ); - st.equal( - qs.stringify( - { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, - { sort: null, encode: false } - ), - 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' - ); - st.end(); - }); - - t.test('can stringify with custom encoding', function (st) { - st.equal(qs.stringify({ 県: '大阪府', '': '' }, { - encoder: function (str) { - if (str.length === 0) { - return ''; - } - var buf = iconv.encode(str, 'shiftjis'); - var result = []; - for (var i = 0; i < buf.length; ++i) { - result.push(buf.readUInt8(i).toString(16)); - } - return '%' + result.join('%'); - } - }), '%8c%a7=%91%e5%8d%e3%95%7b&='); - st.end(); - }); - - t.test('receives the default encoder as a second argument', function (st) { - st.plan(2); - qs.stringify({ a: 1 }, { - encoder: function (str, defaultEncoder) { - st.equal(defaultEncoder, utils.encode); - } - }); - st.end(); - }); - - t.test('throws error with wrong encoder', function (st) { - st['throws'](function () { - qs.stringify({}, { encoder: 'string' }); - }, new TypeError('Encoder has to be a function.')); - st.end(); - }); - - t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { - st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { - encoder: function (buffer) { - if (typeof buffer === 'string') { - return buffer; - } - return String.fromCharCode(buffer.readUInt8(0) + 97); - } - }), 'a=b'); - - st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { - encoder: function (buffer) { - return buffer; - } - }), 'a=a b'); - st.end(); - }); - - t.test('serializeDate option', function (st) { - var date = new Date(); - st.equal( - qs.stringify({ a: date }), - 'a=' + date.toISOString().replace(/:/g, '%3A'), - 'default is toISOString' - ); - - var mutatedDate = new Date(); - mutatedDate.toISOString = function () { - throw new SyntaxError(); - }; - st['throws'](function () { - mutatedDate.toISOString(); - }, SyntaxError); - st.equal( - qs.stringify({ a: mutatedDate }), - 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), - 'toISOString works even when method is not locally present' - ); - - var specificDate = new Date(6); - st.equal( - qs.stringify( - { a: specificDate }, - { serializeDate: function (d) { return d.getTime() * 7; } } - ), - 'a=42', - 'custom serializeDate function called' - ); - - st.equal( - qs.stringify( - { a: [date] }, - { - serializeDate: function (d) { return d.getTime(); }, - arrayFormat: 'comma' - } - ), - 'a=' + date.getTime(), - 'works with arrayFormat comma' - ); - - st.end(); - }); - - t.test('RFC 1738 serialization', function (st) { - st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); - st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); - - st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); - - st.end(); - }); - - t.test('RFC 3986 spaces serialization', function (st) { - st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); - st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); - - st.end(); - }); - - t.test('Backward compatibility to RFC 3986', function (st) { - st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); - st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); - - st.end(); - }); - - t.test('Edge cases and unknown formats', function (st) { - ['UFO1234', false, 1234, null, {}, []].forEach( - function (format) { - st['throws']( - function () { - qs.stringify({ a: 'b c' }, { format: format }); - }, - new TypeError('Unknown format option provided.') - ); - } - ); - st.end(); - }); - - t.test('encodeValuesOnly', function (st) { - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, - { encodeValuesOnly: true } - ), - 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h' - ); - st.equal( - qs.stringify( - { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] } - ), - 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h' - ); - st.end(); - }); - - t.test('encodeValuesOnly - strictNullHandling', function (st) { - st.equal( - qs.stringify( - { a: { b: null } }, - { encodeValuesOnly: true, strictNullHandling: true } - ), - 'a[b]' - ); - st.end(); - }); - - t.test('throws if an invalid charset is specified', function (st) { - st['throws'](function () { - qs.stringify({ a: 'b' }, { charset: 'foobar' }); - }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); - st.end(); - }); - - t.test('respects a charset of iso-8859-1', function (st) { - st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); - st.end(); - }); - - t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { - st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); - st.end(); - }); - - t.test('respects an explicit charset of utf-8 (the default)', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); - st.end(); - }); - - t.test('adds the right sentinel when instructed to and the charset is utf-8', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), 'utf8=%E2%9C%93&a=%C3%A6'); - st.end(); - }); - - t.test('adds the right sentinel when instructed to and the charset is iso-8859-1', function (st) { - st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), 'utf8=%26%2310003%3B&a=%E6'); - st.end(); - }); - - t.test('does not mutate the options argument', function (st) { - var options = {}; - qs.stringify({}, options); - st.deepEqual(options, {}); - st.end(); - }); - - t.test('strictNullHandling works with custom filter', function (st) { - var filter = function (prefix, value) { - return value; - }; - - var options = { strictNullHandling: true, filter: filter }; - st.equal(qs.stringify({ key: null }, options), 'key'); - st.end(); - }); - - t.test('strictNullHandling works with null serializeDate', function (st) { - var serializeDate = function () { - return null; - }; - var options = { strictNullHandling: true, serializeDate: serializeDate }; - var date = new Date(); - st.equal(qs.stringify({ key: date }, options), 'key'); - st.end(); - }); - - t.test('allows for encoding keys and values differently', function (st) { - var encoder = function (str, defaultEncoder, charset, type) { - if (type === 'key') { - return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); - } - if (type === 'value') { - return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); - } - throw 'this should never happen! type: ' + type; - }; - - st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); - st.end(); - }); - - t.test('objects inside arrays', function (st) { - var obj = { a: { b: { c: 'd', e: 'f' } } }; - var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; - - st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'bracket' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); - - st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket'); - st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); - st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), '???', 'array, comma (pending issue #378)', { skip: true }); - - st.end(); - }); - - t.test('stringifies sparse arrays', function (st) { - /* eslint no-sparse-arrays: 0 */ - st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true }), 'a[1]=2&a[4]=1'); - st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true }), 'a[1][b][2][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c]=1'); - st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c][1]=1'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/qs/test/utils.js b/node_modules/qs/test/utils.js deleted file mode 100644 index aa84dfd..0000000 --- a/node_modules/qs/test/utils.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict'; - -var test = require('tape'); -var inspect = require('object-inspect'); -var SaferBuffer = require('safer-buffer').Buffer; -var forEach = require('for-each'); -var utils = require('../lib/utils'); - -test('merge()', function (t) { - t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); - - t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); - - t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); - - var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); - t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); - - var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); - t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); - - var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); - t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); - - var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); - t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); - - var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); - t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); - - t.test( - 'avoids invoking array setters unnecessarily', - { skip: typeof Object.defineProperty !== 'function' }, - function (st) { - var setCount = 0; - var getCount = 0; - var observed = []; - Object.defineProperty(observed, 0, { - get: function () { - getCount += 1; - return { bar: 'baz' }; - }, - set: function () { setCount += 1; } - }); - utils.merge(observed, [null]); - st.equal(setCount, 0); - st.equal(getCount, 1); - observed[0] = observed[0]; // eslint-disable-line no-self-assign - st.equal(setCount, 1); - st.equal(getCount, 2); - st.end(); - } - ); - - t.end(); -}); - -test('assign()', function (t) { - var target = { a: 1, b: 2 }; - var source = { b: 3, c: 4 }; - var result = utils.assign(target, source); - - t.equal(result, target, 'returns the target'); - t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); - t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); - - t.end(); -}); - -test('combine()', function (t) { - t.test('both arrays', function (st) { - var a = [1]; - var b = [2]; - var combined = utils.combine(a, b); - - st.deepEqual(a, [1], 'a is not mutated'); - st.deepEqual(b, [2], 'b is not mutated'); - st.notEqual(a, combined, 'a !== combined'); - st.notEqual(b, combined, 'b !== combined'); - st.deepEqual(combined, [1, 2], 'combined is a + b'); - - st.end(); - }); - - t.test('one array, one non-array', function (st) { - var aN = 1; - var a = [aN]; - var bN = 2; - var b = [bN]; - - var combinedAnB = utils.combine(aN, b); - st.deepEqual(b, [bN], 'b is not mutated'); - st.notEqual(aN, combinedAnB, 'aN + b !== aN'); - st.notEqual(a, combinedAnB, 'aN + b !== a'); - st.notEqual(bN, combinedAnB, 'aN + b !== bN'); - st.notEqual(b, combinedAnB, 'aN + b !== b'); - st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); - - var combinedABn = utils.combine(a, bN); - st.deepEqual(a, [aN], 'a is not mutated'); - st.notEqual(aN, combinedABn, 'a + bN !== aN'); - st.notEqual(a, combinedABn, 'a + bN !== a'); - st.notEqual(bN, combinedABn, 'a + bN !== bN'); - st.notEqual(b, combinedABn, 'a + bN !== b'); - st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); - - st.end(); - }); - - t.test('neither is an array', function (st) { - var combined = utils.combine(1, 2); - st.notEqual(1, combined, '1 + 2 !== 1'); - st.notEqual(2, combined, '1 + 2 !== 2'); - st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); - - st.end(); - }); - - t.end(); -}); - -test('isBuffer()', function (t) { - forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { - t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); - }); - - var fakeBuffer = { constructor: Buffer }; - t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); - - var saferBuffer = SaferBuffer.from('abc'); - t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - - var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); - t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); - t.end(); -}); diff --git a/node_modules/query-string/index.d.ts b/node_modules/query-string/index.d.ts deleted file mode 100644 index 4a115fb..0000000 --- a/node_modules/query-string/index.d.ts +++ /dev/null @@ -1,489 +0,0 @@ -export interface ParseOptions { - /** - Decode the keys and values. URI components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component). - - @default true - */ - readonly decode?: boolean; - - /** - @default 'none' - - - `bracket`: Parse arrays with bracket representation: - - ``` - import queryString = require('query-string'); - - queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `index`: Parse arrays with index representation: - - ``` - import queryString = require('query-string'); - - queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `comma`: Parse arrays with elements separated by comma: - - ``` - import queryString = require('query-string'); - - queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `separator`: Parse arrays with elements separated by a custom character: - - ``` - import queryString = require('query-string'); - - queryString.parse('foo=1|2|3', {arrayFormat: 'separator', arrayFormatSeparator: '|'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `none`: Parse arrays with elements using duplicate keys: - - ``` - import queryString = require('query-string'); - - queryString.parse('foo=1&foo=2&foo=3'); - //=> {foo: ['1', '2', '3']} - ``` - */ - readonly arrayFormat?: 'bracket' | 'index' | 'comma' | 'separator' | 'none'; - - /** - The character used to separate array elements when using `{arrayFormat: 'separator'}`. - - @default , - */ - readonly arrayFormatSeparator?: string; - - /** - Supports both `Function` as a custom sorting function or `false` to disable sorting. - - If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. - - @default true - - @example - ``` - import queryString = require('query-string'); - - const order = ['c', 'a', 'b']; - - queryString.parse('?a=one&b=two&c=three', { - sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) - }); - //=> {c: 'three', a: 'one', b: 'two'} - ``` - - @example - ``` - import queryString = require('query-string'); - - queryString.parse('?a=one&c=three&b=two', {sort: false}); - //=> {a: 'one', c: 'three', b: 'two'} - ``` - */ - readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; - - /** - Parse the value as a number type instead of string type if it's a number. - - @default false - - @example - ``` - import queryString = require('query-string'); - - queryString.parse('foo=1', {parseNumbers: true}); - //=> {foo: 1} - ``` - */ - readonly parseNumbers?: boolean; - - /** - Parse the value as a boolean type instead of string type if it's a boolean. - - @default false - - @example - ``` - import queryString = require('query-string'); - - queryString.parse('foo=true', {parseBooleans: true}); - //=> {foo: true} - ``` - */ - readonly parseBooleans?: boolean; - - /** - Parse the fragment identifier from the URL and add it to result object. - - @default false - - @example - ``` - import queryString = require('query-string'); - - queryString.parseUrl('https://foo.bar?foo=bar#xyz', {parseFragmentIdentifier: true}); - //=> {url: 'https://foo.bar', query: {foo: 'bar'}, fragmentIdentifier: 'xyz'} - ``` - */ - readonly parseFragmentIdentifier?: boolean; -} - -export interface ParsedQuery { - [key: string]: T | T[] | null; -} - -/** -Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. - -The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. - -@param query - The query string to parse. -*/ -export function parse(query: string, options: {parseBooleans: true, parseNumbers: true} & ParseOptions): ParsedQuery; -export function parse(query: string, options: {parseBooleans: true} & ParseOptions): ParsedQuery; -export function parse(query: string, options: {parseNumbers: true} & ParseOptions): ParsedQuery; -export function parse(query: string, options?: ParseOptions): ParsedQuery; - -export interface ParsedUrl { - readonly url: string; - readonly query: ParsedQuery; - - /** - The fragment identifier of the URL. - - Present when the `parseFragmentIdentifier` option is `true`. - */ - readonly fragmentIdentifier?: string; -} - -/** -Extract the URL and the query string as an object. - -If the `parseFragmentIdentifier` option is `true`, the object will also contain a `fragmentIdentifier` property. - -@param url - The URL to parse. - -@example -``` -import queryString = require('query-string'); - -queryString.parseUrl('https://foo.bar?foo=bar'); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}} - -queryString.parseUrl('https://foo.bar?foo=bar#xyz', {parseFragmentIdentifier: true}); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}, fragmentIdentifier: 'xyz'} -``` -*/ -export function parseUrl(url: string, options?: ParseOptions): ParsedUrl; - -export interface StringifyOptions { - /** - Strictly encode URI components with [`strict-uri-encode`](https://github.com/kevva/strict-uri-encode). It uses [`encodeURIComponent`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to `false`. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. - - @default true - */ - readonly strict?: boolean; - - /** - [URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. - - @default true - */ - readonly encode?: boolean; - - /** - @default 'none' - - - `bracket`: Serialize arrays using bracket representation: - - ``` - import queryString = require('query-string'); - - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); - //=> 'foo[]=1&foo[]=2&foo[]=3' - ``` - - - `index`: Serialize arrays using index representation: - - ``` - import queryString = require('query-string'); - - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); - //=> 'foo[0]=1&foo[1]=2&foo[2]=3' - ``` - - - `comma`: Serialize arrays by separating elements with comma: - - ``` - import queryString = require('query-string'); - - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); - //=> 'foo=1,2,3' - ``` - - - `separator`: Serialize arrays by separating elements with character: - - ``` - import queryString = require('query-string'); - - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'separator', arrayFormatSeparator: '|'}); - //=> 'foo=1|2|3' - ``` - - - `none`: Serialize arrays by using duplicate keys: - - ``` - import queryString = require('query-string'); - - queryString.stringify({foo: [1, 2, 3]}); - //=> 'foo=1&foo=2&foo=3' - ``` - */ - readonly arrayFormat?: 'bracket' | 'index' | 'comma' | 'separator' | 'none'; - - /** - The character used to separate array elements when using `{arrayFormat: 'separator'}`. - - @default , - */ - readonly arrayFormatSeparator?: string; - - /** - Supports both `Function` as a custom sorting function or `false` to disable sorting. - - If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. - - @default true - - @example - ``` - import queryString = require('query-string'); - - const order = ['c', 'a', 'b']; - - queryString.stringify({a: 1, b: 2, c: 3}, { - sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) - }); - //=> 'c=3&a=1&b=2' - ``` - - @example - ``` - import queryString = require('query-string'); - - queryString.stringify({b: 1, c: 2, a: 3}, {sort: false}); - //=> 'b=1&c=2&a=3' - ``` - */ - readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; - - /** - Skip keys with `null` as the value. - - Note that keys with `undefined` as the value are always skipped. - - @default false - - @example - ``` - import queryString = require('query-string'); - - queryString.stringify({a: 1, b: undefined, c: null, d: 4}, { - skipNull: true - }); - //=> 'a=1&d=4' - - queryString.stringify({a: undefined, b: null}, { - skipNull: true - }); - //=> '' - ``` - */ - readonly skipNull?: boolean; - - /** - Skip keys with an empty string as the value. - - @default false - - @example - ``` - import queryString = require('query-string'); - - queryString.stringify({a: 1, b: '', c: '', d: 4}, { - skipEmptyString: true - }); - //=> 'a=1&d=4' - ``` - - @example - ``` - import queryString = require('query-string'); - - queryString.stringify({a: '', b: ''}, { - skipEmptyString: true - }); - //=> '' - ``` - */ - readonly skipEmptyString?: boolean; -} - -export type Stringifiable = string | boolean | number | null | undefined; - -export type StringifiableRecord = Record< - string, - Stringifiable | readonly Stringifiable[] ->; - -/** -Stringify an object into a query string and sort the keys. -*/ -export function stringify( - // TODO: Use the below instead when the following TS issues are fixed: - // - https://github.com/microsoft/TypeScript/issues/15300 - // - https://github.com/microsoft/TypeScript/issues/42021 - // Context: https://github.com/sindresorhus/query-string/issues/298 - // object: StringifiableRecord, - object: Record, - options?: StringifyOptions -): string; - -/** -Extract a query string from a URL that can be passed into `.parse()`. - -Note: This behaviour can be changed with the `skipNull` option. -*/ -export function extract(url: string): string; - -export interface UrlObject { - readonly url: string; - - /** - Overrides queries in the `url` property. - */ - readonly query?: StringifiableRecord; - - /** - Overrides the fragment identifier in the `url` property. - */ - readonly fragmentIdentifier?: string; -} - -/** -Stringify an object into a URL with a query string and sorting the keys. The inverse of [`.parseUrl()`](https://github.com/sindresorhus/query-string#parseurlstring-options) - -Query items in the `query` property overrides queries in the `url` property. - -The `fragmentIdentifier` property overrides the fragment identifier in the `url` property. - -@example -``` -queryString.stringifyUrl({url: 'https://foo.bar', query: {foo: 'bar'}}); -//=> 'https://foo.bar?foo=bar' - -queryString.stringifyUrl({url: 'https://foo.bar?foo=baz', query: {foo: 'bar'}}); -//=> 'https://foo.bar?foo=bar' - -queryString.stringifyUrl({ - url: 'https://foo.bar', - query: { - top: 'foo' - }, - fragmentIdentifier: 'bar' -}); -//=> 'https://foo.bar?top=foo#bar' -``` -*/ -export function stringifyUrl( - object: UrlObject, - options?: StringifyOptions -): string; - -/** -Pick query parameters from a URL. - -@param url - The URL containing the query parameters to pick. -@param keys - The names of the query parameters to keep. All other query parameters will be removed from the URL. -@param filter - A filter predicate that will be provided the name of each query parameter and its value. The `parseNumbers` and `parseBooleans` options also affect `value`. - -@returns The URL with the picked query parameters. - -@example -``` -queryString.pick('https://foo.bar?foo=1&bar=2#hello', ['foo']); -//=> 'https://foo.bar?foo=1#hello' - -queryString.pick('https://foo.bar?foo=1&bar=2#hello', (name, value) => value === 2, {parseNumbers: true}); -//=> 'https://foo.bar?bar=2#hello' -``` -*/ -export function pick( - url: string, - keys: readonly string[], - options?: ParseOptions & StringifyOptions -): string -export function pick( - url: string, - filter: (key: string, value: string | boolean | number) => boolean, - options?: {parseBooleans: true, parseNumbers: true} & ParseOptions & StringifyOptions -): string -export function pick( - url: string, - filter: (key: string, value: string | boolean) => boolean, - options?: {parseBooleans: true} & ParseOptions & StringifyOptions -): string -export function pick( - url: string, - filter: (key: string, value: string | number) => boolean, - options?: {parseNumbers: true} & ParseOptions & StringifyOptions -): string - -/** -Exclude query parameters from a URL. Like `.pick()` but reversed. - -@param url - The URL containing the query parameters to exclude. -@param keys - The names of the query parameters to remove. All other query parameters will remain in the URL. -@param filter - A filter predicate that will be provided the name of each query parameter and its value. The `parseNumbers` and `parseBooleans` options also affect `value`. - -@returns The URL without the excluded the query parameters. - -@example -``` -queryString.exclude('https://foo.bar?foo=1&bar=2#hello', ['foo']); -//=> 'https://foo.bar?bar=2#hello' - -queryString.exclude('https://foo.bar?foo=1&bar=2#hello', (name, value) => value === 2, {parseNumbers: true}); -//=> 'https://foo.bar?foo=1#hello' -``` -*/ -export function exclude( - url: string, - keys: readonly string[], - options?: ParseOptions & StringifyOptions -): string -export function exclude( - url: string, - filter: (key: string, value: string | boolean | number) => boolean, - options?: {parseBooleans: true, parseNumbers: true} & ParseOptions & StringifyOptions -): string -export function exclude( - url: string, - filter: (key: string, value: string | boolean) => boolean, - options?: {parseBooleans: true} & ParseOptions & StringifyOptions -): string -export function exclude( - url: string, - filter: (key: string, value: string | number) => boolean, - options?: {parseNumbers: true} & ParseOptions & StringifyOptions -): string diff --git a/node_modules/query-string/index.js b/node_modules/query-string/index.js deleted file mode 100644 index 423b9d6..0000000 --- a/node_modules/query-string/index.js +++ /dev/null @@ -1,404 +0,0 @@ -'use strict'; -const strictUriEncode = require('strict-uri-encode'); -const decodeComponent = require('decode-uri-component'); -const splitOnFirst = require('split-on-first'); -const filterObject = require('filter-obj'); - -const isNullOrUndefined = value => value === null || value === undefined; - -function encoderForArrayFormat(options) { - switch (options.arrayFormat) { - case 'index': - return key => (result, value) => { - const index = result.length; - - if ( - value === undefined || - (options.skipNull && value === null) || - (options.skipEmptyString && value === '') - ) { - return result; - } - - if (value === null) { - return [...result, [encode(key, options), '[', index, ']'].join('')]; - } - - return [ - ...result, - [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('') - ]; - }; - - case 'bracket': - return key => (result, value) => { - if ( - value === undefined || - (options.skipNull && value === null) || - (options.skipEmptyString && value === '') - ) { - return result; - } - - if (value === null) { - return [...result, [encode(key, options), '[]'].join('')]; - } - - return [...result, [encode(key, options), '[]=', encode(value, options)].join('')]; - }; - - case 'comma': - case 'separator': - return key => (result, value) => { - if (value === null || value === undefined || value.length === 0) { - return result; - } - - if (result.length === 0) { - return [[encode(key, options), '=', encode(value, options)].join('')]; - } - - return [[result, encode(value, options)].join(options.arrayFormatSeparator)]; - }; - - default: - return key => (result, value) => { - if ( - value === undefined || - (options.skipNull && value === null) || - (options.skipEmptyString && value === '') - ) { - return result; - } - - if (value === null) { - return [...result, encode(key, options)]; - } - - return [...result, [encode(key, options), '=', encode(value, options)].join('')]; - }; - } -} - -function parserForArrayFormat(options) { - let result; - - switch (options.arrayFormat) { - case 'index': - return (key, value, accumulator) => { - result = /\[(\d*)\]$/.exec(key); - - key = key.replace(/\[\d*\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } - - if (accumulator[key] === undefined) { - accumulator[key] = {}; - } - - accumulator[key][result[1]] = value; - }; - - case 'bracket': - return (key, value, accumulator) => { - result = /(\[\])$/.exec(key); - key = key.replace(/\[\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } - - if (accumulator[key] === undefined) { - accumulator[key] = [value]; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - - case 'comma': - case 'separator': - return (key, value, accumulator) => { - const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator); - const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator)); - value = isEncodedArray ? decode(value, options) : value; - const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options); - accumulator[key] = newValue; - }; - - default: - return (key, value, accumulator) => { - if (accumulator[key] === undefined) { - accumulator[key] = value; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - } -} - -function validateArrayFormatSeparator(value) { - if (typeof value !== 'string' || value.length !== 1) { - throw new TypeError('arrayFormatSeparator must be single character string'); - } -} - -function encode(value, options) { - if (options.encode) { - return options.strict ? strictUriEncode(value) : encodeURIComponent(value); - } - - return value; -} - -function decode(value, options) { - if (options.decode) { - return decodeComponent(value); - } - - return value; -} - -function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } - - if (typeof input === 'object') { - return keysSorter(Object.keys(input)) - .sort((a, b) => Number(a) - Number(b)) - .map(key => input[key]); - } - - return input; -} - -function removeHash(input) { - const hashStart = input.indexOf('#'); - if (hashStart !== -1) { - input = input.slice(0, hashStart); - } - - return input; -} - -function getHash(url) { - let hash = ''; - const hashStart = url.indexOf('#'); - if (hashStart !== -1) { - hash = url.slice(hashStart); - } - - return hash; -} - -function extract(input) { - input = removeHash(input); - const queryStart = input.indexOf('?'); - if (queryStart === -1) { - return ''; - } - - return input.slice(queryStart + 1); -} - -function parseValue(value, options) { - if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) { - value = Number(value); - } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) { - value = value.toLowerCase() === 'true'; - } - - return value; -} - -function parse(query, options) { - options = Object.assign({ - decode: true, - sort: true, - arrayFormat: 'none', - arrayFormatSeparator: ',', - parseNumbers: false, - parseBooleans: false - }, options); - - validateArrayFormatSeparator(options.arrayFormatSeparator); - - const formatter = parserForArrayFormat(options); - - // Create an object with no prototype - const ret = Object.create(null); - - if (typeof query !== 'string') { - return ret; - } - - query = query.trim().replace(/^[?#&]/, ''); - - if (!query) { - return ret; - } - - for (const param of query.split('&')) { - if (param === '') { - continue; - } - - let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '='); - - // Missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - value = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options); - formatter(decode(key, options), value, ret); - } - - for (const key of Object.keys(ret)) { - const value = ret[key]; - if (typeof value === 'object' && value !== null) { - for (const k of Object.keys(value)) { - value[k] = parseValue(value[k], options); - } - } else { - ret[key] = parseValue(value, options); - } - } - - if (options.sort === false) { - return ret; - } - - return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => { - const value = ret[key]; - if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) { - // Sort object keys, not values - result[key] = keysSorter(value); - } else { - result[key] = value; - } - - return result; - }, Object.create(null)); -} - -exports.extract = extract; -exports.parse = parse; - -exports.stringify = (object, options) => { - if (!object) { - return ''; - } - - options = Object.assign({ - encode: true, - strict: true, - arrayFormat: 'none', - arrayFormatSeparator: ',' - }, options); - - validateArrayFormatSeparator(options.arrayFormatSeparator); - - const shouldFilter = key => ( - (options.skipNull && isNullOrUndefined(object[key])) || - (options.skipEmptyString && object[key] === '') - ); - - const formatter = encoderForArrayFormat(options); - - const objectCopy = {}; - - for (const key of Object.keys(object)) { - if (!shouldFilter(key)) { - objectCopy[key] = object[key]; - } - } - - const keys = Object.keys(objectCopy); - - if (options.sort !== false) { - keys.sort(options.sort); - } - - return keys.map(key => { - const value = object[key]; - - if (value === undefined) { - return ''; - } - - if (value === null) { - return encode(key, options); - } - - if (Array.isArray(value)) { - return value - .reduce(formatter(key), []) - .join('&'); - } - - return encode(key, options) + '=' + encode(value, options); - }).filter(x => x.length > 0).join('&'); -}; - -exports.parseUrl = (url, options) => { - options = Object.assign({ - decode: true - }, options); - - const [url_, hash] = splitOnFirst(url, '#'); - - return Object.assign( - { - url: url_.split('?')[0] || '', - query: parse(extract(url), options) - }, - options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {} - ); -}; - -exports.stringifyUrl = (object, options) => { - options = Object.assign({ - encode: true, - strict: true - }, options); - - const url = removeHash(object.url).split('?')[0] || ''; - const queryFromUrl = exports.extract(object.url); - const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false}); - - const query = Object.assign(parsedQueryFromUrl, object.query); - let queryString = exports.stringify(query, options); - if (queryString) { - queryString = `?${queryString}`; - } - - let hash = getHash(object.url); - if (object.fragmentIdentifier) { - hash = `#${encode(object.fragmentIdentifier, options)}`; - } - - return `${url}${queryString}${hash}`; -}; - -exports.pick = (input, filter, options) => { - options = Object.assign({ - parseFragmentIdentifier: true - }, options); - - const {url, query, fragmentIdentifier} = exports.parseUrl(input, options); - return exports.stringifyUrl({ - url, - query: filterObject(query, filter), - fragmentIdentifier - }, options); -}; - -exports.exclude = (input, filter, options) => { - const exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value); - - return exports.pick(input, exclusionFilter, options); -}; diff --git a/node_modules/query-string/license b/node_modules/query-string/license deleted file mode 100644 index e464bf7..0000000 --- a/node_modules/query-string/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (http://sindresorhus.com) - -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/query-string/package.json b/node_modules/query-string/package.json deleted file mode 100644 index c75f01a..0000000 --- a/node_modules/query-string/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "query-string", - "version": "6.14.1", - "description": "Parse and stringify URL query strings", - "license": "MIT", - "repository": "sindresorhus/query-string", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "benchmark": "node benchmark.js", - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "browser", - "querystring", - "query", - "string", - "qs", - "param", - "parameter", - "url", - "parse", - "stringify", - "encode", - "decode", - "searchparams", - "filter" - ], - "dependencies": { - "decode-uri-component": "^0.2.0", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "benchmark": "^2.1.4", - "deep-equal": "^1.0.1", - "fast-check": "^1.5.0", - "tsd": "^0.7.3", - "xo": "^0.24.0" - } -} diff --git a/node_modules/query-string/readme.md b/node_modules/query-string/readme.md deleted file mode 100644 index 280972e..0000000 --- a/node_modules/query-string/readme.md +++ /dev/null @@ -1,527 +0,0 @@ -# query-string - -> Parse and stringify URL [query strings](https://en.wikipedia.org/wiki/Query_string) - -
- ---- - -
-

-

- - My open source work is supported by the community - -

- Special thanks to: -
-
- - - -

-
- ---- - -
- -## Install - -``` -$ npm install query-string -``` - -This module targets Node.js 6 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, or, if your project is using create-react-app v1, use version 5: `npm install query-string@5`. - -## Usage - -```js -const queryString = require('query-string'); - -console.log(location.search); -//=> '?foo=bar' - -const parsed = queryString.parse(location.search); -console.log(parsed); -//=> {foo: 'bar'} - -console.log(location.hash); -//=> '#token=bada55cafe' - -const parsedHash = queryString.parse(location.hash); -console.log(parsedHash); -//=> {token: 'bada55cafe'} - -parsed.foo = 'unicorn'; -parsed.ilike = 'pizza'; - -const stringified = queryString.stringify(parsed); -//=> 'foo=unicorn&ilike=pizza' - -location.search = stringified; -// note that `location.search` automatically prepends a question mark -console.log(location.search); -//=> '?foo=unicorn&ilike=pizza' -``` - -## API - -### .parse(string, options?) - -Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. - -The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. - -#### options - -Type: `object` - -##### decode - -Type: `boolean`\ -Default: `true` - -Decode the keys and values. URL components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component). - -##### arrayFormat - -Type: `string`\ -Default: `'none'` - -- `'bracket'`: Parse arrays with bracket representation: - -```js -const queryString = require('query-string'); - -queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'index'`: Parse arrays with index representation: - -```js -const queryString = require('query-string'); - -queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'comma'`: Parse arrays with elements separated by comma: - -```js -const queryString = require('query-string'); - -queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'separator'`: Parse arrays with elements separated by a custom character: - -```js -const queryString = require('query-string'); - -queryString.parse('foo=1|2|3', {arrayFormat: 'separator', arrayFormatSeparator: '|'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'none'`: Parse arrays with elements using duplicate keys: - -```js -const queryString = require('query-string'); - -queryString.parse('foo=1&foo=2&foo=3'); -//=> {foo: ['1', '2', '3']} -``` - -##### arrayFormatSeparator - -Type: `string`\ -Default: `','` - -The character used to separate array elements when using `{arrayFormat: 'separator'}`. - -##### sort - -Type: `Function | boolean`\ -Default: `true` - -Supports both `Function` as a custom sorting function or `false` to disable sorting. - -##### parseNumbers - -Type: `boolean`\ -Default: `false` - -```js -const queryString = require('query-string'); - -queryString.parse('foo=1', {parseNumbers: true}); -//=> {foo: 1} -``` - -Parse the value as a number type instead of string type if it's a number. - -##### parseBooleans - -Type: `boolean`\ -Default: `false` - -```js -const queryString = require('query-string'); - -queryString.parse('foo=true', {parseBooleans: true}); -//=> {foo: true} -``` - -Parse the value as a boolean type instead of string type if it's a boolean. - -### .stringify(object, options?) - -Stringify an object into a query string and sorting the keys. - -#### options - -Type: `object` - -##### strict - -Type: `boolean`\ -Default: `true` - -Strictly encode URI components with [strict-uri-encode](https://github.com/kevva/strict-uri-encode). It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. - -##### encode - -Type: `boolean`\ -Default: `true` - -[URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. - -##### arrayFormat - -Type: `string`\ -Default: `'none'` - -- `'bracket'`: Serialize arrays using bracket representation: - -```js -const queryString = require('query-string'); - -queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); -//=> 'foo[]=1&foo[]=2&foo[]=3' -``` - -- `'index'`: Serialize arrays using index representation: - -```js -const queryString = require('query-string'); - -queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); -//=> 'foo[0]=1&foo[1]=2&foo[2]=3' -``` - -- `'comma'`: Serialize arrays by separating elements with comma: - -```js -const queryString = require('query-string'); - -queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); -//=> 'foo=1,2,3' -``` - -- `'none'`: Serialize arrays by using duplicate keys: - -```js -const queryString = require('query-string'); - -queryString.stringify({foo: [1, 2, 3]}); -//=> 'foo=1&foo=2&foo=3' -``` - -##### arrayFormatSeparator - -Type: `string`\ -Default: `','` - -The character used to separate array elements when using `{arrayFormat: 'separator'}`. - -##### sort - -Type: `Function | boolean` - -Supports both `Function` as a custom sorting function or `false` to disable sorting. - -```js -const queryString = require('query-string'); - -const order = ['c', 'a', 'b']; - -queryString.stringify({a: 1, b: 2, c: 3}, { - sort: (a, b) => order.indexOf(a) - order.indexOf(b) -}); -//=> 'c=3&a=1&b=2' -``` - -```js -const queryString = require('query-string'); - -queryString.stringify({b: 1, c: 2, a: 3}, {sort: false}); -//=> 'b=1&c=2&a=3' -``` - -If omitted, keys are sorted using `Array#sort()`, which means, converting them to strings and comparing strings in Unicode code point order. - -##### skipNull - -Skip keys with `null` as the value. - -Note that keys with `undefined` as the value are always skipped. - -Type: `boolean`\ -Default: `false` - -```js -const queryString = require('query-string'); - -queryString.stringify({a: 1, b: undefined, c: null, d: 4}, { - skipNull: true -}); -//=> 'a=1&d=4' -``` - -```js -const queryString = require('query-string'); - -queryString.stringify({a: undefined, b: null}, { - skipNull: true -}); -//=> '' -``` - -##### skipEmptyString - -Skip keys with an empty string as the value. - -Type: `boolean`\ -Default: `false` - -```js -const queryString = require('query-string'); - -queryString.stringify({a: 1, b: '', c: '', d: 4}, { - skipEmptyString: true -}); -//=> 'a=1&d=4' -``` - -```js -const queryString = require('query-string'); - -queryString.stringify({a: '', b: ''}, { - skipEmptyString: true -}); -//=> '' -``` - -### .extract(string) - -Extract a query string from a URL that can be passed into `.parse()`. - -Note: This behaviour can be changed with the `skipNull` option. - -### .parseUrl(string, options?) - -Extract the URL and the query string as an object. - -Returns an object with a `url` and `query` property. - -If the `parseFragmentIdentifier` option is `true`, the object will also contain a `fragmentIdentifier` property. - -```js -const queryString = require('query-string'); - -queryString.parseUrl('https://foo.bar?foo=bar'); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}} - -queryString.parseUrl('https://foo.bar?foo=bar#xyz', {parseFragmentIdentifier: true}); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}, fragmentIdentifier: 'xyz'} -``` - -#### options - -Type: `object` - -The options are the same as for `.parse()`. - -Extra options are as below. - -##### parseFragmentIdentifier - -Parse the fragment identifier from the URL. - -Type: `boolean`\ -Default: `false` - -```js -const queryString = require('query-string'); - -queryString.parseUrl('https://foo.bar?foo=bar#xyz', {parseFragmentIdentifier: true}); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}, fragmentIdentifier: 'xyz'} -``` - -### .stringifyUrl(object, options?) - -Stringify an object into a URL with a query string and sorting the keys. The inverse of [`.parseUrl()`](https://github.com/sindresorhus/query-string#parseurlstring-options) - -The `options` are the same as for `.stringify()`. - -Returns a string with the URL and a query string. - -Query items in the `query` property overrides queries in the `url` property. - -The `fragmentIdentifier` property overrides the fragment identifier in the `url` property. - -```js -queryString.stringifyUrl({url: 'https://foo.bar', query: {foo: 'bar'}}); -//=> 'https://foo.bar?foo=bar' - -queryString.stringifyUrl({url: 'https://foo.bar?foo=baz', query: {foo: 'bar'}}); -//=> 'https://foo.bar?foo=bar' - -queryString.stringifyUrl({ - url: 'https://foo.bar', - query: { - top: 'foo' - }, - fragmentIdentifier: 'bar' -}); -//=> 'https://foo.bar?top=foo#bar' -``` - -#### object - -Type: `object` - -##### url - -Type: `string` - -The URL to stringify. - -##### query - -Type: `object` - -Query items to add to the URL. - -### .pick(url, keys, options?) -### .pick(url, filter, options?) - -Pick query parameters from a URL. - -Returns a string with the new URL. - -```js -const queryString = require('query-string'); - -queryString.pick('https://foo.bar?foo=1&bar=2#hello', ['foo']); -//=> 'https://foo.bar?foo=1#hello' - -queryString.pick('https://foo.bar?foo=1&bar=2#hello', (name, value) => value === 2, {parseNumbers: true}); -//=> 'https://foo.bar?bar=2#hello' -``` - -### .exclude(url, keys, options?) -### .exclude(url, filter, options?) - -Exclude query parameters from a URL. - -Returns a string with the new URL. - -```js -const queryString = require('query-string'); - -queryString.exclude('https://foo.bar?foo=1&bar=2#hello', ['foo']); -//=> 'https://foo.bar?bar=2#hello' - -queryString.exclude('https://foo.bar?foo=1&bar=2#hello', (name, value) => value === 2, {parseNumbers: true}); -//=> 'https://foo.bar?foo=1#hello' -``` - -#### url - -Type: `string` - -The URL containing the query parameters to filter. - -#### keys - -Type: `string[]` - -The names of the query parameters to filter based on the function used. - -#### filter - -Type: `(key, value) => boolean` - -A filter predicate that will be provided the name of each query parameter and its value. The `parseNumbers` and `parseBooleans` options also affect `value`. - -#### options - -Type: `object` - -[Parse options](#options) and [stringify options](#options-1). - -## Nesting - -This module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues). - -You're much better off just converting the object to a JSON string: - -```js -const queryString = require('query-string'); - -queryString.stringify({ - foo: 'bar', - nested: JSON.stringify({ - unicorn: 'cake' - }) -}); -//=> 'foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D' -``` - -However, there is support for multiple instances of the same key: - -```js -const queryString = require('query-string'); - -queryString.parse('likes=cake&name=bob&likes=icecream'); -//=> {likes: ['cake', 'icecream'], name: 'bob'} - -queryString.stringify({color: ['taupe', 'chartreuse'], id: '515'}); -//=> 'color=taupe&color=chartreuse&id=515' -``` - -## Falsy values - -Sometimes you want to unset a key, or maybe just make it present without assigning a value to it. Here is how falsy values are stringified: - -```js -const queryString = require('query-string'); - -queryString.stringify({foo: false}); -//=> 'foo=false' - -queryString.stringify({foo: null}); -//=> 'foo' - -queryString.stringify({foo: undefined}); -//=> '' -``` - -## query-string for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of query-string and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-query-string?utm_source=npm-query-string&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/regenerator-runtime/LICENSE b/node_modules/regenerator-runtime/LICENSE deleted file mode 100644 index cde61b6..0000000 --- a/node_modules/regenerator-runtime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2014-present, Facebook, Inc. - -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/regenerator-runtime/README.md b/node_modules/regenerator-runtime/README.md deleted file mode 100644 index e8702ba..0000000 --- a/node_modules/regenerator-runtime/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# regenerator-runtime - -Standalone runtime for -[Regenerator](https://github.com/facebook/regenerator)-compiled generator -and `async` functions. - -To import the runtime as a module (recommended), either of the following -import styles will work: -```js -// CommonJS -const regeneratorRuntime = require("regenerator-runtime"); - -// ECMAScript 2015 -import regeneratorRuntime from "regenerator-runtime"; -``` - -To ensure that `regeneratorRuntime` is defined globally, either of the -following styles will work: -```js -// CommonJS -require("regenerator-runtime/runtime"); - -// ECMAScript 2015 -import "regenerator-runtime/runtime.js"; -``` - -To get the absolute file system path of `runtime.js`, evaluate the -following expression: -```js -require("regenerator-runtime/path").path -``` diff --git a/node_modules/regenerator-runtime/package.json b/node_modules/regenerator-runtime/package.json deleted file mode 100644 index efb561f..0000000 --- a/node_modules/regenerator-runtime/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "regenerator-runtime", - "author": "Ben Newman ", - "description": "Runtime for Regenerator-compiled generator and async functions.", - "version": "0.13.7", - "main": "runtime.js", - "keywords": [ - "regenerator", - "runtime", - "generator", - "async" - ], - "sideEffects": true, - "repository": { - "type": "git", - "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime" - }, - "license": "MIT" -} diff --git a/node_modules/regenerator-runtime/path.js b/node_modules/regenerator-runtime/path.js deleted file mode 100644 index ced878b..0000000 --- a/node_modules/regenerator-runtime/path.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -exports.path = require("path").join( - __dirname, - "runtime.js" -); diff --git a/node_modules/regenerator-runtime/runtime.js b/node_modules/regenerator-runtime/runtime.js deleted file mode 100644 index 547b8c6..0000000 --- a/node_modules/regenerator-runtime/runtime.js +++ /dev/null @@ -1,748 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var runtime = (function (exports) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - function define(obj, key, value) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - return obj[key]; - } - try { - // IE 8 has a broken Object.defineProperty that only works on DOM objects. - define({}, ""); - } catch (err) { - define = function(obj, key, value) { - return obj[key] = value; - }; - } - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - exports.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunction.displayName = define( - GeneratorFunctionPrototype, - toStringTagSymbol, - "GeneratorFunction" - ); - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - define(prototype, method, function(arg) { - return this._invoke(method, arg); - }); - }); - } - - exports.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - exports.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - define(genFun, toStringTagSymbol, "GeneratorFunction"); - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - exports.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator, PromiseImpl) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return PromiseImpl.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return PromiseImpl.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. - result.value = unwrapped; - resolve(result); - }, function(error) { - // If a rejected Promise was yielded, throw the rejection back - // into the async generator function so it can be handled there. - return invoke("throw", error, resolve, reject); - }); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new PromiseImpl(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - exports.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { - if (PromiseImpl === void 0) PromiseImpl = Promise; - - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList), - PromiseImpl - ); - - return exports.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - define(Gp, toStringTagSymbol, "Generator"); - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - exports.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - exports.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; - - // Regardless of whether this script is executing as a CommonJS module - // or not, return the runtime object so that we can declare the variable - // regeneratorRuntime in the outer scope, which allows this module to be - // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; - -}( - // If this script is executing as a CommonJS module, use module.exports - // as the regeneratorRuntime namespace. Otherwise create a new empty - // object. Either way, the resulting object will be used to initialize - // the regeneratorRuntime variable at the top of this file. - typeof module === "object" ? module.exports : {} -)); - -try { - regeneratorRuntime = runtime; -} catch (accidentalStrictMode) { - // This module should not be running in strict mode, so the above - // assignment should always work unless something is misconfigured. Just - // in case runtime.js accidentally runs in strict mode, we can escape - // strict mode using a global Function call. This could conceivably fail - // if a Content Security Policy forbids using Function, but in that case - // the proper solution is to fix the accidental strict mode problem. If - // you've misconfigured your bundler to force strict mode and applied a - // CSP to forbid Function, and you're not willing to fix either of those - // problems, please detail your unique predicament in a GitHub issue. - Function("r", "regeneratorRuntime = r")(runtime); -} diff --git a/node_modules/retry/.npmignore b/node_modules/retry/.npmignore new file mode 100644 index 0000000..e7726a0 --- /dev/null +++ b/node_modules/retry/.npmignore @@ -0,0 +1,2 @@ +/node_modules/* +npm-debug.log diff --git a/node_modules/retry/License b/node_modules/retry/License new file mode 100644 index 0000000..0b58de3 --- /dev/null +++ b/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + 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/retry/Makefile b/node_modules/retry/Makefile new file mode 100644 index 0000000..eee21a9 --- /dev/null +++ b/node_modules/retry/Makefile @@ -0,0 +1,22 @@ +SHELL := /bin/bash + +test: + @node test/runner.js + +release-major: test + npm version major -m "Release %s" + git push + npm publish + +release-minor: test + npm version minor -m "Release %s" + git push + npm publish + +release-patch: test + npm version patch -m "Release %s" + git push + npm publish + +.PHONY: test + diff --git a/node_modules/retry/README.md b/node_modules/retry/README.md new file mode 100644 index 0000000..eee05f7 --- /dev/null +++ b/node_modules/retry/README.md @@ -0,0 +1,215 @@ +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `17 minutes and 3 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(err ? operation.mainError() : null, addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + + + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### retry.createTimeout(attempt, opts) + +Returns a new `timeout` (integer in milliseconds) based on the given parameters. + +`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). + +`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. + +`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). + +### retry.wrap(obj, [options], [methodNames]) + +Wrap all functions of the `obj` with retry. Optionally you can pass operation options and +an array of method names which need to be wrapped. + +``` +retry.wrap(obj) + +retry.wrap(obj, ['method1', 'method2']) + +retry.wrap(obj, {retries: 3}) + +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) +``` +The `options` object can take any options that the usual call to `retry.operation` can take. + +### new RetryOperation(timeouts, [options]) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. + +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactoring. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/node_modules/retry/equation.gif b/node_modules/retry/equation.gif new file mode 100644 index 0000000..9710723 Binary files /dev/null and b/node_modules/retry/equation.gif differ diff --git a/node_modules/retry/example/dns.js b/node_modules/retry/example/dns.js new file mode 100644 index 0000000..446729b --- /dev/null +++ b/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +}); \ No newline at end of file diff --git a/node_modules/retry/example/stop.js b/node_modules/retry/example/stop.js new file mode 100644 index 0000000..e1ceafe --- /dev/null +++ b/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/node_modules/retry/index.js b/node_modules/retry/index.js new file mode 100644 index 0000000..ee62f3a --- /dev/null +++ b/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/node_modules/retry/lib/retry.js b/node_modules/retry/lib/retry.js new file mode 100644 index 0000000..77428cf --- /dev/null +++ b/node_modules/retry/lib/retry.js @@ -0,0 +1,99 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper() { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }; + obj[method].options = options; + } +}; diff --git a/node_modules/retry/lib/retry_operation.js b/node_modules/retry/lib/retry_operation.js new file mode 100644 index 0000000..2b3db8e --- /dev/null +++ b/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,143 @@ +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._timeouts = timeouts; + this._options = options || {}; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; diff --git a/node_modules/retry/package.json b/node_modules/retry/package.json new file mode 100644 index 0000000..5ac60c8 --- /dev/null +++ b/node_modules/retry/package.json @@ -0,0 +1,24 @@ +{ + "author": "Tim Koschützki (http://debuggable.com/)", + "name": "retry", + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "license": "MIT", + "version": "0.10.1", + "homepage": "https://github.com/tim-kos/node-retry", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" + }, + "directories": { + "lib": "./lib" + }, + "main": "index", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + } +} diff --git a/node_modules/retry/test/common.js b/node_modules/retry/test/common.js new file mode 100644 index 0000000..2247206 --- /dev/null +++ b/node_modules/retry/test/common.js @@ -0,0 +1,10 @@ +var common = module.exports; +var path = require('path'); + +var rootDir = path.join(__dirname, '..'); +common.dir = { + lib: rootDir + '/lib' +}; + +common.assert = require('assert'); +common.fake = require('fake'); \ No newline at end of file diff --git a/node_modules/retry/test/integration/test-forever.js b/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 0000000..b41307c --- /dev/null +++ b/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/node_modules/retry/test/integration/test-retry-operation.js b/node_modules/retry/test/integration/test-retry-operation.js new file mode 100644 index 0000000..9169364 --- /dev/null +++ b/node_modules/retry/test/integration/test-retry-operation.js @@ -0,0 +1,176 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +(function testErrors() { + var operation = retry.operation(); + + var error = new Error('some error'); + var error2 = new Error('some other error'); + operation._errors.push(error); + operation._errors.push(error2); + + assert.deepEqual(operation.errors(), [error, error2]); +})(); + +(function testMainErrorReturnsMostFrequentError() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + operation._errors.push(error); + + assert.strictEqual(operation.mainError(), error); +})(); + +(function testMainErrorReturnsLastErrorOnEqualCount() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + + assert.strictEqual(operation.mainError(), error2); +})(); + +(function testAttempt() { + var operation = retry.operation(); + var fn = new Function(); + + var timeoutOpts = { + timeout: 1, + cb: function() {} + }; + operation.attempt(fn, timeoutOpts); + + assert.strictEqual(fn, operation._fn); + assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); + assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); +})(); + +(function testRetry() { + var times = 3; + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForever() { + var error = new Error('some error'); + var operation = retry.operation({ retries: 3, forever: true }); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 6 && operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 6); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/node_modules/retry/test/integration/test-retry-wrap.js b/node_modules/retry/test/integration/test-retry-wrap.js new file mode 100644 index 0000000..7ca8bc7 --- /dev/null +++ b/node_modules/retry/test/integration/test-retry-wrap.js @@ -0,0 +1,77 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +function getLib() { + return { + fn1: function() {}, + fn2: function() {}, + fn3: function() {} + }; +} + +(function wrapAll() { + var lib = getLib(); + retry.wrap(lib); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapAllPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn1.options.retries, 2); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function wrapDefined() { + var lib = getLib(); + retry.wrap(lib, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapDefinedAndPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function runWrappedWithoutError() { + var callbackCalled; + var lib = {method: function(a, b, callback) { + assert.equal(a, 1); + assert.equal(b, 2); + assert.equal(typeof callback, 'function'); + callback(); + }}; + retry.wrap(lib); + lib.method(1, 2, function() { + callbackCalled = true; + }); + assert.ok(callbackCalled); +}()); + +(function runWrappedWithError() { + var callbackCalled; + var lib = {method: function(callback) { + callback(new Error('Some error')); + }}; + retry.wrap(lib, {retries: 1}); + lib.method(function(err) { + callbackCalled = true; + assert.ok(err instanceof Error); + }); + assert.ok(!callbackCalled); +}()); diff --git a/node_modules/retry/test/integration/test-timeouts.js b/node_modules/retry/test/integration/test-timeouts.js new file mode 100644 index 0000000..7206b0f --- /dev/null +++ b/node_modules/retry/test/integration/test-timeouts.js @@ -0,0 +1,69 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testDefaultValues() { + var timeouts = retry.timeouts(); + + assert.equal(timeouts.length, 10); + assert.equal(timeouts[0], 1000); + assert.equal(timeouts[1], 2000); + assert.equal(timeouts[2], 4000); +})(); + +(function testDefaultValuesWithRandomize() { + var minTimeout = 5000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + randomize: true + }); + + assert.equal(timeouts.length, 10); + assert.ok(timeouts[0] > minTimeout); + assert.ok(timeouts[1] > timeouts[0]); + assert.ok(timeouts[2] > timeouts[1]); +})(); + +(function testPassedTimeoutsAreUsed() { + var timeoutsArray = [1000, 2000, 3000]; + var timeouts = retry.timeouts(timeoutsArray); + assert.deepEqual(timeouts, timeoutsArray); + assert.notStrictEqual(timeouts, timeoutsArray); +})(); + +(function testTimeoutsAreWithinBoundaries() { + var minTimeout = 1000; + var maxTimeout = 10000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + maxTimeout: maxTimeout + }); + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] >= minTimeout); + assert.ok(timeouts[i] <= maxTimeout); + } +})(); + +(function testTimeoutsAreIncremental() { + var timeouts = retry.timeouts(); + var lastTimeout = timeouts[0]; + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] > lastTimeout); + lastTimeout = timeouts[i]; + } +})(); + +(function testTimeoutsAreIncrementalForFactorsLessThanOne() { + var timeouts = retry.timeouts({ + retries: 3, + factor: 0.5 + }); + + var expected = [250, 500, 1000]; + assert.deepEqual(expected, timeouts); +})(); + +(function testRetries() { + var timeouts = retry.timeouts({retries: 2}); + assert.strictEqual(timeouts.length, 2); +})(); diff --git a/node_modules/retry/test/runner.js b/node_modules/retry/test/runner.js new file mode 100644 index 0000000..e0ee2f5 --- /dev/null +++ b/node_modules/retry/test/runner.js @@ -0,0 +1,5 @@ +var far = require('far').create(); + +far.add(__dirname); +far.include(/\/test-.*\.js$/); +far.execute(); diff --git a/node_modules/side-channel/.eslintignore b/node_modules/side-channel/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/side-channel/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/side-channel/.eslintrc b/node_modules/side-channel/.eslintrc deleted file mode 100644 index 850ac1f..0000000 --- a/node_modules/side-channel/.eslintrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "max-lines-per-function": 0, - "max-params": 0, - "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], - }, -} diff --git a/node_modules/side-channel/.github/FUNDING.yml b/node_modules/side-channel/.github/FUNDING.yml deleted file mode 100644 index 2a94840..0000000 --- a/node_modules/side-channel/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/side-channel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel/.nycrc b/node_modules/side-channel/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/side-channel/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/side-channel/CHANGELOG.md b/node_modules/side-channel/CHANGELOG.md deleted file mode 100644 index a3d161f..0000000 --- a/node_modules/side-channel/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.4](https://github.com/ljharb/side-channel/compare/v1.0.3...v1.0.4) - 2020-12-29 - -### Commits - -- [Tests] migrate tests to Github Actions [`10909cb`](https://github.com/ljharb/side-channel/commit/10909cbf8ce9c0bf96f604cf13d7ffd5a22c2d40) -- [Refactor] Use a linked list rather than an array, and move accessed nodes to the beginning [`195613f`](https://github.com/ljharb/side-channel/commit/195613f28b5c1e6072ef0b61b5beebaf2b6a304e) -- [meta] do not publish github action workflow files [`290ec29`](https://github.com/ljharb/side-channel/commit/290ec29cd21a60585145b4a7237ec55228c52c27) -- [Tests] run `nyc` on all tests; use `tape` runner [`ea6d030`](https://github.com/ljharb/side-channel/commit/ea6d030ff3fe6be2eca39e859d644c51ecd88869) -- [actions] add "Allow Edits" workflow [`d464d8f`](https://github.com/ljharb/side-channel/commit/d464d8fe52b5eddf1504a0ed97f0941a90f32c15) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`02daca8`](https://github.com/ljharb/side-channel/commit/02daca87c6809821c97be468d1afa2f5ef447383) -- [Refactor] use `call-bind` and `get-intrinsic` instead of `es-abstract` [`e09d481`](https://github.com/ljharb/side-channel/commit/e09d481528452ebafa5cdeae1af665c35aa2deee) -- [Deps] update `object.assign` [`ee83aa8`](https://github.com/ljharb/side-channel/commit/ee83aa81df313b5e46319a63adb05cf0c179079a) -- [actions] update rebase action to use checkout v2 [`7726b0b`](https://github.com/ljharb/side-channel/commit/7726b0b058b632fccea709f58960871defaaa9d7) - -## [v1.0.3](https://github.com/ljharb/side-channel/compare/v1.0.2...v1.0.3) - 2020-08-23 - -### Commits - -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`1f10561`](https://github.com/ljharb/side-channel/commit/1f105611ef3acf32dec8032ae5c0baa5e56bb868) -- [Deps] update `es-abstract`, `object-inspect` [`bc20159`](https://github.com/ljharb/side-channel/commit/bc201597949a505e37cef9eaf24c7010831e6f03) -- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`b9b2b22`](https://github.com/ljharb/side-channel/commit/b9b2b225f9e0ea72a6ec2b89348f0bd690bc9ed1) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7055ab4`](https://github.com/ljharb/side-channel/commit/7055ab4de0860606efd2003674a74f1fe6ebc07e) -- [Dev Deps] update `auto-changelog`; add `aud` [`d278c37`](https://github.com/ljharb/side-channel/commit/d278c37d08227be4f84aa769fcd919e73feeba40) -- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`3bcf982`](https://github.com/ljharb/side-channel/commit/3bcf982faa122745b39c33ce83d32fdf003741c6) -- [Tests] only audit prod deps [`18d01c4`](https://github.com/ljharb/side-channel/commit/18d01c4015b82a3d75044c4d5ba7917b2eac01ec) -- [Deps] update `es-abstract` [`6ab096d`](https://github.com/ljharb/side-channel/commit/6ab096d9de2b482cf5e0717e34e212f5b2b9bc9a) -- [Dev Deps] update `tape` [`9dc174c`](https://github.com/ljharb/side-channel/commit/9dc174cc651dfd300b4b72da936a0a7eda5f9452) -- [Deps] update `es-abstract` [`431d0f0`](https://github.com/ljharb/side-channel/commit/431d0f0ff11fbd2ae6f3115582a356d3a1cfce82) -- [Deps] update `es-abstract` [`49869fd`](https://github.com/ljharb/side-channel/commit/49869fd323bf4453f0ba515c0fb265cf5ab7b932) -- [meta] Add package.json to package's exports [`77d9cdc`](https://github.com/ljharb/side-channel/commit/77d9cdceb2a9e47700074f2ae0c0a202e7dac0d4) - -## [v1.0.2](https://github.com/ljharb/side-channel/compare/v1.0.1...v1.0.2) - 2019-12-20 - -### Commits - -- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`4a526df`](https://github.com/ljharb/side-channel/commit/4a526df44e4701566ed001ec78546193f818b082) -- [Deps] update `es-abstract` [`d4f6e62`](https://github.com/ljharb/side-channel/commit/d4f6e629b6fb93a07415db7f30d3c90fd7f264fe) - -## [v1.0.1](https://github.com/ljharb/side-channel/compare/v1.0.0...v1.0.1) - 2019-12-01 - -### Commits - -- [Fix] add missing "exports" [`d212907`](https://github.com/ljharb/side-channel/commit/d2129073abf0701a5343bf28aa2145617604dc2e) - -## v1.0.0 - 2019-12-01 - -### Commits - -- Initial implementation [`dbebd3a`](https://github.com/ljharb/side-channel/commit/dbebd3a4b5ed64242f9a6810efe7c4214cd8cde4) -- Initial tests [`73bdefe`](https://github.com/ljharb/side-channel/commit/73bdefe568c9076cf8c0b8719bc2141aec0e19b8) -- Initial commit [`43c03e1`](https://github.com/ljharb/side-channel/commit/43c03e1c2849ec50a87b7a5cd76238a62b0b8770) -- npm init [`5c090a7`](https://github.com/ljharb/side-channel/commit/5c090a765d66a5527d9889b89aeff78dee91348c) -- [meta] add `auto-changelog` [`a5c4e56`](https://github.com/ljharb/side-channel/commit/a5c4e5675ec02d5eb4d84b4243aeea2a1d38fbec) -- [actions] add automatic rebasing / merge commit blocking [`bab1683`](https://github.com/ljharb/side-channel/commit/bab1683d8f9754b086e94397699fdc645e0d7077) -- [meta] add `funding` field; create FUNDING.yml [`63d7aea`](https://github.com/ljharb/side-channel/commit/63d7aeaf34f5650650ae97ca4b9fae685bd0937c) -- [Tests] add `npm run lint` [`46a5a81`](https://github.com/ljharb/side-channel/commit/46a5a81705cd2664f83df232c01dbbf2ee952885) -- Only apps should have lockfiles [`8b16b03`](https://github.com/ljharb/side-channel/commit/8b16b0305f00895d90c4e2e5773c854cfea0e448) -- [meta] add `safe-publish-latest` [`2f098ef`](https://github.com/ljharb/side-channel/commit/2f098ef092a39399cfe548b19a1fc03c2fd2f490) diff --git a/node_modules/side-channel/LICENSE b/node_modules/side-channel/LICENSE deleted file mode 100644 index 3900dd7..0000000 --- a/node_modules/side-channel/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Jordan Harband - -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/side-channel/README.md b/node_modules/side-channel/README.md deleted file mode 100644 index 7fa4f06..0000000 --- a/node_modules/side-channel/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# side-channel -Store information about any JS value in a side channel. Uses WeakMap if available. diff --git a/node_modules/side-channel/index.js b/node_modules/side-channel/index.js deleted file mode 100644 index f1c4826..0000000 --- a/node_modules/side-channel/index.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); -var callBound = require('call-bind/callBound'); -var inspect = require('object-inspect'); - -var $TypeError = GetIntrinsic('%TypeError%'); -var $WeakMap = GetIntrinsic('%WeakMap%', true); -var $Map = GetIntrinsic('%Map%', true); - -var $weakMapGet = callBound('WeakMap.prototype.get', true); -var $weakMapSet = callBound('WeakMap.prototype.set', true); -var $weakMapHas = callBound('WeakMap.prototype.has', true); -var $mapGet = callBound('Map.prototype.get', true); -var $mapSet = callBound('Map.prototype.set', true); -var $mapHas = callBound('Map.prototype.has', true); - -/* - * This function traverses the list returning the node corresponding to the - * given key. - * - * That node is also moved to the head of the list, so that if it's accessed - * again we don't need to traverse the whole list. By doing so, all the recently - * used nodes can be accessed relatively quickly. - */ -var listGetNode = function (list, key) { // eslint-disable-line consistent-return - for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { - if (curr.key === key) { - prev.next = curr.next; - curr.next = list.next; - list.next = curr; // eslint-disable-line no-param-reassign - return curr; - } - } -}; - -var listGet = function (objects, key) { - var node = listGetNode(objects, key); - return node && node.value; -}; -var listSet = function (objects, key, value) { - var node = listGetNode(objects, key); - if (node) { - node.value = value; - } else { - // Prepend the new node to the beginning of the list - objects.next = { // eslint-disable-line no-param-reassign - key: key, - next: objects.next, - value: value - }; - } -}; -var listHas = function (objects, key) { - return !!listGetNode(objects, key); -}; - -module.exports = function getSideChannel() { - var $wm; - var $m; - var $o; - var channel = { - assert: function (key) { - if (!channel.has(key)) { - throw new $TypeError('Side channel does not contain ' + inspect(key)); - } - }, - get: function (key) { // eslint-disable-line consistent-return - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapGet($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapGet($m, key); - } - } else { - if ($o) { // eslint-disable-line no-lonely-if - return listGet($o, key); - } - } - }, - has: function (key) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $weakMapHas($wm, key); - } - } else if ($Map) { - if ($m) { - return $mapHas($m, key); - } - } else { - if ($o) { // eslint-disable-line no-lonely-if - return listHas($o, key); - } - } - return false; - }, - set: function (key, value) { - if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { - if (!$wm) { - $wm = new $WeakMap(); - } - $weakMapSet($wm, key, value); - } else if ($Map) { - if (!$m) { - $m = new $Map(); - } - $mapSet($m, key, value); - } else { - if (!$o) { - /* - * Initialize the linked list as an empty node, so that we don't have - * to special-case handling of the first node: we can always refer to - * it as (previous node).next, instead of something like (list).head - */ - $o = { key: {}, next: null }; - } - listSet($o, key, value); - } - } - }; - return channel; -}; diff --git a/node_modules/side-channel/package.json b/node_modules/side-channel/package.json deleted file mode 100644 index a3e33f6..0000000 --- a/node_modules/side-channel/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "side-channel", - "version": "1.0.4", - "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", - "main": "index.js", - "exports": { - "./package.json": "./package.json", - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ] - }, - "scripts": { - "prepublish": "safe-publish-latest", - "lint": "eslint .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "npx aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/side-channel.git" - }, - "keywords": [ - "weakmap", - "map", - "side", - "channel", - "metadata" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/side-channel/issues" - }, - "homepage": "https://github.com/ljharb/side-channel#readme", - "devDependencies": { - "@ljharb/eslint-config": "^17.3.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "eslint": "^7.16.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.0.1" - }, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - } -} diff --git a/node_modules/side-channel/test/index.js b/node_modules/side-channel/test/index.js deleted file mode 100644 index 3b92ef7..0000000 --- a/node_modules/side-channel/test/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var getSideChannel = require('../'); - -test('export', function (t) { - t.equal(typeof getSideChannel, 'function', 'is a function'); - t.equal(getSideChannel.length, 0, 'takes no arguments'); - - var channel = getSideChannel(); - t.ok(channel, 'is truthy'); - t.equal(typeof channel, 'object', 'is an object'); - - t.end(); -}); - -test('assert', function (t) { - var channel = getSideChannel(); - t['throws']( - function () { channel.assert({}); }, - TypeError, - 'nonexistent value throws' - ); - - var o = {}; - channel.set(o, 'data'); - t.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); - - t.end(); -}); - -test('has', function (t) { - var channel = getSideChannel(); - var o = []; - - t.equal(channel.has(o), false, 'nonexistent value yields false'); - - channel.set(o, 'foo'); - t.equal(channel.has(o), true, 'existent value yields true'); - - t.end(); -}); - -test('get', function (t) { - var channel = getSideChannel(); - var o = {}; - t.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); - - var data = {}; - channel.set(o, data); - t.equal(channel.get(o), data, '"get" yields data set by "set"'); - - t.end(); -}); - -test('set', function (t) { - var channel = getSideChannel(); - var o = function () {}; - t.equal(channel.get(o), undefined, 'value not set'); - - channel.set(o, 42); - t.equal(channel.get(o), 42, 'value was set'); - - channel.set(o, Infinity); - t.equal(channel.get(o), Infinity, 'value was set again'); - - var o2 = {}; - channel.set(o2, 17); - t.equal(channel.get(o), Infinity, 'o is not modified'); - t.equal(channel.get(o2), 17, 'o2 is set'); - - channel.set(o, 14); - t.equal(channel.get(o), 14, 'o is modified'); - t.equal(channel.get(o2), 17, 'o2 is not modified'); - - t.end(); -}); diff --git a/node_modules/sjcl/.eslintignore b/node_modules/sjcl/.eslintignore new file mode 100644 index 0000000..4f7069b --- /dev/null +++ b/node_modules/sjcl/.eslintignore @@ -0,0 +1,4 @@ +doc/ +core.js +core_closure.js +sjcl.js diff --git a/node_modules/sjcl/.eslintrc b/node_modules/sjcl/.eslintrc new file mode 100644 index 0000000..6b69390 --- /dev/null +++ b/node_modules/sjcl/.eslintrc @@ -0,0 +1,29 @@ +{ + "rules": { + "indent": [ + 0, + 2 + ], + "quotes": [ + 0, + "double" + ], + "linebreak-style": [ + 2, + "unix" + ], + "semi": [ + 2, + "always" + ] + }, + "globals": { + "sjcl": true, + "browserUtil": true + }, + "env": { + "node": true, + "browser": true + }, + "extends": "eslint:recommended" +} diff --git a/node_modules/sjcl/.travis.yml b/node_modules/sjcl/.travis.yml new file mode 100644 index 0000000..0a32dde --- /dev/null +++ b/node_modules/sjcl/.travis.yml @@ -0,0 +1,9 @@ +sudo: false +language: node_js +cache: + directories: + - node_modules +node_js: + - "10" + - "0.12" +before_script: ./configure --with-all diff --git a/node_modules/sjcl/LICENSE.txt b/node_modules/sjcl/LICENSE.txt new file mode 100644 index 0000000..983d342 --- /dev/null +++ b/node_modules/sjcl/LICENSE.txt @@ -0,0 +1,58 @@ +SJCL is open. You can use, modify and redistribute it under a BSD +license or under the GNU GPL, version 2.0. + +--------------------------------------------------------------------- + +http://opensource.org/licenses/BSD-2-Clause + +Copyright (c) 2009-2015, Emily Stark, Mike Hamburg and Dan Boneh at +Stanford University. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--------------------------------------------------------------------- + +http://opensource.org/licenses/GPL-2.0 + +The Stanford Javascript Crypto Library (hosted here on GitHub) is a +project by the Stanford Computer Security Lab to build a secure, +powerful, fast, small, easy-to-use, cross-browser library for +cryptography in Javascript. + +Copyright (c) 2009-2015, Emily Stark, Mike Hamburg and Dan Boneh at +Stanford University. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA \ No newline at end of file diff --git a/node_modules/sjcl/Makefile b/node_modules/sjcl/Makefile new file mode 100644 index 0000000..dd0c346 --- /dev/null +++ b/node_modules/sjcl/Makefile @@ -0,0 +1,99 @@ +YUICOMPRESSOR= yuicompressor-2.4.2.jar + +include config.mk + +.PHONY: all test test_yui test_closure test_uncompressed lint compression_stats + +all: sjcl.js + +sjcl.js: $(COMPRESS) + cp $^ $@ + +core.js: $(SOURCES) config.mk + cat $(SOURCES) > $@ + +# compressed targets +core_closure.js: core.js compress/compress_with_closure.sh compress/*.pl + compress/compress_with_closure.sh $< > $@ + +core_yui.js: core.js compress/compress_with_yui.sh compress/*.pl + compress/compress_with_yui.sh $< > $@ + +compression_stats: core.js core_closure.js core_yui.js + gzip -c core.js > core.js.gz + gzip -c core_yui.js > core_yui.js.gz + gzip -c core_closure.js > core_closure.js.gz + + @echo + @echo + @echo Compression stats: + @echo + @wc -c core.js core_closure.js core_yui.js | head -n -1 + @echo + @wc -c core*.js.gz | head -n -1 + @echo + @echo + + rm -f core*.js.gz + +doc: $(SOURCES) + rm -fr $@ + npm run jsdoc -- $(SOURCES) --destination $@ + +doc_private: $(SOURCES) + rm -fr $@ + npm run jsdoc -- $(SOURCES) --destination $@ --private + +lint: + npm run lint + + +TEST_COMMON= browserTest/nodeUtil.js test/test.js + +TEST_SCRIPTS= $(TEST_COMMON) \ + test/ccm_vectors.js test/ccm_arraybuffer_test.js \ + test/codec_arraybuffer_test.js \ + test/aes_vectors.js test/aes_test.js \ + test/bitArray_vectors.js test/bitArray_test.js \ + test/bn_vectors.js test/bn_test.js \ + test/cbc_vectors.js test/cbc_test.js \ + test/ctr_vectors.js test/ctr_test.js \ + test/ccm_vectors.js test/ccm_test.js \ + test/ecc_vectors.js test/ecc_test.js \ + test/ecc_conv.js \ + test/ecdsa_test.js test/ecdsa_vectors.js test/ecdh_test.js \ + test/gcm_vectors.js test/gcm_test.js \ + test/hmac_vectors.js test/hmac_test.js \ + test/json_test.js \ + test/ocb2_vectors.js test/ocb2_test.js \ + test/ocb2progressive_test.js \ + test/pbkdf2_test.js test/scrypt_vectors.js test/scrypt_test.js \ + test/ripemd160_vectors.js test/ripemd160_test.js \ + test/sha1_vectors.js test/sha1_test.js \ + test/sha1_vectors_long_messages.js test/sha1_test_long_messages.js \ + test/sha1_huge_test_messages.js test/sha1_huge_test.js \ + test/sha256_vectors.js test/sha256_test.js \ + test/sha256_huge_test_messages.js test/sha256_huge_test.js \ + test/sha256_vectors_long_messages.js test/sha256_test_long_messages.js \ + test/sha256_test_brute_force.js \ + test/sha512_vectors.js test/sha512_test.js \ + test/sha512_vectors_long_messages.js test/sha512_test_long_messages.js \ + test/sha512_huge_test_messages.js test/sha512_huge_test.js \ + test/sha512_test_brute_force.js \ + test/srp_vectors.js test/srp_test.js \ + test/z85_vectors.js test/z85_test.js + +# Run all tests in node.js. +test: sjcl.js $(TEST_SCRIPTS) test/run_tests_node.js + node test/run_tests_node.js $< $(TEST_SCRIPTS) + +tidy: + find . -name '*~' -delete + rm -f core.js core_*.js + +clean: tidy + rm -fr sjcl.js doc doc_private + +distclean: clean + ./configure + make sjcl.js tidy diff --git a/node_modules/sjcl/README.md b/node_modules/sjcl/README.md new file mode 100644 index 0000000..4d3cf20 --- /dev/null +++ b/node_modules/sjcl/README.md @@ -0,0 +1,34 @@ +sjcl +==== + +[![Build Status](https://travis-ci.org/bitwiseshiftleft/sjcl.png)](https://travis-ci.org/bitwiseshiftleft/sjcl) + +[![Join the chat at https://gitter.im/bitwiseshiftleft/sjcl](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bitwiseshiftleft/sjcl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Stanford Javascript Crypto Library + +Security Advisories +=== + +* 12.02.2014: the current development version has a paranoia bug in the ecc module. The bug was introduced in commit [ac0b3fe0](https://github.com/bitwiseshiftleft/sjcl/commit/ac0b3fe0) and might affect ecc key generation on platforms without a platform random number generator. + +Security Contact +==== +Security Mail: sjcl@ovt.me +OpenPGP-Key Fingerprint: 0D54 3E52 87B4 EC06 3FA9 0115 72ED A6C7 7AAF 48ED +Keyserver: pool.sks-keyservers.net + +Upgrade Guide +==== + +## 1.0.3 -> 1.0.4 + +`codecBase32` has been re-enabled with changes to conform to [RFC 4648](http://tools.ietf.org/html/rfc4648#section-6): + +* Padding with `=` is now applied to the output of `fromBits`. If you don't want that padding, you can disable it by calling `fromBits` with a second parameter of `true` or anything that evaluates as "truthy" in JS +* The encoding alphabet for `sjcl.codec.base32` now matches that specified by the RFC, rather than the extended hex alphabet. +* The former extended hex alphabet is now available through `sjcl.codec.base32hex` (also matching the RFC). So if you encoded something with `base32` before, you'll want to decode it with `base32hex` now. + +Documentation +==== +The documentation is available [here](http://bitwiseshiftleft.github.io/sjcl/doc/) diff --git a/node_modules/sjcl/README/COPYRIGHT b/node_modules/sjcl/README/COPYRIGHT new file mode 100644 index 0000000..69b3e19 --- /dev/null +++ b/node_modules/sjcl/README/COPYRIGHT @@ -0,0 +1,49 @@ +SJCL used to be in the public domain. Now it's: + +Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh, Stanford University. + +This is for liability reasons. (Speaking of which, SJCL comes with NO +WARRANTY WHATSOEVER, express or implied, to the limit of applicable +law.) + +SJCL is dual-licensed under the GNU GPL version 2.0 or higher, and a +2-clause BSD license. You may use SJCL under the terms of either of +these licenses. For your convenience, the GPL versions 2.0 and 3.0 +and the 2-clause BSD license are included here. Additionally, you may +serve "crunched" copies of sjcl (i.e. those with comments removed, +and other transformations to reduce code size) without any copyright +notice. + +SJCL includes JsDoc toolkit, YUI compressor, Closure compressor, +JSLint and the CodeView template in its build system. These programs' +copyrights are owned by other people. They are distributed here under +the MPL, MIT, BSD, Apache and JSLint licenses. Codeview is "free for +download" but has no license attached; it is Copyright 2010 Wouter Bos. + +The BSD license is (almost?) strictly more permissive, but the +additionally licensing under the GPL allows us to use OCB 2.0 code +royalty-free (at least, if OCB 2.0's creator Phil Rogaway has anything +to say about it). Note that if you redistribute SJCL under a license +other than the GPL, you or your users may need to pay patent licensing +fees for OCB 2.0. + +There may be patents which apply to SJCL other than Phil Rogaway's OCB +patents. We suggest that you consult legal counsel before using SJCL +in a commercial project. + +----- + +Please note, two Java JAR files, Google Closure Compiler and +YUI Compressor, are provided in the "compress" folder as a convenience +for the compiling process of SJCL. These are not part of SJCL itself +and provided under their own licenses. + +As of October 2015, more information can be found at the following +locations: + +Google Closure Compiler + - https://developers.google.com/closure/compiler/ + +YUI Compressor + - http://yui.github.io/yuicompressor/ + diff --git a/node_modules/sjcl/README/INSTALL b/node_modules/sjcl/README/INSTALL new file mode 100644 index 0000000..a5898c4 --- /dev/null +++ b/node_modules/sjcl/README/INSTALL @@ -0,0 +1,36 @@ +SJCL comes with a file sjcl.js pre-built. This default build includes +all the modules except for sjcl.codec.bytes (because the demo site doesn't +use it). All you need to do to install is copy this file to your web +server and start using it. + +SJCL is divided into modules implementing various cryptographic and +convenience functions. If you don't need them all for your application, +you can reconfigure SJCL for a smaller code size. To do this, you can +run + +./configure --without-all --with-aes --with-sha256 ... + +Then type + +make + +to rebuild sjcl.js. This will also create a few intermediate files +core*.js; you can delete these automatically by typing + +make sjcl.js tidy + +instead. You will need make, perl, bash and java to rebuild SJCL. + +Some of the modules depend on other modules; configure should handle this +automatically unless you tell it --without-FOO --with-BAR, where BAR +depends on FOO. If you do this, configure will yell at you. + +SJCL is compressed by stripping comments, shortening variable names, etc. +You can also pass a --compress argument to configure to change the +compressor. By default SJCL uses some perl/sh scripts and Google's +Closure compressor. + +If you reconfigure SJCL, it is recommended that you run the included test +suite by typing "make test". If this prints "FAIL" or segfaults, SJCL +doesn't work; please file a bug. + diff --git a/node_modules/sjcl/README/bsd.txt b/node_modules/sjcl/README/bsd.txt new file mode 100644 index 0000000..a0559ed --- /dev/null +++ b/node_modules/sjcl/README/bsd.txt @@ -0,0 +1,30 @@ +Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation +are those of the authors and should not be interpreted as representing +official policies, either expressed or implied, of the authors. diff --git a/node_modules/sjcl/README/gpl-2.0.txt b/node_modules/sjcl/README/gpl-2.0.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/node_modules/sjcl/README/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/node_modules/sjcl/README/gpl-3.0.txt b/node_modules/sjcl/README/gpl-3.0.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/node_modules/sjcl/README/gpl-3.0.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/node_modules/sjcl/bower.json b/node_modules/sjcl/bower.json new file mode 100644 index 0000000..823fcea --- /dev/null +++ b/node_modules/sjcl/bower.json @@ -0,0 +1,5 @@ +{ + "name": "sjcl", + "version": "1.0.8", + "main": ["./sjcl.js"] +} diff --git a/node_modules/sjcl/browserTest/browserTest.html b/node_modules/sjcl/browserTest/browserTest.html new file mode 100644 index 0000000..be8d534 --- /dev/null +++ b/node_modules/sjcl/browserTest/browserTest.html @@ -0,0 +1,16 @@ + + + + + SJCL browser test + + + + + +

SJCL browser test

+
Waiting for tests to begin...
+
+ + diff --git a/node_modules/sjcl/browserTest/browserUtil.js b/node_modules/sjcl/browserTest/browserUtil.js new file mode 100644 index 0000000..a460adf --- /dev/null +++ b/node_modules/sjcl/browserTest/browserUtil.js @@ -0,0 +1,162 @@ +browserUtil = {}; + +browserUtil.isNodeJS = (typeof(window) === 'undefined'); + +/** + * Pause (for the graphics to update and the script timer to clear), then run the + * specified action. + */ +browserUtil.pauseAndThen = function (cb) { + cb && window.setTimeout(cb, 1); +}; + +/** + * Iterate using continuation-passing style. + */ +browserUtil.cpsIterate = function (f, start, end, pause, callback) { + var pat = pause ? browserUtil.pauseAndThen : function (cb) { cb && cb(); }; + function go() { + var called = false; + if (start >= end) { + pat(callback); + } else { + pat(function () { f(start, function () { + if (!called) { called = true; start++; go(); } + }); }); + } + } + go (start); +}; + +/** + * Map a function over an array using continuation-passing style. + */ +browserUtil.cpsMap = function (map, list, pause, callback) { + browserUtil.cpsIterate(function (i, cb) { map(list[i], i, list.length, cb); }, + 0, list.length, pause, callback); +}; + +/** Cache for remotely loaded scripts. */ +browserUtil.scriptCache = {}; + +/** Load several scripts, then call back */ +browserUtil.loadScripts = function(scriptNames, cbSuccess, cbError) { + var head = document.getElementsByTagName('head')[0]; + browserUtil.cpsMap(function (script, i, n, cb) { + var scriptE = document.createElement('script'), xhr, loaded = false; + + browserUtil.status("Loading script " + script); + + if (window.location.protocol === "file:") { + /* Can't make an AJAX request for files. + * But, we know the load time will be short, so timeout-based error + * detection is fine. + */ + scriptE.onload = function () { + loaded = true; + cb(); + }; + scriptE.onerror = function(err) { + cbError && cbError(script, err, cb); + }; + script.onreadystatechange = function() { + if (this.readyState == 'complete' || this.readyState == 'loaded') { + loaded = true; + cb(); + } + }; + scriptE.type = 'text/javascript'; + scriptE.src = script+"?"+(new Date().valueOf()); + window.setTimeout(function () { + loaded || cbError && cbError(script, "timeout expired", cb); + }, 100); + head.appendChild(scriptE); + } else if (browserUtil.scriptCache[script] !== undefined) { + try { + scriptE.appendChild(document.createTextNode(browserUtil.scriptCache[script])); + } catch (e) { + scriptE.text = browserUtil.scriptCache[script]; + } + head.appendChild(scriptE); + cb(); + } else { + var xhr; + if (window.XMLHttpRequest) { + xhr = new XMLHttpRequest; + } else if (window.ActiveXObject) { + xhr = new ActiveXObject("Microsoft.XMLHTTP"); + } + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status == 200) { + browserUtil.scriptCache[script] = xhr.responseText; + try { + scriptE.appendChild(document.createTextNode(xhr.responseText)); + } catch (e) { + scriptE.text = xhr.responseText; + } + head.appendChild(scriptE); + cb(); + } else { + cbError && cbError(script, xhr.status, cb); + } + } + }; + xhr.open("GET", script+"?"+(new Date().valueOf()), true); + xhr.send(); + } + }, scriptNames, false, cbSuccess); +}; + +/** Write a message to the console */ +browserUtil.write = function(type, message) { + var d1 = document.getElementById("print"), d2 = document.createElement("div"), d3 = document.createElement("div"); + d3.className = type; + d3.appendChild(document.createTextNode(message)); + d2.appendChild(d3); + d1.appendChild(d2); + return { update: function (type2, message2) { + var d4 = document.createElement("div"); + d4.className = type2 + " also"; + d4.appendChild(document.createTextNode(message2)); + d2.insertBefore(d4, d3); + }}; +}; + +browserUtil.writeTable = function (headers) { + var d1 = document.getElementById("print"), d2 = document.createElement("table"), d3 = document.createElement("tr"); + d2.className = 'table'; + + // write the headers + for (var i = 0; i < headers.length; i++) { + var header = document.createElement("th"); + header.appendChild(document.createTextNode(headers[i])); + d3.appendChild(header); + } + + d2.appendChild(d3); + d1.appendChild(d2); + + return { update: function (row) { + var d4 = document.createElement("tr"); + + // write the rows + for (var i = 0; i < row.length; i++) { + var cell = document.createElement("td"); + + cell.appendChild(document.createTextNode(row[i])); + d4.appendChild(cell); + } + + d2.appendChild(d4); + }}; +}; + +/** Write a newline. Does nothing in the browser. */ +browserUtil.writeNewline = function () { }; + +/** Write a message to the status line */ +browserUtil.status = function(message) { + var d1 = document.getElementById("status"); + d1.replaceChild(document.createTextNode(message), d1.firstChild); +}; diff --git a/node_modules/sjcl/browserTest/entropy.html b/node_modules/sjcl/browserTest/entropy.html new file mode 100644 index 0000000..4458ba7 --- /dev/null +++ b/node_modules/sjcl/browserTest/entropy.html @@ -0,0 +1,88 @@ + + + +Entropy Generator Progress + + + + + + + + + + +

Entropy Generator Progress

+ +

Target: 192 bits, available at paranoia level 5.

+ +

Corresponding paranoia level from [0,1..10]: (the idea being that you can see the progress bar advance gently from empty/black to full/yellow after you press this)

+ +

(also consumes 192 bits with every keypress in the text field; use key repeat to consume swiftly)

+ +
+
+
+ +

Please move your mouse, play around and generally introduce entropy into your environment.

+ + + \ No newline at end of file diff --git a/node_modules/sjcl/browserTest/nodeUtil.js b/node_modules/sjcl/browserTest/nodeUtil.js new file mode 100644 index 0000000..9ccb6b9 --- /dev/null +++ b/node_modules/sjcl/browserTest/nodeUtil.js @@ -0,0 +1,44 @@ +browserUtil = { + isNodeJS: true, + + pauseAndThen: function (cb) { cb(); }, + + cpsIterate: function (f, start, end, pause, callback) { + function go() { + var called = false; + if (start >= end) { + callback && callback(); + } else { + f(start, function () { + if (!called) { called = true; start++; go(); } + }); + } + } + go (start); + }, + + cpsMap: function (map, list, pause, callback) { + browserUtil.cpsIterate(function (i, cb) { map(list[i], i, list.length, cb); }, + 0, list.length, pause, callback); + }, + + loadScripts: function(scriptNames, callback) { + for (i=0; i + + + SJCL browser performance + + + +

SJCL browser performance

+
Waiting for tests to begin...
+
+ + + + + diff --git a/node_modules/sjcl/browserTest/performance.js b/node_modules/sjcl/browserTest/performance.js new file mode 100644 index 0000000..a5c41e5 --- /dev/null +++ b/node_modules/sjcl/browserTest/performance.js @@ -0,0 +1,70 @@ +sjcl.perf = { all: {} }; + +sjcl.perf.PerfCase = function PerfCase (name, cases, runCase) { + this.name = name; + this.cases = cases; + this.runCase = runCase; + sjcl.perf.all[name] = this; +}; + +sjcl.perf.PerfCase.prototype.run = function (callback) { + var thiz = this; + + var repo = browserUtil.write("info", "Running " + this.name + "..."); + var table = browserUtil.writeTable(["iter", "time"]); + + thiz.runCase(this.cases[0]); // cold start + + browserUtil.cpsMap(function (t, i, n, cb) { + var runs = []; + + // do 3 runs and average them + for (var k = 0; k < 3; k++) { + var t0 = performance.now(); + thiz.runCase(t); + var t1 = performance.now(); + runs.push(t1 - t0); + } + + var avg = runs.reduce(function(a, b) { return a + b; }) / runs.length; + table.update([t, avg.toFixed(3) + ' ms']); + + cb && cb(); + }, this.cases, true, function() { + + repo.update("pass", "done."); + callback(); + + }); +}; + +sjcl.perf.run = function (perfs, callback) { + browserUtil.status("Profiling..."); + + var t; + if (perfs === undefined || perfs.length == 0) { + perfs = []; + for (t in sjcl.perf.all) { + if (sjcl.perf.all.hasOwnProperty(t)) { + perfs.push(t); + } + } + } + + browserUtil.cpsMap(function (t, i, n, cb) { + sjcl.perf.all[perfs[i]].run(cb); + }, perfs, true, callback); +}; + + +// performance case for pbkdf2 +var cases = [1000, 2000, 4000, 8000, 16000, 32000, 48000, 64000]; +new sjcl.perf.PerfCase("pbkdf2", cases, + function (iter) { + sjcl.misc.pbkdf2("mypassword", "01234567890123456789", iter); + } +); + +sjcl.perf.run([], function() { + browserUtil.status(""); +}); diff --git a/node_modules/sjcl/browserTest/test.css b/node_modules/sjcl/browserTest/test.css new file mode 100644 index 0000000..9402feb --- /dev/null +++ b/node_modules/sjcl/browserTest/test.css @@ -0,0 +1,79 @@ +* { + margin: 0px; + padding: 0px; + font-family: Arial, Helvetica, FreeSans, sans; +} + +#print { + position: relative; + width: 40em; + margin: 0px auto; + padding: 5px; +} + +#print div { + position: relative; +} + +.pass { color: #0A0; } +.fail { color: #A00; } +.unimplemented { color: #F80; } + +.begin { + text-align: center; + padding-bottom: 2px; + border-bottom: 1px solid #aaa; + margin: 0px auto 2px auto; +} + +.all { + text-align: center; + font-weight: bold; +} + +*+* > .begin, *+* > .all { + margin-top: 1em; +} + +.also { + float: right; + width: 17em; + text-align: right; +} + +h1 { + text-align: center; + background: #8A0000; + padding: 5px; + color: white; +} + +#status { + padding: 3px 10px 3px 5px; + background: #d5c490; + color: #444; + font-size: 0.8em; + margin-bottom: 1em; + height: 1.3em; + vertical-align: middle; +} + +.table { + width: 100%; + border-spacing: 0; + border-collapse: collapse; + margin: 5px 0; +} + +.table td, .table th { + padding: 3px; + border: 1px solid #ddd; +} + +.table td { + text-align: right; +} + +.table tr:nth-of-type(odd) { + background: #f9f9f9; +} diff --git a/node_modules/sjcl/compress/compress_with_closure.sh b/node_modules/sjcl/compress/compress_with_closure.sh new file mode 100755 index 0000000..fe57755 --- /dev/null +++ b/node_modules/sjcl/compress/compress_with_closure.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +DIR=`dirname $0` + +URL="https://dl.google.com/closure-compiler/compiler-latest.zip" +FILE=`echo $URL | sed 's#.*/##'` +unzip > /dev/null 2> /dev/null +if [ $? -eq 0 ] ; then + wget -V > /dev/null 2> /dev/null + if [ $? -eq 0 ] ; then + pushd . > /dev/null + cd $DIR + wget -q -N $URL + popd > /dev/null + else + curl -V > /dev/null 2> /dev/null + if [ $? -eq 0 ] ; then + curl -s -z $DIR/$FILE -o $DIR/$FILE $URL > /dev/null 2> /dev/null + fi + fi + if [ -s $DIR/$FILE ] ; then + pushd . > /dev/null + cd $DIR + unzip -o $FILE compiler.jar > /dev/null 2> /dev/null + popd > /dev/null + fi +fi + +$DIR/remove_constants.pl $1 | $DIR/opacify.pl > ._tmpRC.js + +echo -n '"use strict";' +java -jar $DIR/compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS \ + --js ._tmpRC.js \ + | $DIR/digitize.pl \ + | $DIR/dewindowize.pl + + +rm -f ._tmpRC.js + diff --git a/node_modules/sjcl/compress/compress_with_yui.sh b/node_modules/sjcl/compress/compress_with_yui.sh new file mode 100755 index 0000000..9dfecda --- /dev/null +++ b/node_modules/sjcl/compress/compress_with_yui.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Compress $1 with YUI Compressor 2.4.2, returning the compressed script on stdout + +DIR=`dirname $0` + +$DIR/remove_constants.pl $1 > ._tmpRC.js + +java -jar $DIR/yuicompressor-2.4.2.jar ._tmpRC.js \ + | $DIR/digitize.pl + +rm -f ._tmpRC.js + diff --git a/node_modules/sjcl/compress/dewindowize.pl b/node_modules/sjcl/compress/dewindowize.pl new file mode 100755 index 0000000..c884382 --- /dev/null +++ b/node_modules/sjcl/compress/dewindowize.pl @@ -0,0 +1,8 @@ +#!/usr/bin/env perl + +while (<>) { + s/window\.sjcl\s*=/var sjcl=/g; + s/window\.sjcl/sjcl/g; + print; +} + diff --git a/node_modules/sjcl/compress/digitize.pl b/node_modules/sjcl/compress/digitize.pl new file mode 100755 index 0000000..0fcc5c2 --- /dev/null +++ b/node_modules/sjcl/compress/digitize.pl @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +# Convert numbers to hex, when doing so is likely to increase compressibility. +# This actually makes the script slightly longer, but generally makes it compress +# to something shorter. +# +# Here we're targeting constants like 0xFF, 0xFFFF0000, 0x10101, 0x100000000, etc. + +sub digitize { + my $number = shift; + if ($number >= 256) { + my $nn = `printf "%x" $number`; + if ($nn =~ /^[01f]+$/i) { return "0x$nn"; } + } + return $number; +} + +while (<>) { + s/([^a-zA-Z0-9_"])(\d+)/$1 . digitize $2/eg; + print; +} + diff --git a/node_modules/sjcl/compress/opacify.pl b/node_modules/sjcl/compress/opacify.pl new file mode 100755 index 0000000..4d76a75 --- /dev/null +++ b/node_modules/sjcl/compress/opacify.pl @@ -0,0 +1,39 @@ +#!/usr/bin/env perl + +# This script is a hack. +# +# Opacify all non-private names by turning them into strings. +# That way, the Google compressor won't rename them. +# +# The script ignores properties whose names begin with _, because they +# are believed to be private. +# +# XXX TODO FIXME: this messes with strings, so it screws up exceptions. + +my $script = join '', <>; + +# remove comments +#$script =~ s=/\*([^\*]|\*+[^\/])*\*/==g; +#$script =~ s=//.*==g; + +# stringify property names +$script =~ s=\.([a-zA-Z][_a-zA-Z0-9]*)=['$1']=g; + +# destringify 'prototype' +$script =~ s=\['prototype'\]=.prototype=g; + +# stringify sjcl +$script =~ s=(?:var\s+)?sjcl(\.|\s*\=)=window['sjcl']$1=g; + +# stringify object notation +$script =~ s=([\{,] + \s* + (?:/\*(?:[^\*]|\*+[^\/])*\*/\s* # preserve C-style comments + |//[^\n]*\n\s*)*) + ([a-zA-Z0-9][_a-zA-Z0-9]*):=$1'$2':=xg; + +# Export sjcl. This is a bit of a hack, and might get replaced later. +print $script; + +# not necessary with windowization. +# print "window\['sjcl'\] = sjcl;\n"; diff --git a/node_modules/sjcl/compress/remove_constants.pl b/node_modules/sjcl/compress/remove_constants.pl new file mode 100755 index 0000000..73aee05 --- /dev/null +++ b/node_modules/sjcl/compress/remove_constants.pl @@ -0,0 +1,69 @@ +#!/usr/bin/env perl + +# This script is a hack. It identifies things which it believes to be +# constant, then replaces them throughout the code. +# +# Constants are identified as properties declared in object notation +# with values consisting only of capital letters and underscores. If +# the first character is an underscore, the constant is private, and +# can be removed entirely. +# +# The script dies if any two constants have the same property name but +# different values. +my $script = join '', <>; + +# remove comments +#$script =~ s=/\*([^\*]|\*+[^\/])*\*/==g; +#$script =~ s=//.*==g; + +sub preserve { + my $stuff = shift; + $stuff =~ s/,//; + return $stuff; +} + +my %constants = (); + +sub add_constant { + my ($name, $value) = @_; + if (defined $constants{$name} && $constants{$name} ne $value) { + print STDERR "variant constant $name = $value"; + die; + } else { + $constants{$name} = $value; + #print STDERR "constant: $name = $value\n"; + } +} + +# find private constants +while ($script =~ + s/([,\{]) \s* # indicator that this is part of an object + (_[A-Z0-9_]+) \s* : \s* # all-caps variable name beginning with _ + (\d+|0x[0-9A-Fa-f]+) \s* # numeric value + ([,\}]) # next part of object + /preserve "$1$4"/ex) { + add_constant $2, $3; +} + +my $script2 = ''; + +# find public constants +while ($script =~ + s/^(.*?) # beginning of script + ([,\{]) \s* # indicator that this is part of an object + ([A-Z0-9_]+) \s* : \s* # all-caps variable name + (\d+|0x[0-9A-Fa-f]+) \s* # numeric value + ([,\}]) # next part of object([,\{]) \s* + /$5/esx) { + $script2 .= "$1$2$3:$4"; + add_constant $3, $4; +} + +$script = "$script2$script"; + +foreach (keys %constants) { + my $value = $constants{$_}; + $script =~ s/(?:[a-zA-Z0-9_]+\.)+$_(?=[^a-zA-Z0-9_])/$value/g; +} + +print $script; diff --git a/node_modules/sjcl/config.mk b/node_modules/sjcl/config.mk new file mode 100644 index 0000000..1a6a361 --- /dev/null +++ b/node_modules/sjcl/config.mk @@ -0,0 +1,2 @@ +SOURCES= core/sjcl.js core/aes.js core/bitArray.js core/codecString.js core/codecHex.js core/codecBase32.js core/codecBase64.js core/sha256.js core/ccm.js core/ocb2.js core/gcm.js core/hmac.js core/pbkdf2.js core/random.js core/convenience.js core/exports.js +COMPRESS= core_closure.js diff --git a/node_modules/sjcl/configure b/node_modules/sjcl/configure new file mode 100755 index 0000000..abc6dd8 --- /dev/null +++ b/node_modules/sjcl/configure @@ -0,0 +1,157 @@ +#!/usr/bin/env perl + +use strict; + +my ($arg, $i, $j, $targ); + +my @targets = qw/sjcl aes bitArray codecString codecHex codecBase32 codecBase64 codecBytes codecZ85 sha256 sha512 sha1 ccm ctr cbc ocb2 ocb2progressive gcm hmac pbkdf2 scrypt random convenience bn ecc srp ccmArrayBuffer codecArrayBuffer ripemd160/; +my %deps = ('aes'=>'sjcl', + 'bitArray'=>'sjcl', + 'codecString'=>'bitArray', + 'codecHex'=>'bitArray', + 'codecBase64'=>'bitArray', + 'codecBase32'=>'bitArray', + 'codecBytes'=>'bitArray', + 'codecZ85'=>'bitArray', + 'sha256'=>'codecString', + 'sha512'=>'codecString', + 'sha1'=>'codecString', + 'ripemd160' => 'codecString', + 'ccm'=>'bitArray,aes', + 'ctr'=>'bitArray,aes', + 'ocb2'=>'bitArray,aes', + 'ocb2progressive'=>'ocb2', + 'gcm'=>'bitArray,aes', + 'hmac'=>'sha256', + 'pbkdf2'=>'hmac', + 'scrypt'=>'pbkdf2,codecBytes', + 'srp'=>'sha1,bn,bitArray', + 'bn'=>'bitArray,random', + 'ecc'=>'bn', + 'cbc'=>'bitArray,aes', + 'random'=>'sha256,aes', + 'convenience'=>'ccm,pbkdf2,random,codecBase64', + 'ccmArrayBuffer'=>'bitArray,codecArrayBuffer', + 'codecArrayBuffer'=>'bitArray'); + +my $compress = "closure"; +my $exported = 1; + +my %enabled = (); +$enabled{$_} = 0 foreach (@targets); + +# by default, all but codecBytes, codecZ85, srp, bn +$enabled{$_} = 1 foreach (qw/aes bitArray codecString codecHex codecBase32 codecBase64 sha256 ccm ocb2 gcm hmac pbkdf2 random convenience/); + +# argument parsing +while (my $arg = shift @ARGV) { + if ($arg =~ /^--?with-all$/) { + foreach (@targets) { + if ($enabled{$_} == 0) { + $enabled{$_} = 1; + } + } + } elsif ($arg =~ /^--?without-all$/) { + foreach (@targets) { + if ($enabled{$_} == 1) { + $enabled{$_} = 0; + } + } + } elsif ($arg =~ /^--?with-(.*)$/) { + $targ = $1; + $targ =~ s/-(.)/uc $1/ge; + if (!defined $deps{$targ}) { + print STDERR "No such target $targ\n"; + exit 1; + } + $enabled{$targ} = 2; + } elsif ($arg =~ /^--?without-(.*)$/) { + $targ = $1; + $targ =~ s/-(.)/uc $1/ge; + if (!defined $deps{$targ}) { + print STDERR "No such target $targ\n"; + exit 1; + } + $enabled{$targ} = -1; + } elsif ($arg =~ /^--?compress(?:or|ion)?=(none|closure|yui)$/) { + $compress = $1; + } elsif ($arg =~ /^--?no-export$/) { + $exported = 0; + } else { + my $targets = join " ", @targets; + $targets =~ s/sjcl //; + $targets =~ s/(.{50})\s+/$1\n /g; + print STDERR < 0) { + foreach $j (split /,/, $deps{$i}) { + if ($enabled{$j} == -1) { + if ($enabled{$i} == 2) { + print STDERR "Conflicting options: $i depends on $j\n"; + exit 1; + } else { + $enabled{$i} = -1; + last; + } + } + } + } +} + +$config = "exports $config" if $exported; + +# reverse +foreach my $i (reverse @targets) { + if ($enabled{$i} > 0) { + foreach $j (split /,/, $deps{$i}) { + if ($enabled{$j} < $enabled{$i}) { + $enabled{$j} = $enabled{$i}; + } + } + $config = "$i $config"; + } +} + +open CONFIG, "> config.mk" or die "$!"; + + +($pconfig = $config) =~ s/^sjcl //; +$pconfig =~ s/ /\n /g; +print "Enabled components:\n $pconfig\n"; +print "Compression: $compress\n"; + +$config =~ s=\S+=core/$&.js=g; +print CONFIG "SOURCES= $config\n"; + +$compress = "core_$compress.js"; +$compress = 'core.js' if ($compress eq 'core_none.js'); + +print CONFIG "COMPRESS= $compress\n"; diff --git a/node_modules/sjcl/core/aes.js b/node_modules/sjcl/core/aes.js new file mode 100644 index 0000000..5e1b652 --- /dev/null +++ b/node_modules/sjcl/core/aes.js @@ -0,0 +1,206 @@ +/** @fileOverview Low-level AES implementation. + * + * This file contains a low-level implementation of AES, optimized for + * size and for efficiency on several browsers. It is based on + * OpenSSL's aes_core.c, a public-domain implementation by Vincent + * Rijmen, Antoon Bosselaers and Paulo Barreto. + * + * An older version of this implementation is available in the public + * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh, + * Stanford University 2008-2010 and BSD-licensed for liability + * reasons. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * Schedule out an AES key for both encryption and decryption. This + * is a low-level class. Use a cipher mode to do bulk encryption. + * + * @constructor + * @param {Array} key The key as an array of 4, 6 or 8 words. + */ +sjcl.cipher.aes = function (key) { + if (!this._tables[0][0][0]) { + this._precompute(); + } + + var i, j, tmp, + encKey, decKey, + sbox = this._tables[0][4], decTable = this._tables[1], + keyLen = key.length, rcon = 1; + + if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) { + throw new sjcl.exception.invalid("invalid aes key size"); + } + + this._key = [encKey = key.slice(0), decKey = []]; + + // schedule encryption keys + for (i = keyLen; i < 4 * keyLen + 28; i++) { + tmp = encKey[i-1]; + + // apply sbox + if (i%keyLen === 0 || (keyLen === 8 && i%keyLen === 4)) { + tmp = sbox[tmp>>>24]<<24 ^ sbox[tmp>>16&255]<<16 ^ sbox[tmp>>8&255]<<8 ^ sbox[tmp&255]; + + // shift rows and add rcon + if (i%keyLen === 0) { + tmp = tmp<<8 ^ tmp>>>24 ^ rcon<<24; + rcon = rcon<<1 ^ (rcon>>7)*283; + } + } + + encKey[i] = encKey[i-keyLen] ^ tmp; + } + + // schedule decryption keys + for (j = 0; i; j++, i--) { + tmp = encKey[j&3 ? i : i - 4]; + if (i<=4 || j<4) { + decKey[j] = tmp; + } else { + decKey[j] = decTable[0][sbox[tmp>>>24 ]] ^ + decTable[1][sbox[tmp>>16 & 255]] ^ + decTable[2][sbox[tmp>>8 & 255]] ^ + decTable[3][sbox[tmp & 255]]; + } + } +}; + +sjcl.cipher.aes.prototype = { + // public + /* Something like this might appear here eventually + name: "AES", + blockSize: 4, + keySizes: [4,6,8], + */ + + /** + * Encrypt an array of 4 big-endian words. + * @param {Array} data The plaintext. + * @return {Array} The ciphertext. + */ + encrypt:function (data) { return this._crypt(data,0); }, + + /** + * Decrypt an array of 4 big-endian words. + * @param {Array} data The ciphertext. + * @return {Array} The plaintext. + */ + decrypt:function (data) { return this._crypt(data,1); }, + + /** + * The expanded S-box and inverse S-box tables. These will be computed + * on the client so that we don't have to send them down the wire. + * + * There are two tables, _tables[0] is for encryption and + * _tables[1] is for decryption. + * + * The first 4 sub-tables are the expanded S-box with MixColumns. The + * last (_tables[01][4]) is the S-box itself. + * + * @private + */ + _tables: [[[],[],[],[],[]],[[],[],[],[],[]]], + + /** + * Expand the S-box tables. + * + * @private + */ + _precompute: function () { + var encTable = this._tables[0], decTable = this._tables[1], + sbox = encTable[4], sboxInv = decTable[4], + i, x, xInv, d=[], th=[], x2, x4, x8, s, tEnc, tDec; + + // Compute double and third tables + for (i = 0; i < 256; i++) { + th[( d[i] = i<<1 ^ (i>>7)*283 )^i]=i; + } + + for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) { + // Compute sbox + s = xInv ^ xInv<<1 ^ xInv<<2 ^ xInv<<3 ^ xInv<<4; + s = s>>8 ^ s&255 ^ 99; + sbox[x] = s; + sboxInv[s] = x; + + // Compute MixColumns + x8 = d[x4 = d[x2 = d[x]]]; + tDec = x8*0x1010101 ^ x4*0x10001 ^ x2*0x101 ^ x*0x1010100; + tEnc = d[s]*0x101 ^ s*0x1010100; + + for (i = 0; i < 4; i++) { + encTable[i][x] = tEnc = tEnc<<24 ^ tEnc>>>8; + decTable[i][s] = tDec = tDec<<24 ^ tDec>>>8; + } + } + + // Compactify. Considerable speedup on Firefox. + for (i = 0; i < 5; i++) { + encTable[i] = encTable[i].slice(0); + decTable[i] = decTable[i].slice(0); + } + }, + + /** + * Encryption and decryption core. + * @param {Array} input Four words to be encrypted or decrypted. + * @param dir The direction, 0 for encrypt and 1 for decrypt. + * @return {Array} The four encrypted or decrypted words. + * @private + */ + _crypt:function (input, dir) { + if (input.length !== 4) { + throw new sjcl.exception.invalid("invalid aes block size"); + } + + var key = this._key[dir], + // state variables a,b,c,d are loaded with pre-whitened data + a = input[0] ^ key[0], + b = input[dir ? 3 : 1] ^ key[1], + c = input[2] ^ key[2], + d = input[dir ? 1 : 3] ^ key[3], + a2, b2, c2, + + nInnerRounds = key.length/4 - 2, + i, + kIndex = 4, + out = [0,0,0,0], + table = this._tables[dir], + + // load up the tables + t0 = table[0], + t1 = table[1], + t2 = table[2], + t3 = table[3], + sbox = table[4]; + + // Inner rounds. Cribbed from OpenSSL. + for (i = 0; i < nInnerRounds; i++) { + a2 = t0[a>>>24] ^ t1[b>>16 & 255] ^ t2[c>>8 & 255] ^ t3[d & 255] ^ key[kIndex]; + b2 = t0[b>>>24] ^ t1[c>>16 & 255] ^ t2[d>>8 & 255] ^ t3[a & 255] ^ key[kIndex + 1]; + c2 = t0[c>>>24] ^ t1[d>>16 & 255] ^ t2[a>>8 & 255] ^ t3[b & 255] ^ key[kIndex + 2]; + d = t0[d>>>24] ^ t1[a>>16 & 255] ^ t2[b>>8 & 255] ^ t3[c & 255] ^ key[kIndex + 3]; + kIndex += 4; + a=a2; b=b2; c=c2; + } + + // Last round. + for (i = 0; i < 4; i++) { + out[dir ? 3&-i : i] = + sbox[a>>>24 ]<<24 ^ + sbox[b>>16 & 255]<<16 ^ + sbox[c>>8 & 255]<<8 ^ + sbox[d & 255] ^ + key[kIndex++]; + a2=a; a=b; b=c; c=d; d=a2; + } + + return out; + } +}; + diff --git a/node_modules/sjcl/core/bitArray.js b/node_modules/sjcl/core/bitArray.js new file mode 100644 index 0000000..963bdce --- /dev/null +++ b/node_modules/sjcl/core/bitArray.js @@ -0,0 +1,202 @@ +/** @fileOverview Arrays of bits, encoded as arrays of Numbers. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * Arrays of bits, encoded as arrays of Numbers. + * @namespace + * @description + *

+ * These objects are the currency accepted by SJCL's crypto functions. + *

+ * + *

+ * Most of our crypto primitives operate on arrays of 4-byte words internally, + * but many of them can take arguments that are not a multiple of 4 bytes. + * This library encodes arrays of bits (whose size need not be a multiple of 8 + * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an + * array of words, 32 bits at a time. Since the words are double-precision + * floating point numbers, they fit some extra data. We use this (in a private, + * possibly-changing manner) to encode the number of bits actually present + * in the last word of the array. + *

+ * + *

+ * Because bitwise ops clear this out-of-band data, these arrays can be passed + * to ciphers like AES which want arrays of words. + *

+ */ +sjcl.bitArray = { + /** + * Array slices in units of bits. + * @param {bitArray} a The array to slice. + * @param {Number} bstart The offset to the start of the slice, in bits. + * @param {Number} bend The offset to the end of the slice, in bits. If this is undefined, + * slice until the end of the array. + * @return {bitArray} The requested slice. + */ + bitSlice: function (a, bstart, bend) { + a = sjcl.bitArray._shiftRight(a.slice(bstart/32), 32 - (bstart & 31)).slice(1); + return (bend === undefined) ? a : sjcl.bitArray.clamp(a, bend-bstart); + }, + + /** + * Extract a number packed into a bit array. + * @param {bitArray} a The array to slice. + * @param {Number} bstart The offset to the start of the slice, in bits. + * @param {Number} blength The length of the number to extract. + * @return {Number} The requested slice. + */ + extract: function(a, bstart, blength) { + // FIXME: this Math.floor is not necessary at all, but for some reason + // seems to suppress a bug in the Chromium JIT. + var x, sh = Math.floor((-bstart-blength) & 31); + if ((bstart + blength - 1 ^ bstart) & -32) { + // it crosses a boundary + x = (a[bstart/32|0] << (32 - sh)) ^ (a[bstart/32+1|0] >>> sh); + } else { + // within a single word + x = a[bstart/32|0] >>> sh; + } + return x & ((1< 0 && len) { + a[l-1] = sjcl.bitArray.partial(len, a[l-1] & 0x80000000 >> (len-1), 1); + } + return a; + }, + + /** + * Make a partial word for a bit array. + * @param {Number} len The number of bits in the word. + * @param {Number} x The bits. + * @param {Number} [_end=0] Pass 1 if x has already been shifted to the high side. + * @return {Number} The partial word. + */ + partial: function (len, x, _end) { + if (len === 32) { return x; } + return (_end ? x|0 : x << (32-len)) + len * 0x10000000000; + }, + + /** + * Get the number of bits used by a partial word. + * @param {Number} x The partial word. + * @return {Number} The number of bits used by the partial word. + */ + getPartial: function (x) { + return Math.round(x/0x10000000000) || 32; + }, + + /** + * Compare two arrays for equality in a predictable amount of time. + * @param {bitArray} a The first array. + * @param {bitArray} b The second array. + * @return {boolean} true if a == b; false otherwise. + */ + equal: function (a, b) { + if (sjcl.bitArray.bitLength(a) !== sjcl.bitArray.bitLength(b)) { + return false; + } + var x = 0, i; + for (i=0; i= 32; shift -= 32) { + out.push(carry); + carry = 0; + } + if (shift === 0) { + return out.concat(a); + } + + for (i=0; i>>shift); + carry = a[i] << (32-shift); + } + last2 = a.length ? a[a.length-1] : 0; + shift2 = sjcl.bitArray.getPartial(last2); + out.push(sjcl.bitArray.partial(shift+shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(),1)); + return out; + }, + + /** xor a block of 4 words together. + * @private + */ + _xor4: function(x,y) { + return [x[0]^y[0],x[1]^y[1],x[2]^y[2],x[3]^y[3]]; + }, + + /** byteswap a word array inplace. + * (does not handle partial words) + * @param {sjcl.bitArray} a word array + * @return {sjcl.bitArray} byteswapped array + */ + byteswapM: function(a) { + var i, v, m = 0xff00; + for (i = 0; i < a.length; ++i) { + v = a[i]; + a[i] = (v >>> 24) | ((v >>> 8) & m) | ((v & m) << 8) | (v << 24); + } + return a; + } +}; diff --git a/node_modules/sjcl/core/bn.js b/node_modules/sjcl/core/bn.js new file mode 100644 index 0000000..3d5acc5 --- /dev/null +++ b/node_modules/sjcl/core/bn.js @@ -0,0 +1,738 @@ +// Thanks to Colin McRae and Jonathan Burns of ionic security +// for reporting and fixing two bugs in this file! + +/** + * Constructs a new bignum from another bignum, a number or a hex string. + * @constructor + */ +sjcl.bn = function(it) { + this.initWith(it); +}; + +sjcl.bn.prototype = { + radix: 24, + maxMul: 8, + _class: sjcl.bn, + + copy: function() { + return new this._class(this); + }, + + /** + * Initializes this with it, either as a bn, a number, or a hex string. + */ + initWith: function(it) { + var i=0, k; + switch(typeof it) { + case "object": + this.limbs = it.limbs.slice(0); + break; + + case "number": + this.limbs = [it]; + this.normalize(); + break; + + case "string": + it = it.replace(/^0x/, ''); + this.limbs = []; + // hack + k = this.radix / 4; + for (i=0; i < it.length; i+=k) { + this.limbs.push(parseInt(it.substring(Math.max(it.length - i - k, 0), it.length - i),16)); + } + break; + + default: + this.limbs = [0]; + } + return this; + }, + + /** + * Returns true if "this" and "that" are equal. Calls fullReduce(). + * Equality test is in constant time. + */ + equals: function(that) { + if (typeof that === "number") { that = new this._class(that); } + var difference = 0, i; + this.fullReduce(); + that.fullReduce(); + for (i = 0; i < this.limbs.length || i < that.limbs.length; i++) { + difference |= this.getLimb(i) ^ that.getLimb(i); + } + return (difference === 0); + }, + + /** + * Get the i'th limb of this, zero if i is too large. + */ + getLimb: function(i) { + return (i >= this.limbs.length) ? 0 : this.limbs[i]; + }, + + /** + * Constant time comparison function. + * Returns 1 if this >= that, or zero otherwise. + */ + greaterEquals: function(that) { + if (typeof that === "number") { that = new this._class(that); } + var less = 0, greater = 0, i, a, b; + i = Math.max(this.limbs.length, that.limbs.length) - 1; + for (; i>= 0; i--) { + a = this.getLimb(i); + b = that.getLimb(i); + greater |= (b - a) & ~less; + less |= (a - b) & ~greater; + } + return (greater | ~less) >>> 31; + }, + + /** + * Convert to a hex string. + */ + toString: function() { + this.fullReduce(); + var out="", i, s, l = this.limbs; + for (i=0; i < this.limbs.length; i++) { + s = l[i].toString(16); + while (i < this.limbs.length - 1 && s.length < 6) { + s = "0" + s; + } + out = s + out; + } + return "0x"+out; + }, + + /** this += that. Does not normalize. */ + addM: function(that) { + if (typeof(that) !== "object") { that = new this._class(that); } + var i, l=this.limbs, ll=that.limbs; + for (i=l.length; i> r; + } + if (carry) { + l.push(carry); + } + return this; + }, + + /** this /= 2, rounded down. Requires normalized; ends up normalized. */ + halveM: function() { + var i, carry=0, tmp, r=this.radix, l=this.limbs; + for (i=l.length-1; i>=0; i--) { + tmp = l[i]; + l[i] = (tmp+carry)>>1; + carry = (tmp&1) << r; + } + if (!l[l.length-1]) { + l.pop(); + } + return this; + }, + + /** this -= that. Does not normalize. */ + subM: function(that) { + if (typeof(that) !== "object") { that = new this._class(that); } + var i, l=this.limbs, ll=that.limbs; + for (i=l.length; i 0; ci--) { + that.halveM(); + if (out.greaterEquals(that)) { + out.subM(that).normalize(); + } + } + return out.trim(); + }, + + /** return inverse mod prime p. p must be odd. Binary extended Euclidean algorithm mod p. */ + inverseMod: function(p) { + var a = new sjcl.bn(1), b = new sjcl.bn(0), x = new sjcl.bn(this), y = new sjcl.bn(p), tmp, i, nz=1; + + if (!(p.limbs[0] & 1)) { + throw (new sjcl.exception.invalid("inverseMod: p must be odd")); + } + + // invariant: y is odd + do { + if (x.limbs[0] & 1) { + if (!x.greaterEquals(y)) { + // x < y; swap everything + tmp = x; x = y; y = tmp; + tmp = a; a = b; b = tmp; + } + x.subM(y); + x.normalize(); + + if (!a.greaterEquals(b)) { + a.addM(p); + } + a.subM(b); + } + + // cut everything in half + x.halveM(); + if (a.limbs[0] & 1) { + a.addM(p); + } + a.normalize(); + a.halveM(); + + // check for termination: x ?= 0 + for (i=nz=0; i>(j + 1) == 0) { break; } + + pow = pow.square(); + } + } + + return out; + }, + + /** this * that mod N */ + mulmod: function(that, N) { + return this.mod(N).mul(that.mod(N)).mod(N); + }, + + /** this ^ x mod N */ + powermod: function(x, N) { + x = new sjcl.bn(x); + N = new sjcl.bn(N); + + // Jump to montpowermod if possible. + if ((N.limbs[0] & 1) == 1) { + var montOut = this.montpowermod(x, N); + + if (montOut != false) { return montOut; } // else go to slow powermod + } + + var i, j, l = x.normalize().trim().limbs, out = new this._class(1), pow = this; + + for (i=0; i>(j + 1) == 0) { break; } + + pow = pow.mulmod(pow, N); + } + } + + return out; + }, + + /** this ^ x mod N with Montomery reduction */ + montpowermod: function(x, N) { + x = new sjcl.bn(x).normalize().trim(); + N = new sjcl.bn(N); + + var i, j, + radix = this.radix, + out = new this._class(1), + pow = this.copy(); + + // Generate R as a cap of N. + var R, s, wind, bitsize = x.bitLength(); + + R = new sjcl.bn({ + limbs: N.copy().normalize().trim().limbs.map(function() { return 0; }) + }); + + for (s = this.radix; s > 0; s--) { + if (((N.limbs[N.limbs.length - 1] >> s) & 1) == 1) { + R.limbs[R.limbs.length - 1] = 1 << s; + break; + } + } + + // Calculate window size as a function of the exponent's size. + if (bitsize == 0) { + return this; + } else if (bitsize < 18) { + wind = 1; + } else if (bitsize < 48) { + wind = 3; + } else if (bitsize < 144) { + wind = 4; + } else if (bitsize < 768) { + wind = 5; + } else { + wind = 6; + } + + // Find R' and N' such that R * R' - N * N' = 1. + var RR = R.copy(), NN = N.copy(), RP = new sjcl.bn(1), NP = new sjcl.bn(0), RT = R.copy(); + + while (RT.greaterEquals(1)) { + RT.halveM(); + + if ((RP.limbs[0] & 1) == 0) { + RP.halveM(); + NP.halveM(); + } else { + RP.addM(NN); + RP.halveM(); + + NP.halveM(); + NP.addM(RR); + } + } + + RP = RP.normalize(); + NP = NP.normalize(); + + RR.doubleM(); + var R2 = RR.mulmod(RR, N); + + // Check whether the invariant holds. + // If it doesn't, we can't use Montgomery reduction on this modulus. + if (!RR.mul(RP).sub(N.mul(NP)).equals(1)) { + return false; + } + + var montIn = function(c) { return montMul(c, R2); }, + montMul = function(a, b) { + // Standard Montgomery reduction + var k, ab, right, abBar, mask = (1 << (s + 1)) - 1; + + ab = a.mul(b); + + right = ab.mul(NP); + right.limbs = right.limbs.slice(0, R.limbs.length); + + if (right.limbs.length == R.limbs.length) { + right.limbs[R.limbs.length - 1] &= mask; + } + + right = right.mul(N); + + abBar = ab.add(right).normalize().trim(); + abBar.limbs = abBar.limbs.slice(R.limbs.length - 1); + + // Division. Equivelent to calling *.halveM() s times. + for (k=0; k < abBar.limbs.length; k++) { + if (k > 0) { + abBar.limbs[k - 1] |= (abBar.limbs[k] & mask) << (radix - s - 1); + } + + abBar.limbs[k] = abBar.limbs[k] >> (s + 1); + } + + if (abBar.greaterEquals(N)) { + abBar.subM(N); + } + + return abBar; + }, + montOut = function(c) { return montMul(c, 1); }; + + pow = montIn(pow); + out = montIn(out); + + // Sliding-Window Exponentiation (HAC 14.85) + var h, precomp = {}, cap = (1 << (wind - 1)) - 1; + + precomp[1] = pow.copy(); + precomp[2] = montMul(pow, pow); + + for (h=1; h<=cap; h++) { + precomp[(2 * h) + 1] = montMul(precomp[(2 * h) - 1], precomp[2]); + } + + var getBit = function(exp, i) { // Gets ith bit of exp. + var off = i % exp.radix; + + return (exp.limbs[Math.floor(i / exp.radix)] & (1 << off)) >> off; + }; + + for (i = x.bitLength() - 1; i >= 0; ) { + if (getBit(x, i) == 0) { + // If the next bit is zero: + // Square, move forward one bit. + out = montMul(out, out); + i = i - 1; + } else { + // If the next bit is one: + // Find the longest sequence of bits after this one, less than `wind` + // bits long, that ends with a 1. Convert the sequence into an + // integer and look up the pre-computed value to add. + var l = i - wind + 1; + + while (getBit(x, l) == 0) { + l++; + } + + var indx = 0; + for (j = l; j <= i; j++) { + indx += getBit(x, j) << (j - l); + out = montMul(out, out); + } + + out = montMul(out, precomp[indx]); + + i = l - 1; + } + } + + return montOut(out); + }, + + trim: function() { + var l = this.limbs, p; + do { + p = l.pop(); + } while (l.length && p === 0); + l.push(p); + return this; + }, + + /** Reduce mod a modulus. Stubbed for subclassing. */ + reduce: function() { + return this; + }, + + /** Reduce and normalize. */ + fullReduce: function() { + return this.normalize(); + }, + + /** Propagate carries. */ + normalize: function() { + var carry=0, i, pv = this.placeVal, ipv = this.ipv, l, m, limbs = this.limbs, ll = limbs.length, mask = this.radixMask; + for (i=0; i < ll || (carry !== 0 && carry !== -1); i++) { + l = (limbs[i]||0) + carry; + m = limbs[i] = l & mask; + carry = (l-m)*ipv; + } + if (carry === -1) { + limbs[i-1] -= pv; + } + this.trim(); + return this; + }, + + /** Constant-time normalize. Does not allocate additional space. */ + cnormalize: function() { + var carry=0, i, ipv = this.ipv, l, m, limbs = this.limbs, ll = limbs.length, mask = this.radixMask; + for (i=0; i < ll-1; i++) { + l = limbs[i] + carry; + m = limbs[i] = l & mask; + carry = (l-m)*ipv; + } + limbs[i] += carry; + return this; + }, + + /** Serialize to a bit array */ + toBits: function(len) { + this.fullReduce(); + len = len || this.exponent || this.bitLength(); + var i = Math.floor((len-1)/24), w=sjcl.bitArray, e = (len + 7 & -8) % this.radix || this.radix, + out = [w.partial(e, this.getLimb(i))]; + for (i--; i >= 0; i--) { + out = w.concat(out, [w.partial(Math.min(this.radix,len), this.getLimb(i))]); + len -= this.radix; + } + return out; + }, + + /** Return the length in bits, rounded up to the nearest byte. */ + bitLength: function() { + this.fullReduce(); + var out = this.radix * (this.limbs.length - 1), + b = this.limbs[this.limbs.length - 1]; + for (; b; b >>>= 1) { + out ++; + } + return out+7 & -8; + } +}; + +/** @memberOf sjcl.bn +* @this { sjcl.bn } +*/ +sjcl.bn.fromBits = function(bits) { + var Class = this, out = new Class(), words=[], w=sjcl.bitArray, t = this.prototype, + l = Math.min(this.bitLength || 0x100000000, w.bitLength(bits)), e = l % t.radix || t.radix; + + words[0] = w.extract(bits, 0, e); + for (; e < l; e += t.radix) { + words.unshift(w.extract(bits, e, t.radix)); + } + + out.limbs = words; + return out; +}; + + + +sjcl.bn.prototype.ipv = 1 / (sjcl.bn.prototype.placeVal = Math.pow(2,sjcl.bn.prototype.radix)); +sjcl.bn.prototype.radixMask = (1 << sjcl.bn.prototype.radix) - 1; + +/** + * Creates a new subclass of bn, based on reduction modulo a pseudo-Mersenne prime, + * i.e. a prime of the form 2^e + sum(a * 2^b),where the sum is negative and sparse. + */ +sjcl.bn.pseudoMersennePrime = function(exponent, coeff) { + /** @constructor + * @private + */ + function p(it) { + this.initWith(it); + /*if (this.limbs[this.modOffset]) { + this.reduce(); + }*/ + } + + var ppr = p.prototype = new sjcl.bn(), i, tmp, mo; + mo = ppr.modOffset = Math.ceil(tmp = exponent / ppr.radix); + ppr.exponent = exponent; + ppr.offset = []; + ppr.factor = []; + ppr.minOffset = mo; + ppr.fullMask = 0; + ppr.fullOffset = []; + ppr.fullFactor = []; + ppr.modulus = p.modulus = new sjcl.bn(Math.pow(2,exponent)); + + ppr.fullMask = 0|-Math.pow(2, exponent % ppr.radix); + + for (i=0; i mo) { + l = limbs.pop(); + ll = limbs.length; + for (k=0; k> 3) & 15)) * 0x1010101; + + /* Pad and encrypt. */ + iv = prp.encrypt(xor(iv,w.concat(plaintext,[bl,bl,bl,bl]).slice(i,i+4))); + output.splice(i,0,iv[0],iv[1],iv[2],iv[3]); + return output; + }, + + /** Decrypt in CBC mode. + * @param {Object} prp The block cipher. It must have a block size of 16 bytes. + * @param {bitArray} ciphertext The ciphertext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] The authenticated data. It must be empty. + * @return The decrypted data, an array of bytes. + * @throws {sjcl.exception.invalid} if the IV isn't exactly 128 bits, or if any adata is specified. + * @throws {sjcl.exception.corrupt} if if the message is corrupt. + */ + decrypt: function(prp, ciphertext, iv, adata) { + if (adata && adata.length) { + throw new sjcl.exception.invalid("cbc can't authenticate data"); + } + if (sjcl.bitArray.bitLength(iv) !== 128) { + throw new sjcl.exception.invalid("cbc iv must be 128 bits"); + } + if ((sjcl.bitArray.bitLength(ciphertext) & 127) || !ciphertext.length) { + throw new sjcl.exception.corrupt("cbc ciphertext must be a positive multiple of the block size"); + } + var i, + w = sjcl.bitArray, + xor = w._xor4, + bi, bo, + output = []; + + adata = adata || []; + + for (i=0; i 16) { + throw new sjcl.exception.corrupt("pkcs#5 padding corrupt"); + } + bo = bi * 0x1010101; + if (!w.equal(w.bitSlice([bo,bo,bo,bo], 0, bi*8), + w.bitSlice(output, output.length*32 - bi*8, output.length*32))) { + throw new sjcl.exception.corrupt("pkcs#5 padding corrupt"); + } + + return w.bitSlice(output, 0, output.length*32 - bi*8); + } + }; +}; diff --git a/node_modules/sjcl/core/ccm.js b/node_modules/sjcl/core/ccm.js new file mode 100644 index 0000000..00c2fea --- /dev/null +++ b/node_modules/sjcl/core/ccm.js @@ -0,0 +1,220 @@ +/** @fileOverview CCM mode implementation. + * + * Special thanks to Roy Nicholson for pointing out a bug in our + * implementation. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * CTR mode with CBC MAC. + * @namespace + */ +sjcl.mode.ccm = { + /** The name of the mode. + * @constant + */ + name: "ccm", + + _progressListeners: [], + + listenProgress: function (cb) { + sjcl.mode.ccm._progressListeners.push(cb); + }, + + unListenProgress: function (cb) { + var index = sjcl.mode.ccm._progressListeners.indexOf(cb); + if (index > -1) { + sjcl.mode.ccm._progressListeners.splice(index, 1); + } + }, + + _callProgressListener: function (val) { + var p = sjcl.mode.ccm._progressListeners.slice(), i; + + for (i = 0; i < p.length; i += 1) { + p[i](val); + } + }, + + /** Encrypt in CCM mode. + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {bitArray} plaintext The plaintext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] The authenticated data. + * @param {Number} [tlen=64] the desired tag length, in bits. + * @return {bitArray} The encrypted data, an array of bytes. + */ + encrypt: function(prf, plaintext, iv, adata, tlen) { + var L, out = plaintext.slice(0), tag, w=sjcl.bitArray, ivl = w.bitLength(iv) / 8, ol = w.bitLength(out) / 8; + tlen = tlen || 64; + adata = adata || []; + + if (ivl < 7) { + throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"); + } + + // compute the length of the length + for (L=2; L<4 && ol >>> 8*L; L++) {} + if (L < 15 - ivl) { L = 15-ivl; } + iv = w.clamp(iv,8*(15-L)); + + // compute the tag + tag = sjcl.mode.ccm._computeTag(prf, plaintext, iv, adata, tlen, L); + + // encrypt + out = sjcl.mode.ccm._ctrMode(prf, out, iv, tag, tlen, L); + + return w.concat(out.data, out.tag); + }, + + /** Decrypt in CCM mode. + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {bitArray} ciphertext The ciphertext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] adata The authenticated data. + * @param {Number} [tlen=64] tlen the desired tag length, in bits. + * @return {bitArray} The decrypted data. + */ + decrypt: function(prf, ciphertext, iv, adata, tlen) { + tlen = tlen || 64; + adata = adata || []; + var L, + w=sjcl.bitArray, + ivl = w.bitLength(iv) / 8, + ol = w.bitLength(ciphertext), + out = w.clamp(ciphertext, ol - tlen), + tag = w.bitSlice(ciphertext, ol - tlen), tag2; + + + ol = (ol - tlen) / 8; + + if (ivl < 7) { + throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes"); + } + + // compute the length of the length + for (L=2; L<4 && ol >>> 8*L; L++) {} + if (L < 15 - ivl) { L = 15-ivl; } + iv = w.clamp(iv,8*(15-L)); + + // decrypt + out = sjcl.mode.ccm._ctrMode(prf, out, iv, tag, tlen, L); + + // check the tag + tag2 = sjcl.mode.ccm._computeTag(prf, out.data, iv, adata, tlen, L); + if (!w.equal(out.tag, tag2)) { + throw new sjcl.exception.corrupt("ccm: tag doesn't match"); + } + + return out.data; + }, + + _macAdditionalData: function (prf, adata, iv, tlen, ol, L) { + var mac, tmp, i, macData = [], w=sjcl.bitArray, xor = w._xor4; + + // mac the flags + mac = [w.partial(8, (adata.length ? 1<<6 : 0) | (tlen-2) << 2 | L-1)]; + + // mac the iv and length + mac = w.concat(mac, iv); + mac[3] |= ol; + mac = prf.encrypt(mac); + + if (adata.length) { + // mac the associated data. start with its length... + tmp = w.bitLength(adata)/8; + if (tmp <= 0xFEFF) { + macData = [w.partial(16, tmp)]; + } else if (tmp <= 0xFFFFFFFF) { + macData = w.concat([w.partial(16,0xFFFE)], [tmp]); + } // else ... + + // mac the data itself + macData = w.concat(macData, adata); + for (i=0; i 16) { + throw new sjcl.exception.invalid("ccm: invalid tag length"); + } + + if (adata.length > 0xFFFFFFFF || plaintext.length > 0xFFFFFFFF) { + // I don't want to deal with extracting high words from doubles. + throw new sjcl.exception.bug("ccm: can't deal with 4GiB or more data"); + } + + mac = sjcl.mode.ccm._macAdditionalData(prf, adata, iv, tlen, w.bitLength(plaintext)/8, L); + + // mac the plaintext + for (i=0; i n) { + sjcl.mode.ccm._callProgressListener(i/l); + n += p; + } + ctr[3]++; + enc = prf.encrypt(ctr); + data[i] ^= enc[0]; + data[i+1] ^= enc[1]; + data[i+2] ^= enc[2]; + data[i+3] ^= enc[3]; + } + return { tag:tag, data:w.clamp(data,bl) }; + } +}; diff --git a/node_modules/sjcl/core/ccmArrayBuffer.js b/node_modules/sjcl/core/ccmArrayBuffer.js new file mode 100644 index 0000000..15b14e8 --- /dev/null +++ b/node_modules/sjcl/core/ccmArrayBuffer.js @@ -0,0 +1,249 @@ +/** @fileOverview Really fast & small implementation of CCM using JS' array buffers + * + * @author Marco Munizaga + */ + +/** + * CTR mode with CBC MAC. + * @namespace + */ +sjcl.arrayBuffer = sjcl.arrayBuffer || {}; + +//patch arraybuffers if they don't exist +if (typeof(ArrayBuffer) === 'undefined') { + (function(globals){ + "use strict"; + globals.ArrayBuffer = function(){}; + globals.DataView = function(){}; + }(this)); +} + + +sjcl.arrayBuffer.ccm = { + mode: "ccm", + + defaults: { + tlen:128 //this is M in the NIST paper + }, + + /** Encrypt in CCM mode. Meant to return the same exact thing as the bitArray ccm to work as a drop in replacement + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {bitArray} plaintext The plaintext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] The authenticated data. + * @param {Number} [tlen=64] the desired tag length, in bits. + * @return {bitArray} The encrypted data, an array of bytes. + */ + compat_encrypt: function(prf, plaintext, iv, adata, tlen){ + var plaintext_buffer = sjcl.codec.arrayBuffer.fromBits(plaintext, true, 16), + ol = sjcl.bitArray.bitLength(plaintext)/8, + encrypted_obj, + ct, + tag; + + tlen = tlen || 64; + adata = adata || []; + + encrypted_obj = sjcl.arrayBuffer.ccm.encrypt(prf, plaintext_buffer, iv, adata, tlen, ol); + ct = sjcl.codec.arrayBuffer.toBits(encrypted_obj.ciphertext_buffer); + + ct = sjcl.bitArray.clamp(ct, ol*8); + + + return sjcl.bitArray.concat(ct, encrypted_obj.tag); + }, + + /** Decrypt in CCM mode. Meant to imitate the bitArray ccm + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {bitArray} ciphertext The ciphertext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] adata The authenticated data. + * @param {Number} [tlen=64] tlen the desired tag length, in bits. + * @return {bitArray} The decrypted data. + */ + compat_decrypt: function(prf, ciphertext, iv, adata, tlen){ + tlen = tlen || 64; + adata = adata || []; + var L, i, + w=sjcl.bitArray, + ol = w.bitLength(ciphertext), + out = w.clamp(ciphertext, ol - tlen), + tag = w.bitSlice(ciphertext, ol - tlen), tag2, + ciphertext_buffer = sjcl.codec.arrayBuffer.fromBits(out, true, 16); + + var plaintext_buffer = sjcl.arrayBuffer.ccm.decrypt(prf, ciphertext_buffer, iv, tag, adata, tlen, (ol-tlen)/8); + return sjcl.bitArray.clamp(sjcl.codec.arrayBuffer.toBits(plaintext_buffer), ol-tlen); + + }, + + /** Really fast ccm encryption, uses arraybufer and mutates the plaintext buffer + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {ArrayBuffer} plaintext_buffer The plaintext data. + * @param {bitArray} iv The initialization value. + * @param {ArrayBuffer} [adata=[]] The authenticated data. + * @param {Number} [tlen=128] the desired tag length, in bits. + * @return {ArrayBuffer} The encrypted data, in the same array buffer as the given plaintext, but given back anyways + */ + encrypt: function(prf, plaintext_buffer, iv, adata, tlen, ol){ + var auth_blocks, mac, L, w = sjcl.bitArray, + ivl = w.bitLength(iv) / 8; + + //set up defaults + adata = adata || []; + tlen = tlen || sjcl.arrayBuffer.ccm.defaults.tlen; + ol = ol || plaintext_buffer.byteLength; + tlen = Math.ceil(tlen/8); + + for (L=2; L<4 && ol >>> 8*L; L++) {} + if (L < 15 - ivl) { L = 15-ivl; } + iv = w.clamp(iv,8*(15-L)); + + //prf should use a 256 bit key to make precomputation attacks infeasible + + mac = sjcl.arrayBuffer.ccm._computeTag(prf, plaintext_buffer, iv, adata, tlen, ol, L); + + //encrypt the plaintext and the mac + //returns the mac since the plaintext will be left encrypted inside the buffer + mac = sjcl.arrayBuffer.ccm._ctrMode(prf, plaintext_buffer, iv, mac, tlen, L); + + + //the plaintext_buffer has been modified so it is now the ciphertext_buffer + return {'ciphertext_buffer':plaintext_buffer, 'tag':mac}; + }, + + /** Really fast ccm decryption, uses arraybufer and mutates the given buffer + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {ArrayBuffer} ciphertext_buffer The Ciphertext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} The authentication tag for the ciphertext + * @param {ArrayBuffer} [adata=[]] The authenticated data. + * @param {Number} [tlen=128] the desired tag length, in bits. + * @return {ArrayBuffer} The decrypted data, in the same array buffer as the given buffer, but given back anyways + */ + decrypt: function(prf, ciphertext_buffer, iv, tag, adata, tlen, ol){ + var mac, mac2, i, L, w = sjcl.bitArray, + ivl = w.bitLength(iv) / 8; + + //set up defaults + adata = adata || []; + tlen = tlen || sjcl.arrayBuffer.ccm.defaults.tlen; + ol = ol || ciphertext_buffer.byteLength; + tlen = Math.ceil(tlen/8) ; + + for (L=2; L<4 && ol >>> 8*L; L++) {} + if (L < 15 - ivl) { L = 15-ivl; } + iv = w.clamp(iv,8*(15-L)); + + //prf should use a 256 bit key to make precomputation attacks infeasible + + //decrypt the buffer + mac = sjcl.arrayBuffer.ccm._ctrMode(prf, ciphertext_buffer, iv, tag, tlen, L); + + mac2 = sjcl.arrayBuffer.ccm._computeTag(prf, ciphertext_buffer, iv, adata, tlen, ol, L); + + //check the tag + if (!sjcl.bitArray.equal(mac, mac2)){ + throw new sjcl.exception.corrupt("ccm: tag doesn't match"); + } + + return ciphertext_buffer; + + }, + + /* Compute the (unencrypted) authentication tag, according to the CCM specification + * @param {Object} prf The pseudorandom function. + * @param {ArrayBuffer} data_buffer The plaintext data in an arraybuffer. + * @param {bitArray} iv The initialization value. + * @param {bitArray} adata The authenticated data. + * @param {Number} tlen the desired tag length, in bits. + * @return {bitArray} The tag, but not yet encrypted. + * @private + */ + _computeTag: function(prf, data_buffer, iv, adata, tlen, ol, L){ + var i, plaintext, mac, data, data_blocks_size, data_blocks, + w = sjcl.bitArray, tmp, macData; + + mac = sjcl.mode.ccm._macAdditionalData(prf, adata, iv, tlen, ol, L); + + if (data_buffer.byteLength !== 0) { + data = new DataView(data_buffer); + //set padding bytes to 0 + for (i=ol; i< data_buffer.byteLength; i++){ + data.setUint8(i,0); + } + + //now to mac the plaintext blocks + for (i=0; i < data.byteLength; i+=16){ + mac[0] ^= data.getUint32(i); + mac[1] ^= data.getUint32(i+4); + mac[2] ^= data.getUint32(i+8); + mac[3] ^= data.getUint32(i+12); + + mac = prf.encrypt(mac); + } + } + + return sjcl.bitArray.clamp(mac,tlen*8); + }, + + /** CCM CTR mode. + * Encrypt or decrypt data and tag with the prf in CCM-style CTR mode. + * Mutates given array buffer + * @param {Object} prf The PRF. + * @param {ArrayBuffer} data_buffer The data to be encrypted or decrypted. + * @param {bitArray} iv The initialization vector. + * @param {bitArray} tag The authentication tag. + * @param {Number} tlen The length of th etag, in bits. + * @return {Object} An object with data and tag, the en/decryption of data and tag values. + * @private + */ + _ctrMode: function(prf, data_buffer, iv, mac, tlen, L){ + var data, ctr, word0, word1, word2, word3, keyblock, i, w = sjcl.bitArray, xor = w._xor4, n = data_buffer.byteLength/50, p = n; + + ctr = new DataView(new ArrayBuffer(16)); //create the first block for the counter + + //prf should use a 256 bit key to make precomputation attacks infeasible + + // start the ctr + ctr = w.concat([w.partial(8,L-1)],iv).concat([0,0,0]).slice(0,4); + + // en/decrypt the tag + mac = w.bitSlice(xor(mac,prf.encrypt(ctr)), 0, tlen*8); + + ctr[3]++; + if (ctr[3]===0) ctr[2]++; //increment higher bytes if the lowest 4 bytes are 0 + + if (data_buffer.byteLength !== 0) { + data = new DataView(data_buffer); + //now lets encrypt the message + for (i=0; i n) { + sjcl.mode.ccm._callProgressListener(i/data_buffer.byteLength); + n += p; + } + keyblock = prf.encrypt(ctr); + + word0 = data.getUint32(i); + word1 = data.getUint32(i+4); + word2 = data.getUint32(i+8); + word3 = data.getUint32(i+12); + + data.setUint32(i,word0 ^ keyblock[0]); + data.setUint32(i+4, word1 ^ keyblock[1]); + data.setUint32(i+8, word2 ^ keyblock[2]); + data.setUint32(i+12, word3 ^ keyblock[3]); + + ctr[3]++; + if (ctr[3]===0) ctr[2]++; //increment higher bytes if the lowest 4 bytes are 0 + } + } + + //return the mac, the ciphered data is available through the same data_buffer that was given + return mac; + } + +}; diff --git a/node_modules/sjcl/core/codecArrayBuffer.js b/node_modules/sjcl/core/codecArrayBuffer.js new file mode 100644 index 0000000..cc10049 --- /dev/null +++ b/node_modules/sjcl/core/codecArrayBuffer.js @@ -0,0 +1,116 @@ +/** @fileOverview Bit array codec implementations. + * + * @author Marco Munizaga + */ + +//patch arraybuffers if they don't exist +if (typeof(ArrayBuffer) === 'undefined') { + (function(globals){ + "use strict"; + globals.ArrayBuffer = function(){}; + globals.DataView = function(){}; + }(this)); +} + +/** + * ArrayBuffer + * @namespace + */ +sjcl.codec.arrayBuffer = { + /** Convert from a bitArray to an ArrayBuffer. + * Will default to 8byte padding if padding is undefined*/ + fromBits: function (arr, padding, padding_count) { + var out, i, ol, tmp, smallest; + padding = padding==undefined ? true : padding; + padding_count = padding_count || 8; + + if (arr.length === 0) { + return new ArrayBuffer(0); + } + + ol = sjcl.bitArray.bitLength(arr)/8; + + //check to make sure the bitLength is divisible by 8, if it isn't + //we can't do anything since arraybuffers work with bytes, not bits + if ( sjcl.bitArray.bitLength(arr)%8 !== 0 ) { + throw new sjcl.exception.invalid("Invalid bit size, must be divisble by 8 to fit in an arraybuffer correctly"); + } + + if (padding && ol%padding_count !== 0){ + ol += padding_count - (ol%padding_count); + } + + + //padded temp for easy copying + tmp = new DataView(new ArrayBuffer(arr.length*4)); + for (i=0; i= width ? n : new Array(width - n.length + 1).join('0') + n; + }; + + for (var i = 0; i < stringBufferView.byteLength; i+=2) { + if (i%16 == 0) string += ('\n'+(i).toString(16)+'\t'); + string += ( pad(stringBufferView.getUint16(i).toString(16),4) + ' '); + } + + if ( typeof console === undefined ){ + console = console || {log:function(){}}; //fix for IE + } + console.log(string.toUpperCase()); + } +}; + diff --git a/node_modules/sjcl/core/codecBase32.js b/node_modules/sjcl/core/codecBase32.js new file mode 100644 index 0000000..ed80269 --- /dev/null +++ b/node_modules/sjcl/core/codecBase32.js @@ -0,0 +1,91 @@ +/** @fileOverview Bit array codec implementations. + * + * @author Nils Kenneweg + */ + +/** + * Base32 encoding/decoding + * @namespace + */ +sjcl.codec.base32 = { + /** The base32 alphabet. + * @private + */ + _chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", + _hexChars: "0123456789ABCDEFGHIJKLMNOPQRSTUV", + + /* bits in an array */ + BITS: 32, + /* base to encode at (2^x) */ + BASE: 5, + /* bits - base */ + REMAINING: 27, + + /** Convert from a bitArray to a base32 string. */ + fromBits: function (arr, _noEquals, _hex) { + var BITS = sjcl.codec.base32.BITS, BASE = sjcl.codec.base32.BASE, REMAINING = sjcl.codec.base32.REMAINING; + var out = "", i, bits=0, c = sjcl.codec.base32._chars, ta=0, bl = sjcl.bitArray.bitLength(arr); + + if (_hex) { + c = sjcl.codec.base32._hexChars; + } + + for (i=0; out.length * BASE < bl; ) { + out += c.charAt((ta ^ arr[i]>>>bits) >>> REMAINING); + if (bits < BASE) { + ta = arr[i] << (BASE-bits); + bits += REMAINING; + i++; + } else { + ta <<= BASE; + bits -= BASE; + } + } + while ((out.length & 7) && !_noEquals) { out += "="; } + + return out; + }, + + /** Convert from a base32 string to a bitArray */ + toBits: function(str, _hex) { + str = str.replace(/\s|=/g,'').toUpperCase(); + var BITS = sjcl.codec.base32.BITS, BASE = sjcl.codec.base32.BASE, REMAINING = sjcl.codec.base32.REMAINING; + var out = [], i, bits=0, c = sjcl.codec.base32._chars, ta=0, x, format="base32"; + + if (_hex) { + c = sjcl.codec.base32._hexChars; + format = "base32hex"; + } + + for (i=0; i REMAINING) { + bits -= REMAINING; + out.push(ta ^ x>>>bits); + ta = x << (BITS-bits); + } else { + bits += BASE; + ta ^= x << (BITS-bits); + } + } + if (bits&56) { + out.push(sjcl.bitArray.partial(bits&56, ta, 1)); + } + return out; + } +}; + +sjcl.codec.base32hex = { + fromBits: function (arr, _noEquals) { return sjcl.codec.base32.fromBits(arr,_noEquals,1); }, + toBits: function (str) { return sjcl.codec.base32.toBits(str,1); } +}; diff --git a/node_modules/sjcl/core/codecBase64.js b/node_modules/sjcl/core/codecBase64.js new file mode 100644 index 0000000..fc0dbb0 --- /dev/null +++ b/node_modules/sjcl/core/codecBase64.js @@ -0,0 +1,70 @@ +/** @fileOverview Bit array codec implementations. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * Base64 encoding/decoding + * @namespace + */ +sjcl.codec.base64 = { + /** The base64 alphabet. + * @private + */ + _chars: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", + + /** Convert from a bitArray to a base64 string. */ + fromBits: function (arr, _noEquals, _url) { + var out = "", i, bits=0, c = sjcl.codec.base64._chars, ta=0, bl = sjcl.bitArray.bitLength(arr); + if (_url) { + c = c.substr(0,62) + '-_'; + } + for (i=0; out.length * 6 < bl; ) { + out += c.charAt((ta ^ arr[i]>>>bits) >>> 26); + if (bits < 6) { + ta = arr[i] << (6-bits); + bits += 26; + i++; + } else { + ta <<= 6; + bits -= 6; + } + } + while ((out.length & 3) && !_noEquals) { out += "="; } + return out; + }, + + /** Convert from a base64 string to a bitArray */ + toBits: function(str, _url) { + str = str.replace(/\s|=/g,''); + var out = [], i, bits=0, c = sjcl.codec.base64._chars, ta=0, x; + if (_url) { + c = c.substr(0,62) + '-_'; + } + for (i=0; i 26) { + bits -= 26; + out.push(ta ^ x>>>bits); + ta = x << (32-bits); + } else { + bits += 6; + ta ^= x << (32-bits); + } + } + if (bits&56) { + out.push(sjcl.bitArray.partial(bits&56, ta, 1)); + } + return out; + } +}; + +sjcl.codec.base64url = { + fromBits: function (arr) { return sjcl.codec.base64.fromBits(arr,1,1); }, + toBits: function (str) { return sjcl.codec.base64.toBits(str,1); } +}; diff --git a/node_modules/sjcl/core/codecBytes.js b/node_modules/sjcl/core/codecBytes.js new file mode 100644 index 0000000..cc8e818 --- /dev/null +++ b/node_modules/sjcl/core/codecBytes.js @@ -0,0 +1,40 @@ +/** @fileOverview Bit array codec implementations. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * Arrays of bytes + * @namespace + */ +sjcl.codec.bytes = { + /** Convert from a bitArray to an array of bytes. */ + fromBits: function (arr) { + var out = [], bl = sjcl.bitArray.bitLength(arr), i, tmp; + for (i=0; i>> 24); + tmp <<= 8; + } + return out; + }, + /** Convert from an array of bytes to a bitArray. */ + toBits: function (bytes) { + var out = [], i, tmp=0; + for (i=0; i>> 8 >>> 8 >>> 8); + tmp <<= 8; + } + return decodeURIComponent(escape(out)); + }, + + /** Convert from a UTF-8 string to a bitArray. */ + toBits: function (str) { + str = unescape(encodeURIComponent(str)); + var out = [], i, tmp=0; + for (i=0; i()[]{}@%$#", + + /** The decoder map (maps base 85 to base 256). + * @private + */ + _byteMap: [ + 0x00, 0x44, 0x00, 0x54, 0x53, 0x52, 0x48, 0x00, + 0x4B, 0x4C, 0x46, 0x41, 0x00, 0x3F, 0x3E, 0x45, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x40, 0x00, 0x49, 0x42, 0x4A, 0x47, + 0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, + 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, + 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, + 0x3B, 0x3C, 0x3D, 0x4D, 0x00, 0x4E, 0x43, 0x00, + 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, + 0x21, 0x22, 0x23, 0x4F, 0x00, 0x50, 0x00, 0x00 + ], + + /** + * @summary Method to convert a bitArray to a Z85-encoded string. + * The bits represented by the array MUST be multiples of 4 bytes. + * @param {bitArray} arr - The input bitArray. + * @return {string} The Z85-encoded string. + */ + fromBits: function (arr) { + // Sanity checks + if (!arr) { + return null; + } + // Check we have multiples of 4 bytes (32 bits) + if (0 !== sjcl.bitArray.bitLength(arr) % 32) { + throw new sjcl.exception.invalid("Invalid bitArray length!"); + } + + var out = "", c = sjcl.codec.z85._chars; + + // Convert sequences of 4 bytes (each word) to 5 characters. + for (var i = 0; i < arr.length; ++i) { + // Each element in the bitArray is a 32-bit (4-byte) word. + var word = arr[i]; + var value = 0; + for (var j = 0; j < 4; ++j) { + // Extract each successive byte from the word from the left. + var byteChunk = (word >>> 8*(4 - j - 1)) & 0xFF; + // Accumulate in base-256 + value = value*256 + byteChunk; + } + var divisor = 85*85*85*85; + while (divisor) { + out += c.charAt(Math.floor(value/divisor) % 85); + divisor = Math.floor(divisor/85); + } + } + + // Sanity check - each 4-bytes (1 word) should yield 5 characters. + var encodedSize = arr.length*5; + if (out.length !== encodedSize) { + throw new sjcl.exception.invalid("Bad Z85 conversion!"); + } + return out; + }, + + /** + * @summary Method to convert a Z85-encoded string to a bitArray. + * The length of the string MUST be a multiple of 5 + * (else it is not a valid Z85 string). + * @param {string} str - A valid Z85-encoded string. + * @return {bitArray} The decoded data represented as a bitArray. + */ + toBits: function(str) { + // Sanity check + if (!str) { + return []; + } + // Accept only strings bounded to 5 bytes + if (0 !== str.length % 5) { + throw new sjcl.exception.invalid("Invalid Z85 string!"); + } + + var out = [], value = 0, byteMap = sjcl.codec.z85._byteMap; + var word = 0, wordSize = 0; + for (var i = 0; i < str.length;) { + // Accumulate value in base 85. + value = value * 85 + byteMap[str[i++].charCodeAt(0) - 32]; + if (0 === i % 5) { + // Output value in base-256 + var divisor = 256*256*256; + while (divisor) { + // The following is equivalent to a left shift by 8 bits + // followed by OR-ing; however, left shift may cause sign problems + // due to 2's complement interpretation, + // and we're operating on unsigned values. + word = (word * Math.pow(2, 8)) + (Math.floor(value/divisor) % 256); + ++wordSize; + // If 4 bytes have been acumulated, push the word into the bitArray. + if (4 === wordSize) { + out.push(word); + word = 0, wordSize = 0; + } + divisor = Math.floor(divisor/256); + } + value = 0; + } + } + + return out; + } +} diff --git a/node_modules/sjcl/core/convenience.js b/node_modules/sjcl/core/convenience.js new file mode 100644 index 0000000..909e12d --- /dev/null +++ b/node_modules/sjcl/core/convenience.js @@ -0,0 +1,327 @@ +/** @fileOverview Convenience functions centered around JSON encapsulation. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + + /** + * JSON encapsulation + * @namespace + */ + sjcl.json = { + /** Default values for encryption */ + defaults: { v:1, iter:10000, ks:128, ts:64, mode:"ccm", adata:"", cipher:"aes" }, + + /** Simple encryption function. + * @param {String|bitArray} password The password or key. + * @param {String} plaintext The data to encrypt. + * @param {Object} [params] The parameters including tag, iv and salt. + * @param {Object} [rp] A returned version with filled-in parameters. + * @return {Object} The cipher raw data. + * @throws {sjcl.exception.invalid} if a parameter is invalid. + */ + _encrypt: function (password, plaintext, params, rp) { + params = params || {}; + rp = rp || {}; + + var j = sjcl.json, p = j._add({ iv: sjcl.random.randomWords(4,0) }, + j.defaults), tmp, prp, adata; + j._add(p, params); + adata = p.adata; + if (typeof p.salt === "string") { + p.salt = sjcl.codec.base64.toBits(p.salt); + } + if (typeof p.iv === "string") { + p.iv = sjcl.codec.base64.toBits(p.iv); + } + + if (!sjcl.mode[p.mode] || + !sjcl.cipher[p.cipher] || + (typeof password === "string" && p.iter <= 100) || + (p.ts !== 64 && p.ts !== 96 && p.ts !== 128) || + (p.ks !== 128 && p.ks !== 192 && p.ks !== 256) || + (p.iv.length < 2 || p.iv.length > 4)) { + throw new sjcl.exception.invalid("json encrypt: invalid parameters"); + } + + if (typeof password === "string") { + tmp = sjcl.misc.cachedPbkdf2(password, p); + password = tmp.key.slice(0,p.ks/32); + p.salt = tmp.salt; + } else if (sjcl.ecc && password instanceof sjcl.ecc.elGamal.publicKey) { + tmp = password.kem(); + p.kemtag = tmp.tag; + password = tmp.key.slice(0,p.ks/32); + } + if (typeof plaintext === "string") { + plaintext = sjcl.codec.utf8String.toBits(plaintext); + } + if (typeof adata === "string") { + p.adata = adata = sjcl.codec.utf8String.toBits(adata); + } + prp = new sjcl.cipher[p.cipher](password); + + /* return the json data */ + j._add(rp, p); + rp.key = password; + + /* do the encryption */ + if (p.mode === "ccm" && sjcl.arrayBuffer && sjcl.arrayBuffer.ccm && plaintext instanceof ArrayBuffer) { + p.ct = sjcl.arrayBuffer.ccm.encrypt(prp, plaintext, p.iv, adata, p.ts); + } else { + p.ct = sjcl.mode[p.mode].encrypt(prp, plaintext, p.iv, adata, p.ts); + } + + //return j.encode(j._subtract(p, j.defaults)); + return p; + }, + + /** Simple encryption function. + * @param {String|bitArray} password The password or key. + * @param {String} plaintext The data to encrypt. + * @param {Object} [params] The parameters including tag, iv and salt. + * @param {Object} [rp] A returned version with filled-in parameters. + * @return {String} The ciphertext serialized data. + * @throws {sjcl.exception.invalid} if a parameter is invalid. + */ + encrypt: function (password, plaintext, params, rp) { + var j = sjcl.json, p = j._encrypt.apply(j, arguments); + return j.encode(p); + }, + + /** Simple decryption function. + * @param {String|bitArray} password The password or key. + * @param {Object} ciphertext The cipher raw data to decrypt. + * @param {Object} [params] Additional non-default parameters. + * @param {Object} [rp] A returned object with filled parameters. + * @return {String} The plaintext. + * @throws {sjcl.exception.invalid} if a parameter is invalid. + * @throws {sjcl.exception.corrupt} if the ciphertext is corrupt. + */ + _decrypt: function (password, ciphertext, params, rp) { + params = params || {}; + rp = rp || {}; + + var j = sjcl.json, p = j._add(j._add(j._add({},j.defaults),ciphertext), params, true), ct, tmp, prp, adata=p.adata; + if (typeof p.salt === "string") { + p.salt = sjcl.codec.base64.toBits(p.salt); + } + if (typeof p.iv === "string") { + p.iv = sjcl.codec.base64.toBits(p.iv); + } + + if (!sjcl.mode[p.mode] || + !sjcl.cipher[p.cipher] || + (typeof password === "string" && p.iter <= 100) || + (p.ts !== 64 && p.ts !== 96 && p.ts !== 128) || + (p.ks !== 128 && p.ks !== 192 && p.ks !== 256) || + (!p.iv) || + (p.iv.length < 2 || p.iv.length > 4)) { + throw new sjcl.exception.invalid("json decrypt: invalid parameters"); + } + + if (typeof password === "string") { + tmp = sjcl.misc.cachedPbkdf2(password, p); + password = tmp.key.slice(0,p.ks/32); + p.salt = tmp.salt; + } else if (sjcl.ecc && password instanceof sjcl.ecc.elGamal.secretKey) { + password = password.unkem(sjcl.codec.base64.toBits(p.kemtag)).slice(0,p.ks/32); + } + if (typeof adata === "string") { + adata = sjcl.codec.utf8String.toBits(adata); + } + prp = new sjcl.cipher[p.cipher](password); + + /* do the decryption */ + if (p.mode === "ccm" && sjcl.arrayBuffer && sjcl.arrayBuffer.ccm && p.ct instanceof ArrayBuffer) { + ct = sjcl.arrayBuffer.ccm.decrypt(prp, p.ct, p.iv, p.tag, adata, p.ts); + } else { + ct = sjcl.mode[p.mode].decrypt(prp, p.ct, p.iv, adata, p.ts); + } + + /* return the json data */ + j._add(rp, p); + rp.key = password; + + if (params.raw === 1) { + return ct; + } else { + return sjcl.codec.utf8String.fromBits(ct); + } + }, + + /** Simple decryption function. + * @param {String|bitArray} password The password or key. + * @param {String} ciphertext The ciphertext to decrypt. + * @param {Object} [params] Additional non-default parameters. + * @param {Object} [rp] A returned object with filled parameters. + * @return {String} The plaintext. + * @throws {sjcl.exception.invalid} if a parameter is invalid. + * @throws {sjcl.exception.corrupt} if the ciphertext is corrupt. + */ + decrypt: function (password, ciphertext, params, rp) { + var j = sjcl.json; + return j._decrypt(password, j.decode(ciphertext), params, rp); + }, + + /** Encode a flat structure into a JSON string. + * @param {Object} obj The structure to encode. + * @return {String} A JSON string. + * @throws {sjcl.exception.invalid} if obj has a non-alphanumeric property. + * @throws {sjcl.exception.bug} if a parameter has an unsupported type. + */ + encode: function (obj) { + var i, out='{', comma=''; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + if (!i.match(/^[a-z0-9]+$/i)) { + throw new sjcl.exception.invalid("json encode: invalid property name"); + } + out += comma + '"' + i + '":'; + comma = ','; + + switch (typeof obj[i]) { + case 'number': + case 'boolean': + out += obj[i]; + break; + + case 'string': + out += '"' + escape(obj[i]) + '"'; + break; + + case 'object': + out += '"' + sjcl.codec.base64.fromBits(obj[i],0) + '"'; + break; + + default: + throw new sjcl.exception.bug("json encode: unsupported type"); + } + } + } + return out+'}'; + }, + + /** Decode a simple (flat) JSON string into a structure. The ciphertext, + * adata, salt and iv will be base64-decoded. + * @param {String} str The string. + * @return {Object} The decoded structure. + * @throws {sjcl.exception.invalid} if str isn't (simple) JSON. + */ + decode: function (str) { + str = str.replace(/\s/g,''); + if (!str.match(/^\{.*\}$/)) { + throw new sjcl.exception.invalid("json decode: this isn't json!"); + } + var a = str.replace(/^\{|\}$/g, '').split(/,/), out={}, i, m; + for (i=0; i=0; i--) { + for (j=sjcl.bn.prototype.radix-4; j>=0; j-=4) { + out = out.doubl().doubl().doubl().doubl().add(multiples[k[i]>>j & 0xF]); + } + } + + return out; + }, + + /** + * Multiply this point by k, added to affine2*k2, and return the answer in Jacobian coordinates. + * @param {bigInt} k The coefficient to multiply this by. + * @param {sjcl.ecc.point} affine This point in affine coordinates. + * @param {bigInt} k2 The coefficient to multiply affine2 this by. + * @param {sjcl.ecc.point} affine The other point in affine coordinates. + * @return {sjcl.ecc.pointJac} The result of the multiplication and addition, in Jacobian coordinates. + */ + mult2: function(k1, affine, k2, affine2) { + if (typeof(k1) === "number") { + k1 = [k1]; + } else if (k1.limbs !== undefined) { + k1 = k1.normalize().limbs; + } + + if (typeof(k2) === "number") { + k2 = [k2]; + } else if (k2.limbs !== undefined) { + k2 = k2.normalize().limbs; + } + + var i, j, out = new sjcl.ecc.point(this.curve).toJac(), m1 = affine.multiples(), + m2 = affine2.multiples(), l1, l2; + + for (i=Math.max(k1.length,k2.length)-1; i>=0; i--) { + l1 = k1[i] | 0; + l2 = k2[i] | 0; + for (j=sjcl.bn.prototype.radix-4; j>=0; j-=4) { + out = out.doubl().doubl().doubl().doubl().add(m1[l1>>j & 0xF]).add(m2[l2>>j & 0xF]); + } + } + + return out; + }, + + negate: function() { + return this.toAffine().negate().toJac(); + }, + + isValid: function() { + var z2 = this.z.square(), z4 = z2.square(), z6 = z4.mul(z2); + return this.y.square().equals( + this.curve.b.mul(z6).add(this.x.mul( + this.curve.a.mul(z4).add(this.x.square())))); + } +}; + +/** + * Construct an elliptic curve. Most users will not use this and instead start with one of the NIST curves defined below. + * + * @constructor + * @param {bigInt} p The prime modulus. + * @param {bigInt} r The prime order of the curve. + * @param {bigInt} a The constant a in the equation of the curve y^2 = x^3 + ax + b (for NIST curves, a is always -3). + * @param {bigInt} x The x coordinate of a base point of the curve. + * @param {bigInt} y The y coordinate of a base point of the curve. + */ +sjcl.ecc.curve = function(Field, r, a, b, x, y) { + this.field = Field; + this.r = new sjcl.bn(r); + this.a = new Field(a); + this.b = new Field(b); + this.G = new sjcl.ecc.point(this, new Field(x), new Field(y)); +}; + +sjcl.ecc.curve.prototype.fromBits = function (bits) { + var w = sjcl.bitArray, l = this.field.prototype.exponent + 7 & -8, + p = new sjcl.ecc.point(this, this.field.fromBits(w.bitSlice(bits, 0, l)), + this.field.fromBits(w.bitSlice(bits, l, 2*l))); + if (!p.isValid()) { + throw new sjcl.exception.corrupt("not on the curve!"); + } + return p; +}; + +sjcl.ecc.curves = { + c192: new sjcl.ecc.curve( + sjcl.bn.prime.p192, + "0xffffffffffffffffffffffff99def836146bc9b1b4d22831", + -3, + "0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", + "0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012", + "0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811"), + + c224: new sjcl.ecc.curve( + sjcl.bn.prime.p224, + "0xffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d", + -3, + "0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", + "0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", + "0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34"), + + c256: new sjcl.ecc.curve( + sjcl.bn.prime.p256, + "0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + -3, + "0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", + "0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"), + + c384: new sjcl.ecc.curve( + sjcl.bn.prime.p384, + "0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + -3, + "0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", + "0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", + "0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"), + + c521: new sjcl.ecc.curve( + sjcl.bn.prime.p521, + "0x1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", + -3, + "0x051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00", + "0xC6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66", + "0x11839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650"), + + k192: new sjcl.ecc.curve( + sjcl.bn.prime.p192k, + "0xfffffffffffffffffffffffe26f2fc170f69466a74defd8d", + 0, + 3, + "0xdb4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d", + "0x9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"), + + k224: new sjcl.ecc.curve( + sjcl.bn.prime.p224k, + "0x010000000000000000000000000001dce8d2ec6184caf0a971769fb1f7", + 0, + 5, + "0xa1455b334df099df30fc28a169a467e9e47075a90f7e650eb6b7a45c", + "0x7e089fed7fba344282cafbd6f7e319f7c0b0bd59e2ca4bdb556d61a5"), + + k256: new sjcl.ecc.curve( + sjcl.bn.prime.p256k, + "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + 0, + 7, + "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + "0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8") + +}; + +sjcl.ecc.curveName = function (curve) { + var curcurve; + for (curcurve in sjcl.ecc.curves) { + if (sjcl.ecc.curves.hasOwnProperty(curcurve)) { + if (sjcl.ecc.curves[curcurve] === curve) { + return curcurve; + } + } + } + + throw new sjcl.exception.invalid("no such curve"); +}; + +sjcl.ecc.deserialize = function (key) { + var types = ["elGamal", "ecdsa"]; + + if (!key || !key.curve || !sjcl.ecc.curves[key.curve]) { throw new sjcl.exception.invalid("invalid serialization"); } + if (types.indexOf(key.type) === -1) { throw new sjcl.exception.invalid("invalid type"); } + + var curve = sjcl.ecc.curves[key.curve]; + + if (key.secretKey) { + if (!key.exponent) { throw new sjcl.exception.invalid("invalid exponent"); } + var exponent = new sjcl.bn(key.exponent); + return new sjcl.ecc[key.type].secretKey(curve, exponent); + } else { + if (!key.point) { throw new sjcl.exception.invalid("invalid point"); } + + var point = curve.fromBits(sjcl.codec.hex.toBits(key.point)); + return new sjcl.ecc[key.type].publicKey(curve, point); + } +}; + +/** our basicKey classes +*/ +sjcl.ecc.basicKey = { + /** ecc publicKey. + * @constructor + * @param {curve} curve the elliptic curve + * @param {point} point the point on the curve + */ + publicKey: function(curve, point) { + this._curve = curve; + this._curveBitLength = curve.r.bitLength(); + if (point instanceof Array) { + this._point = curve.fromBits(point); + } else { + this._point = point; + } + + this.serialize = function () { + var curveName = sjcl.ecc.curveName(curve); + return { + type: this.getType(), + secretKey: false, + point: sjcl.codec.hex.fromBits(this._point.toBits()), + curve: curveName + }; + }; + + /** get this keys point data + * @return x and y as bitArrays + */ + this.get = function() { + var pointbits = this._point.toBits(); + var len = sjcl.bitArray.bitLength(pointbits); + var x = sjcl.bitArray.bitSlice(pointbits, 0, len/2); + var y = sjcl.bitArray.bitSlice(pointbits, len/2); + return { x: x, y: y }; + }; + }, + + /** ecc secretKey + * @constructor + * @param {curve} curve the elliptic curve + * @param exponent + */ + secretKey: function(curve, exponent) { + this._curve = curve; + this._curveBitLength = curve.r.bitLength(); + this._exponent = exponent; + + this.serialize = function () { + var exponent = this.get(); + var curveName = sjcl.ecc.curveName(curve); + return { + type: this.getType(), + secretKey: true, + exponent: sjcl.codec.hex.fromBits(exponent), + curve: curveName + }; + }; + + /** get this keys exponent data + * @return {bitArray} exponent + */ + this.get = function () { + return this._exponent.toBits(); + }; + } +}; + +/** @private */ +sjcl.ecc.basicKey.generateKeys = function(cn) { + return function generateKeys(curve, paranoia, sec) { + curve = curve || 256; + + if (typeof curve === "number") { + curve = sjcl.ecc.curves['c'+curve]; + if (curve === undefined) { + throw new sjcl.exception.invalid("no such curve"); + } + } + sec = sec || sjcl.bn.random(curve.r, paranoia); + + var pub = curve.G.mult(sec); + return { pub: new sjcl.ecc[cn].publicKey(curve, pub), + sec: new sjcl.ecc[cn].secretKey(curve, sec) }; + }; +}; + +/** elGamal keys */ +sjcl.ecc.elGamal = { + /** generate keys + * @function + * @param curve + * @param {int} paranoia Paranoia for generation (default 6) + * @param {secretKey} sec secret Key to use. used to get the publicKey for ones secretKey + */ + generateKeys: sjcl.ecc.basicKey.generateKeys("elGamal"), + /** elGamal publicKey. + * @constructor + * @augments sjcl.ecc.basicKey.publicKey + */ + publicKey: function (curve, point) { + sjcl.ecc.basicKey.publicKey.apply(this, arguments); + }, + /** elGamal secretKey + * @constructor + * @augments sjcl.ecc.basicKey.secretKey + */ + secretKey: function (curve, exponent) { + sjcl.ecc.basicKey.secretKey.apply(this, arguments); + } +}; + +sjcl.ecc.elGamal.publicKey.prototype = { + /** Kem function of elGamal Public Key + * @param paranoia paranoia to use for randomization. + * @return {object} key and tag. unkem(tag) with the corresponding secret key results in the key returned. + */ + kem: function(paranoia) { + var sec = sjcl.bn.random(this._curve.r, paranoia), + tag = this._curve.G.mult(sec).toBits(), + key = sjcl.hash.sha256.hash(this._point.mult(sec).toBits()); + return { key: key, tag: tag }; + }, + + getType: function() { + return "elGamal"; + } +}; + +sjcl.ecc.elGamal.secretKey.prototype = { + /** UnKem function of elGamal Secret Key + * @param {bitArray} tag The Tag to decrypt. + * @return {bitArray} decrypted key. + */ + unkem: function(tag) { + return sjcl.hash.sha256.hash(this._curve.fromBits(tag).mult(this._exponent).toBits()); + }, + + /** Diffie-Hellmann function + * @param {elGamal.publicKey} pk The Public Key to do Diffie-Hellmann with + * @return {bitArray} diffie-hellmann result for this key combination. + */ + dh: function(pk) { + return sjcl.hash.sha256.hash(pk._point.mult(this._exponent).toBits()); + }, + + /** Diffie-Hellmann function, compatible with Java generateSecret + * @param {elGamal.publicKey} pk The Public Key to do Diffie-Hellmann with + * @return {bitArray} undigested X value, diffie-hellmann result for this key combination, + * compatible with Java generateSecret(). + */ + dhJavaEc: function(pk) { + return pk._point.mult(this._exponent).x.toBits(); + }, + + getType: function() { + return "elGamal"; + } +}; + +/** ecdsa keys */ +sjcl.ecc.ecdsa = { + /** generate keys + * @function + * @param curve + * @param {int} paranoia Paranoia for generation (default 6) + * @param {secretKey} sec secret Key to use. used to get the publicKey for ones secretKey + */ + generateKeys: sjcl.ecc.basicKey.generateKeys("ecdsa") +}; + +/** ecdsa publicKey. +* @constructor +* @augments sjcl.ecc.basicKey.publicKey +*/ +sjcl.ecc.ecdsa.publicKey = function (curve, point) { + sjcl.ecc.basicKey.publicKey.apply(this, arguments); +}; + +/** specific functions for ecdsa publicKey. */ +sjcl.ecc.ecdsa.publicKey.prototype = { + /** Diffie-Hellmann function + * @param {bitArray} hash hash to verify. + * @param {bitArray} rs signature bitArray. + * @param {boolean} fakeLegacyVersion use old legacy version + */ + verify: function(hash, rs, fakeLegacyVersion) { + if (sjcl.bitArray.bitLength(hash) > this._curveBitLength) { + hash = sjcl.bitArray.clamp(hash, this._curveBitLength); + } + var w = sjcl.bitArray, + R = this._curve.r, + l = this._curveBitLength, + r = sjcl.bn.fromBits(w.bitSlice(rs,0,l)), + ss = sjcl.bn.fromBits(w.bitSlice(rs,l,2*l)), + s = fakeLegacyVersion ? ss : ss.inverseMod(R), + hG = sjcl.bn.fromBits(hash).mul(s).mod(R), + hA = r.mul(s).mod(R), + r2 = this._curve.G.mult2(hG, hA, this._point).x; + if (r.equals(0) || ss.equals(0) || r.greaterEquals(R) || ss.greaterEquals(R) || !r2.equals(r)) { + if (fakeLegacyVersion === undefined) { + return this.verify(hash, rs, true); + } else { + throw (new sjcl.exception.corrupt("signature didn't check out")); + } + } + return true; + }, + + getType: function() { + return "ecdsa"; + } +}; + +/** ecdsa secretKey +* @constructor +* @augments sjcl.ecc.basicKey.publicKey +*/ +sjcl.ecc.ecdsa.secretKey = function (curve, exponent) { + sjcl.ecc.basicKey.secretKey.apply(this, arguments); +}; + +/** specific functions for ecdsa secretKey. */ +sjcl.ecc.ecdsa.secretKey.prototype = { + /** Diffie-Hellmann function + * @param {bitArray} hash hash to sign. + * @param {int} paranoia paranoia for random number generation + * @param {boolean} fakeLegacyVersion use old legacy version + */ + sign: function(hash, paranoia, fakeLegacyVersion, fixedKForTesting) { + if (sjcl.bitArray.bitLength(hash) > this._curveBitLength) { + hash = sjcl.bitArray.clamp(hash, this._curveBitLength); + } + var R = this._curve.r, + l = R.bitLength(), + k = fixedKForTesting || sjcl.bn.random(R.sub(1), paranoia).add(1), + r = this._curve.G.mult(k).x.mod(R), + ss = sjcl.bn.fromBits(hash).add(r.mul(this._exponent)), + s = fakeLegacyVersion ? ss.inverseMod(R).mul(k).mod(R) + : ss.mul(k.inverseMod(R)).mod(R); + return sjcl.bitArray.concat(r.toBits(l), s.toBits(l)); + }, + + getType: function() { + return "ecdsa"; + } +}; diff --git a/node_modules/sjcl/core/exports.js b/node_modules/sjcl/core/exports.js new file mode 100644 index 0000000..84ddfe4 --- /dev/null +++ b/node_modules/sjcl/core/exports.js @@ -0,0 +1,8 @@ +if(typeof module !== 'undefined' && module.exports){ + module.exports = sjcl; +} +if (typeof define === "function") { + define([], function () { + return sjcl; + }); +} diff --git a/node_modules/sjcl/core/gcm.js b/node_modules/sjcl/core/gcm.js new file mode 100644 index 0000000..be099f0 --- /dev/null +++ b/node_modules/sjcl/core/gcm.js @@ -0,0 +1,187 @@ +/** @fileOverview GCM mode implementation. + * + * @author Juho Vähä-Herttua + */ + +/** + * Galois/Counter mode. + * @namespace + */ +sjcl.mode.gcm = { + /** + * The name of the mode. + * @constant + */ + name: "gcm", + + /** Encrypt in GCM mode. + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {bitArray} plaintext The plaintext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] The authenticated data. + * @param {Number} [tlen=128] The desired tag length, in bits. + * @return {bitArray} The encrypted data, an array of bytes. + */ + encrypt: function (prf, plaintext, iv, adata, tlen) { + var out, data = plaintext.slice(0), w=sjcl.bitArray; + tlen = tlen || 128; + adata = adata || []; + + // encrypt and tag + out = sjcl.mode.gcm._ctrMode(true, prf, data, adata, iv, tlen); + + return w.concat(out.data, out.tag); + }, + + /** Decrypt in GCM mode. + * @static + * @param {Object} prf The pseudorandom function. It must have a block size of 16 bytes. + * @param {bitArray} ciphertext The ciphertext data. + * @param {bitArray} iv The initialization value. + * @param {bitArray} [adata=[]] The authenticated data. + * @param {Number} [tlen=128] The desired tag length, in bits. + * @return {bitArray} The decrypted data. + */ + decrypt: function (prf, ciphertext, iv, adata, tlen) { + var out, data = ciphertext.slice(0), tag, w=sjcl.bitArray, l=w.bitLength(data); + tlen = tlen || 128; + adata = adata || []; + + // Slice tag out of data + if (tlen <= l) { + tag = w.bitSlice(data, l-tlen); + data = w.bitSlice(data, 0, l-tlen); + } else { + tag = data; + data = []; + } + + // decrypt and tag + out = sjcl.mode.gcm._ctrMode(false, prf, data, adata, iv, tlen); + + if (!w.equal(out.tag, tag)) { + throw new sjcl.exception.corrupt("gcm: tag doesn't match"); + } + return out.data; + }, + + /* Compute the galois multiplication of X and Y + * @private + */ + _galoisMultiply: function (x, y) { + var i, j, xi, Zi, Vi, lsb_Vi, w=sjcl.bitArray, xor=w._xor4; + + Zi = [0,0,0,0]; + Vi = y.slice(0); + + // Block size is 128 bits, run 128 times to get Z_128 + for (i=0; i<128; i++) { + xi = (x[Math.floor(i/32)] & (1 << (31-i%32))) !== 0; + if (xi) { + // Z_i+1 = Z_i ^ V_i + Zi = xor(Zi, Vi); + } + + // Store the value of LSB(V_i) + lsb_Vi = (Vi[3] & 1) !== 0; + + // V_i+1 = V_i >> 1 + for (j=3; j>0; j--) { + Vi[j] = (Vi[j] >>> 1) | ((Vi[j-1]&1) << 31); + } + Vi[0] = Vi[0] >>> 1; + + // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R + if (lsb_Vi) { + Vi[0] = Vi[0] ^ (0xe1 << 24); + } + } + return Zi; + }, + + _ghash: function(H, Y0, data) { + var Yi, i, l = data.length; + + Yi = Y0.slice(0); + for (i=0; i 255) { + throw new sjcl.exception.invalid("key bit length is too large for hkdf"); + } + + hmac = new sjcl.misc.hmac(key, Hash); + curOut = []; + for (i = 1; i <= loops; i++) { + hmac.update(curOut); + hmac.update(info); + hmac.update([sjcl.bitArray.partial(8, i)]); + curOut = hmac.digest(); + ret = sjcl.bitArray.concat(ret, curOut); + } + return sjcl.bitArray.clamp(ret, keyBitLength); +}; diff --git a/node_modules/sjcl/core/hmac.js b/node_modules/sjcl/core/hmac.js new file mode 100644 index 0000000..eb8e86d --- /dev/null +++ b/node_modules/sjcl/core/hmac.js @@ -0,0 +1,61 @@ +/** @fileOverview HMAC implementation. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** HMAC with the specified hash function. + * @constructor + * @param {bitArray} key the key for HMAC. + * @param {Object} [Hash=sjcl.hash.sha256] The hash function to use. + */ +sjcl.misc.hmac = function (key, Hash) { + this._hash = Hash = Hash || sjcl.hash.sha256; + var exKey = [[],[]], i, + bs = Hash.prototype.blockSize / 32; + this._baseHash = [new Hash(), new Hash()]; + + if (key.length > bs) { + key = Hash.hash(key); + } + + for (i=0; i>>31, + x[1]<<1 ^ x[2]>>>31, + x[2]<<1 ^ x[3]>>>31, + x[3]<<1 ^ (x[0]>>>31)*0x87]; + } +}; diff --git a/node_modules/sjcl/core/ocb2progressive.js b/node_modules/sjcl/core/ocb2progressive.js new file mode 100644 index 0000000..14246ad --- /dev/null +++ b/node_modules/sjcl/core/ocb2progressive.js @@ -0,0 +1,138 @@ +/** + * OCB2.0 implementation slightly modified by Yifan Gu + * to support progressive encryption + * @author Yifan Gu + */ + +/** @fileOverview OCB 2.0 implementation + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * Phil Rogaway's Offset CodeBook mode, version 2.0. + * May be covered by US and international patents. + * + * @namespace + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +sjcl.mode.ocb2progressive = { + createEncryptor: function(prp, iv, adata, tlen, premac) { + if (sjcl.bitArray.bitLength(iv) !== 128) { + throw new sjcl.exception.invalid("ocb iv must be 128 bits"); + } + var i, + times2 = sjcl.mode.ocb2._times2, + w = sjcl.bitArray, + xor = w._xor4, + checksum = [0,0,0,0], + delta = times2(prp.encrypt(iv)), + bi, bl, + datacache = [], + pad; + + adata = adata || []; + tlen = tlen || 64; + + return { + process: function(data){ + var datalen = sjcl.bitArray.bitLength(data); + if (datalen == 0){ // empty input natrually gives empty output + return []; + } + var output = []; + datacache = datacache.concat(data); + for (i=0; i+4 < datacache.length; i+=4) { + /* Encrypt a non-final block */ + bi = datacache.slice(i,i+4); + checksum = xor(checksum, bi); + output = output.concat(xor(delta,prp.encrypt(xor(delta, bi)))); + delta = times2(delta); + } + datacache = datacache.slice(i); // at end of each process we ensure size of datacache is smaller than 4 + return output; //spits out the result. + }, + finalize: function(){ + // the final block + bi = datacache; + bl = w.bitLength(bi); + pad = prp.encrypt(xor(delta,[0,0,0,bl])); + bi = w.clamp(xor(bi.concat([0,0,0]),pad), bl); + + /* Checksum the final block, and finalize the checksum */ + checksum = xor(checksum,xor(bi.concat([0,0,0]),pad)); + checksum = prp.encrypt(xor(checksum,xor(delta,times2(delta)))); + + /* MAC the header */ + if (adata.length) { + checksum = xor(checksum, premac ? adata : sjcl.mode.ocb2.pmac(prp, adata)); + } + + return w.concat(bi, w.clamp(checksum, tlen)); // spits out the last block + } + }; + }, + createDecryptor: function(prp, iv, adata, tlen, premac){ + if (sjcl.bitArray.bitLength(iv) !== 128) { + throw new sjcl.exception.invalid("ocb iv must be 128 bits"); + } + tlen = tlen || 64; + var i, + times2 = sjcl.mode.ocb2._times2, + w = sjcl.bitArray, + xor = w._xor4, + checksum = [0,0,0,0], + delta = times2(prp.encrypt(iv)), + bi, bl, + datacache = [], + pad; + + adata = adata || []; + + return { + process: function(data){ + if (data.length == 0){ // empty input natrually gives empty output + return []; + } + var output = []; + datacache = datacache.concat(data); + var cachelen = sjcl.bitArray.bitLength(datacache); + for (i=0; i+4 < (cachelen-tlen)/32; i+=4) { + /* Decrypt a non-final block */ + bi = xor(delta, prp.decrypt(xor(delta, datacache.slice(i,i+4)))); + checksum = xor(checksum, bi); + output = output.concat(bi); + delta = times2(delta); + } + datacache = datacache.slice(i); + return output; + }, + finalize: function(){ + /* Chop out and decrypt the final block */ + bl = sjcl.bitArray.bitLength(datacache) - tlen; + pad = prp.encrypt(xor(delta,[0,0,0,bl])); + bi = xor(pad, w.clamp(datacache,bl).concat([0,0,0])); + + /* Checksum the final block, and finalize the checksum */ + checksum = xor(checksum, bi); + checksum = prp.encrypt(xor(checksum, xor(delta, times2(delta)))); + + /* MAC the header */ + if (adata.length) { + checksum = xor(checksum, premac ? adata : sjcl.mode.ocb2.pmac(prp, adata)); + } + + if (!w.equal(w.clamp(checksum, tlen), w.bitSlice(datacache, bl))) { + throw new sjcl.exception.corrupt("ocb: tag doesn't match"); + } + + return w.clamp(bi,bl); + } + }; + } +}; diff --git a/node_modules/sjcl/core/pbkdf2.js b/node_modules/sjcl/core/pbkdf2.js new file mode 100644 index 0000000..d239f9c --- /dev/null +++ b/node_modules/sjcl/core/pbkdf2.js @@ -0,0 +1,58 @@ +/** @fileOverview Password-based key-derivation function, version 2.0. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** Password-Based Key-Derivation Function, version 2.0. + * + * Generate keys from passwords using PBKDF2-HMAC-SHA256. + * + * This is the method specified by RSA's PKCS #5 standard. + * + * @param {bitArray|String} password The password. + * @param {bitArray|String} salt The salt. Should have lots of entropy. + * @param {Number} [count=1000] The number of iterations. Higher numbers make the function slower but more secure. + * @param {Number} [length] The length of the derived key. Defaults to the + output size of the hash function. + * @param {Object} [Prff=sjcl.misc.hmac] The pseudorandom function family. + * @return {bitArray} the derived key. + */ +sjcl.misc.pbkdf2 = function (password, salt, count, length, Prff) { + count = count || 10000; + + if (length < 0 || count < 0) { + throw new sjcl.exception.invalid("invalid params to pbkdf2"); + } + + if (typeof password === "string") { + password = sjcl.codec.utf8String.toBits(password); + } + + if (typeof salt === "string") { + salt = sjcl.codec.utf8String.toBits(salt); + } + + Prff = Prff || sjcl.misc.hmac; + + var prf = new Prff(password), + u, ui, i, j, k, out = [], b = sjcl.bitArray; + + for (k = 1; 32 * out.length < (length || 1); k++) { + u = ui = prf.encrypt(b.concat(salt,[k])); + + for (i=1; iUse sjcl.random as a singleton for this class! + *

+ * This random number generator is a derivative of Ferguson and Schneier's + * generator Fortuna. It collects entropy from various events into several + * pools, implemented by streaming SHA-256 instances. It differs from + * ordinary Fortuna in a few ways, though. + *

+ * + *

+ * Most importantly, it has an entropy estimator. This is present because + * there is a strong conflict here between making the generator available + * as soon as possible, and making sure that it doesn't "run on empty". + * In Fortuna, there is a saved state file, and the system is likely to have + * time to warm up. + *

+ * + *

+ * Second, because users are unlikely to stay on the page for very long, + * and to speed startup time, the number of pools increases logarithmically: + * a new pool is created when the previous one is actually used for a reseed. + * This gives the same asymptotic guarantees as Fortuna, but gives more + * entropy to early reseeds. + *

+ * + *

+ * The entire mechanism here feels pretty klunky. Furthermore, there are + * several improvements that should be made, including support for + * dedicated cryptographic functions that may be present in some browsers; + * state files in local storage; cookies containing randomness; etc. So + * look for improvements in future versions. + *

+ * @constructor + */ +sjcl.prng = function(defaultParanoia) { + + /* private */ + this._pools = [new sjcl.hash.sha256()]; + this._poolEntropy = [0]; + this._reseedCount = 0; + this._robins = {}; + this._eventId = 0; + + this._collectorIds = {}; + this._collectorIdNext = 0; + + this._strength = 0; + this._poolStrength = 0; + this._nextReseed = 0; + this._key = [0,0,0,0,0,0,0,0]; + this._counter = [0,0,0,0]; + this._cipher = undefined; + this._defaultParanoia = defaultParanoia; + + /* event listener stuff */ + this._collectorsStarted = false; + this._callbacks = {progress: {}, seeded: {}}; + this._callbackI = 0; + + /* constants */ + this._NOT_READY = 0; + this._READY = 1; + this._REQUIRES_RESEED = 2; + + this._MAX_WORDS_PER_BURST = 65536; + this._PARANOIA_LEVELS = [0,48,64,96,128,192,256,384,512,768,1024]; + this._MILLISECONDS_PER_RESEED = 30000; + this._BITS_PER_RESEED = 80; +}; + +sjcl.prng.prototype = { + /** Generate several random words, and return them in an array. + * A word consists of 32 bits (4 bytes) + * @param {Number} nwords The number of words to generate. + */ + randomWords: function (nwords, paranoia) { + var out = [], i, readiness = this.isReady(paranoia), g; + + if (readiness === this._NOT_READY) { + throw new sjcl.exception.notReady("generator isn't seeded"); + } else if (readiness & this._REQUIRES_RESEED) { + this._reseedFromPools(!(readiness & this._READY)); + } + + for (i=0; i0) { + estimatedEntropy++; + tmp = tmp >>> 1; + } + } + } + this._pools[robin].update([id,this._eventId++,2,estimatedEntropy,t,data.length].concat(data)); + } + break; + + case "string": + if (estimatedEntropy === undefined) { + /* English text has just over 1 bit per character of entropy. + * But this might be HTML or something, and have far less + * entropy than English... Oh well, let's just say one bit. + */ + estimatedEntropy = data.length; + } + this._pools[robin].update([id,this._eventId++,3,estimatedEntropy,t,data.length]); + this._pools[robin].update(data); + break; + + default: + err=1; + } + if (err) { + throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string"); + } + + /* record the new strength */ + this._poolEntropy[robin] += estimatedEntropy; + this._poolStrength += estimatedEntropy; + + /* fire off events */ + if (oldReady === this._NOT_READY) { + if (this.isReady() !== this._NOT_READY) { + this._fireEvent("seeded", Math.max(this._strength, this._poolStrength)); + } + this._fireEvent("progress", this.getProgress()); + } + }, + + /** Is the generator ready? */ + isReady: function (paranoia) { + var entropyRequired = this._PARANOIA_LEVELS[ (paranoia !== undefined) ? paranoia : this._defaultParanoia ]; + + if (this._strength && this._strength >= entropyRequired) { + return (this._poolEntropy[0] > this._BITS_PER_RESEED && (new Date()).valueOf() > this._nextReseed) ? + this._REQUIRES_RESEED | this._READY : + this._READY; + } else { + return (this._poolStrength >= entropyRequired) ? + this._REQUIRES_RESEED | this._NOT_READY : + this._NOT_READY; + } + }, + + /** Get the generator's progress toward readiness, as a fraction */ + getProgress: function (paranoia) { + var entropyRequired = this._PARANOIA_LEVELS[ paranoia ? paranoia : this._defaultParanoia ]; + + if (this._strength >= entropyRequired) { + return 1.0; + } else { + return (this._poolStrength > entropyRequired) ? + 1.0 : + this._poolStrength / entropyRequired; + } + }, + + /** start the built-in entropy collectors */ + startCollectors: function () { + if (this._collectorsStarted) { return; } + + this._eventListener = { + loadTimeCollector: this._bind(this._loadTimeCollector), + mouseCollector: this._bind(this._mouseCollector), + keyboardCollector: this._bind(this._keyboardCollector), + accelerometerCollector: this._bind(this._accelerometerCollector), + touchCollector: this._bind(this._touchCollector) + }; + + if (window.addEventListener) { + window.addEventListener("load", this._eventListener.loadTimeCollector, false); + window.addEventListener("mousemove", this._eventListener.mouseCollector, false); + window.addEventListener("keypress", this._eventListener.keyboardCollector, false); + window.addEventListener("devicemotion", this._eventListener.accelerometerCollector, false); + window.addEventListener("touchmove", this._eventListener.touchCollector, false); + } else if (document.attachEvent) { + document.attachEvent("onload", this._eventListener.loadTimeCollector); + document.attachEvent("onmousemove", this._eventListener.mouseCollector); + document.attachEvent("keypress", this._eventListener.keyboardCollector); + } else { + throw new sjcl.exception.bug("can't attach event"); + } + + this._collectorsStarted = true; + }, + + /** stop the built-in entropy collectors */ + stopCollectors: function () { + if (!this._collectorsStarted) { return; } + + if (window.removeEventListener) { + window.removeEventListener("load", this._eventListener.loadTimeCollector, false); + window.removeEventListener("mousemove", this._eventListener.mouseCollector, false); + window.removeEventListener("keypress", this._eventListener.keyboardCollector, false); + window.removeEventListener("devicemotion", this._eventListener.accelerometerCollector, false); + window.removeEventListener("touchmove", this._eventListener.touchCollector, false); + } else if (document.detachEvent) { + document.detachEvent("onload", this._eventListener.loadTimeCollector); + document.detachEvent("onmousemove", this._eventListener.mouseCollector); + document.detachEvent("keypress", this._eventListener.keyboardCollector); + } + + this._collectorsStarted = false; + }, + + /* use a cookie to store entropy. + useCookie: function (all_cookies) { + throw new sjcl.exception.bug("random: useCookie is unimplemented"); + },*/ + + /** add an event listener for progress or seeded-ness. */ + addEventListener: function (name, callback) { + this._callbacks[name][this._callbackI++] = callback; + }, + + /** remove an event listener for progress or seeded-ness */ + removeEventListener: function (name, cb) { + var i, j, cbs=this._callbacks[name], jsTemp=[]; + + /* I'm not sure if this is necessary; in C++, iterating over a + * collection and modifying it at the same time is a no-no. + */ + + for (j in cbs) { + if (cbs.hasOwnProperty(j) && cbs[j] === cb) { + jsTemp.push(j); + } + } + + for (i=0; i= 1 << this._pools.length) { + this._pools.push(new sjcl.hash.sha256()); + this._poolEntropy.push(0); + } + + /* how strong was this reseed? */ + this._poolStrength -= strength; + if (strength > this._strength) { + this._strength = strength; + } + + this._reseedCount ++; + this._reseed(reseedData); + }, + + _keyboardCollector: function () { + this._addCurrentTimeToEntropy(1); + }, + + _mouseCollector: function (ev) { + var x, y; + + try { + x = ev.x || ev.clientX || ev.offsetX || 0; + y = ev.y || ev.clientY || ev.offsetY || 0; + } catch (err) { + // Event originated from a secure element. No mouse position available. + x = 0; + y = 0; + } + + if (x != 0 && y!= 0) { + this.addEntropy([x,y], 2, "mouse"); + } + + this._addCurrentTimeToEntropy(0); + }, + + _touchCollector: function(ev) { + var touch = ev.touches[0] || ev.changedTouches[0]; + var x = touch.pageX || touch.clientX, + y = touch.pageY || touch.clientY; + + this.addEntropy([x,y],1,"touch"); + + this._addCurrentTimeToEntropy(0); + }, + + _loadTimeCollector: function () { + this._addCurrentTimeToEntropy(2); + }, + + _addCurrentTimeToEntropy: function (estimatedEntropy) { + if (typeof window !== 'undefined' && window.performance && typeof window.performance.now === "function") { + //how much entropy do we want to add here? + this.addEntropy(window.performance.now(), estimatedEntropy, "loadtime"); + } else { + this.addEntropy((new Date()).valueOf(), estimatedEntropy, "loadtime"); + } + }, + _accelerometerCollector: function (ev) { + var ac = ev.accelerationIncludingGravity.x||ev.accelerationIncludingGravity.y||ev.accelerationIncludingGravity.z; + if(window.orientation){ + var or = window.orientation; + if (typeof or === "number") { + this.addEntropy(or, 1, "accelerometer"); + } + } + if (ac) { + this.addEntropy(ac, 2, "accelerometer"); + } + this._addCurrentTimeToEntropy(0); + }, + + _fireEvent: function (name, arg) { + var j, cbs=sjcl.random._callbacks[name], cbsTemp=[]; + /* TODO: there is a race condition between removing collectors and firing them */ + + /* I'm not sure if this is necessary; in C++, iterating over a + * collection and modifying it at the same time is a no-no. + */ + + for (j in cbs) { + if (cbs.hasOwnProperty(j)) { + cbsTemp.push(cbs[j]); + } + } + + for (j=0; j + */ +(function() { + +/** + * Context for a RIPEMD-160 operation in progress. + * @constructor + */ +sjcl.hash.ripemd160 = function (hash) { + if (hash) { + this._h = hash._h.slice(0); + this._buffer = hash._buffer.slice(0); + this._length = hash._length; + } else { + this.reset(); + } +}; + +/** + * Hash a string or an array of words. + * @static + * @param {bitArray|String} data the data to hash. + * @return {bitArray} The hash value, an array of 5 big-endian words. + */ +sjcl.hash.ripemd160.hash = function (data) { + return (new sjcl.hash.ripemd160()).update(data).finalize(); +}; + +sjcl.hash.ripemd160.prototype = { + /** + * Reset the hash state. + * @return this + */ + reset: function () { + this._h = _h0.slice(0); + this._buffer = []; + this._length = 0; + return this; + }, + + /** + * Reset the hash state. + * @param {bitArray|String} data the data to hash. + * @return this + */ + update: function (data) { + if ( typeof data === "string" ) + data = sjcl.codec.utf8String.toBits(data); + + var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data), + ol = this._length, + nl = this._length = ol + sjcl.bitArray.bitLength(data); + if (nl > 9007199254740991){ + throw new sjcl.exception.invalid("Cannot hash more than 2^53 - 1 bits"); + } + for (i = 512+ol - ((512+ol) & 511); i <= nl; i+= 512) { + var words = b.splice(0,16); + for ( var w = 0; w < 16; ++w ) + words[w] = _cvt(words[w]); + + _block.call( this, words ); + } + + return this; + }, + + /** + * Complete hashing and output the hash value. + * @return {bitArray} The hash value, an array of 5 big-endian words. + */ + finalize: function () { + var b = sjcl.bitArray.concat( this._buffer, [ sjcl.bitArray.partial(1,1) ] ), + l = ( this._length + 1 ) % 512, + z = ( l > 448 ? 512 : 448 ) - l % 448, + zp = z % 32; + + if ( zp > 0 ) + b = sjcl.bitArray.concat( b, [ sjcl.bitArray.partial(zp,0) ] ); + for ( ; z >= 32; z -= 32 ) + b.push(0); + + b.push( _cvt( this._length | 0 ) ); + b.push( _cvt( Math.floor(this._length / 0x100000000) ) ); + + while ( b.length ) { + var words = b.splice(0,16); + for ( var w = 0; w < 16; ++w ) + words[w] = _cvt(words[w]); + + _block.call( this, words ); + } + + var h = this._h; + this.reset(); + + for ( var w = 0; w < 5; ++w ) + h[w] = _cvt(h[w]); + + return h; + } +}; + +var _h0 = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; + +var _k1 = [ 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e ]; +var _k2 = [ 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000 ]; +for ( var i = 4; i >= 0; --i ) { + for ( var j = 1; j < 16; ++j ) { + _k1.splice(i,0,_k1[i]); + _k2.splice(i,0,_k2[i]); + } +} + +var _r1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 ]; +var _r2 = [ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 ]; + +var _s1 = [ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]; +var _s2 = [ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; + +function _f0(x,y,z) { + return x ^ y ^ z; +} + +function _f1(x,y,z) { + return (x & y) | (~x & z); +} + +function _f2(x,y,z) { + return (x | ~y) ^ z; +} + +function _f3(x,y,z) { + return (x & z) | (y & ~z); +} + +function _f4(x,y,z) { + return x ^ (y | ~z); +} + +function _rol(n,l) { + return (n << l) | (n >>> (32-l)); +} + +function _cvt(n) { + return ( (n & 0xff << 0) << 24 ) + | ( (n & 0xff << 8) << 8 ) + | ( (n & 0xff << 16) >>> 8 ) + | ( (n & 0xff << 24) >>> 24 ); +} + +function _block(X) { + var A1 = this._h[0], B1 = this._h[1], C1 = this._h[2], D1 = this._h[3], E1 = this._h[4], + A2 = this._h[0], B2 = this._h[1], C2 = this._h[2], D2 = this._h[3], E2 = this._h[4]; + + var j = 0, T; + + for ( ; j < 16; ++j ) { + T = _rol( A1 + _f0(B1,C1,D1) + X[_r1[j]] + _k1[j], _s1[j] ) + E1; + A1 = E1; E1 = D1; D1 = _rol(C1,10); C1 = B1; B1 = T; + T = _rol( A2 + _f4(B2,C2,D2) + X[_r2[j]] + _k2[j], _s2[j] ) + E2; + A2 = E2; E2 = D2; D2 = _rol(C2,10); C2 = B2; B2 = T; } + for ( ; j < 32; ++j ) { + T = _rol( A1 + _f1(B1,C1,D1) + X[_r1[j]] + _k1[j], _s1[j] ) + E1; + A1 = E1; E1 = D1; D1 = _rol(C1,10); C1 = B1; B1 = T; + T = _rol( A2 + _f3(B2,C2,D2) + X[_r2[j]] + _k2[j], _s2[j] ) + E2; + A2 = E2; E2 = D2; D2 = _rol(C2,10); C2 = B2; B2 = T; } + for ( ; j < 48; ++j ) { + T = _rol( A1 + _f2(B1,C1,D1) + X[_r1[j]] + _k1[j], _s1[j] ) + E1; + A1 = E1; E1 = D1; D1 = _rol(C1,10); C1 = B1; B1 = T; + T = _rol( A2 + _f2(B2,C2,D2) + X[_r2[j]] + _k2[j], _s2[j] ) + E2; + A2 = E2; E2 = D2; D2 = _rol(C2,10); C2 = B2; B2 = T; } + for ( ; j < 64; ++j ) { + T = _rol( A1 + _f3(B1,C1,D1) + X[_r1[j]] + _k1[j], _s1[j] ) + E1; + A1 = E1; E1 = D1; D1 = _rol(C1,10); C1 = B1; B1 = T; + T = _rol( A2 + _f1(B2,C2,D2) + X[_r2[j]] + _k2[j], _s2[j] ) + E2; + A2 = E2; E2 = D2; D2 = _rol(C2,10); C2 = B2; B2 = T; } + for ( ; j < 80; ++j ) { + T = _rol( A1 + _f4(B1,C1,D1) + X[_r1[j]] + _k1[j], _s1[j] ) + E1; + A1 = E1; E1 = D1; D1 = _rol(C1,10); C1 = B1; B1 = T; + T = _rol( A2 + _f0(B2,C2,D2) + X[_r2[j]] + _k2[j], _s2[j] ) + E2; + A2 = E2; E2 = D2; D2 = _rol(C2,10); C2 = B2; B2 = T; } + + T = this._h[1] + C1 + D2; + this._h[1] = this._h[2] + D1 + E2; + this._h[2] = this._h[3] + E1 + A2; + this._h[3] = this._h[4] + A1 + B2; + this._h[4] = this._h[0] + B1 + C2; + this._h[0] = T; +} + +})(); diff --git a/node_modules/sjcl/core/scrypt.js b/node_modules/sjcl/core/scrypt.js new file mode 100644 index 0000000..7c77558 --- /dev/null +++ b/node_modules/sjcl/core/scrypt.js @@ -0,0 +1,146 @@ +/** scrypt Password-Based Key-Derivation Function. + * + * @param {bitArray|String} password The password. + * @param {bitArray|String} salt The salt. Should have lots of entropy. + * + * @param {Number} [N=16384] CPU/Memory cost parameter. + * @param {Number} [r=8] Block size parameter. + * @param {Number} [p=1] Parallelization parameter. + * + * @param {Number} [length] The length of the derived key. Defaults to the + * output size of the hash function. + * @param {Object} [Prff=sjcl.misc.hmac] The pseudorandom function family. + * + * @return {bitArray} The derived key. + */ +sjcl.misc.scrypt = function (password, salt, N, r, p, length, Prff) { + var SIZE_MAX = Math.pow(2, 32) - 1, + self = sjcl.misc.scrypt; + + N = N || 16384; + r = r || 8; + p = p || 1; + + if (r * p >= Math.pow(2, 30)) { + throw sjcl.exception.invalid("The parameters r, p must satisfy r * p < 2^30"); + } + + if ((N < 2) || (N & (N - 1) != 0)) { + throw sjcl.exception.invalid("The parameter N must be a power of 2."); + } + + if (N > SIZE_MAX / 128 / r) { + throw sjcl.exception.invalid("N too big."); + } + + if (r > SIZE_MAX / 128 / p) { + throw sjcl.exception.invalid("r too big."); + } + + var blocks = sjcl.misc.pbkdf2(password, salt, 1, p * 128 * r * 8, Prff), + len = blocks.length / p; + + self.reverse(blocks); + + for (var i = 0; i < p; i++) { + var block = blocks.slice(i * len, (i + 1) * len); + self.blockcopy(self.ROMix(block, N), 0, blocks, i * len); + } + + self.reverse(blocks); + + return sjcl.misc.pbkdf2(password, blocks, 1, length, Prff); +}; + +sjcl.misc.scrypt.salsa20Core = function (word, rounds) { + var R = function(a, b) { return (a << b) | (a >>> (32 - b)); }; + var x = word.slice(0); + + for (var i = rounds; i > 0; i -= 2) { + x[ 4] ^= R(x[ 0]+x[12], 7); x[ 8] ^= R(x[ 4]+x[ 0], 9); + x[12] ^= R(x[ 8]+x[ 4],13); x[ 0] ^= R(x[12]+x[ 8],18); + x[ 9] ^= R(x[ 5]+x[ 1], 7); x[13] ^= R(x[ 9]+x[ 5], 9); + x[ 1] ^= R(x[13]+x[ 9],13); x[ 5] ^= R(x[ 1]+x[13],18); + x[14] ^= R(x[10]+x[ 6], 7); x[ 2] ^= R(x[14]+x[10], 9); + x[ 6] ^= R(x[ 2]+x[14],13); x[10] ^= R(x[ 6]+x[ 2],18); + x[ 3] ^= R(x[15]+x[11], 7); x[ 7] ^= R(x[ 3]+x[15], 9); + x[11] ^= R(x[ 7]+x[ 3],13); x[15] ^= R(x[11]+x[ 7],18); + x[ 1] ^= R(x[ 0]+x[ 3], 7); x[ 2] ^= R(x[ 1]+x[ 0], 9); + x[ 3] ^= R(x[ 2]+x[ 1],13); x[ 0] ^= R(x[ 3]+x[ 2],18); + x[ 6] ^= R(x[ 5]+x[ 4], 7); x[ 7] ^= R(x[ 6]+x[ 5], 9); + x[ 4] ^= R(x[ 7]+x[ 6],13); x[ 5] ^= R(x[ 4]+x[ 7],18); + x[11] ^= R(x[10]+x[ 9], 7); x[ 8] ^= R(x[11]+x[10], 9); + x[ 9] ^= R(x[ 8]+x[11],13); x[10] ^= R(x[ 9]+x[ 8],18); + x[12] ^= R(x[15]+x[14], 7); x[13] ^= R(x[12]+x[15], 9); + x[14] ^= R(x[13]+x[12],13); x[15] ^= R(x[14]+x[13],18); + } + + for (i = 0; i < 16; i++) word[i] = x[i]+word[i]; +}; + +sjcl.misc.scrypt.blockMix = function(blocks) { + var X = blocks.slice(-16), + out = [], + len = blocks.length / 16, + self = sjcl.misc.scrypt; + + for (var i = 0; i < len; i++) { + self.blockxor(blocks, 16 * i, X, 0, 16); + self.salsa20Core(X, 8); + + if ((i & 1) == 0) { + self.blockcopy(X, 0, out, 8 * i); + } else { + self.blockcopy(X, 0, out, 8 * (i^1 + len)); + } + } + + return out; +}; + +sjcl.misc.scrypt.ROMix = function(block, N) { + var X = block.slice(0), + V = [], + self = sjcl.misc.scrypt; + + for (var i = 0; i < N; i++) { + V.push(X.slice(0)); + X = self.blockMix(X); + } + + for (i = 0; i < N; i++) { + var j = X[X.length - 16] & (N - 1); + + self.blockxor(V[j], 0, X, 0); + X = self.blockMix(X); + } + + return X; +}; + +sjcl.misc.scrypt.reverse = function (words) { // Converts Big <-> Little Endian words + for (var i in words) { + var out = words[i] & 0xFF; + out = (out << 8) | (words[i] >>> 8) & 0xFF; + out = (out << 8) | (words[i] >>> 16) & 0xFF; + out = (out << 8) | (words[i] >>> 24) & 0xFF; + + words[i] = out; + } +}; + +sjcl.misc.scrypt.blockcopy = function (S, Si, D, Di, len) { + var i; + + len = len || (S.length - Si); + + for (i = 0; i < len; i++) D[Di + i] = S[Si + i] | 0; +}; + +sjcl.misc.scrypt.blockxor = function(S, Si, D, Di, len) { + var i; + + len = len || (S.length - Si); + + for (i = 0; i < len; i++) D[Di + i] = (D[Di + i] ^ S[Si + i]) | 0; +}; diff --git a/node_modules/sjcl/core/sha1.js b/node_modules/sjcl/core/sha1.js new file mode 100644 index 0000000..b56d749 --- /dev/null +++ b/node_modules/sjcl/core/sha1.js @@ -0,0 +1,191 @@ +/** @fileOverview Javascript SHA-1 implementation. + * + * Based on the implementation in RFC 3174, method 1, and on the SJCL + * SHA-256 implementation. + * + * @author Quinn Slack + */ + +/** + * Context for a SHA-1 operation in progress. + * @constructor + */ +sjcl.hash.sha1 = function (hash) { + if (hash) { + this._h = hash._h.slice(0); + this._buffer = hash._buffer.slice(0); + this._length = hash._length; + } else { + this.reset(); + } +}; + +/** + * Hash a string or an array of words. + * @static + * @param {bitArray|String} data the data to hash. + * @return {bitArray} The hash value, an array of 5 big-endian words. + */ +sjcl.hash.sha1.hash = function (data) { + return (new sjcl.hash.sha1()).update(data).finalize(); +}; + +sjcl.hash.sha1.prototype = { + /** + * The hash's block size, in bits. + * @constant + */ + blockSize: 512, + + /** + * Reset the hash state. + * @return this + */ + reset:function () { + this._h = this._init.slice(0); + this._buffer = []; + this._length = 0; + return this; + }, + + /** + * Input several words to the hash. + * @param {bitArray|String} data the data to hash. + * @return this + */ + update: function (data) { + if (typeof data === "string") { + data = sjcl.codec.utf8String.toBits(data); + } + var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data), + ol = this._length, + nl = this._length = ol + sjcl.bitArray.bitLength(data); + if (nl > 9007199254740991){ + throw new sjcl.exception.invalid("Cannot hash more than 2^53 - 1 bits"); + } + + if (typeof Uint32Array !== 'undefined') { + var c = new Uint32Array(b); + var j = 0; + for (i = this.blockSize+ol - ((this.blockSize+ol) & (this.blockSize-1)); i <= nl; + i+= this.blockSize) { + this._block(c.subarray(16 * j, 16 * (j+1))); + j += 1; + } + b.splice(0, 16 * j); + } else { + for (i = this.blockSize+ol - ((this.blockSize+ol) & (this.blockSize-1)); i <= nl; + i+= this.blockSize) { + this._block(b.splice(0,16)); + } + } + return this; + }, + + /** + * Complete hashing and output the hash value. + * @return {bitArray} The hash value, an array of 5 big-endian words. TODO + */ + finalize:function () { + var i, b = this._buffer, h = this._h; + + // Round out and push the buffer + b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]); + // Round out the buffer to a multiple of 16 words, less the 2 length words. + for (i = b.length + 2; i & 15; i++) { + b.push(0); + } + + // append the length + b.push(Math.floor(this._length / 0x100000000)); + b.push(this._length | 0); + + while (b.length) { + this._block(b.splice(0,16)); + } + + this.reset(); + return h; + }, + + /** + * The SHA-1 initialization vector. + * @private + */ + _init:[0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0], + + /** + * The SHA-1 hash key. + * @private + */ + _key:[0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6], + + /** + * The SHA-1 logical functions f(0), f(1), ..., f(79). + * @private + */ + _f:function(t, b, c, d) { + if (t <= 19) { + return (b & c) | (~b & d); + } else if (t <= 39) { + return b ^ c ^ d; + } else if (t <= 59) { + return (b & c) | (b & d) | (c & d); + } else if (t <= 79) { + return b ^ c ^ d; + } + }, + + /** + * Circular left-shift operator. + * @private + */ + _S:function(n, x) { + return (x << n) | (x >>> 32-n); + }, + + /** + * Perform one cycle of SHA-1. + * @param {Uint32Array|bitArray} words one block of words. + * @private + */ + _block:function (words) { + var t, tmp, a, b, c, d, e, + h = this._h; + var w; + if (typeof Uint32Array !== 'undefined') { + // When words is passed to _block, it has 16 elements. SHA1 _block + // function extends words with new elements (at the end there are 80 elements). + // The problem is that if we use Uint32Array instead of Array, + // the length of Uint32Array cannot be changed. Thus, we replace words with a + // normal Array here. + w = Array(80); // do not use Uint32Array here as the instantiation is slower + for (var j=0; j<16; j++){ + w[j] = words[j]; + } + } else { + w = words; + } + + a = h[0]; b = h[1]; c = h[2]; d = h[3]; e = h[4]; + + for (t=0; t<=79; t++) { + if (t >= 16) { + w[t] = this._S(1, w[t-3] ^ w[t-8] ^ w[t-14] ^ w[t-16]); + } + tmp = (this._S(5, a) + this._f(t, b, c, d) + e + w[t] + + this._key[Math.floor(t/20)]) | 0; + e = d; + d = c; + c = this._S(30, b); + b = a; + a = tmp; + } + + h[0] = (h[0]+a) |0; + h[1] = (h[1]+b) |0; + h[2] = (h[2]+c) |0; + h[3] = (h[3]+d) |0; + h[4] = (h[4]+e) |0; + } +}; diff --git a/node_modules/sjcl/core/sha256.js b/node_modules/sjcl/core/sha256.js new file mode 100644 index 0000000..22ff4d8 --- /dev/null +++ b/node_modules/sjcl/core/sha256.js @@ -0,0 +1,230 @@ +/** @fileOverview Javascript SHA-256 implementation. + * + * An older version of this implementation is available in the public + * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh, + * Stanford University 2008-2010 and BSD-licensed for liability + * reasons. + * + * Special thanks to Aldo Cortesi for pointing out several bugs in + * this code. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +/** + * Context for a SHA-256 operation in progress. + * @constructor + */ +sjcl.hash.sha256 = function (hash) { + if (!this._key[0]) { this._precompute(); } + if (hash) { + this._h = hash._h.slice(0); + this._buffer = hash._buffer.slice(0); + this._length = hash._length; + } else { + this.reset(); + } +}; + +/** + * Hash a string or an array of words. + * @static + * @param {bitArray|String} data the data to hash. + * @return {bitArray} The hash value, an array of 16 big-endian words. + */ +sjcl.hash.sha256.hash = function (data) { + return (new sjcl.hash.sha256()).update(data).finalize(); +}; + +sjcl.hash.sha256.prototype = { + /** + * The hash's block size, in bits. + * @constant + */ + blockSize: 512, + + /** + * Reset the hash state. + * @return this + */ + reset:function () { + this._h = this._init.slice(0); + this._buffer = []; + this._length = 0; + return this; + }, + + /** + * Input several words to the hash. + * @param {bitArray|String} data the data to hash. + * @return this + */ + update: function (data) { + if (typeof data === "string") { + data = sjcl.codec.utf8String.toBits(data); + } + var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data), + ol = this._length, + nl = this._length = ol + sjcl.bitArray.bitLength(data); + if (nl > 9007199254740991){ + throw new sjcl.exception.invalid("Cannot hash more than 2^53 - 1 bits"); + } + + if (typeof Uint32Array !== 'undefined') { + var c = new Uint32Array(b); + var j = 0; + for (i = 512+ol - ((512+ol) & 511); i <= nl; i+= 512) { + this._block(c.subarray(16 * j, 16 * (j+1))); + j += 1; + } + b.splice(0, 16 * j); + } else { + for (i = 512+ol - ((512+ol) & 511); i <= nl; i+= 512) { + this._block(b.splice(0,16)); + } + } + return this; + }, + + /** + * Complete hashing and output the hash value. + * @return {bitArray} The hash value, an array of 8 big-endian words. + */ + finalize:function () { + var i, b = this._buffer, h = this._h; + + // Round out and push the buffer + b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]); + + // Round out the buffer to a multiple of 16 words, less the 2 length words. + for (i = b.length + 2; i & 15; i++) { + b.push(0); + } + + // append the length + b.push(Math.floor(this._length / 0x100000000)); + b.push(this._length | 0); + + while (b.length) { + this._block(b.splice(0,16)); + } + + this.reset(); + return h; + }, + + /** + * The SHA-256 initialization vector, to be precomputed. + * @private + */ + _init:[], + /* + _init:[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19], + */ + + /** + * The SHA-256 hash key, to be precomputed. + * @private + */ + _key:[], + /* + _key: + [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2], + */ + + + /** + * Function to precompute _init and _key. + * @private + */ + _precompute: function () { + var i = 0, prime = 2, factor, isPrime; + + function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; } + + for (; i<64; prime++) { + isPrime = true; + for (factor=2; factor*factor <= prime; factor++) { + if (prime % factor === 0) { + isPrime = false; + break; + } + } + if (isPrime) { + if (i<8) { + this._init[i] = frac(Math.pow(prime, 1/2)); + } + this._key[i] = frac(Math.pow(prime, 1/3)); + i++; + } + } + }, + + /** + * Perform one cycle of SHA-256. + * @param {Uint32Array|bitArray} w one block of words. + * @private + */ + _block:function (w) { + var i, tmp, a, b, + h = this._h, + k = this._key, + h0 = h[0], h1 = h[1], h2 = h[2], h3 = h[3], + h4 = h[4], h5 = h[5], h6 = h[6], h7 = h[7]; + + /* Rationale for placement of |0 : + * If a value can overflow is original 32 bits by a factor of more than a few + * million (2^23 ish), there is a possibility that it might overflow the + * 53-bit mantissa and lose precision. + * + * To avoid this, we clamp back to 32 bits by |'ing with 0 on any value that + * propagates around the loop, and on the hash state h[]. I don't believe + * that the clamps on h4 and on h0 are strictly necessary, but it's close + * (for h4 anyway), and better safe than sorry. + * + * The clamps on h[] are necessary for the output to be correct even in the + * common case and for short inputs. + */ + for (i=0; i<64; i++) { + // load up the input word for this round + if (i<16) { + tmp = w[i]; + } else { + a = w[(i+1 ) & 15]; + b = w[(i+14) & 15]; + tmp = w[i&15] = ((a>>>7 ^ a>>>18 ^ a>>>3 ^ a<<25 ^ a<<14) + + (b>>>17 ^ b>>>19 ^ b>>>10 ^ b<<15 ^ b<<13) + + w[i&15] + w[(i+9) & 15]) | 0; + } + + tmp = (tmp + h7 + (h4>>>6 ^ h4>>>11 ^ h4>>>25 ^ h4<<26 ^ h4<<21 ^ h4<<7) + (h6 ^ h4&(h5^h6)) + k[i]); // | 0; + + // shift register + h7 = h6; h6 = h5; h5 = h4; + h4 = h3 + tmp | 0; + h3 = h2; h2 = h1; h1 = h0; + + h0 = (tmp + ((h1&h2) ^ (h3&(h1^h2))) + (h1>>>2 ^ h1>>>13 ^ h1>>>22 ^ h1<<30 ^ h1<<19 ^ h1<<10)) | 0; + } + + h[0] = h[0]+h0 | 0; + h[1] = h[1]+h1 | 0; + h[2] = h[2]+h2 | 0; + h[3] = h[3]+h3 | 0; + h[4] = h[4]+h4 | 0; + h[5] = h[5]+h5 | 0; + h[6] = h[6]+h6 | 0; + h[7] = h[7]+h7 | 0; + } +}; + + diff --git a/node_modules/sjcl/core/sha512.js b/node_modules/sjcl/core/sha512.js new file mode 100644 index 0000000..32da101 --- /dev/null +++ b/node_modules/sjcl/core/sha512.js @@ -0,0 +1,376 @@ +/** @fileOverview Javascript SHA-512 implementation. + * + * This implementation was written for CryptoJS by Jeff Mott and adapted for + * SJCL by Stefan Thomas. + * + * CryptoJS (c) 2009–2012 by Jeff Mott. All rights reserved. + * Released with New BSD License + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + * @author Jeff Mott + * @author Stefan Thomas + */ + +/** + * Context for a SHA-512 operation in progress. + * @constructor + */ +sjcl.hash.sha512 = function (hash) { + if (!this._key[0]) { this._precompute(); } + if (hash) { + this._h = hash._h.slice(0); + this._buffer = hash._buffer.slice(0); + this._length = hash._length; + } else { + this.reset(); + } +}; + +/** + * Hash a string or an array of words. + * @static + * @param {bitArray|String} data the data to hash. + * @return {bitArray} The hash value, an array of 16 big-endian words. + */ +sjcl.hash.sha512.hash = function (data) { + return (new sjcl.hash.sha512()).update(data).finalize(); +}; + +sjcl.hash.sha512.prototype = { + /** + * The hash's block size, in bits. + * @constant + */ + blockSize: 1024, + + /** + * Reset the hash state. + * @return this + */ + reset:function () { + this._h = this._init.slice(0); + this._buffer = []; + this._length = 0; + return this; + }, + + /** + * Input several words to the hash. + * @param {bitArray|String} data the data to hash. + * @return this + */ + update: function (data) { + if (typeof data === "string") { + data = sjcl.codec.utf8String.toBits(data); + } + var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data), + ol = this._length, + nl = this._length = ol + sjcl.bitArray.bitLength(data); + if (nl > 9007199254740991){ + throw new sjcl.exception.invalid("Cannot hash more than 2^53 - 1 bits"); + } + + if (typeof Uint32Array !== 'undefined') { + var c = new Uint32Array(b); + var j = 0; + for (i = 1024+ol - ((1024+ol) & 1023); i <= nl; i+= 1024) { + this._block(c.subarray(32 * j, 32 * (j+1))); + j += 1; + } + b.splice(0, 32 * j); + } else { + for (i = 1024+ol - ((1024+ol) & 1023); i <= nl; i+= 1024) { + this._block(b.splice(0,32)); + } + } + return this; + }, + + /** + * Complete hashing and output the hash value. + * @return {bitArray} The hash value, an array of 16 big-endian words. + */ + finalize:function () { + var i, b = this._buffer, h = this._h; + + // Round out and push the buffer + b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]); + + // Round out the buffer to a multiple of 32 words, less the 4 length words. + for (i = b.length + 4; i & 31; i++) { + b.push(0); + } + + // append the length + b.push(0); + b.push(0); + b.push(Math.floor(this._length / 0x100000000)); + b.push(this._length | 0); + + while (b.length) { + this._block(b.splice(0,32)); + } + + this.reset(); + return h; + }, + + /** + * The SHA-512 initialization vector, to be precomputed. + * @private + */ + _init:[], + + /** + * Least significant 24 bits of SHA512 initialization values. + * + * Javascript only has 53 bits of precision, so we compute the 40 most + * significant bits and add the remaining 24 bits as constants. + * + * @private + */ + _initr: [ 0xbcc908, 0xcaa73b, 0x94f82b, 0x1d36f1, 0xe682d1, 0x3e6c1f, 0x41bd6b, 0x7e2179 ], + + /* + _init: + [0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179], + */ + + /** + * The SHA-512 hash key, to be precomputed. + * @private + */ + _key:[], + + /** + * Least significant 24 bits of SHA512 key values. + * @private + */ + _keyr: + [0x28ae22, 0xef65cd, 0x4d3b2f, 0x89dbbc, 0x48b538, 0x05d019, 0x194f9b, 0x6d8118, + 0x030242, 0x706fbe, 0xe4b28c, 0xffb4e2, 0x7b896f, 0x1696b1, 0xc71235, 0x692694, + 0xf14ad2, 0x4f25e3, 0x8cd5b5, 0xac9c65, 0x2b0275, 0xa6e483, 0x41fbd4, 0x1153b5, + 0x66dfab, 0xb43210, 0xfb213f, 0xef0ee4, 0xa88fc2, 0x0aa725, 0x03826f, 0x0e6e70, + 0xd22ffc, 0x26c926, 0xc42aed, 0x95b3df, 0xaf63de, 0x77b2a8, 0xedaee6, 0x82353b, + 0xf10364, 0x423001, 0xf89791, 0x54be30, 0xef5218, 0x65a910, 0x71202a, 0xbbd1b8, + 0xd2d0c8, 0x41ab53, 0x8eeb99, 0x9b48a8, 0xc95a63, 0x418acb, 0x63e373, 0xb2b8a3, + 0xefb2fc, 0x172f60, 0xf0ab72, 0x6439ec, 0x631e28, 0x82bde9, 0xc67915, 0x72532b, + 0x26619c, 0xc0c207, 0xe0eb1e, 0x6ed178, 0x176fba, 0xc898a6, 0xf90dae, 0x1c471b, + 0x047d84, 0xc72493, 0xc9bebc, 0x100d4c, 0x3e42b6, 0x657e2a, 0xd6faec, 0x475817], + + /* + _key: + [0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817], + */ + + /** + * Function to precompute _init and _key. + * @private + */ + _precompute: function () { + // XXX: This code is for precomputing the SHA256 constants, change for + // SHA512 and re-enable. + var i = 0, prime = 2, factor , isPrime; + + function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; } + function frac2(x) { return (x-Math.floor(x)) * 0x10000000000 & 0xff; } + + for (; i<80; prime++) { + isPrime = true; + for (factor=2; factor*factor <= prime; factor++) { + if (prime % factor === 0) { + isPrime = false; + break; + } + } + if (isPrime) { + if (i<8) { + this._init[i*2] = frac(Math.pow(prime, 1/2)); + this._init[i*2+1] = (frac2(Math.pow(prime, 1/2)) << 24) | this._initr[i]; + } + this._key[i*2] = frac(Math.pow(prime, 1/3)); + this._key[i*2+1] = (frac2(Math.pow(prime, 1/3)) << 24) | this._keyr[i]; + i++; + } + } + }, + + /** + * Perform one cycle of SHA-512. + * @param {Uint32Array|bitArray} words one block of words. + * @private + */ + _block:function (words) { + var i, wrh, wrl, + h = this._h, + k = this._key, + h0h = h[ 0], h0l = h[ 1], h1h = h[ 2], h1l = h[ 3], + h2h = h[ 4], h2l = h[ 5], h3h = h[ 6], h3l = h[ 7], + h4h = h[ 8], h4l = h[ 9], h5h = h[10], h5l = h[11], + h6h = h[12], h6l = h[13], h7h = h[14], h7l = h[15]; + var w; + if (typeof Uint32Array !== 'undefined') { + // When words is passed to _block, it has 32 elements. SHA512 _block + // function extends words with new elements (at the end there are 160 elements). + // The problem is that if we use Uint32Array instead of Array, + // the length of Uint32Array cannot be changed. Thus, we replace words with a + // normal Array here. + w = Array(160); // do not use Uint32Array here as the instantiation is slower + for (var j=0; j<32; j++){ + w[j] = words[j]; + } + } else { + w = words; + } + + // Working variables + var ah = h0h, al = h0l, bh = h1h, bl = h1l, + ch = h2h, cl = h2l, dh = h3h, dl = h3l, + eh = h4h, el = h4l, fh = h5h, fl = h5l, + gh = h6h, gl = h6l, hh = h7h, hl = h7l; + + for (i=0; i<80; i++) { + // load up the input word for this round + if (i<16) { + wrh = w[i * 2]; + wrl = w[i * 2 + 1]; + } else { + // Gamma0 + var gamma0xh = w[(i-15) * 2]; + var gamma0xl = w[(i-15) * 2 + 1]; + var gamma0h = + ((gamma0xl << 31) | (gamma0xh >>> 1)) ^ + ((gamma0xl << 24) | (gamma0xh >>> 8)) ^ + (gamma0xh >>> 7); + var gamma0l = + ((gamma0xh << 31) | (gamma0xl >>> 1)) ^ + ((gamma0xh << 24) | (gamma0xl >>> 8)) ^ + ((gamma0xh << 25) | (gamma0xl >>> 7)); + + // Gamma1 + var gamma1xh = w[(i-2) * 2]; + var gamma1xl = w[(i-2) * 2 + 1]; + var gamma1h = + ((gamma1xl << 13) | (gamma1xh >>> 19)) ^ + ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ + (gamma1xh >>> 6); + var gamma1l = + ((gamma1xh << 13) | (gamma1xl >>> 19)) ^ + ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ + ((gamma1xh << 26) | (gamma1xl >>> 6)); + + // Shortcuts + var wr7h = w[(i-7) * 2]; + var wr7l = w[(i-7) * 2 + 1]; + + var wr16h = w[(i-16) * 2]; + var wr16l = w[(i-16) * 2 + 1]; + + // W(round) = gamma0 + W(round - 7) + gamma1 + W(round - 16) + wrl = gamma0l + wr7l; + wrh = gamma0h + wr7h + ((wrl >>> 0) < (gamma0l >>> 0) ? 1 : 0); + wrl += gamma1l; + wrh += gamma1h + ((wrl >>> 0) < (gamma1l >>> 0) ? 1 : 0); + wrl += wr16l; + wrh += wr16h + ((wrl >>> 0) < (wr16l >>> 0) ? 1 : 0); + } + + w[i*2] = wrh |= 0; + w[i*2 + 1] = wrl |= 0; + + // Ch + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + + // Maj + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + // Sigma0 + var sigma0h = ((al << 4) | (ah >>> 28)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((ah << 4) | (al >>> 28)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + + // Sigma1 + var sigma1h = ((el << 18) | (eh >>> 14)) ^ ((el << 14) | (eh >>> 18)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((eh << 18) | (el >>> 14)) ^ ((eh << 14) | (el >>> 18)) ^ ((el << 23) | (eh >>> 9)); + + // K(round) + var krh = k[i*2]; + var krl = k[i*2+1]; + + // t1 = h + sigma1 + ch + K(round) + W(round) + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + t1l += chl; + t1h += chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + t1l += krl; + t1h += krh + ((t1l >>> 0) < (krl >>> 0) ? 1 : 0); + t1l = t1l + wrl|0; // FF32..FF34 perf issue https://bugzilla.mozilla.org/show_bug.cgi?id=1054972 + t1h += wrh + ((t1l >>> 0) < (wrl >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash + h0l = h[1] = (h0l + al) | 0; + h[0] = (h0h + ah + ((h0l >>> 0) < (al >>> 0) ? 1 : 0)) | 0; + h1l = h[3] = (h1l + bl) | 0; + h[2] = (h1h + bh + ((h1l >>> 0) < (bl >>> 0) ? 1 : 0)) | 0; + h2l = h[5] = (h2l + cl) | 0; + h[4] = (h2h + ch + ((h2l >>> 0) < (cl >>> 0) ? 1 : 0)) | 0; + h3l = h[7] = (h3l + dl) | 0; + h[6] = (h3h + dh + ((h3l >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + h4l = h[9] = (h4l + el) | 0; + h[8] = (h4h + eh + ((h4l >>> 0) < (el >>> 0) ? 1 : 0)) | 0; + h5l = h[11] = (h5l + fl) | 0; + h[10] = (h5h + fh + ((h5l >>> 0) < (fl >>> 0) ? 1 : 0)) | 0; + h6l = h[13] = (h6l + gl) | 0; + h[12] = (h6h + gh + ((h6l >>> 0) < (gl >>> 0) ? 1 : 0)) | 0; + h7l = h[15] = (h7l + hl) | 0; + h[14] = (h7h + hh + ((h7l >>> 0) < (hl >>> 0) ? 1 : 0)) | 0; + } +}; + + diff --git a/node_modules/sjcl/core/sjcl.js b/node_modules/sjcl/core/sjcl.js new file mode 100644 index 0000000..199faf8 --- /dev/null +++ b/node_modules/sjcl/core/sjcl.js @@ -0,0 +1,103 @@ +/** @fileOverview Javascript cryptography implementation. + * + * Crush to remove comments, shorten variable names and + * generally reduce transmission size. + * + * @author Emily Stark + * @author Mike Hamburg + * @author Dan Boneh + */ + +"use strict"; +/*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */ +/*global document, window, escape, unescape, module, require, Uint32Array */ + +/** + * The Stanford Javascript Crypto Library, top-level namespace. + * @namespace + */ +var sjcl = { + /** + * Symmetric ciphers. + * @namespace + */ + cipher: {}, + + /** + * Hash functions. Right now only SHA256 is implemented. + * @namespace + */ + hash: {}, + + /** + * Key exchange functions. Right now only SRP is implemented. + * @namespace + */ + keyexchange: {}, + + /** + * Cipher modes of operation. + * @namespace + */ + mode: {}, + + /** + * Miscellaneous. HMAC and PBKDF2. + * @namespace + */ + misc: {}, + + /** + * Bit array encoders and decoders. + * @namespace + * + * @description + * The members of this namespace are functions which translate between + * SJCL's bitArrays and other objects (usually strings). Because it + * isn't always clear which direction is encoding and which is decoding, + * the method names are "fromBits" and "toBits". + */ + codec: {}, + + /** + * Exceptions. + * @namespace + */ + exception: { + /** + * Ciphertext is corrupt. + * @constructor + */ + corrupt: function(message) { + this.toString = function() { return "CORRUPT: "+this.message; }; + this.message = message; + }, + + /** + * Invalid parameter. + * @constructor + */ + invalid: function(message) { + this.toString = function() { return "INVALID: "+this.message; }; + this.message = message; + }, + + /** + * Bug or missing feature in SJCL. + * @constructor + */ + bug: function(message) { + this.toString = function() { return "BUG: "+this.message; }; + this.message = message; + }, + + /** + * Something isn't ready. + * @constructor + */ + notReady: function(message) { + this.toString = function() { return "NOT READY: "+this.message; }; + this.message = message; + } + } +}; diff --git a/node_modules/sjcl/core/srp.js b/node_modules/sjcl/core/srp.js new file mode 100644 index 0000000..8487632 --- /dev/null +++ b/node_modules/sjcl/core/srp.js @@ -0,0 +1,226 @@ +/** @fileOverview Javascript SRP implementation. + * + * This file contains a partial implementation of the SRP (Secure Remote + * Password) password-authenticated key exchange protocol. Given a user + * identity, salt, and SRP group, it generates the SRP verifier that may + * be sent to a remote server to establish and SRP account. + * + * For more information, see http://srp.stanford.edu/. + * + * @author Quinn Slack + */ + +/** + * Compute the SRP verifier from the username, password, salt, and group. + * @namespace + */ +sjcl.keyexchange.srp = { + /** + * Calculates SRP v, the verifier. + * v = g^x mod N [RFC 5054] + * @param {String} I The username. + * @param {String} P The password. + * @param {Object} s A bitArray of the salt. + * @param {Object} group The SRP group. Use sjcl.keyexchange.srp.knownGroup + to obtain this object. + * @return {Object} A bitArray of SRP v. + */ + makeVerifier: function(I, P, s, group) { + var x; + x = sjcl.keyexchange.srp.makeX(I, P, s); + x = sjcl.bn.fromBits(x); + return group.g.powermod(x, group.N); + }, + + /** + * Calculates SRP x. + * x = SHA1( | SHA( | ":" | )) [RFC 2945] + * @param {String} I The username. + * @param {String} P The password. + * @param {Object} s A bitArray of the salt. + * @return {Object} A bitArray of SRP x. + */ + makeX: function(I, P, s) { + var inner = sjcl.hash.sha1.hash(I + ':' + P); + return sjcl.hash.sha1.hash(sjcl.bitArray.concat(s, inner)); + }, + + /** + * Returns the known SRP group with the given size (in bits). + * @param {String} i The size of the known SRP group. + * @return {Object} An object with "N" and "g" properties. + */ + knownGroup:function(i) { + if (typeof i !== "string") { i = i.toString(); } + if (!sjcl.keyexchange.srp._didInitKnownGroups) { sjcl.keyexchange.srp._initKnownGroups(); } + return sjcl.keyexchange.srp._knownGroups[i]; + }, + + /** + * Initializes bignum objects for known group parameters. + * @private + */ + _didInitKnownGroups: false, + _initKnownGroups:function() { + var i, size, group; + for (i=0; i < sjcl.keyexchange.srp._knownGroupSizes.length; i++) { + size = sjcl.keyexchange.srp._knownGroupSizes[i].toString(); + group = sjcl.keyexchange.srp._knownGroups[size]; + group.N = new sjcl.bn(group.N); + group.g = new sjcl.bn(group.g); + } + sjcl.keyexchange.srp._didInitKnownGroups = true; + }, + + _knownGroupSizes: [1024, 1536, 2048, 3072, 4096, 6144, 8192], + _knownGroups: { + 1024: { + N: "EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C" + + "9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE4" + + "8E495C1D6089DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B29" + + "7BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA9A" + + "FD5138FE8376435B9FC61D2FC0EB06E3", + g:2 + }, + + 1536: { + N: "9DEF3CAFB939277AB1F12A8617A47BBBDBA51DF499AC4C80BEEEA961" + + "4B19CC4D5F4F5F556E27CBDE51C6A94BE4607A291558903BA0D0F843" + + "80B655BB9A22E8DCDF028A7CEC67F0D08134B1C8B97989149B609E0B" + + "E3BAB63D47548381DBC5B1FC764E3F4B53DD9DA1158BFD3E2B9C8CF5" + + "6EDF019539349627DB2FD53D24B7C48665772E437D6C7F8CE442734A" + + "F7CCB7AE837C264AE3A9BEB87F8A2FE9B8B5292E5A021FFF5E91479E" + + "8CE7A28C2442C6F315180F93499A234DCF76E3FED135F9BB", + g: 2 + }, + + 2048: { + N: "AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC319294" + + "3DB56050A37329CBB4A099ED8193E0757767A13DD52312AB4B03310D" + + "CD7F48A9DA04FD50E8083969EDB767B0CF6095179A163AB3661A05FB" + + "D5FAAAE82918A9962F0B93B855F97993EC975EEAA80D740ADBF4FF74" + + "7359D041D5C33EA71D281E446B14773BCA97B43A23FB801676BD207A" + + "436C6481F1D2B9078717461A5B9D32E688F87748544523B524B0D57D" + + "5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6AF874E73" + + "03CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB6" + + "94B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F" + + "9E4AFF73", + g: 2 + }, + + 3072: { + N: "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF", + g: 5 + }, + + 4096: { + N: "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" + + "FFFFFFFFFFFFFFFF", + g: 5 + }, + + 6144: { + N: "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BDF8FF9406" + + "AD9E530EE5DB382F413001AEB06A53ED9027D831179727B0865A8918" + + "DA3EDBEBCF9B14ED44CE6CBACED4BB1BDB7F1447E6CC254B33205151" + + "2BD7AF426FB8F401378CD2BF5983CA01C64B92ECF032EA15D1721D03" + + "F482D7CE6E74FEF6D55E702F46980C82B5A84031900B1C9E59E7C97F" + + "BEC7E8F323A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE32806A1D58B" + + "B7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55CDA56C9EC2EF29632" + + "387FE8D76E3C0468043E8F663F4860EE12BF2D5B0B7474D6E694F91E" + + "6DCC4024FFFFFFFFFFFFFFFF", + g: 5 + }, + + 8192: { + N:"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BDF8FF9406" + + "AD9E530EE5DB382F413001AEB06A53ED9027D831179727B0865A8918" + + "DA3EDBEBCF9B14ED44CE6CBACED4BB1BDB7F1447E6CC254B33205151" + + "2BD7AF426FB8F401378CD2BF5983CA01C64B92ECF032EA15D1721D03" + + "F482D7CE6E74FEF6D55E702F46980C82B5A84031900B1C9E59E7C97F" + + "BEC7E8F323A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE32806A1D58B" + + "B7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55CDA56C9EC2EF29632" + + "387FE8D76E3C0468043E8F663F4860EE12BF2D5B0B7474D6E694F91E" + + "6DBE115974A3926F12FEE5E438777CB6A932DF8CD8BEC4D073B931BA" + + "3BC832B68D9DD300741FA7BF8AFC47ED2576F6936BA424663AAB639C" + + "5AE4F5683423B4742BF1C978238F16CBE39D652DE3FDB8BEFC848AD9" + + "22222E04A4037C0713EB57A81A23F0C73473FC646CEA306B4BCBC886" + + "2F8385DDFA9D4B7FA2C087E879683303ED5BDD3A062B3CF5B3A278A6" + + "6D2A13F83F44F82DDF310EE074AB6A364597E899A0255DC164F31CC5" + + "0846851DF9AB48195DED7EA1B1D510BD7EE74D73FAF36BC31ECFA268" + + "359046F4EB879F924009438B481C6CD7889A002ED5EE382BC9190DA6" + + "FC026E479558E4475677E9AA9E3050E2765694DFC81F56E880B96E71" + + "60C980DD98EDD3DFFFFFFFFFFFFFFFFF", + g: 19 + } + } + +}; diff --git a/node_modules/sjcl/demo/alpha-arrow.png b/node_modules/sjcl/demo/alpha-arrow.png new file mode 100644 index 0000000..e4334a7 Binary files /dev/null and b/node_modules/sjcl/demo/alpha-arrow.png differ diff --git a/node_modules/sjcl/demo/example.css b/node_modules/sjcl/demo/example.css new file mode 100644 index 0000000..7fcfb73 --- /dev/null +++ b/node_modules/sjcl/demo/example.css @@ -0,0 +1,179 @@ +* { + margin: 0px; + padding: 0px; + font-family: Arial, Helvetica, FreeSans, sans; +} + +h1 { + text-align: center; + background: #eee; + padding: 5px; + margin-bottom: 0.6em; + font-size: 1.5em; +} + +.header { + width: 650px; + margin: 0px auto 1em; +} + +p+p { + margin-top: 1em; +} + +.explanation { + color: #555; + margin-top: 0.3em; +} + +.section+.section, .explanation+.section { + margin-top: 1.5em; +} + +.hex { + text-transform: uppercase; +} + +.hex, .base64, #ciphertext { + font-family: 'Courier', mono; +} + +.wide, textarea { + width: 100%; + margin: 0px -4px; + font-size: inherit; + text-align: left; +} + +textarea+*, .wide+* { + margin-top: 0.3em; +} + +/* bulk object placement */ +#theForm { + position: relative; + width: 940px; + margin: 0px auto; + font-size: 0.8em; +} + +.column { + top: 0px; + width: 300px; +} + +.box { + border: 2px solid #999; + padding: 7px; + margin-bottom: 20px; + -moz-border-radius: 7px; + -webkit-border-radius: 7px; +} + +#cmode { position: absolute; left: 640px; } +#ctexts { position: absolute; left: 320px; } + +.floatright { + float: right; + text-align: right; +} + +a { + cursor: pointer; + color: #282; +} + +a.random, #buttons a { text-decoration: none; } +a.random:hover, a.random:focus { text-decoration: underline; } + +h2 { + margin: -7px -7px 3px -7px; + text-align: center; + font-size: 1.2em; + color: white; + background: #999; +} + +#pplaintext { border-color: #f65; } +#pplaintext h2 { background: #f65; } + +#ppassword { border-color: #4a4; } +#ppassword h2 { background: #4a4; } + +#pciphertext { border-color: #78f; } +#pciphertext h2 { background: #78f; } + +#buttons { text-align: center; margin-top: -20px; } + +a#doPbkdf2, a#encrypt, a#decrypt { + display: inline-block; + text-align: center; + height: 43px; + padding-top: 20px; + width: 50px; + background: url('alpha-arrow.png') no-repeat bottom center; + vertical-align: middle; + border: none; + color: white; + overflow: hidden; +} + +.turnDown { + display: inline-block; + padding-bottom: 3px; + -moz-transform: rotate(90deg); + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + background-color: inherit; +} + +.turnUp { + display: inline-block; + padding-bottom: 3px; + -moz-transform: rotate(-90deg); + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); + background-color: inherit; +} + +.buttons a.disabled { + background-color: #ccc ! important; + cursor: inherit ! important; +} + +a#encrypt { background-color: #f65; margin-bottom: 2px; } +a#encrypt:hover, a#encrypt:focus { background-color: #f76; } +a#encrypt:active { background-color: #f87; } + +a#decrypt { + height: 36px; + padding-top: 27px; + background: url('alpha-arrow.png') no-repeat top center; + background-color: #78f; + margin-top: 2px; +} +a#decrypt:hover { background-color: #89f; } +a#decrypt:focus { background-color: #89f; } +a#decrypt:active { background-color: #9af; } + +#ppassword, #pkey, #pmode, #pplaintext, #pciphertext { + -moz-border-radius: 7px; + -webkit-border-radius: 7px; +} +input[type='text'], input[type='password'], textarea { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + font-size: inherit; + border: 1px solid #444; + padding: 3px; +} + +input[type='text']:focus, input[type='password']:focus, textarea:focus { + border-color: red; +} + +input[type="radio"], input[type="checkbox"] { + position: relative; + top: 0.15em; + margin-right: -0.15em; +} diff --git a/node_modules/sjcl/demo/example.js b/node_modules/sjcl/demo/example.js new file mode 100644 index 0000000..42b1c0e --- /dev/null +++ b/node_modules/sjcl/demo/example.js @@ -0,0 +1,153 @@ +/* keep track of which salts have been used. */ +var form, usedIvs = {'':1}, usedSalts = {'':1}; + +/* enter actions */ +var enterActions = { + password: doPbkdf2, + salt: doPbkdf2, + iter: doPbkdf2 +}; + +function loaded() { + form = new formHandler('theForm', enterActions); + form._extendedKey = []; + sjcl.random.startCollectors(); + document.getElementById("password").focus(); +} + +/* there's probaby a better way to tell the user something, but oh well */ +function error(x) { + alert(x); +} + +/* compute PBKDF2 on the password. */ +function doPbkdf2(decrypting) { + var v = form.get(), salt=v.salt, key, hex = sjcl.codec.hex.fromBits, p={}, + password = v.password; + + p.iter = v.iter; + + if (password.length == 0) { + if (decrypting) { error("Can't decrypt: need a password!"); } + return; + } + + if (salt.length === 0 && decrypting) { + error("Can't decrypt: need a salt for PBKDF2!"); + return; + } + + if (decrypting || !v.freshsalt || !usedSalts[v.salt]) { + p.salt = v.salt; + } + + p = sjcl.misc.cachedPbkdf2(password, p); + form._extendedKey = p.key; + v.key = p.key.slice(0, v.keysize/32); + v.salt = p.salt; + + form.set(v); + form.plaintext.el.select(); +} +/* Encrypt a message */ +function doEncrypt() { + var v = form.get(), iv = v.iv, password = v.password, key = v.key, adata = v.adata, aes, plaintext=v.plaintext, rp = {}, ct, p; + + if (plaintext === '' && v.ciphertext.length) { return; } + if (key.length == 0 && password.length == 0) { + error("need a password or key!"); + return; + } + + p = { adata:v.adata, + iter:v.iter, + mode:v.mode, + ts:parseInt(v.tag), + ks:parseInt(v.keysize) }; + if (!v.freshiv || !usedIvs[v.iv]) { p.iv = v.iv; } + if (!v.freshsalt || !usedSalts[v.salt]) { p.salt = v.salt; } + ct = sjcl.encrypt(password || key, plaintext, p, rp).replace(/,/g,",\n"); + + v.iv = rp.iv; + usedIvs[rp.iv] = 1; + if (rp.salt) { + v.salt = rp.salt; + usedSalts[rp.salt] = 1; + } + v.key = rp.key; + + if (v.json) { + v.ciphertext = ct; + v.adata = ''; + } else { + v.ciphertext = ct.match(/"ct":"([^"]*)"/)[1]; //" + } + + v.plaintext = ''; + + form.set(v); + form.ciphertext.el.select(); +} + +/* Decrypt a message */ +function doDecrypt() { + var v = form.get(), iv = v.iv, key = v.key, adata = v.adata, aes, ciphertext=v.ciphertext, rp = {}; + + if (ciphertext.length === 0) { return; } + if (!v.password && !v.key.length) { + error("Can't decrypt: need a password or key!"); return; + } + + if (ciphertext.match("{")) { + /* it's jsonized */ + try { + v.plaintext = sjcl.decrypt(v.password || v.key, ciphertext, {}, rp); + } catch(e) { + error("Can't decrypt: "+e); + return; + } + v.mode = rp.mode; + v.iv = rp.iv; + v.adata = sjcl.codec.utf8String.fromBits(rp.adata); + if (v.password) { + v.salt = rp.salt; + v.iter = rp.iter; + v.keysize = rp.ks; + v.tag = rp.ts; + } + v.key = rp.key; + v.ciphertext = ""; + document.getElementById('plaintext').select(); + } else { + /* it's raw */ + ciphertext = sjcl.codec.base64.toBits(ciphertext); + if (iv.length === 0) { + error("Can't decrypt: need an IV!"); return; + } + if (key.length === 0) { + if (v.password.length) { + doPbkdf2(true); + key = v.key; + } + } + aes = new sjcl.cipher.aes(key); + + try { + v.plaintext = sjcl.codec.utf8String.fromBits(sjcl.mode[v.mode].decrypt(aes, ciphertext, iv, v.adata, v.tag)); + v.ciphertext = ""; + document.getElementById('plaintext').select(); + } catch (e) { + error("Can't decrypt: " + e); + } + } + form.set(v); +} + +function extendKey(size) { + form.key.set(form._extendedKey.slice(0,size)); +} + +function randomize(field, words, paranoia) { + form[field].set(sjcl.random.randomWords(words, paranoia)); + if (field == 'salt') { form.key.set([]); } +} diff --git a/node_modules/sjcl/demo/form.js b/node_modules/sjcl/demo/form.js new file mode 100644 index 0000000..c949238 --- /dev/null +++ b/node_modules/sjcl/demo/form.js @@ -0,0 +1,137 @@ +/* Hackish form handling system. */ +function hasClass(e, cl) { + return (" "+e.className+" ").match(" "+cl+" "); +} + +function stopPropagation(e) { + e.preventDefault && e.preventDefault(); + e.cancelBubble = true; +} + +/* proxy for a form object, with appropriate encoder/decoder */ +function formElement(el) { + this.el = el; +} +formElement.prototype = { + get: function() { + var el = this.el; + if (el.type == "checkbox") { + return el.checked; + } else if (hasClass(el, "numeric")) { + return parseInt(el.value); + } else if (hasClass(el, "hex")) { + return sjcl.codec.hex.toBits(el.value); + } else if (hasClass(el, "base64")) { + return sjcl.codec.base64.toBits(el.value); + } else { + return el.value; + } + }, + + set: function(x) { + var el = this.el; + if (el.type == "checkbox") { + el.checked = x; return; + } else if (hasClass(el, "hex")) { + if (typeof x !== 'string') { + x = sjcl.codec.hex.fromBits(x); + } + x = x.toUpperCase().replace(/ /g,'').replace(/(.{8})/g, "$1 ").replace(/ $/, ''); + } else if (hasClass(el, "base64")) { + if (typeof x !== 'string') { + x = sjcl.codec.base64.fromBits(x); + } + x = x.replace(/\s/g,'').replace(/(.{32})/g, "$1\n").replace(/\n$/, ''); + } + el.value = x; + } +}; + +function radioGroup(name) { + this.name = name; +} +radioGroup.prototype = { + get: function() { + var els = document.getElementsByName(this.name), i; + for (i=0; i + + + + SJCL demo + + + + + + +

SJCL demo

+ +
+

This page is a demo of the Stanford Javascript Crypto Library. To get started, just type in a password in the left pane and a secret message in the middle pane, then click "encrypt". Encryption takes place in your browser and we never see the plaintext.

+ +

SJCL has lots of other options, many of which are shown in the grey boxes.

+
+ +
+
+ +
+

Password

+
+ + +

+ Choose a strong, random password. +

+
+
+ +
+

Key Derivation

+
+
+ + random +
+ + + +

+ Salt adds more variability to your key, and prevents attackers + from using rainbow tables to attack it. +

+
+ +
+ + +

+ Strengthening makes it slower to compute the key corresponding to your + password. This makes it take much longer for an attacker to guess it. +

+
+ +
+ Key size: + + + + + + +

+ 128 bits should be secure enough, but you can generate a longer + key if you wish. +

+
+ + +
+
+ + +
+ +

+ This key is computed from your password, salt and strengthening factor. It + will be used internally by the cipher. Instead of using a password, you can + enter a key here directly. If you do, it should be 32, 48 or 64 hexadecimal + digits (128, 192 or 256 bits). +

+
+ +
+
+ + +
+
+

Cipher Parameters

+

+ SJCL encrypts your data with the AES block cipher. +

+
+ Cipher mode: + + + + + + +

+ The cipher mode is a standard for how to use AES and other + algorithms to encrypt and authenticate your message. + OCB2 mode (patented) and + GCM mode (unencumbered) + are slightly faster and have more features than + CCM mode. +

+
+ +
+
+ + random +
+ + + +

+ The IV needs to be different for every message you send. It adds + randomness to your message, so that the same message will look + different each time you send it. +

+

+ Be careful: CCM mode and GCM mode don't use + the whole IV, so changing just part of it isn't enough. +

+
+ +
+ Authentication strength: + + + + + + +

+ SJCL adds a an authentication tag to your message to make sure + nobody changes it. The longer the authentication tag, the harder it is + for somebody to change your encrypted message without you noticing. 64 + bits is probably enough. +

+
+ +
+ + +

+ These parameters are required to decrypt your message later. If the + person you're sending the message to knows them, you don't need to send + them so your message will be shorter. +

+

+ Default parameters won't be sent. Your password won't be sent, either. + The salt and iv will be encoded in base64 instead of hex, so they'll + look different from what's in the box. +

+
+
+
+ +
+
+

Plaintext

+
+ + +
+ This message will be encrypted, so that nobody can read it or change it + without your password. +
+
+ +
+ + +
+ This auxilliary message isn't secret, but its integrity will be checked + along with the integrity of the message. +
+
+
+ + + +
+

Ciphertext

+ + +
+ Your message, encrypted and authenticated so that nobody can read it + or change it without your password. +
+
+ + + diff --git a/node_modules/sjcl/jsdoc.conf.json b/node_modules/sjcl/jsdoc.conf.json new file mode 100644 index 0000000..8576842 --- /dev/null +++ b/node_modules/sjcl/jsdoc.conf.json @@ -0,0 +1,7 @@ +{ + "templates": { + "default": { + "useLongnameInNav": true + } + } +} diff --git a/node_modules/sjcl/package.json b/node_modules/sjcl/package.json new file mode 100644 index 0000000..698b26c --- /dev/null +++ b/node_modules/sjcl/package.json @@ -0,0 +1,30 @@ +{ + "name": "sjcl", + "version": "1.0.8", + "description": "Stanford Javascript Crypto Library", + "main": "sjcl.js", + "author": "bitwiseshiftleft", + "license": "(BSD-2-Clause OR GPL-2.0-only)", + "homepage": "https://github.com/bitwiseshiftleft/sjcl", + "keywords": [ + "encryption", + "high-level", + "crypto" + ], + "repository": { + "type": "git", + "url": "https://github.com/bitwiseshiftleft/sjcl.git" + }, + "scripts": { + "test": "make test", + "jsdoc": "jsdoc -c jsdoc.conf.json", + "lint": "eslint . || true" + }, + "engines": { + "node": "*" + }, + "devDependencies": { + "eslint": "^2.11.1", + "jsdoc": "3.4.0" + } +} diff --git a/node_modules/sjcl/sjcl.js b/node_modules/sjcl/sjcl.js new file mode 100644 index 0000000..c3c3ea9 --- /dev/null +++ b/node_modules/sjcl/sjcl.js @@ -0,0 +1,60 @@ +"use strict";var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}}; +sjcl.cipher.aes=function(a){this.s[0][0][0]||this.O();var b,c,d,e,f=this.s[0][4],g=this.s[1];b=a.length;var h=1;if(4!==b&&6!==b&&8!==b)throw new sjcl.exception.invalid("invalid aes key size");this.b=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=f[c>>>24]<<24^f[c>>16&255]<<16^f[c>>8&255]<<8^f[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:g[0][f[c>>>24]]^g[1][f[c>>16&255]]^g[2][f[c>>8&255]]^g[3][f[c& +255]]}; +sjcl.cipher.aes.prototype={encrypt:function(a){return t(this,a,0)},decrypt:function(a){return t(this,a,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var a=this.s[0],b=this.s[1],c=a[4],d=b[4],e,f,g,h=[],k=[],l,n,m,p;for(e=0;0x100>e;e++)k[(h[e]=e<<1^283*(e>>7))^e]=e;for(f=g=0;!c[f];f^=l||1,g=k[g]||1)for(m=g^g<<1^g<<2^g<<3^g<<4,m=m>>8^m&255^99,c[f]=m,d[m]=f,n=h[e=h[l=h[f]]],p=0x1010101*n^0x10001*e^0x101*l^0x1010100*f,n=0x101*h[m]^0x1010100*m,e=0;4>e;e++)a[e][f]=n=n<<24^n>>>8,b[e][m]=p=p<<24^p>>>8;for(e= +0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}}; +function t(a,b,c){if(4!==b.length)throw new sjcl.exception.invalid("invalid aes block size");var d=a.b[c],e=b[0]^d[0],f=b[c?3:1]^d[1],g=b[2]^d[2];b=b[c?1:3]^d[3];var h,k,l,n=d.length/4-2,m,p=4,r=[0,0,0,0];h=a.s[c];a=h[0];var q=h[1],v=h[2],w=h[3],x=h[4];for(m=0;m>>24]^q[f>>16&255]^v[g>>8&255]^w[b&255]^d[p],k=a[f>>>24]^q[g>>16&255]^v[b>>8&255]^w[e&255]^d[p+1],l=a[g>>>24]^q[b>>16&255]^v[e>>8&255]^w[f&255]^d[p+2],b=a[b>>>24]^q[e>>16&255]^v[f>>8&255]^w[g&255]^d[p+3],p+=4,e=h,f=k,g=l;for(m= +0;4>m;m++)r[c?3&-m:m]=x[e>>>24]<<24^x[f>>16&255]<<16^x[g>>8&255]<<8^x[b&255]^d[p++],h=e,e=f,f=g,g=b,b=h;return r} +sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.$(a.slice(b/32),32-(b&31)).slice(1);return void 0===c?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return!1;var c=0,d;for(d=0;d>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32>>24|c>>>8&0xff00|(c&0xff00)<<8|c<<24;return a}}; +sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d>>8>>>8>>>8),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c>>g)>>>e),gn){if(!b)try{return sjcl.codec.base32hex.toBits(a)}catch(p){}throw new sjcl.exception.invalid("this isn't "+m+"!");}h>e?(h-=e,f.push(l^n>>>h),l=n<>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,f=sjcl.codec.base64.B,g=0,h;b&&(f=f.substr(0,62)+"-_");for(d=0;dh)throw new sjcl.exception.invalid("this isn't base64!");26>>e),g=h<<32-e):(e+=6,g^=h<<32-e)}e&56&&c.push(sjcl.bitArray.partial(e&56,g,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.b[0]||this.O();a?(this.F=a.F.slice(0),this.A=a.A.slice(0),this.l=a.l):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()}; +sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.F=this.Y.slice(0);this.A=[];this.l=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.A=sjcl.bitArray.concat(this.A,a);b=this.l;a=this.l=b+sjcl.bitArray.bitLength(a);if(0x1fffffffffffffb;c++){e=!0;for(d=2;d*d<=c;d++)if(0===c%d){e= +!1;break}e&&(8>b&&(this.Y[b]=a(Math.pow(c,.5))),this.b[b]=a(Math.pow(c,1/3)),b++)}}}; +function u(a,b){var c,d,e,f=a.F,g=a.b,h=f[0],k=f[1],l=f[2],n=f[3],m=f[4],p=f[5],r=f[6],q=f[7];for(c=0;64>c;c++)16>c?d=b[c]:(d=b[c+1&15],e=b[c+14&15],d=b[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+b[c&15]+b[c+9&15]|0),d=d+q+(m>>>6^m>>>11^m>>>25^m<<26^m<<21^m<<7)+(r^m&(p^r))+g[c],q=r,r=p,p=m,m=n+d|0,n=l,l=k,k=h,h=d+(k&l^n&(k^l))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;f[0]=f[0]+h|0;f[1]=f[1]+k|0;f[2]=f[2]+l|0;f[3]=f[3]+n|0;f[4]=f[4]+m|0;f[5]=f[5]+p|0;f[6]=f[6]+r|0;f[7]= +f[7]+q|0} +sjcl.mode.ccm={name:"ccm",G:[],listenProgress:function(a){sjcl.mode.ccm.G.push(a)},unListenProgress:function(a){a=sjcl.mode.ccm.G.indexOf(a);-1k)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(f=2;4>f&&l>>>8*f;f++);f<15-k&&(f=15-k);c=h.clamp(c, +8*(15-f));b=sjcl.mode.ccm.V(a,b,c,d,e,f);g=sjcl.mode.ccm.C(a,g,c,b,e,f);return h.concat(g.data,g.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var f=sjcl.bitArray,g=f.bitLength(c)/8,h=f.bitLength(b),k=f.clamp(b,h-e),l=f.bitSlice(b,h-e),h=(h-e)/8;if(7>g)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(b=2;4>b&&h>>>8*b;b++);b<15-g&&(b=15-g);c=f.clamp(c,8*(15-b));k=sjcl.mode.ccm.C(a,k,c,l,e,b);a=sjcl.mode.ccm.V(a,k.data,c,d,e,b);if(!f.equal(k.tag,a))throw new sjcl.exception.corrupt("ccm: tag doesn't match"); +return k.data},na:function(a,b,c,d,e,f){var g=[],h=sjcl.bitArray,k=h.i;d=[h.partial(8,(b.length?64:0)|d-2<<2|f-1)];d=h.concat(d,c);d[3]|=e;d=a.encrypt(d);if(b.length)for(c=h.bitLength(b)/8,65279>=c?g=[h.partial(16,c)]:0xffffffff>=c&&(g=h.concat([h.partial(16,65534)],[c])),g=h.concat(g,b),b=0;be||16n&&(sjcl.mode.ccm.fa(g/ +k),n+=m),c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,l)}}}; +sjcl.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,d,e,f){if(128!==sjcl.bitArray.bitLength(c))throw new sjcl.exception.invalid("ocb iv must be 128 bits");var g,h=sjcl.mode.ocb2.S,k=sjcl.bitArray,l=k.i,n=[0,0,0,0];c=h(a.encrypt(c));var m,p=[];d=d||[];e=e||64;for(g=0;g+4e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0]));g=f(g,c); +return a.encrypt(f(d(f(h,d(h))),g))},S:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}}; +sjcl.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);b=sjcl.bitArray;d=d||[];a=sjcl.mode.gcm.C(!0,a,f,d,c,e||128);return b.concat(a.data,a.tag)},decrypt:function(a,b,c,d,e){var f=b.slice(0),g=sjcl.bitArray,h=g.bitLength(f);e=e||128;d=d||[];e<=h?(b=g.bitSlice(f,h-e),f=g.bitSlice(f,0,h-e)):(b=f,f=[]);a=sjcl.mode.gcm.C(!1,a,f,d,c,e);if(!g.equal(a.tag,b))throw new sjcl.exception.corrupt("gcm: tag doesn't match");return a.data},ka:function(a,b){var c,d,e,f,g,h=sjcl.bitArray.i;e=[0,0, +0,0];f=b.slice(0);for(c=0;128>c;c++){(d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f));g=0!==(f[3]&1);for(d=3;0>>1|(f[d-1]&1)<<31;f[0]>>>=1;g&&(f[0]^=-0x1f000000)}return e},j:function(a,b,c){var d,e=c.length;b=b.slice(0);for(d=0;de&&(a=b.hash(a));for(d=0;dd||0>c)throw new sjcl.exception.invalid("invalid params to pbkdf2");"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));e=e||sjcl.misc.hmac;a=new e(a);var f,g,h,k,l=[],n=sjcl.bitArray;for(k=1;32*l.length<(d||1);k++){e=f=a.encrypt(n.concat(b,[k]));for(g=1;gg;g++)e.push(0x100000000*Math.random()|0);for(g=0;g=1<this.o&&(this.o= +f);this.P++;this.b=sjcl.hash.sha256.hash(this.b.concat(e));this.L=new sjcl.cipher.aes(this.b);for(d=0;4>d&&(this.h[d]=this.h[d]+1|0,!this.h[d]);d++);}for(d=0;d>>1;this.c[g].update([d,this.N++,2,b,f,a.length].concat(a))}break;case "string":void 0===b&&(b=a.length);this.c[g].update([d,this.N++,3,b,f,a.length]);this.c[g].update(a);break;default:k=1}if(k)throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[g]+=b;this.f+=b;h===this.u&&(this.isReady()!==this.u&&A("seeded",Math.max(this.o,this.f)),A("progress",this.getProgress()))}, +isReady:function(a){a=this.T[void 0!==a?a:this.M];return this.o&&this.o>=a?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=a?this.J|this.u:this.u},getProgress:function(a){a=this.T[a?a:this.M];return this.o>=a?1:this.f>a?1:this.f/a},startCollectors:function(){if(!this.D){this.a={loadTimeCollector:B(this,this.ma),mouseCollector:B(this,this.oa),keyboardCollector:B(this,this.la),accelerometerCollector:B(this,this.ea),touchCollector:B(this,this.qa)};if(window.addEventListener)window.addEventListener("load", +this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new sjcl.exception.bug("can't attach event"); +this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove", +this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(a,b){this.K[a][this.ga++]=b},removeEventListener:function(a,b){var c,d,e=this.K[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;cb&&(a.h[b]=a.h[b]+1|0,!a.h[b]);b++);return a.L.encrypt(a.h)} +function B(a,b){return function(){b.apply(a,arguments)}}sjcl.random=new sjcl.prng(6); +a:try{var D,E,F,G;if(G="undefined"!==typeof module&&module.exports){var H;try{H=require("crypto")}catch(a){H=null}G=E=H}if(G&&E.randomBytes)D=E.randomBytes(128),D=new Uint32Array((new Uint8Array(D)).buffer),sjcl.random.addEntropy(D,1024,"crypto['randomBytes']");else if("undefined"!==typeof window&&"undefined"!==typeof Uint32Array){F=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(F);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(F); +else break a;sjcl.random.addEntropy(F,1024,"crypto['getRandomValues']")}}catch(a){"undefined"!==typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(a))} +sjcl.json={defaults:{v:1,iter:1E4,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,f=e.g({iv:sjcl.random.randomWords(4,0)},e.defaults),g;e.g(f,c);c=f.adata;"string"===typeof f.salt&&(f.salt=sjcl.codec.base64.toBits(f.salt));"string"===typeof f.iv&&(f.iv=sjcl.codec.base64.toBits(f.iv));if(!sjcl.mode[f.mode]||!sjcl.cipher[f.cipher]||"string"===typeof a&&100>=f.iter||64!==f.ts&&96!==f.ts&&128!==f.ts||128!==f.ks&&192!==f.ks&&0x100!==f.ks||2>f.iv.length|| +4=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4>> (32 - tv[0].length)); // unsigned shift, convert to signed word + this.require(b === (tv[1]|0), t + "array entry shifted is number: " + word2hex(b) + " == " + word2hex(tv[1])); + } + + cb && cb(); + }); + + + new sjcl.test.TestCase("bitArray concat, slicing, shifting and clamping", function (cb) { + if (!sjcl.bitArray) { + this.unimplemented(); + cb && cb(); + return; + } + + var i, j, kat = sjcl.test.vector.bitArray.slices, tv, a, a1, b, bitlen, t; + for (i=0; i}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7"], +["8e0bdd697628b91d8f245587ee95c5b04d48963f79259877b49cd9063aead3b7", + "JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6"], +/** + * Thomas Hobbes' "Leviathan", Part I, Chapter VI: + * (The "classic" Base85 example, also the second Wikipedia logo): + * + * "Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure" + * + * The period at the end of the sentence has been omitted, + * since keeping it requires padding the Hex string to align to 4-bytes. + */ + ["4d616e2069732064697374696e677569736865642c206e6f74206f6e6c792062792068697320726561736f6e2c2062757420627920746869732073696e67756c61722070617373696f6e2066726f6d206f7468657220616e696d616c732c2077686963682069732061206c757374206f6620746865206d696e642c20746861742062792061207065727365766572616e6365206f662064656c6967687420696e2074686520636f6e74696e75656420616e6420696e6465666174696761626c652067656e65726174696f6e206f66206b6e6f776c656467652c2065786365656473207468652073686f727420766568656d656e6365206f6620616e79206361726e616c20706c656173757265", + "o<}]Zx(+zcx(!xgzFa9aB7/b}efF?GBrCHty void; +}; +/** + * Config options for a single request. + * + * @property endpointPath - The endpoint to contact. + * @property [data] - The data for a POST request. + * @property [url] - The full url to contact. Will be computed from the portalUrl and endpointPath if not provided. + * @property [method] - The request method. + * @property [query] - Query parameters. + * @property [extraPath] - An additional path to append to the URL, e.g. a 46-character skylink. + * @property [headers] - Any request headers to set. + * @property [responseType] - The response type. + * @property [transformRequest] - A function that allows manually transforming the request. + * @property [transformResponse] - A function that allows manually transforming the response. + */ +export declare type RequestConfig = CustomClientOptions & { + endpointPath: string; + data?: FormData | Record; + url?: string; + method?: Method; + headers?: Headers; + query?: Record; + extraPath?: string; + responseType?: ResponseType; + transformRequest?: (data: unknown) => string; + transformResponse?: (data: string) => Record; +}; +/** + * The Skynet Client which can be used to access Skynet. + */ +export declare class SkynetClient { + customOptions: CustomClientOptions; + protected initialPortalUrl: string; + protected static resolvedPortalUrl?: Promise; + protected customPortalUrl?: string; + uploadFile: typeof uploadFile; + protected uploadSmallFile: typeof uploadSmallFile; + protected uploadSmallFileRequest: typeof uploadSmallFileRequest; + protected uploadLargeFile: typeof uploadLargeFile; + protected uploadLargeFileRequest: typeof uploadLargeFileRequest; + uploadDirectory: typeof uploadDirectory; + protected uploadDirectoryRequest: typeof uploadDirectoryRequest; + downloadFile: typeof downloadFile; + downloadFileHns: typeof downloadFileHns; + getSkylinkUrl: typeof getSkylinkUrl; + getHnsUrl: typeof getHnsUrl; + getHnsresUrl: typeof getHnsresUrl; + getMetadata: typeof getMetadata; + getFileContent: typeof getFileContent; + getFileContentHns: typeof getFileContentHns; + protected getFileContentRequest: typeof getFileContentRequest; + openFile: typeof openFile; + openFileHns: typeof openFileHns; + resolveHns: typeof resolveHns; + pinSkylink: typeof pinSkylink; + extractDomain: typeof extractDomain; + getFullDomainUrl: typeof getFullDomainUrl; + loadMySky: typeof loadMySky; + file: { + getJSON: (userID: string, path: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + getEntryData: (userID: string, path: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + getEntryLink: (userID: string, path: string) => Promise; + getJSONEncrypted: (userID: string, pathSeed: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + }; + db: { + deleteJSON: (privateKey: string, dataKey: string, customOptions?: import("./skydb").CustomSetJSONOptions | undefined) => Promise; + getJSON: (publicKey: string, dataKey: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + setJSON: (privateKey: string, dataKey: string, json: import("./skydb").JsonData, customOptions?: import("./skydb").CustomSetJSONOptions | undefined) => Promise; + setDataLink: (privateKey: string, dataKey: string, dataLink: string, customOptions?: import("./skydb").CustomSetJSONOptions | undefined) => Promise; + getRawBytes: (publicKey: string, dataKey: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + }; + registry: { + getEntry: (publicKey: string, dataKey: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + getEntryUrl: (publicKey: string, dataKey: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + getEntryLink: (publicKey: string, dataKey: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + setEntry: (privateKey: string, entry: import("./registry").RegistryEntry, customOptions?: import("./registry").CustomSetEntryOptions | undefined) => Promise; + postSignedEntry: (publicKey: string, entry: import("./registry").RegistryEntry, signature: Uint8Array, customOptions?: import("./registry").CustomSetEntryOptions | undefined) => Promise; + }; + /** + * The Skynet Client which can be used to access Skynet. + * + * @class + * @param [initialPortalUrl] The initial portal URL to use to access Skynet, if specified. A request will be made to this URL to get the actual portal URL. To use the default portal while passing custom options, pass "". + * @param [customOptions] Configuration for the client. + */ + constructor(initialPortalUrl?: string, customOptions?: CustomClientOptions); + /** + * Make the request for the API portal URL. + * + * @returns - A promise that resolves when the request is complete. + */ + initPortalUrl(): Promise; + /** + * Returns the API portal URL. Makes the request to get it if not done so already. + * + * @returns - the portal URL. + */ + portalUrl(): Promise; + /** + * Creates and executes a request. + * + * @param config - Configuration for the request. + * @returns - The response from axios. + */ + protected executeRequest(config: RequestConfig): Promise; +} +/** + * Helper function that builds the request URL. + * + * @param client - The Skynet client. + * @param endpointPath - The endpoint to contact. + * @param [url] - The base URL to use, instead of the portal URL. + * @param [extraPath] - An optional path to append to the URL. + * @param [query] - Optional query parameters to append to the URL. + * @returns - The built URL. + */ +export declare function buildRequestUrl(client: SkynetClient, endpointPath: string, url?: string, extraPath?: string, query?: Record): Promise; +declare type Headers = { + [key: string]: string; +}; +/** + * Helper function that builds the request headers. + * + * @param [headers] - Any base headers. + * @param [customUserAgent] - A custom user agent to set. + * @param [customCookie] - A custom cookie. + * @returns - The built headers. + */ +export declare function buildRequestHeaders(headers?: Headers, customUserAgent?: string, customCookie?: string): Headers; +export {}; +//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/client.d.ts.map b/node_modules/skynet-js/dist/cjs/client.d.ts.map new file mode 100644 index 0000000..1f68c98 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/client.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,QAAQ,EACR,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGhE;;;;;;;GAOG;AACH,oBAAY,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CACrE,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,oBAAY,aAAa,GAAG,mBAAmB,GAAG;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IACvB,aAAa,EAAE,mBAAmB,CAAC;IAGnC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAEnC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAErD,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAMnC,UAAU,oBAAc;IACxB,SAAS,CAAC,eAAe,yBAAmB;IAC5C,SAAS,CAAC,sBAAsB,gCAA0B;IAC1D,SAAS,CAAC,eAAe,yBAAmB;IAC5C,SAAS,CAAC,sBAAsB,gCAA0B;IAC1D,eAAe,yBAAmB;IAClC,SAAS,CAAC,sBAAsB,gCAA0B;IAI1D,YAAY,sBAAgB;IAC5B,eAAe,yBAAmB;IAClC,aAAa,uBAAiB;IAC9B,SAAS,mBAAa;IACtB,YAAY,sBAAgB;IAC5B,WAAW,qBAAe;IAC1B,cAAc,wBAAkB;IAChC,iBAAiB,2BAAqB;IACtC,SAAS,CAAC,qBAAqB,+BAAyB;IACxD,QAAQ,kBAAY;IACpB,WAAW,qBAAe;IAC1B,UAAU,oBAAc;IAIxB,UAAU,oBAAc;IAIxB,aAAa,uBAAiB;IAC9B,gBAAgB,0BAAoB;IACpC,SAAS,mBAAa;IAItB,IAAI;;;;;MAKF;IAIF,EAAE;;;;;;MAMA;IAIF,QAAQ;;;;;;MAMN;IAEF;;;;;;OAMG;gBACS,gBAAgB,SAAK,EAAE,aAAa,GAAE,mBAAwB;IAY1E;;;;OAIG;IAEG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCpC;;;;OAIG;IAEG,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAWlC;;;;;OAKG;cACa,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAmC9E;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED,aAAK,OAAO,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAY/G"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/client.js b/node_modules/skynet-js/dist/cjs/client.js new file mode 100644 index 0000000..c1929ef --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/client.js @@ -0,0 +1,219 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildRequestHeaders = exports.buildRequestUrl = exports.SkynetClient = void 0; +const axios_1 = __importDefault(require("axios")); +const upload_1 = require("./upload"); +const download_1 = require("./download"); +const file_1 = require("./file"); +const pin_1 = require("./pin"); +const registry_1 = require("./registry"); +const skydb_1 = require("./skydb"); +const url_1 = require("./utils/url"); +const mysky_1 = require("./mysky"); +const utils_1 = require("./mysky/utils"); +const string_1 = require("./utils/string"); +/** + * The Skynet Client which can be used to access Skynet. + */ +class SkynetClient { + /** + * The Skynet Client which can be used to access Skynet. + * + * @class + * @param [initialPortalUrl] The initial portal URL to use to access Skynet, if specified. A request will be made to this URL to get the actual portal URL. To use the default portal while passing custom options, pass "". + * @param [customOptions] Configuration for the client. + */ + constructor(initialPortalUrl = "", customOptions = {}) { + // Set methods (defined in other files). + // Upload + this.uploadFile = upload_1.uploadFile; + this.uploadSmallFile = upload_1.uploadSmallFile; + this.uploadSmallFileRequest = upload_1.uploadSmallFileRequest; + this.uploadLargeFile = upload_1.uploadLargeFile; + this.uploadLargeFileRequest = upload_1.uploadLargeFileRequest; + this.uploadDirectory = upload_1.uploadDirectory; + this.uploadDirectoryRequest = upload_1.uploadDirectoryRequest; + // Download + this.downloadFile = download_1.downloadFile; + this.downloadFileHns = download_1.downloadFileHns; + this.getSkylinkUrl = download_1.getSkylinkUrl; + this.getHnsUrl = download_1.getHnsUrl; + this.getHnsresUrl = download_1.getHnsresUrl; + this.getMetadata = download_1.getMetadata; + this.getFileContent = download_1.getFileContent; + this.getFileContentHns = download_1.getFileContentHns; + this.getFileContentRequest = download_1.getFileContentRequest; + this.openFile = download_1.openFile; + this.openFileHns = download_1.openFileHns; + this.resolveHns = download_1.resolveHns; + // Pin + this.pinSkylink = pin_1.pinSkylink; + // MySky + this.extractDomain = utils_1.extractDomain; + this.getFullDomainUrl = utils_1.getFullDomainUrl; + this.loadMySky = mysky_1.loadMySky; + // File API + this.file = { + getJSON: file_1.getJSON.bind(this), + getEntryData: file_1.getEntryData.bind(this), + getEntryLink: file_1.getEntryLink.bind(this), + getJSONEncrypted: file_1.getJSONEncrypted.bind(this), + }; + // SkyDB + this.db = { + deleteJSON: skydb_1.deleteJSON.bind(this), + getJSON: skydb_1.getJSON.bind(this), + setJSON: skydb_1.setJSON.bind(this), + setDataLink: skydb_1.setDataLink.bind(this), + getRawBytes: skydb_1.getRawBytes.bind(this), + }; + // SkyDB helpers + this.registry = { + getEntry: registry_1.getEntry.bind(this), + getEntryUrl: registry_1.getEntryUrl.bind(this), + getEntryLink: registry_1.getEntryLink.bind(this), + setEntry: registry_1.setEntry.bind(this), + postSignedEntry: registry_1.postSignedEntry.bind(this), + }; + if (initialPortalUrl === "") { + // Portal was not given, use the default portal URL. We'll still make a request for the resolved portal URL. + initialPortalUrl = url_1.defaultPortalUrl(); + } + else { + // Portal was given, don't make the request for the resolved portal URL. + this.customPortalUrl = initialPortalUrl; + } + this.initialPortalUrl = initialPortalUrl; + this.customOptions = customOptions; + } + /** + * Make the request for the API portal URL. + * + * @returns - A promise that resolves when the request is complete. + */ + /* istanbul ignore next */ + async initPortalUrl() { + if (this.customPortalUrl) { + // Tried to make a request for the API portal URL when a custom URL was already provided. + return; + } + if (!SkynetClient.resolvedPortalUrl) { + SkynetClient.resolvedPortalUrl = new Promise((resolve, reject) => { + this.executeRequest({ + ...this.customOptions, + method: "head", + url: this.initialPortalUrl, + endpointPath: "/", + }).then((response) => { + if (typeof response.headers === "undefined") { + reject(new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists.")); + } + const portalUrl = response.headers["skynet-portal-api"]; + if (!portalUrl) { + reject(new Error("Could not get portal URL for the given portal")); + } + resolve(string_1.trimSuffix(portalUrl, "/")); + }); + }); + } + await SkynetClient.resolvedPortalUrl; + return; + } + /** + * Returns the API portal URL. Makes the request to get it if not done so already. + * + * @returns - the portal URL. + */ + /* istanbul ignore next */ + async portalUrl() { + if (this.customPortalUrl) { + return this.customPortalUrl; + } + // Make the request if needed and not done so. + this.initPortalUrl(); + return await SkynetClient.resolvedPortalUrl; // eslint-disable-line + } + /** + * Creates and executes a request. + * + * @param config - Configuration for the request. + * @returns - The response from axios. + */ + async executeRequest(config) { + const url = await buildRequestUrl(this, config.endpointPath, config.url, config.extraPath, config.query); + // Build headers. + const headers = buildRequestHeaders(config.headers, config.customUserAgent, config.customCookie); + const auth = config.APIKey ? { username: "", password: config.APIKey } : undefined; + const onUploadProgress = config.onUploadProgress && + /* istanbul ignore next */ + function (event) { + const progress = event.loaded / event.total; + // Need the if-statement or TS complains. + if (config.onUploadProgress) + config.onUploadProgress(progress, event); + }; + return axios_1.default({ + url, + method: config.method, + data: config.data, + headers, + auth, + onUploadProgress, + responseType: config.responseType, + transformRequest: config.transformRequest, + transformResponse: config.transformResponse, + maxContentLength: Infinity, + maxBodyLength: Infinity, + // Allow cross-site cookies. + withCredentials: true, + }); + } +} +exports.SkynetClient = SkynetClient; +/** + * Helper function that builds the request URL. + * + * @param client - The Skynet client. + * @param endpointPath - The endpoint to contact. + * @param [url] - The base URL to use, instead of the portal URL. + * @param [extraPath] - An optional path to append to the URL. + * @param [query] - Optional query parameters to append to the URL. + * @returns - The built URL. + */ +async function buildRequestUrl(client, endpointPath, url, extraPath, query) { + // Build the URL. + if (!url) { + const portalUrl = await client.portalUrl(); + url = url_1.makeUrl(portalUrl, endpointPath, extraPath !== null && extraPath !== void 0 ? extraPath : ""); + } + if (query) { + url = url_1.addUrlQuery(url, query); + } + return url; +} +exports.buildRequestUrl = buildRequestUrl; +/** + * Helper function that builds the request headers. + * + * @param [headers] - Any base headers. + * @param [customUserAgent] - A custom user agent to set. + * @param [customCookie] - A custom cookie. + * @returns - The built headers. + */ +function buildRequestHeaders(headers, customUserAgent, customCookie) { + if (!headers) { + headers = {}; + } + // Set some headers from common options. + if (customUserAgent) { + headers["User-Agent"] = customUserAgent; + } + if (customCookie) { + headers["Cookie"] = customCookie; + } + return headers; +} +exports.buildRequestHeaders = buildRequestHeaders; diff --git a/node_modules/skynet-js/dist/cjs/crypto.d.ts b/node_modules/skynet-js/dist/cjs/crypto.d.ts new file mode 100644 index 0000000..d60c824 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/crypto.d.ts @@ -0,0 +1,76 @@ +/// +import { RegistryEntry } from "./registry"; +export declare type Signature = Buffer; +/** + * Key pair. + * + * @property publicKey - The public key. + * @property privateKey - The private key. + */ +export declare type KeyPair = { + publicKey: string; + privateKey: string; +}; +/** + * Key pair and seed. + * + * @property seed - The secure seed. + */ +export declare type KeyPairAndSeed = KeyPair & { + seed: string; +}; +export declare const HASH_LENGTH = 32; +/** + * Derives a child seed from the given master seed and sub seed. + * + * @param masterSeed - The master seed to derive from. + * @param seed - The sub seed for the derivation. + * @returns - The child seed derived from `masterSeed` using `seed`. + * @throws - Will throw if the inputs are not strings. + */ +export declare function deriveChildSeed(masterSeed: string, seed: string): string; +/** + * Generates a master key pair and seed. + * + * @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. + * @returns - The generated key pair and seed. + */ +export declare function genKeyPairAndSeed(length?: number): KeyPairAndSeed; +/** + * Generates a public and private key from a provided, secure seed. + * + * @param seed - A secure seed. + * @returns - The generated key pair. + * @throws - Will throw if the input is not a string. + */ +export declare function genKeyPairFromSeed(seed: string): KeyPair; +/** + * Takes all given arguments and hashes them. + * + * @param args - Byte arrays to hash. + * @returns - The final hash as a byte array. + */ +export declare function hashAll(...args: Uint8Array[]): Uint8Array; +/** + * Hash the given data key. + * + * @param dataKey - Data key to hash. + * @returns - Hash of the data key. + */ +export declare function hashDataKey(dataKey: string): Uint8Array; +/** + * Hashes the given registry entry. + * + * @param registryEntry - Registry entry to hash. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - Hash of the registry entry. + */ +export declare function hashRegistryEntry(registryEntry: RegistryEntry, hashedDataKeyHex: boolean): Uint8Array; +/** + * Hashes the given string or byte array using sha512. + * + * @param message - The string or byte array to hash. + * @returns - The resulting hash. + */ +export declare function sha512(message: Uint8Array | string): Uint8Array; +//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/crypto.d.ts.map b/node_modules/skynet-js/dist/cjs/crypto.d.ts.map new file mode 100644 index 0000000..234d44f --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK3C,oBAAY,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;GAKG;AACH,oBAAY,OAAO,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,cAAc,GAAG,OAAO,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,WAAW,KAAK,CAAC;AAW9B;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKxE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,SAAK,GAAG,cAAc,CAK7D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASxD;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,CAIzD;AAGD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,UAAU,CAWrG;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAM/D"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/crypto.js b/node_modules/skynet-js/dist/cjs/crypto.js new file mode 100644 index 0000000..982fa4d --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/crypto.js @@ -0,0 +1,133 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sha512 = exports.hashRegistryEntry = exports.hashDataKey = exports.hashAll = exports.genKeyPairFromSeed = exports.genKeyPairAndSeed = exports.deriveChildSeed = exports.HASH_LENGTH = void 0; +const sjcl_1 = require("sjcl"); +const blakejs_1 = require("blakejs"); +const randombytes_1 = __importDefault(require("randombytes")); +const tweetnacl_1 = require("tweetnacl"); +const string_1 = require("./utils/string"); +const validation_1 = require("./utils/validation"); +const encoding_1 = require("./utils/encoding"); +exports.HASH_LENGTH = 32; +/** + * Returns a blake2b 256bit hasher. See `NewHash` in Sia. + * + * @returns - blake2b 256bit hasher. + */ +function newHash() { + return blakejs_1.blake2bInit(32, null); +} +/** + * Derives a child seed from the given master seed and sub seed. + * + * @param masterSeed - The master seed to derive from. + * @param seed - The sub seed for the derivation. + * @returns - The child seed derived from `masterSeed` using `seed`. + * @throws - Will throw if the inputs are not strings. + */ +function deriveChildSeed(masterSeed, seed) { + validation_1.validateString("masterSeed", masterSeed, "parameter"); + validation_1.validateString("seed", seed, "parameter"); + return string_1.toHexString(hashAll(encoding_1.encodeUtf8String(masterSeed), encoding_1.encodeUtf8String(seed))); +} +exports.deriveChildSeed = deriveChildSeed; +/** + * Generates a master key pair and seed. + * + * @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. + * @returns - The generated key pair and seed. + */ +function genKeyPairAndSeed(length = 64) { + validation_1.validateNumber("length", length, "parameter"); + const seed = makeSeed(length); + return { ...genKeyPairFromSeed(seed), seed }; +} +exports.genKeyPairAndSeed = genKeyPairAndSeed; +/** + * Generates a public and private key from a provided, secure seed. + * + * @param seed - A secure seed. + * @returns - The generated key pair. + * @throws - Will throw if the input is not a string. + */ +function genKeyPairFromSeed(seed) { + validation_1.validateString("seed", seed, "parameter"); + // Get a 32-byte key. + const derivedKey = sjcl_1.misc.pbkdf2(seed, "", 1000, 32 * 8); + const derivedKeyHex = sjcl_1.codec.hex.fromBits(derivedKey); + const { publicKey, secretKey } = tweetnacl_1.sign.keyPair.fromSeed(string_1.hexToUint8Array(derivedKeyHex)); + return { publicKey: string_1.toHexString(publicKey), privateKey: string_1.toHexString(secretKey) }; +} +exports.genKeyPairFromSeed = genKeyPairFromSeed; +/** + * Takes all given arguments and hashes them. + * + * @param args - Byte arrays to hash. + * @returns - The final hash as a byte array. + */ +function hashAll(...args) { + const hasher = newHash(); + args.forEach((arg) => blakejs_1.blake2bUpdate(hasher, arg)); + return blakejs_1.blake2bFinal(hasher); +} +exports.hashAll = hashAll; +// TODO: Is this the same as hashString? +/** + * Hash the given data key. + * + * @param dataKey - Data key to hash. + * @returns - Hash of the data key. + */ +function hashDataKey(dataKey) { + return hashAll(encoding_1.encodeUtf8String(dataKey)); +} +exports.hashDataKey = hashDataKey; +/** + * Hashes the given registry entry. + * + * @param registryEntry - Registry entry to hash. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - Hash of the registry entry. + */ +function hashRegistryEntry(registryEntry, hashedDataKeyHex) { + let dataKeyBytes; + if (hashedDataKeyHex) { + dataKeyBytes = string_1.hexToUint8Array(registryEntry.dataKey); + } + else { + dataKeyBytes = hashDataKey(registryEntry.dataKey); + } + const dataBytes = encoding_1.encodePrefixedBytes(registryEntry.data); + return hashAll(dataKeyBytes, dataBytes, encoding_1.encodeBigintAsUint64(registryEntry.revision)); +} +exports.hashRegistryEntry = hashRegistryEntry; +/** + * Hashes the given string or byte array using sha512. + * + * @param message - The string or byte array to hash. + * @returns - The resulting hash. + */ +function sha512(message) { + if (typeof message === "string") { + return tweetnacl_1.hash(string_1.stringToUint8ArrayUtf8(message)); + } + else { + return tweetnacl_1.hash(message); + } +} +exports.sha512 = sha512; +/** + * Generates a random seed of the given length in bytes. + * + * @param length - Length of the seed in bytes. + * @returns - The generated seed. + */ +function makeSeed(length) { + // Cryptographically-secure random number generator. It should use the + // built-in crypto.getRandomValues in the browser. + const array = randombytes_1.default(length); + return string_1.toHexString(array); +} diff --git a/node_modules/skynet-js/dist/cjs/download.d.ts b/node_modules/skynet-js/dist/cjs/download.d.ts new file mode 100644 index 0000000..62d9812 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/download.d.ts @@ -0,0 +1,231 @@ +import { ResponseType } from "axios"; +import { SkynetClient } from "./client"; +import { JsonData } from "./skydb"; +import { BaseCustomOptions } from "./utils/options"; +/** + * Custom download options. + * + * @property [endpointDownload] - The relative URL path of the portal endpoint to contact. + * @property [download=false] - Indicates to `getSkylinkUrl` whether the file should be downloaded (true) or opened in the browser (false). `downloadFile` and `openFile` override this value. + * @property [path] - A path to append to the skylink, e.g. `dir1/dir2/file`. A Unix-style path is expected. Each path component will be URL-encoded. + * @property [range] - The Range request header to set for the download. Not applicable for in-borwser downloads. + * @property [responseType] - The response type. + * @property [query] - A query object to convert to a query parameter string and append to the URL. + * @property [subdomain=false] - Whether to return the final skylink in subdomain format. + */ +export declare type CustomDownloadOptions = BaseCustomOptions & { + endpointDownload?: string; + download?: boolean; + path?: string; + range?: string; + responseType?: ResponseType; + subdomain?: boolean; +}; +/** + * Custom HNS download options. + * + * @property [endpointDownloadHns] - The relative URL path of the portal endpoint to contact. + * @property [hnsSubdomain="hns"] - The name of the hns subdomain on the portal. + */ +export declare type CustomHnsDownloadOptions = CustomDownloadOptions & { + endpointDownloadHns?: string; + hnsSubdomain?: string; +}; +export declare type CustomGetMetadataOptions = BaseCustomOptions & { + endpointGetMetadata?: string; + query?: Record; +}; +export declare type CustomHnsResolveOptions = BaseCustomOptions & { + endpointResolveHns?: string; +}; +/** + * The response for a get file content request. + * + * @property data - The returned file content. Its type is stored in contentType. + * @property contentType - The type of the content. + * @property portalUrl - The URL of the portal. + * @property skylink - 46-character skylink. + */ +export declare type GetFileContentResponse = { + data: T; + contentType: string; + portalUrl: string; + skylink: string; +}; +/** + * The response for a get metadata request. + * + * @property metadata - The metadata in JSON format. + * @property portalUrl - The URL of the portal. + * @property skylink - 46-character skylink. + */ +export declare type GetMetadataResponse = { + metadata: Record; + portalUrl: string; + skylink: string; +}; +/** + * The response for a resolve HNS request. + * + * @property skylink - 46-character skylink. + */ +export declare type ResolveHnsResponse = { + data: JsonData; + skylink: string; +}; +export declare const defaultDownloadOptions: { + endpointDownload: string; + download: boolean; + path: undefined; + range: undefined; + responseType: undefined; + query: undefined; + subdomain: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Initiates a download of the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. Can be followed by a path. Note that the skylink will not be encoded, so if your path might contain special characters, consider using `customOptions.path`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function downloadFile(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Initiates a download of the content of the skylink at the Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +export declare function downloadFileHns(this: SkynetClient, domain: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Constructs the full URL for the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getSkylinkUrl(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Gets the skylink URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getSkylinkUrlForPortal(portalUrl: string, skylinkUrl: string, customOptions?: CustomDownloadOptions): string; +/** + * Constructs the full URL for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +export declare function getHnsUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise; +/** + * Constructs the full URL for the resolver for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the resolver for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise; +/** + * Gets only the metadata for the given skylink without the contents. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The metadata in JSON format. Empty if no metadata was found. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getMetadata(this: SkynetClient, skylinkUrl: string, customOptions?: CustomGetMetadataOptions): Promise; +/** + * Gets the contents of the file at the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getFileContent(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise>; +/** + * Gets the contents of the file at the given Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the domain does not contain a skylink. + */ +export declare function getFileContentHns(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise>; +/** + * Does a GET request of the skylink, returning the data property of the response. + * + * @param this - SkynetClient + * @param url - URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the request does not succeed or the response is missing data. + */ +export declare function getFileContentRequest(this: SkynetClient, url: string, customOptions?: CustomDownloadOptions): Promise>; +/** + * Opens the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function openFile(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Opens the content of the skylink from the given Handshake domain within the browser. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +export declare function openFileHns(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise; +/** + * Resolves the given HNS domain to its skylink and returns it and the raw data. + * + * @param this - SkynetClient + * @param domain - Handshake resolver domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The raw data and corresponding skylink. + * @throws - Will throw if the input domain is not a string. + */ +export declare function resolveHns(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise; +//# sourceMappingURL=download.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/download.d.ts.map b/node_modules/skynet-js/dist/cjs/download.d.ts.map new file mode 100644 index 0000000..ba6c35e --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/download.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAIxE;;;;;;;;;;GAUG;AACH,oBAAY,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,wBAAwB,GAAG,iBAAiB,GAAG;IACzD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,oBAAY,uBAAuB,GAAG,iBAAiB,GAAG;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;;;;GAOG;AACH,oBAAY,sBAAsB,CAAC,CAAC,GAAG,OAAO,IAAI;IAChD,IAAI,EAAE,CAAC,CAAC;IACR,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CASlC,CAAC;AAiBF;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,MAAM,CA0DR;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,uBAAuB,GACtC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,mBAAmB,CAAC,CAkC9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAQpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EACjD,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAQpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,GAAG,OAAO,EACrD,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,MAAM,EACX,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAgCpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,uBAAuB,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAyB7B"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/download.js b/node_modules/skynet-js/dist/cjs/download.js new file mode 100644 index 0000000..84298f2 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/download.js @@ -0,0 +1,418 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveHns = exports.openFileHns = exports.openFile = exports.getFileContentRequest = exports.getFileContentHns = exports.getFileContent = exports.getMetadata = exports.getHnsresUrl = exports.getHnsUrl = exports.getSkylinkUrlForPortal = exports.getSkylinkUrl = exports.downloadFileHns = exports.downloadFile = exports.defaultDownloadOptions = void 0; +const format_1 = require("./skylink/format"); +const parse_1 = require("./skylink/parse"); +const string_1 = require("./utils/string"); +const options_1 = require("./utils/options"); +const url_1 = require("./utils/url"); +const validation_1 = require("./utils/validation"); +exports.defaultDownloadOptions = { + ...options_1.defaultBaseOptions, + endpointDownload: "/", + download: false, + path: undefined, + range: undefined, + responseType: undefined, + query: undefined, + subdomain: false, +}; +const defaultGetMetadataOptions = { + endpointGetMetadata: "/skynet/metadata", + query: undefined, +}; +const defaultDownloadHnsOptions = { + ...exports.defaultDownloadOptions, + endpointDownloadHns: "hns", + hnsSubdomain: "hns", + // Default to subdomain format for HNS URLs. + subdomain: true, +}; +const defaultResolveHnsOptions = { + ...options_1.defaultBaseOptions, + endpointResolveHns: "hnsres", +}; +/** + * Initiates a download of the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. Can be followed by a path. Note that the skylink will not be encoded, so if your path might contain special characters, consider using `customOptions.path`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +async function downloadFile(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + const opts = { ...exports.defaultDownloadOptions, ...this.customOptions, ...customOptions, download: true }; + const url = await this.getSkylinkUrl(skylinkUrl, opts); + // Download the url. + window.location.assign(url); + return url; +} +exports.downloadFile = downloadFile; +/** + * Initiates a download of the content of the skylink at the Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +async function downloadFileHns(domain, customOptions) { + // Validation is done in `getHnsUrl`. + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions, download: true }; + const url = await this.getHnsUrl(domain, opts); + // Download the url. + window.location.assign(url); + return url; +} +exports.downloadFileHns = downloadFileHns; +/** + * Constructs the full URL for the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +async function getSkylinkUrl(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrlForPortal`. + const opts = { ...exports.defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const portalUrl = await this.portalUrl(); + return getSkylinkUrlForPortal(portalUrl, skylinkUrl, opts); +} +exports.getSkylinkUrl = getSkylinkUrl; +/** + * Gets the skylink URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +function getSkylinkUrlForPortal(portalUrl, skylinkUrl, customOptions) { + var _a; + validation_1.validateString("portalUrl", portalUrl, "parameter"); + validation_1.validateString("skylinkUrl", skylinkUrl, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultDownloadOptions); + const opts = { ...exports.defaultDownloadOptions, ...customOptions }; + const query = {}; + if (opts.download) { + // Set the "attachment" parameter. + query.attachment = true; + } + // URL-encode the path. + let path = ""; + if (opts.path) { + if (typeof opts.path !== "string") { + throw new Error(`opts.path has to be a string, ${typeof opts.path} provided`); + } + // Encode each element of the path separately and join them. + // + // Don't use encodeURI because it does not encode characters such as '?' + // etc. These are allowed as filenames on Skynet and should be encoded so + // they are not treated as URL separators. + path = opts.path + .split("/") + .map((element) => encodeURIComponent(element)) + .join("/"); + } + let url; + if (opts.subdomain) { + // The caller wants to use a URL with the skylink as a base32 subdomain. + // + // Get the path from the skylink. Use the empty string if not found. + const skylinkPath = (_a = parse_1.parseSkylink(skylinkUrl, { onlyPath: true })) !== null && _a !== void 0 ? _a : ""; + // Get just the skylink. + let skylink = parse_1.parseSkylink(skylinkUrl); + if (skylink === null) { + throw new Error(`Could not get skylink out of input '${skylinkUrl}'`); + } + // Convert the skylink (without the path) to base32. + skylink = format_1.convertSkylinkToBase32(skylink); + url = url_1.addSubdomain(portalUrl, skylink); + url = url_1.makeUrl(url, skylinkPath, path); + } + else { + // Get the skylink including the path. + const skylink = parse_1.parseSkylink(skylinkUrl, { includePath: true }); + if (skylink === null) { + throw new Error(`Could not get skylink with path out of input '${skylinkUrl}'`); + } + // Add additional path if passed in. + url = url_1.makeUrl(portalUrl, opts.endpointDownload, skylink); + url = url_1.makeUrl(url, path); + } + return url_1.addUrlQuery(url, query); +} +exports.getSkylinkUrlForPortal = getSkylinkUrlForPortal; +/** + * Constructs the full URL for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +async function getHnsUrl(domain, customOptions) { + validation_1.validateString("domain", domain, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", defaultDownloadHnsOptions); + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; + const query = {}; + if (opts.download) { + query.attachment = true; + } + domain = string_1.trimUriPrefix(domain, url_1.uriHandshakePrefix); + const portalUrl = await this.portalUrl(); + const url = opts.subdomain + ? url_1.addSubdomain(url_1.addSubdomain(portalUrl, opts.hnsSubdomain), domain) + : url_1.makeUrl(portalUrl, opts.endpointDownloadHns, domain); + return url_1.addUrlQuery(url, query); +} +exports.getHnsUrl = getHnsUrl; +/** + * Constructs the full URL for the resolver for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the resolver for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +async function getHnsresUrl(domain, customOptions) { + validation_1.validateString("domain", domain, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", defaultResolveHnsOptions); + const opts = { ...defaultResolveHnsOptions, ...this.customOptions, ...customOptions }; + domain = string_1.trimUriPrefix(domain, url_1.uriHandshakePrefix); + const portalUrl = await this.portalUrl(); + return url_1.makeUrl(portalUrl, opts.endpointResolveHns, domain); +} +exports.getHnsresUrl = getHnsresUrl; +/** + * Gets only the metadata for the given skylink without the contents. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The metadata in JSON format. Empty if no metadata was found. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +async function getMetadata(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + var _a; + const opts = { ...defaultGetMetadataOptions, ...this.customOptions, ...customOptions }; + // Don't include the path for now since the endpoint doesn't support it. + const path = parse_1.parseSkylink(skylinkUrl, { onlyPath: true }); + if (path) { + throw new Error("Skylink string should not contain a path"); + } + const getSkylinkUrlOpts = { endpointDownload: opts.endpointGetMetadata, query: opts.query }; + const url = await this.getSkylinkUrl(skylinkUrl, getSkylinkUrlOpts); + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointGetMetadata, + method: "GET", + url, + }); + validateGetMetadataResponse(response); + const metadata = response.data; + if (typeof response.headers === "undefined") { + throw new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists."); + } + const portalUrl = (_a = response.headers["skynet-portal-api"]) !== null && _a !== void 0 ? _a : ""; + const skylink = response.headers["skynet-skylink"] ? format_1.formatSkylink(response.headers["skynet-skylink"]) : ""; + return { metadata, portalUrl, skylink }; +} +exports.getMetadata = getMetadata; +/** + * Gets the contents of the file at the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +async function getFileContent(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + const opts = { ...exports.defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const url = await this.getSkylinkUrl(skylinkUrl, opts); + return this.getFileContentRequest(url, opts); +} +exports.getFileContent = getFileContent; +/** + * Gets the contents of the file at the given Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the domain does not contain a skylink. + */ +async function getFileContentHns(domain, customOptions) { + // Validation is done in `getHnsUrl`. + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; + const url = await this.getHnsUrl(domain, opts); + return this.getFileContentRequest(url, opts); +} +exports.getFileContentHns = getFileContentHns; +/** + * Does a GET request of the skylink, returning the data property of the response. + * + * @param this - SkynetClient + * @param url - URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the request does not succeed or the response is missing data. + */ +async function getFileContentRequest(url, customOptions) { + // Not publicly available, don't validate input. + var _a, _b; + const opts = { ...exports.defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const headers = opts.range ? { Range: opts.range } : undefined; + // GET request the data at the skylink. + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointDownload, + method: "get", + url, + headers, + }); + if (typeof response.data === "undefined") { + throw new Error("Did not get 'data' in response despite a successful request. Please try again and report this issue to the devs if it persists."); + } + if (typeof response.headers === "undefined") { + throw new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists."); + } + const contentType = (_a = response.headers["content-type"]) !== null && _a !== void 0 ? _a : ""; + const portalUrl = (_b = response.headers["skynet-portal-api"]) !== null && _b !== void 0 ? _b : ""; + const skylink = response.headers["skynet-skylink"] ? format_1.formatSkylink(response.headers["skynet-skylink"]) : ""; + return { data: response.data, contentType, portalUrl, skylink }; +} +exports.getFileContentRequest = getFileContentRequest; +/** + * Opens the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +async function openFile(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + const opts = { ...exports.defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const url = await this.getSkylinkUrl(skylinkUrl, opts); + window.open(url, "_blank"); + return url; +} +exports.openFile = openFile; +/** + * Opens the content of the skylink from the given Handshake domain within the browser. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +async function openFileHns(domain, customOptions) { + // Validation is done in `getHnsUrl`. + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; + const url = await this.getHnsUrl(domain, opts); + // Open the url in a new tab. + window.open(url, "_blank"); + return url; +} +exports.openFileHns = openFileHns; +/** + * Resolves the given HNS domain to its skylink and returns it and the raw data. + * + * @param this - SkynetClient + * @param domain - Handshake resolver domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The raw data and corresponding skylink. + * @throws - Will throw if the input domain is not a string. + */ +async function resolveHns(domain, customOptions) { + // Validation is done in `getHnsresUrl`. + const opts = { ...defaultResolveHnsOptions, ...this.customOptions, ...customOptions }; + const url = await this.getHnsresUrl(domain, opts); + // Get the txt record from the hnsres domain on the portal. + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointResolveHns, + method: "get", + url, + }); + validateResolveHnsResponse(response); + if (response.data.skylink) { + return { data: response.data, skylink: response.data.skylink }; + } + else { + const skylink = await this.registry.getEntryLink(response.data.registry.publickey, response.data.registry.datakey, { + hashedDataKeyHex: true, + }); + return { data: response.data, skylink }; + } +} +exports.resolveHns = resolveHns; +/** + * Validates the response from getMetadata. + * + * @param response - The Axios response. + * @throws - Will throw if the response does not contain the expected fields. + */ +function validateGetMetadataResponse(response) { + try { + if (!response.data) { + throw new Error("response.data field missing"); + } + } + catch (err) { + throw new Error(`Metadata response invalid despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} +/** + * Validates the response from resolveHns. + * + * @param response - The Axios response. + * @throws - Will throw if the response contains an unexpected format. + */ +function validateResolveHnsResponse(response) { + try { + if (!response.data) { + throw new Error("response.data field missing"); + } + if (response.data.skylink) { + validation_1.validateString("response.data.skylink", response.data.skylink, "resolveHns response field"); + } + else if (response.data.registry) { + validation_1.validateObject("response.data.registry", response.data.registry, "resolveHns response field"); + validation_1.validateString("response.data.registry.publickey", response.data.registry.publickey, "resolveHns response field"); + validation_1.validateString("response.data.registry.datakey", response.data.registry.datakey, "resolveHns response field"); + } + else { + validation_1.throwValidationError("response.data", response.data, "response data object", "object containing skylink or registry field"); + } + } + catch (err) { + throw new Error(`Did not get a complete resolve HNS response despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} diff --git a/node_modules/skynet-js/dist/cjs/file.d.ts b/node_modules/skynet-js/dist/cjs/file.d.ts new file mode 100644 index 0000000..da06002 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/file.d.ts @@ -0,0 +1,50 @@ +import { SkynetClient } from "./client"; +import { EntryData } from "./mysky"; +import { EncryptedJSONResponse } from "./mysky/encrypted_files"; +import { CustomGetEntryOptions } from "./registry"; +import { CustomGetJSONOptions, JSONResponse } from "./skydb"; +/** + * Gets Discoverable JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + */ +export declare function getJSON(this: SkynetClient, userID: string, path: string, customOptions?: CustomGetJSONOptions): Promise; +/** + * Gets the entry link for the entry set with MySky at the given data path, for + * the given public user ID. This is a v2 skylink. This link stays the same even + * if the content at the entry changes. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @returns - The entry link. + */ +export declare function getEntryLink(this: SkynetClient, userID: string, path: string): Promise; +/** + * Gets the entry data for the entry set with MySky at the given data path, for + * the given public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + */ +export declare function getEntryData(this: SkynetClient, userID: string, path: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets Encrypted JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param pathSeed - The share-able secret path seed. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + */ +export declare function getJSONEncrypted(this: SkynetClient, userID: string, pathSeed: string, customOptions?: CustomGetJSONOptions): Promise; +//# sourceMappingURL=file.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/file.d.ts.map b/node_modules/skynet-js/dist/cjs/file.d.ts.map new file mode 100644 index 0000000..10898e8 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/file.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAIL,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAA0B,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAyB,YAAY,EAAE,MAAM,SAAS,CAAC;AAOpF;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,YAAY,CAAC,CAevB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASpG;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,SAAS,CAAC,CAmBpB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAEhB,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,qBAAqB,CAAC,CAuBhC"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/file.js b/node_modules/skynet-js/dist/cjs/file.js new file mode 100644 index 0000000..5a25dc3 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/file.js @@ -0,0 +1,121 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getJSONEncrypted = exports.getEntryData = exports.getEntryLink = exports.getJSON = void 0; +const encrypted_files_1 = require("./mysky/encrypted_files"); +const tweak_1 = require("./mysky/tweak"); +const registry_1 = require("./registry"); +const skydb_1 = require("./skydb"); +const validation_1 = require("./utils/validation"); +// ==== +// JSON +// ==== +/** + * Gets Discoverable JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + */ +async function getJSON(userID, path, customOptions) { + validation_1.validateString("userID", userID, "parameter"); + validation_1.validateString("path", path, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultGetJSONOptions); + const opts = { + ...skydb_1.defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + return await this.db.getJSON(userID, dataKey, opts); +} +exports.getJSON = getJSON; +// ===== +// Entry +// ===== +/** + * Gets the entry link for the entry set with MySky at the given data path, for + * the given public user ID. This is a v2 skylink. This link stays the same even + * if the content at the entry changes. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @returns - The entry link. + */ +async function getEntryLink(userID, path) { + validation_1.validateString("userID", userID, "parameter"); + validation_1.validateString("path", path, "parameter"); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + // Do not hash the tweak anymore. + const opts = { ...registry_1.defaultGetEntryOptions, hashedDataKeyHex: true }; + return await this.registry.getEntryLink(userID, dataKey, opts); +} +exports.getEntryLink = getEntryLink; +/** + * Gets the entry data for the entry set with MySky at the given data path, for + * the given public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + */ +async function getEntryData(userID, path, customOptions) { + validation_1.validateString("userID", userID, "parameter"); + validation_1.validateString("path", path, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", registry_1.defaultGetEntryOptions); + const opts = { + ...registry_1.defaultGetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const { entry } = await this.registry.getEntry(userID, dataKey, opts); + if (!entry) { + return { data: null }; + } + return { data: entry.data }; +} +exports.getEntryData = getEntryData; +// =============== +// Encrypted Files +// =============== +/** + * Gets Encrypted JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param pathSeed - The share-able secret path seed. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + */ +async function getJSONEncrypted(userID, pathSeed, +// TODO: Take a new options type? +customOptions) { + validation_1.validateString("userID", userID, "parameter"); + validation_1.validateStringLen("pathSeed", pathSeed, "parameter", 64); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultGetJSONOptions); + const opts = { + ...skydb_1.defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + hashedDataKeyHex: true, // Do not hash the tweak anymore. + }; + // Fetch the raw encrypted JSON data. + const dataKey = encrypted_files_1.deriveEncryptedFileTweak(pathSeed); + const { data } = await this.db.getRawBytes(userID, dataKey, opts); + if (data === null) { + return { data: null }; + } + const key = encrypted_files_1.deriveEncryptedFileKeyEntropy(pathSeed); + const json = encrypted_files_1.decryptJSONFile(data, key); + return { data: json }; +} +exports.getJSONEncrypted = getJSONEncrypted; diff --git a/node_modules/skynet-js/dist/cjs/index.d.ts b/node_modules/skynet-js/dist/cjs/index.d.ts new file mode 100644 index 0000000..49adc00 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/index.d.ts @@ -0,0 +1,25 @@ +export { SkynetClient } from "./client"; +export { HASH_LENGTH, deriveChildSeed, genKeyPairAndSeed, genKeyPairFromSeed } from "./crypto"; +export { getSkylinkUrlForPortal } from "./download"; +export { getEntryUrlForPortal, signEntry } from "./registry"; +export { DacLibrary, MySky, mySkyDomain, mySkyDevDomain } from "./mysky"; +export { deriveEncryptedFileKeyEntropy, deriveEncryptedFileSeed, deriveEncryptedFileTweak, ENCRYPTION_PATH_SEED_LENGTH, } from "./mysky/encrypted_files"; +export { deriveDiscoverableFileTweak } from "./mysky/tweak"; +export { convertSkylinkToBase32, convertSkylinkToBase64 } from "./skylink/format"; +export { parseSkylink } from "./skylink/parse"; +export { isSkylinkV1, isSkylinkV2 } from "./skylink/sia"; +export { getRelativeFilePath, getRootDirectory } from "./utils/file"; +export { MAX_REVISION } from "./utils/number"; +export { stringToUint8ArrayUtf8, uint8ArrayToStringUtf8 } from "./utils/string"; +export { defaultPortalUrl, defaultSkynetPortalUrl, extractDomainForPortal, getFullDomainUrlForPortal, uriHandshakePrefix, uriSkynetPrefix, } from "./utils/url"; +export { Permission, PermCategory, PermType, PermRead, PermWrite, PermHidden, PermDiscoverable, PermLegacySkyID, } from "skynet-mysky-utils"; +export type { CustomClientOptions, RequestConfig } from "./client"; +export type { KeyPair, KeyPairAndSeed, Signature } from "./crypto"; +export type { CustomDownloadOptions, ResolveHnsResponse } from "./download"; +export type { CustomConnectorOptions } from "./mysky"; +export type { CustomPinOptions, PinResponse } from "./pin"; +export type { CustomGetEntryOptions, CustomSetEntryOptions, SignedRegistryEntry, RegistryEntry } from "./registry"; +export type { CustomGetJSONOptions, CustomSetJSONOptions, JsonData, JSONResponse, RawBytesResponse } from "./skydb"; +export type { CustomUploadOptions, UploadRequestResponse } from "./upload"; +export type { ParseSkylinkOptions } from "./skylink/parse"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/index.d.ts.map b/node_modules/skynet-js/dist/cjs/index.d.ts.map new file mode 100644 index 0000000..e5043ee --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAI5B,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACnE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC5E,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnH,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpH,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC3E,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/index.js b/node_modules/skynet-js/dist/cjs/index.js new file mode 100644 index 0000000..38180ef --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/index.js @@ -0,0 +1,61 @@ +"use strict"; +/* istanbul ignore file */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PermLegacySkyID = exports.PermDiscoverable = exports.PermHidden = exports.PermWrite = exports.PermRead = exports.PermType = exports.PermCategory = exports.Permission = exports.uriSkynetPrefix = exports.uriHandshakePrefix = exports.getFullDomainUrlForPortal = exports.extractDomainForPortal = exports.defaultSkynetPortalUrl = exports.defaultPortalUrl = exports.uint8ArrayToStringUtf8 = exports.stringToUint8ArrayUtf8 = exports.MAX_REVISION = exports.getRootDirectory = exports.getRelativeFilePath = exports.isSkylinkV2 = exports.isSkylinkV1 = exports.parseSkylink = exports.convertSkylinkToBase64 = exports.convertSkylinkToBase32 = exports.deriveDiscoverableFileTweak = exports.ENCRYPTION_PATH_SEED_LENGTH = exports.deriveEncryptedFileTweak = exports.deriveEncryptedFileSeed = exports.deriveEncryptedFileKeyEntropy = exports.mySkyDevDomain = exports.mySkyDomain = exports.MySky = exports.DacLibrary = exports.signEntry = exports.getEntryUrlForPortal = exports.getSkylinkUrlForPortal = exports.genKeyPairFromSeed = exports.genKeyPairAndSeed = exports.deriveChildSeed = exports.HASH_LENGTH = exports.SkynetClient = void 0; +var client_1 = require("./client"); +Object.defineProperty(exports, "SkynetClient", { enumerable: true, get: function () { return client_1.SkynetClient; } }); +var crypto_1 = require("./crypto"); +Object.defineProperty(exports, "HASH_LENGTH", { enumerable: true, get: function () { return crypto_1.HASH_LENGTH; } }); +Object.defineProperty(exports, "deriveChildSeed", { enumerable: true, get: function () { return crypto_1.deriveChildSeed; } }); +Object.defineProperty(exports, "genKeyPairAndSeed", { enumerable: true, get: function () { return crypto_1.genKeyPairAndSeed; } }); +Object.defineProperty(exports, "genKeyPairFromSeed", { enumerable: true, get: function () { return crypto_1.genKeyPairFromSeed; } }); +var download_1 = require("./download"); +Object.defineProperty(exports, "getSkylinkUrlForPortal", { enumerable: true, get: function () { return download_1.getSkylinkUrlForPortal; } }); +var registry_1 = require("./registry"); +Object.defineProperty(exports, "getEntryUrlForPortal", { enumerable: true, get: function () { return registry_1.getEntryUrlForPortal; } }); +Object.defineProperty(exports, "signEntry", { enumerable: true, get: function () { return registry_1.signEntry; } }); +var mysky_1 = require("./mysky"); +Object.defineProperty(exports, "DacLibrary", { enumerable: true, get: function () { return mysky_1.DacLibrary; } }); +Object.defineProperty(exports, "MySky", { enumerable: true, get: function () { return mysky_1.MySky; } }); +Object.defineProperty(exports, "mySkyDomain", { enumerable: true, get: function () { return mysky_1.mySkyDomain; } }); +Object.defineProperty(exports, "mySkyDevDomain", { enumerable: true, get: function () { return mysky_1.mySkyDevDomain; } }); +var encrypted_files_1 = require("./mysky/encrypted_files"); +Object.defineProperty(exports, "deriveEncryptedFileKeyEntropy", { enumerable: true, get: function () { return encrypted_files_1.deriveEncryptedFileKeyEntropy; } }); +Object.defineProperty(exports, "deriveEncryptedFileSeed", { enumerable: true, get: function () { return encrypted_files_1.deriveEncryptedFileSeed; } }); +Object.defineProperty(exports, "deriveEncryptedFileTweak", { enumerable: true, get: function () { return encrypted_files_1.deriveEncryptedFileTweak; } }); +Object.defineProperty(exports, "ENCRYPTION_PATH_SEED_LENGTH", { enumerable: true, get: function () { return encrypted_files_1.ENCRYPTION_PATH_SEED_LENGTH; } }); +var tweak_1 = require("./mysky/tweak"); +Object.defineProperty(exports, "deriveDiscoverableFileTweak", { enumerable: true, get: function () { return tweak_1.deriveDiscoverableFileTweak; } }); +var format_1 = require("./skylink/format"); +Object.defineProperty(exports, "convertSkylinkToBase32", { enumerable: true, get: function () { return format_1.convertSkylinkToBase32; } }); +Object.defineProperty(exports, "convertSkylinkToBase64", { enumerable: true, get: function () { return format_1.convertSkylinkToBase64; } }); +var parse_1 = require("./skylink/parse"); +Object.defineProperty(exports, "parseSkylink", { enumerable: true, get: function () { return parse_1.parseSkylink; } }); +var sia_1 = require("./skylink/sia"); +Object.defineProperty(exports, "isSkylinkV1", { enumerable: true, get: function () { return sia_1.isSkylinkV1; } }); +Object.defineProperty(exports, "isSkylinkV2", { enumerable: true, get: function () { return sia_1.isSkylinkV2; } }); +var file_1 = require("./utils/file"); +Object.defineProperty(exports, "getRelativeFilePath", { enumerable: true, get: function () { return file_1.getRelativeFilePath; } }); +Object.defineProperty(exports, "getRootDirectory", { enumerable: true, get: function () { return file_1.getRootDirectory; } }); +var number_1 = require("./utils/number"); +Object.defineProperty(exports, "MAX_REVISION", { enumerable: true, get: function () { return number_1.MAX_REVISION; } }); +var string_1 = require("./utils/string"); +Object.defineProperty(exports, "stringToUint8ArrayUtf8", { enumerable: true, get: function () { return string_1.stringToUint8ArrayUtf8; } }); +Object.defineProperty(exports, "uint8ArrayToStringUtf8", { enumerable: true, get: function () { return string_1.uint8ArrayToStringUtf8; } }); +var url_1 = require("./utils/url"); +Object.defineProperty(exports, "defaultPortalUrl", { enumerable: true, get: function () { return url_1.defaultPortalUrl; } }); +Object.defineProperty(exports, "defaultSkynetPortalUrl", { enumerable: true, get: function () { return url_1.defaultSkynetPortalUrl; } }); +Object.defineProperty(exports, "extractDomainForPortal", { enumerable: true, get: function () { return url_1.extractDomainForPortal; } }); +Object.defineProperty(exports, "getFullDomainUrlForPortal", { enumerable: true, get: function () { return url_1.getFullDomainUrlForPortal; } }); +Object.defineProperty(exports, "uriHandshakePrefix", { enumerable: true, get: function () { return url_1.uriHandshakePrefix; } }); +Object.defineProperty(exports, "uriSkynetPrefix", { enumerable: true, get: function () { return url_1.uriSkynetPrefix; } }); +// Re-export Permission API. +var skynet_mysky_utils_1 = require("skynet-mysky-utils"); +Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return skynet_mysky_utils_1.Permission; } }); +Object.defineProperty(exports, "PermCategory", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermCategory; } }); +Object.defineProperty(exports, "PermType", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermType; } }); +Object.defineProperty(exports, "PermRead", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermRead; } }); +Object.defineProperty(exports, "PermWrite", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermWrite; } }); +Object.defineProperty(exports, "PermHidden", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermHidden; } }); +Object.defineProperty(exports, "PermDiscoverable", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermDiscoverable; } }); +Object.defineProperty(exports, "PermLegacySkyID", { enumerable: true, get: function () { return skynet_mysky_utils_1.PermLegacySkyID; } }); diff --git a/node_modules/skynet-js/dist/cjs/mysky/connector.d.ts b/node_modules/skynet-js/dist/cjs/mysky/connector.d.ts new file mode 100644 index 0000000..1062df7 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/connector.d.ts @@ -0,0 +1,36 @@ +import { Connection } from "post-me"; +import { SkynetClient } from "../client"; +/** + * Custom connector options. + * + * @property [dev] - Whether to use the dev build of mysky. It is functionally equivalent to the default production mysky, except that all permissions are granted automatically and data lives in a separate sandbox from production. + * @property [debug] - Whether to tell mysky and DACs to print debug messages. + * @property [alpha] - Whether to use the alpha build of mysky. This is the build where development occurs and it can be expected to break. This takes precedence over the 'dev' option if that is also set. + * @property [handshakeMaxAttempts=150] - The amount of handshake attempts to make when starting a connection. + * @property [handshakeAttemptsInterval=100] - The time interval to wait between handshake attempts. + */ +export declare type CustomConnectorOptions = { + dev?: boolean; + debug?: boolean; + alpha?: boolean; + handshakeMaxAttempts?: number; + handshakeAttemptsInterval?: number; +}; +export declare const defaultConnectorOptions: { + dev: boolean; + debug: boolean; + alpha: boolean; + handshakeMaxAttempts: number; + handshakeAttemptsInterval: number; +}; +export declare class Connector { + url: string; + client: SkynetClient; + childFrame: HTMLIFrameElement; + connection: Connection; + options: CustomConnectorOptions; + constructor(url: string, client: SkynetClient, childFrame: HTMLIFrameElement, connection: Connection, options: CustomConnectorOptions); + static init(client: SkynetClient, domain: string, customOptions?: CustomConnectorOptions): Promise; + call(method: string, ...args: unknown[]): Promise; +} +//# sourceMappingURL=connector.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/connector.d.ts.map b/node_modules/skynet-js/dist/cjs/mysky/connector.d.ts.map new file mode 100644 index 0000000..0165d95 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/connector.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/mysky/connector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAoC,MAAM,SAAS,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;;GAQG;AACH,oBAAY,sBAAsB,GAAG;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;CAMnC,CAAC;AAEF,qBAAa,SAAS;IAEX,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,sBAAsB;gBAJ/B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,sBAAsB;WAK3B,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsC7G,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGjE"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/connector.js b/node_modules/skynet-js/dist/cjs/mysky/connector.js new file mode 100644 index 0000000..a7f735a --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/connector.js @@ -0,0 +1,58 @@ +"use strict"; +/* istanbul ignore file */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Connector = exports.defaultConnectorOptions = void 0; +const post_me_1 = require("post-me"); +const skynet_mysky_utils_1 = require("skynet-mysky-utils"); +const url_1 = require("../utils/url"); +exports.defaultConnectorOptions = { + dev: false, + debug: false, + alpha: false, + handshakeMaxAttempts: skynet_mysky_utils_1.defaultHandshakeMaxAttempts, + handshakeAttemptsInterval: skynet_mysky_utils_1.defaultHandshakeAttemptsInterval, +}; +class Connector { + constructor(url, client, childFrame, connection, options) { + this.url = url; + this.client = client; + this.childFrame = childFrame; + this.connection = connection; + this.options = options; + } + // Static initializer + static async init(client, domain, customOptions) { + const opts = { ...exports.defaultConnectorOptions, ...customOptions }; + // Get the URL for the domain on the current portal. + let domainUrl = await client.getFullDomainUrl(domain); + if (opts.dev) { + domainUrl = url_1.addUrlQuery(domainUrl, { dev: "true" }); + } + if (opts.debug) { + domainUrl = url_1.addUrlQuery(domainUrl, { debug: "true" }); + } + if (opts.alpha) { + domainUrl = url_1.addUrlQuery(domainUrl, { alpha: "true" }); + } + // Create the iframe. + const childFrame = skynet_mysky_utils_1.createIframe(domainUrl, domainUrl); + // The frame window should always exist. Sanity check + make TS happy. + if (!childFrame.contentWindow) { + throw new Error("'childFrame.contentWindow' was null"); + } + const childWindow = childFrame.contentWindow; + // Connect to the iframe. + const messenger = new post_me_1.WindowMessenger({ + localWindow: window, + remoteWindow: childWindow, + remoteOrigin: "*", + }); + const connection = await post_me_1.ParentHandshake(messenger, {}, opts.handshakeMaxAttempts, opts.handshakeAttemptsInterval); + // Construct the component connector. + return new Connector(domainUrl, client, childFrame, connection, opts); + } + async call(method, ...args) { + return this.connection.remoteHandle().call(method, ...args); + } +} +exports.Connector = Connector; diff --git a/node_modules/skynet-js/dist/cjs/mysky/dac.d.ts b/node_modules/skynet-js/dist/cjs/mysky/dac.d.ts new file mode 100644 index 0000000..94d713b --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/dac.d.ts @@ -0,0 +1,12 @@ +import { Permission } from "skynet-mysky-utils"; +import { SkynetClient } from "../client"; +import { Connector, CustomConnectorOptions } from "./connector"; +export declare abstract class DacLibrary { + protected dacDomain: string; + protected connector?: Connector; + constructor(dacDomain: string); + init(client: SkynetClient, customOptions: CustomConnectorOptions): Promise; + abstract getPermissions(): Permission[]; + onUserLogin(): void; +} +//# sourceMappingURL=dac.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/dac.d.ts.map b/node_modules/skynet-js/dist/cjs/mysky/dac.d.ts.map new file mode 100644 index 0000000..af2bd90 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/dac.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dac.d.ts","sourceRoot":"","sources":["../../../src/mysky/dac.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEhE,8BAAsB,UAAU;IAGX,SAAS,CAAC,SAAS,EAAE,MAAM;IAF9C,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;gBAEH,SAAS,EAAE,MAAM;IAEjC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7F,QAAQ,CAAC,cAAc,IAAI,UAAU,EAAE;IAEvC,WAAW,IAAI,IAAI;CAOpB"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/dac.js b/node_modules/skynet-js/dist/cjs/mysky/dac.js new file mode 100644 index 0000000..9b9025f --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/dac.js @@ -0,0 +1,21 @@ +"use strict"; +/* istanbul ignore file */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DacLibrary = void 0; +const connector_1 = require("./connector"); +class DacLibrary { + constructor(dacDomain) { + this.dacDomain = dacDomain; + } + async init(client, customOptions) { + this.connector = await connector_1.Connector.init(client, this.dacDomain, customOptions); + await this.connector.connection.remoteHandle().call("init"); + } + onUserLogin() { + if (!this.connector) { + throw new Error("init was not called"); + } + this.connector.connection.remoteHandle().call("onUserLogin"); + } +} +exports.DacLibrary = DacLibrary; diff --git a/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.d.ts b/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.d.ts new file mode 100644 index 0000000..a9f4af8 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.d.ts @@ -0,0 +1,127 @@ +import { JsonData } from "../skydb"; +/** + * The current response version for encrypted JSON files. Part of the metadata + * prepended to encrypted data. + */ +export declare const ENCRYPTED_JSON_RESPONSE_VERSION = 1; +/** + * The length of the encryption key. + */ +export declare const ENCRYPTION_KEY_LENGTH = 32; +/** + * The length of the hidden field metadata stored along with encrypted files. + * Note that this is hidden from the user, but not actually encrypted. It is + * stored after the nonce. + */ +export declare const ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH = 16; +/** + * The length of the random nonce, prepended to the encrypted bytes. It comes + * before the unencrypted hidden field metadata. + */ +export declare const ENCRYPTION_NONCE_LENGTH = 24; +/** + * The length of the share-able path seed. + */ +export declare const ENCRYPTION_PATH_SEED_LENGTH = 32; +export declare type EncryptedJSONResponse = { + data: JsonData | null; +}; +declare type EncryptedFileMetadata = { + version: number; +}; +/** + * Decrypts the given bytes as an encrypted JSON file. + * + * @param data - The given raw bytes. + * @param key - The encryption key. + * @returns - The JSON data and metadata. + * @throws - Will throw if the bytes could not be decrypted. + */ +export declare function decryptJSONFile(data: Uint8Array, key: Uint8Array): JsonData; +/** + * Encrypts the given JSON data and metadata. + * + * @param json - The given JSON data. + * @param metadata - The given metadata. + * @param key - The encryption key. + * @returns - The encrypted data. + */ +export declare function encryptJSONFile(json: JsonData, metadata: EncryptedFileMetadata, key: Uint8Array): Uint8Array; +/** + * Derives key entropy for the given path seed. + * + * @param pathSeed - The given path seed. + * @returns - The key entropy. + */ +export declare function deriveEncryptedFileKeyEntropy(pathSeed: string): Uint8Array; +/** + * Derives the encrypted file tweak for the given path seed. + * + * @param pathSeed - the given path seed. + * @returns - The encrypted file tweak. + */ +export declare function deriveEncryptedFileTweak(pathSeed: string): string; +/** + * Derives the path seed for the relative path, given the starting path seed and + * whether it is a directory. The path can be an absolute path if the root seed + * is given. + * + * @param pathSeed - The given starting path seed. + * @param subPath - The path. + * @param isDirectory - Whether the path is a directory. + * @returns - The path seed for the given path. + */ +export declare function deriveEncryptedFileSeed(pathSeed: string, subPath: string, isDirectory: boolean): string; +/** + * To prevent analysis that can occur by looking at the sizes of files, all + * encrypted files will be padded to the nearest "pad block" (after encryption). + * A pad block is minimally 4 kib in size, is always a power of 2, and is always + * at least 5% of the size of the file. + * + * For example, a 1 kib encrypted file would be padded to 4 kib, a 5 kib file + * would be padded to 8 kib, and a 105 kib file would be padded to 112 kib. + * Below is a short table of valid file sizes: + * + * ``` + * 4 KiB 8 KiB 12 KiB 16 KiB 20 KiB + * 24 KiB 28 KiB 32 KiB 36 KiB 40 KiB + * 44 KiB 48 KiB 52 KiB 56 KiB 60 KiB + * 64 KiB 68 KiB 72 KiB 76 KiB 80 KiB + * + * 88 KiB 96 KiB 104 KiB 112 KiB 120 KiB + * 128 KiB 136 KiB 144 KiB 152 KiB 160 KiB + * + * 176 KiB 192 Kib 208 KiB 224 KiB 240 KiB + * 256 KiB 272 KiB 288 KiB 304 KiB 320 KiB + * + * 352 KiB ... etc + * ``` + * + * Note that the first 20 valid sizes are all a multiple of 4 KiB, the next 10 + * are a multiple of 8 KiB, and each 10 after that the multiple doubles. We use + * this method of padding files to prevent an adversary from guessing the + * contents or structure of the file based on its size. + * + * @param initialSize - The size of the file. + * @returns - The final size, padded to a pad block. + * @throws - Will throw if the size would overflow the JS number type. + */ +export declare function padFileSize(initialSize: number): number; +/** + * Checks if the given size corresponds to the correct padded block. + * + * @param size - The given file size. + * @returns - Whether the size corresponds to a padded block. + * @throws - Will throw if the size would overflow the JS number type. + */ +export declare function checkPaddedBlock(size: number): boolean; +/** + * Encodes the given encrypted file metadata. + * + * @param metadata - The given metadata. + * @returns - The encoded metadata bytes. + * @throws - Will throw if the version does not fit in a byte. + */ +export declare function encodeEncryptedFileMetadata(metadata: EncryptedFileMetadata): Uint8Array; +export {}; +//# sourceMappingURL=encrypted_files.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.d.ts.map b/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.d.ts.map new file mode 100644 index 0000000..2d00efe --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encrypted_files.d.ts","sourceRoot":"","sources":["../../../src/mysky/encrypted_files.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAYpC;;;GAGG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAO1C;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAW9C,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB,CAAC;AAQF,aAAK,qBAAqB,GAAG;IAE3B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,QAAQ,CA2C3E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAyB5G;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAK1E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,CAuBvG;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAevD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWtD;AAoBD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,UAAU,CAWvF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.js b/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.js new file mode 100644 index 0000000..2f6c45d --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/encrypted_files.js @@ -0,0 +1,288 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.encodeEncryptedFileMetadata = exports.checkPaddedBlock = exports.padFileSize = exports.deriveEncryptedFileSeed = exports.deriveEncryptedFileTweak = exports.deriveEncryptedFileKeyEntropy = exports.encryptJSONFile = exports.decryptJSONFile = exports.ENCRYPTION_PATH_SEED_LENGTH = exports.ENCRYPTION_NONCE_LENGTH = exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH = exports.ENCRYPTION_KEY_LENGTH = exports.ENCRYPTED_JSON_RESPONSE_VERSION = void 0; +const randombytes_1 = __importDefault(require("randombytes")); +const skynet_mysky_utils_1 = require("skynet-mysky-utils"); +const tweetnacl_1 = require("tweetnacl"); +const crypto_1 = require("../crypto"); +const string_1 = require("../utils/string"); +const validation_1 = require("../utils/validation"); +/** + * The current response version for encrypted JSON files. Part of the metadata + * prepended to encrypted data. + */ +exports.ENCRYPTED_JSON_RESPONSE_VERSION = 1; +/** + * The length of the encryption key. + */ +exports.ENCRYPTION_KEY_LENGTH = 32; +/** + * The length of the hidden field metadata stored along with encrypted files. + * Note that this is hidden from the user, but not actually encrypted. It is + * stored after the nonce. + */ +exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH = 16; +/** + * The length of the random nonce, prepended to the encrypted bytes. It comes + * before the unencrypted hidden field metadata. + */ +exports.ENCRYPTION_NONCE_LENGTH = 24; +/** + * The length of the overhead introduced by encryption. + */ +const ENCRYPTION_OVERHEAD_LENGTH = 16; +/** + * The length of the share-able path seed. + */ +exports.ENCRYPTION_PATH_SEED_LENGTH = 32; +// Descriptive salt that should not be changed. +const SALT_ENCRYPTED_CHILD = "encrypted filesystem child"; +// Descriptive salt that should not be changed. +const SALT_ENCRYPTED_TWEAK = "encrypted filesystem tweak"; +// Descriptive salt that should not be changed. +const SALT_ENCRYPTION = "encryption"; +/** + * Decrypts the given bytes as an encrypted JSON file. + * + * @param data - The given raw bytes. + * @param key - The encryption key. + * @returns - The JSON data and metadata. + * @throws - Will throw if the bytes could not be decrypted. + */ +function decryptJSONFile(data, key) { + validation_1.validateUint8Array("data", data, "parameter"); + validation_1.validateUint8ArrayLen("key", key, "parameter", exports.ENCRYPTION_KEY_LENGTH); + // Validate that the size of the data corresponds to a padded block. + if (!checkPaddedBlock(data.length)) { + throw new Error(`Expected parameter 'data' to be padded encrypted data, length was '${data.length}', nearest padded block is '${padFileSize(data.length)}'`); + } + // Extract the nonce. + const nonce = data.slice(0, exports.ENCRYPTION_NONCE_LENGTH); + data = data.slice(exports.ENCRYPTION_NONCE_LENGTH); + // Extract the unencrypted hidden field metadata. + const metadataBytes = data.slice(0, exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + data = data.slice(exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + const metadata = decodeEncryptedFileMetadata(metadataBytes); + if (metadata.version !== exports.ENCRYPTED_JSON_RESPONSE_VERSION) { + throw new Error(`Received unrecognized JSON response version '${metadata.version}' in metadata, expected '${exports.ENCRYPTED_JSON_RESPONSE_VERSION}'`); + } + // Decrypt the non-nonce part of the data. + let decryptedBytes = tweetnacl_1.secretbox.open(data, nonce, key); + if (!decryptedBytes) { + throw new Error("Could not decrypt given encrypted JSON file"); + } + // Trim the 0-byte padding off the end of the decrypted bytes. This should never remove real data as + // properly-formatted JSON must end with '}'. + let paddingIndex = decryptedBytes.length; + while (paddingIndex > 0 && decryptedBytes[paddingIndex - 1] === 0) { + paddingIndex--; + } + decryptedBytes = decryptedBytes.slice(0, paddingIndex); + // Parse the final decrypted message as json. + return JSON.parse(string_1.uint8ArrayToStringUtf8(decryptedBytes)); +} +exports.decryptJSONFile = decryptJSONFile; +/** + * Encrypts the given JSON data and metadata. + * + * @param json - The given JSON data. + * @param metadata - The given metadata. + * @param key - The encryption key. + * @returns - The encrypted data. + */ +function encryptJSONFile(json, metadata, key) { + validation_1.validateObject("json", json, "parameter"); + validation_1.validateNumber("metadata.version", metadata.version, "parameter"); + validation_1.validateUint8ArrayLen("key", key, "parameter", exports.ENCRYPTION_KEY_LENGTH); + // Stringify the json and convert to bytes. + let data = string_1.stringToUint8ArrayUtf8(JSON.stringify(json)); + // Add padding so that the final size will be a padded block. The overhead will be added by encryption and we add the nonce at the end. + const totalOverhead = ENCRYPTION_OVERHEAD_LENGTH + exports.ENCRYPTION_NONCE_LENGTH + exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH; + const finalSize = padFileSize(data.length + totalOverhead) - totalOverhead; + data = new Uint8Array([...data, ...new Uint8Array(finalSize - data.length)]); + // Generate a random nonce. + const nonce = new Uint8Array(randombytes_1.default(exports.ENCRYPTION_NONCE_LENGTH)); + // Encrypt the data. + const encryptedBytes = tweetnacl_1.secretbox(data, nonce, key); + // Prepend the metadata. + const metadataBytes = encodeEncryptedFileMetadata(metadata); + const finalBytes = new Uint8Array([...metadataBytes, ...encryptedBytes]); + // Prepend the nonce to the final data. + return new Uint8Array([...nonce, ...finalBytes]); +} +exports.encryptJSONFile = encryptJSONFile; +/** + * Derives key entropy for the given path seed. + * + * @param pathSeed - The given path seed. + * @returns - The key entropy. + */ +function deriveEncryptedFileKeyEntropy(pathSeed) { + const bytes = new Uint8Array([...crypto_1.sha512(SALT_ENCRYPTION), ...crypto_1.sha512(pathSeed)]); + const hashBytes = crypto_1.sha512(bytes); + // Truncate the hash to the size of an encryption key. + return hashBytes.slice(0, exports.ENCRYPTION_KEY_LENGTH); +} +exports.deriveEncryptedFileKeyEntropy = deriveEncryptedFileKeyEntropy; +/** + * Derives the encrypted file tweak for the given path seed. + * + * @param pathSeed - the given path seed. + * @returns - The encrypted file tweak. + */ +function deriveEncryptedFileTweak(pathSeed) { + let hashBytes = crypto_1.sha512(new Uint8Array([...crypto_1.sha512(SALT_ENCRYPTED_TWEAK), ...crypto_1.sha512(pathSeed)])); + // Truncate the hash or it will be rejected in skyd. + hashBytes = hashBytes.slice(0, crypto_1.HASH_LENGTH); + return string_1.toHexString(hashBytes); +} +exports.deriveEncryptedFileTweak = deriveEncryptedFileTweak; +/** + * Derives the path seed for the relative path, given the starting path seed and + * whether it is a directory. The path can be an absolute path if the root seed + * is given. + * + * @param pathSeed - The given starting path seed. + * @param subPath - The path. + * @param isDirectory - Whether the path is a directory. + * @returns - The path seed for the given path. + */ +function deriveEncryptedFileSeed(pathSeed, subPath, isDirectory) { + validation_1.validateHexString("pathSeed", pathSeed, "parameter"); + validation_1.validateString("subPath", subPath, "parameter"); + validation_1.validateBoolean("isDirectory", isDirectory, "parameter"); + let pathSeedBytes = string_1.hexToUint8Array(pathSeed); + subPath = skynet_mysky_utils_1.sanitizePath(subPath); + const names = subPath.split("/"); + names.forEach((name, index) => { + const directory = index === names.length - 1 ? isDirectory : true; + const derivationPathObj = { + pathSeed: pathSeedBytes, + directory, + name, + }; + const derivationPath = hashDerivationPathObject(derivationPathObj); + const bytes = new Uint8Array([...crypto_1.sha512(SALT_ENCRYPTED_CHILD), ...derivationPath]); + pathSeedBytes = crypto_1.sha512(bytes); + }); + // Truncate and hex-encode the final output. + return string_1.toHexString(pathSeedBytes.slice(0, exports.ENCRYPTION_PATH_SEED_LENGTH)); +} +exports.deriveEncryptedFileSeed = deriveEncryptedFileSeed; +/** + * Hashes the derivation path object. + * + * @param obj - The given object containing the derivation path. + * @returns - The hash. + */ +function hashDerivationPathObject(obj) { + const bytes = new Uint8Array([...obj.pathSeed, obj.directory ? 1 : 0, ...string_1.stringToUint8ArrayUtf8(obj.name)]); + return crypto_1.sha512(bytes); +} +/** + * To prevent analysis that can occur by looking at the sizes of files, all + * encrypted files will be padded to the nearest "pad block" (after encryption). + * A pad block is minimally 4 kib in size, is always a power of 2, and is always + * at least 5% of the size of the file. + * + * For example, a 1 kib encrypted file would be padded to 4 kib, a 5 kib file + * would be padded to 8 kib, and a 105 kib file would be padded to 112 kib. + * Below is a short table of valid file sizes: + * + * ``` + * 4 KiB 8 KiB 12 KiB 16 KiB 20 KiB + * 24 KiB 28 KiB 32 KiB 36 KiB 40 KiB + * 44 KiB 48 KiB 52 KiB 56 KiB 60 KiB + * 64 KiB 68 KiB 72 KiB 76 KiB 80 KiB + * + * 88 KiB 96 KiB 104 KiB 112 KiB 120 KiB + * 128 KiB 136 KiB 144 KiB 152 KiB 160 KiB + * + * 176 KiB 192 Kib 208 KiB 224 KiB 240 KiB + * 256 KiB 272 KiB 288 KiB 304 KiB 320 KiB + * + * 352 KiB ... etc + * ``` + * + * Note that the first 20 valid sizes are all a multiple of 4 KiB, the next 10 + * are a multiple of 8 KiB, and each 10 after that the multiple doubles. We use + * this method of padding files to prevent an adversary from guessing the + * contents or structure of the file based on its size. + * + * @param initialSize - The size of the file. + * @returns - The final size, padded to a pad block. + * @throws - Will throw if the size would overflow the JS number type. + */ +function padFileSize(initialSize) { + const kib = 1 << 10; + // Only iterate to 53 (the maximum safe power of 2). + for (let n = 0; n < 53; n++) { + if (initialSize <= (1 << n) * 80 * kib) { + const paddingBlock = (1 << n) * 4 * kib; + let finalSize = initialSize; + if (finalSize % paddingBlock !== 0) { + finalSize = initialSize - (initialSize % paddingBlock) + paddingBlock; + } + return finalSize; + } + } + // Prevent overflow. Max JS number size is 2^53-1. + throw new Error("Could not pad file size, overflow detected."); +} +exports.padFileSize = padFileSize; +/** + * Checks if the given size corresponds to the correct padded block. + * + * @param size - The given file size. + * @returns - Whether the size corresponds to a padded block. + * @throws - Will throw if the size would overflow the JS number type. + */ +function checkPaddedBlock(size) { + const kib = 1 << 10; + // Only iterate to 53 (the maximum safe power of 2). + for (let n = 0; n < 53; n++) { + if (size <= (1 << n) * 80 * kib) { + const paddingBlock = (1 << n) * 4 * kib; + return size % paddingBlock === 0; + } + } + // Prevent overflow. Max JS number size is 2^53-1. + throw new Error("Could not check padded file size, overflow detected."); +} +exports.checkPaddedBlock = checkPaddedBlock; +/** + * Decodes the encoded encrypted file metadata. + * + * @param bytes - The encoded metadata. + * @returns - The decoded metadata. + * @throws - Will throw if the given bytes are of the wrong length. + */ +function decodeEncryptedFileMetadata(bytes) { + // Ensure input is correct length. + validation_1.validateUint8ArrayLen("bytes", bytes, "encrypted file metadata bytes", exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + const version = bytes[0]; + return { + version, + }; +} +/** + * Encodes the given encrypted file metadata. + * + * @param metadata - The given metadata. + * @returns - The encoded metadata bytes. + * @throws - Will throw if the version does not fit in a byte. + */ +function encodeEncryptedFileMetadata(metadata) { + const bytes = new Uint8Array(exports.ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + // Encode the version + if (metadata.version >= 1 << 8 || metadata.version < 0) { + throw new Error(`Metadata version '${metadata.version}' could not be stored in a uint8`); + } + // Don't need to use a DataView or worry about endianness for a uint8. + bytes[0] = metadata.version; + return bytes; +} +exports.encodeEncryptedFileMetadata = encodeEncryptedFileMetadata; diff --git a/node_modules/skynet-js/dist/cjs/mysky/index.d.ts b/node_modules/skynet-js/dist/cjs/mysky/index.d.ts new file mode 100644 index 0000000..73c6d93 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/index.d.ts @@ -0,0 +1,171 @@ +export type { CustomConnectorOptions } from "./connector"; +export { DacLibrary } from "./dac"; +import { Connection } from "post-me"; +import { Permission } from "skynet-mysky-utils"; +import { Connector, CustomConnectorOptions } from "./connector"; +import { SkynetClient } from "../client"; +import { DacLibrary } from "./dac"; +import { CustomGetEntryOptions, RegistryEntry } from "../registry"; +import { CustomGetJSONOptions, CustomSetJSONOptions, JsonData, JSONResponse } from "../skydb"; +import { Signature } from "../crypto"; +import { EncryptedJSONResponse } from "./encrypted_files"; +export declare const mySkyDomain = "skynet-mysky.hns"; +export declare const mySkyDevDomain = "skynet-mysky-dev.hns"; +export declare const mySkyAlphaDomain = "sandbridge.hns"; +export declare const MAX_ENTRY_LENGTH = 70; +export declare type EntryData = { + data: Uint8Array | null; +}; +/** + * Loads MySky. Note that this does not log in the user. + * + * @param this - The Skynet client. + * @param skappDomain - The domain of the host skapp. For this domain permissions will be requested and, by default, automatically granted. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - Loaded (but not logged-in) MySky instance. + */ +export declare function loadMySky(this: SkynetClient, skappDomain?: string, customOptions?: CustomConnectorOptions): Promise; +export declare class MySky { + protected connector: Connector; + protected hostDomain: string; + static instance: MySky | null; + dacs: DacLibrary[]; + grantedPermissions: Permission[]; + pendingPermissions: Permission[]; + constructor(connector: Connector, permissions: Permission[], hostDomain: string); + static New(client: SkynetClient, skappDomain?: string, customOptions?: CustomConnectorOptions): Promise; + /** + * Loads the given DACs. + * + * @param dacs - The DAC library instances to call `init` on. + */ + loadDacs(...dacs: DacLibrary[]): Promise; + addPermissions(...permissions: Permission[]): Promise; + checkLogin(): Promise; + /** + * Destroys the mysky connection by: + * + * 1. Destroying the connected DACs. + * + * 2. Closing the connection. + * + * 3. Closing the child iframe. + * + * @throws - Will throw if there is an unexpected DOM error. + */ + destroy(): Promise; + logout(): Promise; + requestLoginAccess(): Promise; + userID(): Promise; + /** + * Gets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + getJSON(path: string, customOptions?: CustomGetJSONOptions): Promise; + /** + * Gets the entry link for the entry at the given path. This is a v2 skylink. + * This link stays the same even if the content at the entry changes. + * + * @param path - The data path. + * @returns - The entry link. + */ + getEntryLink(path: string): Promise; + /** + * Sets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + setJSON(path: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise; + /** + * Sets entry at the given path to point to the data link. Like setJSON, but it doesn't upload a file. + * + * @param path - The data path. + * @param dataLink - The data link to set at the path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + setDataLink(path: string, dataLink: string, customOptions?: CustomSetJSONOptions): Promise; + /** + * Deletes Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the revision is already the maximum value. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + deleteJSON(path: string, customOptions?: CustomSetJSONOptions): Promise; + /** + * Gets the raw registry entry data for the given path, if the user has given + * Discoverable Read permissions. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + getEntryData(path: string, customOptions?: CustomGetEntryOptions): Promise; + /** + * Sets the entry data at the given path, if the user has given Discoverable + * Write permissions. + * + * @param path - The data path. + * @param data - The raw entry data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the length of the data is > 70 bytes. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + setEntryData(path: string, data: Uint8Array, customOptions?: CustomSetJSONOptions): Promise; + /** + * Lets you get the share-able path seed, which can be passed to + * file.getJSONEncrypted. Requires Hidden Read permission on the path. + * + * @param path - The given path. + * @param isDirectory - Whether the path is a directory. + * @returns - The seed for the path. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + getEncryptedFileSeed(path: string, isDirectory: boolean): Promise; + /** + * Gets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + getJSONEncrypted(path: string, customOptions?: CustomGetJSONOptions): Promise; + /** + * Sets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to encrypt and set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the original json data. + * @throws - Will throw if the user does not have Hidden Write permission on the path. + */ + setJSONEncrypted(path: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise; + protected catchError(errorMsg: string): Promise; + protected launchUI(): Promise; + protected connectUi(childWindow: Window): Promise; + protected loadDac(dac: DacLibrary): Promise; + protected handleLogin(loggedIn: boolean): void; + protected signRegistryEntry(entry: RegistryEntry, path: string): Promise; + protected signEncryptedRegistryEntry(entry: RegistryEntry, path: string): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/index.d.ts.map b/node_modules/skynet-js/dist/cjs/mysky/index.d.ts.map new file mode 100644 index 0000000..c21ce56 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mysky/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAoC,MAAM,SAAS,CAAC;AACvE,OAAO,EAML,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAA2B,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAkD,aAAa,EAAE,MAAM,aAAa,CAAC;AACnH,OAAO,EAGL,oBAAoB,EACpB,oBAAoB,EAEpB,QAAQ,EACR,YAAY,EAGb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAatC,OAAO,EAIL,qBAAqB,EAGtB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAMnC,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,YAAY,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,sBAAsB,GACrC,OAAO,CAAC,KAAK,CAAC,CAIhB;AAED,qBAAa,KAAK;IAgBJ,SAAS,CAAC,SAAS,EAAE,SAAS;IAA6B,SAAS,CAAC,UAAU,EAAE,MAAM;IAfnG,MAAM,CAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,CAAQ;IAGrC,IAAI,EAAE,UAAU,EAAE,CAAM;IAGxB,kBAAkB,EAAE,UAAU,EAAE,CAAM;IAGtC,kBAAkB,EAAE,UAAU,EAAE,CAAC;gBAMX,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,EAAY,UAAU,EAAE,MAAM;WAItF,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,KAAK,CAAC;IAiCpH;;;;OAIG;IACG,QAAQ,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9C,cAAc,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAepC;;;;;;;;;;OAUG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBxB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAqEtC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/B;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IAiBxF;;;;;;OAMG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWjD;;;;;;;;;OASG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyBxG;;;;;;;;OAQG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BtG;;;;;;;;;OASG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BnF;;;;;;;;OAQG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqB3F;;;;;;;;;;OAUG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuC5G;;;;;;;;OAQG;IACG,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAO/E;;;;;;;;OAQG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA2B1G;;;;;;;;;OASG;IACG,gBAAgB,CACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,qBAAqB,CAAC;cAmCjB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAK3C,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;cAe3B,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;cAuBnD,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IASvD,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;cAQ9B,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;cAIzE,0BAA0B,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAGnG"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/index.js b/node_modules/skynet-js/dist/cjs/mysky/index.js new file mode 100644 index 0000000..086e416 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/index.js @@ -0,0 +1,508 @@ +"use strict"; +/* istanbul ignore file */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MySky = exports.loadMySky = exports.MAX_ENTRY_LENGTH = exports.mySkyAlphaDomain = exports.mySkyDevDomain = exports.mySkyDomain = exports.DacLibrary = void 0; +var dac_1 = require("./dac"); +Object.defineProperty(exports, "DacLibrary", { enumerable: true, get: function () { return dac_1.DacLibrary; } }); +const post_me_1 = require("post-me"); +const skynet_mysky_utils_1 = require("skynet-mysky-utils"); +const connector_1 = require("./connector"); +const registry_1 = require("../registry"); +const skydb_1 = require("../skydb"); +const tweak_1 = require("./tweak"); +const utils_1 = require("./utils"); +const options_1 = require("../utils/options"); +const validation_1 = require("../utils/validation"); +const sia_1 = require("../skylink/sia"); +const encrypted_files_1 = require("./encrypted_files"); +exports.mySkyDomain = "skynet-mysky.hns"; +exports.mySkyDevDomain = "skynet-mysky-dev.hns"; +exports.mySkyAlphaDomain = "sandbridge.hns"; +exports.MAX_ENTRY_LENGTH = 70; +const mySkyUiRelativeUrl = "ui.html"; +const mySkyUiTitle = "MySky UI"; +const [mySkyUiW, mySkyUiH] = [600, 600]; +/** + * Loads MySky. Note that this does not log in the user. + * + * @param this - The Skynet client. + * @param skappDomain - The domain of the host skapp. For this domain permissions will be requested and, by default, automatically granted. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - Loaded (but not logged-in) MySky instance. + */ +async function loadMySky(skappDomain, customOptions) { + const mySky = await MySky.New(this, skappDomain, customOptions); + return mySky; +} +exports.loadMySky = loadMySky; +class MySky { + // ============ + // Constructors + // ============ + constructor(connector, permissions, hostDomain) { + this.connector = connector; + this.hostDomain = hostDomain; + // Holds the loaded DACs. + this.dacs = []; + // Holds the currently granted permissions. + this.grantedPermissions = []; + this.pendingPermissions = permissions; + } + static async New(client, skappDomain, customOptions) { + const opts = { ...connector_1.defaultConnectorOptions, ...customOptions }; + // Enforce singleton. + if (MySky.instance) { + return MySky.instance; + } + let domain = exports.mySkyDomain; + if (opts.alpha) { + domain = exports.mySkyAlphaDomain; + } + else if (opts.dev) { + domain = exports.mySkyDevDomain; + } + const connector = await connector_1.Connector.init(client, domain, customOptions); + const hostDomain = await client.extractDomain(window.location.hostname); + const permissions = []; + if (skappDomain) { + // TODO: Are these permissions correct? + const perm1 = new skynet_mysky_utils_1.Permission(hostDomain, skappDomain, skynet_mysky_utils_1.PermCategory.Hidden, skynet_mysky_utils_1.PermType.Read); + const perm2 = new skynet_mysky_utils_1.Permission(hostDomain, skappDomain, skynet_mysky_utils_1.PermCategory.Hidden, skynet_mysky_utils_1.PermType.Write); + permissions.push(perm1, perm2); + } + MySky.instance = new MySky(connector, permissions, hostDomain); + return MySky.instance; + } + // ========== + // Public API + // ========== + /** + * Loads the given DACs. + * + * @param dacs - The DAC library instances to call `init` on. + */ + async loadDacs(...dacs) { + const promises = []; + for (const dac of dacs) { + promises.push(this.loadDac(dac)); + } + this.dacs.push(...dacs); + await Promise.all(promises); + } + async addPermissions(...permissions) { + this.pendingPermissions.push(...permissions); + } + async checkLogin() { + const [seedFound, permissionsResponse] = await this.connector.connection + .remoteHandle() + .call("checkLogin", this.pendingPermissions); + // Save granted and failed permissions. + const { grantedPermissions, failedPermissions } = permissionsResponse; + this.grantedPermissions = grantedPermissions; + this.pendingPermissions = failedPermissions; + const loggedIn = seedFound && failedPermissions.length === 0; + this.handleLogin(loggedIn); + return loggedIn; + } + /** + * Destroys the mysky connection by: + * + * 1. Destroying the connected DACs. + * + * 2. Closing the connection. + * + * 3. Closing the child iframe. + * + * @throws - Will throw if there is an unexpected DOM error. + */ + async destroy() { + // TODO: For all connected dacs, send a destroy call. + // TODO: Delete all connected dacs. + // Close the connection. + this.connector.connection.close(); + // Close the child iframe. + const frame = this.connector.childFrame; + if (frame) { + // The parent node should always exist. Sanity check + make TS happy. + if (!frame.parentNode) { + throw new Error("'childFrame.parentNode' was not set"); + } + frame.parentNode.removeChild(frame); + } + } + async logout() { + return await this.connector.connection.remoteHandle().call("logout"); + } + async requestLoginAccess() { + let uiWindow; + let uiConnection; + let seedFound = false; + // Add error listener. + const { promise: promiseError, controller: controllerError } = skynet_mysky_utils_1.monitorWindowError(); + // eslint-disable-next-line no-async-promise-executor + const promise = new Promise(async (resolve, reject) => { + // Make this promise run in the background and reject on window close or any errors. + promiseError.catch((err) => { + if (err === skynet_mysky_utils_1.errorWindowClosed) { + // Resolve without updating the pending permissions. + resolve(); + return; + } + reject(err); + }); + try { + // Launch the UI. + uiWindow = await this.launchUI(); + uiConnection = await this.connectUi(uiWindow); + // Send the UI the list of required permissions. + // TODO: This should be a dual-promise that also calls ping() on an interval and rejects if no response was found in a given amount of time. + const [seedFoundResponse, permissionsResponse] = await uiConnection + .remoteHandle() + .call("requestLoginAccess", this.pendingPermissions); + seedFound = seedFoundResponse; + // Save failed permissions. + const { grantedPermissions, failedPermissions } = permissionsResponse; + this.grantedPermissions = grantedPermissions; + this.pendingPermissions = failedPermissions; + resolve(); + } + catch (err) { + reject(err); + } + }); + await promise + .catch((err) => { + throw err; + }) + .finally(() => { + // Close the window. + if (uiWindow) { + uiWindow.close(); + } + // Close the connection. + if (uiConnection) { + uiConnection.close(); + } + // Clean up the event listeners and promises. + controllerError.cleanup(); + }); + const loggedIn = seedFound && this.pendingPermissions.length === 0; + this.handleLogin(loggedIn); + return loggedIn; + } + async userID() { + return await this.connector.connection.remoteHandle().call("userID"); + } + /** + * Gets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + async getJSON(path, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultGetJSONOptions); + const opts = { + ...skydb_1.defaultGetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + return await this.connector.client.db.getJSON(publicKey, dataKey, opts); + } + /** + * Gets the entry link for the entry at the given path. This is a v2 skylink. + * This link stays the same even if the content at the entry changes. + * + * @param path - The data path. + * @returns - The entry link. + */ + async getEntryLink(path) { + validation_1.validateString("path", path, "parameter"); + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + // Do not hash the tweak anymore. + const opts = { ...registry_1.defaultGetEntryOptions, hashedDataKeyHex: true }; + return await this.connector.client.registry.getEntryLink(publicKey, dataKey, opts); + } + /** + * Sets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async setJSON(path, json, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateObject("json", json, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultSetJSONOptions); + const opts = { + ...skydb_1.defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const [entry, dataLink] = await skydb_1.getOrCreateRegistryEntry(this.connector.client, publicKey, dataKey, json, opts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + return { data: json, dataLink }; + } + /** + * Sets entry at the given path to point to the data link. Like setJSON, but it doesn't upload a file. + * + * @param path - The data path. + * @param dataLink - The data link to set at the path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async setDataLink(path, dataLink, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateString("dataLink", dataLink, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultSetJSONOptions); + const opts = { + ...skydb_1.defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entry = await skydb_1.getNextRegistryEntry(this.connector.client, publicKey, dataKey, sia_1.decodeSkylink(dataLink), getEntryOpts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + } + /** + * Deletes Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the revision is already the maximum value. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async deleteJSON(path, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultSetJSONOptions); + const opts = { + ...skydb_1.defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entry = await skydb_1.getNextRegistryEntry(this.connector.client, publicKey, dataKey, new Uint8Array(sia_1.RAW_SKYLINK_SIZE), getEntryOpts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + } + /** + * Gets the raw registry entry data for the given path, if the user has given + * Discoverable Read permissions. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + async getEntryData(path, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", registry_1.defaultGetEntryOptions); + const opts = { + ...registry_1.defaultGetEntryOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const { entry } = await this.connector.client.registry.getEntry(publicKey, dataKey, opts); + if (!entry) { + return { data: null }; + } + return { data: entry.data }; + } + /** + * Sets the entry data at the given path, if the user has given Discoverable + * Write permissions. + * + * @param path - The data path. + * @param data - The raw entry data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the length of the data is > 70 bytes. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async setEntryData(path, data, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateUint8Array("data", data, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", registry_1.defaultSetEntryOptions); + if (data.length > exports.MAX_ENTRY_LENGTH) { + validation_1.throwValidationError("data", data, "parameter", `'Uint8Array' of length <= ${exports.MAX_ENTRY_LENGTH}, was length ${data.length}`); + } + const opts = { + ...skydb_1.defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = tweak_1.deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entry = await skydb_1.getNextRegistryEntry(this.connector.client, publicKey, dataKey, data, getEntryOpts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + return { data: entry.data }; + } + // =============== + // Encrypted Files + // =============== + /** + * Lets you get the share-able path seed, which can be passed to + * file.getJSONEncrypted. Requires Hidden Read permission on the path. + * + * @param path - The given path. + * @param isDirectory - Whether the path is a directory. + * @returns - The seed for the path. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + async getEncryptedFileSeed(path, isDirectory) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateBoolean("isDirectory", isDirectory, "parameter"); + return await this.connector.connection.remoteHandle().call("getEncryptedFileSeed", path, isDirectory); + } + /** + * Gets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + async getJSONEncrypted(path, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultGetJSONOptions); + const opts = { + ...skydb_1.defaultGetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + hashedDataKeyHex: true, // Do not hash the tweak anymore. + }; + // Call MySky which checks for read permissions on the path. + const [publicKey, pathSeed] = await Promise.all([this.userID(), this.getEncryptedFileSeed(path, false)]); + // Fetch the raw encrypted JSON data. + const dataKey = encrypted_files_1.deriveEncryptedFileTweak(pathSeed); + const { data } = await this.connector.client.db.getRawBytes(publicKey, dataKey, opts); + if (data === null) { + return { data: null }; + } + const encryptionKey = encrypted_files_1.deriveEncryptedFileKeyEntropy(pathSeed); + const json = encrypted_files_1.decryptJSONFile(data, encryptionKey); + return { data: json }; + } + /** + * Sets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to encrypt and set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the original json data. + * @throws - Will throw if the user does not have Hidden Write permission on the path. + */ + async setJSONEncrypted(path, json, customOptions) { + validation_1.validateString("path", path, "parameter"); + validation_1.validateObject("json", json, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", skydb_1.defaultSetJSONOptions); + const opts = { + ...skydb_1.defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + // Call MySky which checks for read permissions on the path. + const [publicKey, pathSeed] = await Promise.all([this.userID(), this.getEncryptedFileSeed(path, false)]); + const dataKey = encrypted_files_1.deriveEncryptedFileTweak(pathSeed); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const encryptionKey = encrypted_files_1.deriveEncryptedFileKeyEntropy(pathSeed); + // Pad and encrypt json file. + const data = encrypted_files_1.encryptJSONFile(json, { version: encrypted_files_1.ENCRYPTED_JSON_RESPONSE_VERSION }, encryptionKey); + const entry = await skydb_1.getOrCreateRawBytesRegistryEntry(this.connector.client, publicKey, dataKey, data, opts); + // Call MySky which checks for write permissions on the path. + const signature = await this.signEncryptedRegistryEntry(entry, path); + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + return { data: json }; + } + // ================ + // Internal Methods + // ================ + async catchError(errorMsg) { + const event = new CustomEvent(skynet_mysky_utils_1.dispatchedErrorEvent, { detail: errorMsg }); + window.dispatchEvent(event); + } + async launchUI() { + const mySkyUrl = new URL(this.connector.url); + mySkyUrl.pathname = mySkyUiRelativeUrl; + const uiUrl = mySkyUrl.toString(); + // Open the window. + const childWindow = utils_1.popupCenter(uiUrl, mySkyUiTitle, mySkyUiW, mySkyUiH); + if (!childWindow) { + throw new Error(`Could not open window at '${uiUrl}'`); + } + return childWindow; + } + async connectUi(childWindow) { + const options = this.connector.options; + // Complete handshake with UI window. + const messenger = new post_me_1.WindowMessenger({ + localWindow: window, + remoteWindow: childWindow, + remoteOrigin: "*", + }); + const methods = { + catchError: this.catchError, + }; + const connection = await post_me_1.ParentHandshake(messenger, methods, options.handshakeMaxAttempts, options.handshakeAttemptsInterval); + return connection; + } + async loadDac(dac) { + // Initialize DAC. + await dac.init(this.connector.client, this.connector.options); + // Add DAC permissions. + const perms = dac.getPermissions(); + this.addPermissions(...perms); + } + handleLogin(loggedIn) { + if (loggedIn) { + for (const dac of this.dacs) { + dac.onUserLogin(); + } + } + } + async signRegistryEntry(entry, path) { + return await this.connector.connection.remoteHandle().call("signRegistryEntry", entry, path); + } + async signEncryptedRegistryEntry(entry, path) { + return await this.connector.connection.remoteHandle().call("signEncryptedRegistryEntry", entry, path); + } +} +exports.MySky = MySky; +MySky.instance = null; diff --git a/node_modules/skynet-js/dist/cjs/mysky/tweak.d.ts b/node_modules/skynet-js/dist/cjs/mysky/tweak.d.ts new file mode 100644 index 0000000..ceee529 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/tweak.d.ts @@ -0,0 +1,29 @@ +/** + * Derives the discoverable file tweak for the given path. + * + * @param path - The given path. + * @returns - The hex-encoded tweak. + */ +export declare function deriveDiscoverableFileTweak(path: string): string; +export declare class DiscoverableBucketTweak { + version: number; + path: Array; + constructor(path: string); + encode(): Uint8Array; + getHash(): Uint8Array; +} +/** + * Splits the path by forward slashes. + * + * @param path - The path to split. + * @returns - An array of path components. + */ +export declare function splitPath(path: string): Array; +/** + * Hashes the path component. + * + * @param component - The component extracted from the path. + * @returns - The hash. + */ +export declare function hashPathComponent(component: string): Uint8Array; +//# sourceMappingURL=tweak.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/tweak.d.ts.map b/node_modules/skynet-js/dist/cjs/mysky/tweak.d.ts.map new file mode 100644 index 0000000..35e6bd2 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/tweak.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tweak.d.ts","sourceRoot":"","sources":["../../../src/mysky/tweak.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,qBAAa,uBAAuB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;gBAEZ,IAAI,EAAE,MAAM;IAOxB,MAAM,IAAI,UAAU;IAapB,OAAO,IAAI,UAAU;CAItB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAErD;AAED;;;;;GAKG;AAEH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAE/D"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/tweak.js b/node_modules/skynet-js/dist/cjs/mysky/tweak.js new file mode 100644 index 0000000..227b2fe --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/tweak.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hashPathComponent = exports.splitPath = exports.DiscoverableBucketTweak = exports.deriveDiscoverableFileTweak = void 0; +const crypto_1 = require("../crypto"); +const string_1 = require("../utils/string"); +const discoverableBucketTweakVersion = 1; +/** + * Derives the discoverable file tweak for the given path. + * + * @param path - The given path. + * @returns - The hex-encoded tweak. + */ +function deriveDiscoverableFileTweak(path) { + const dbt = new DiscoverableBucketTweak(path); + const bytes = dbt.getHash(); + return string_1.toHexString(bytes); +} +exports.deriveDiscoverableFileTweak = deriveDiscoverableFileTweak; +class DiscoverableBucketTweak { + constructor(path) { + const paths = splitPath(path); + const pathHashes = paths.map(hashPathComponent); + this.version = discoverableBucketTweakVersion; + this.path = pathHashes; + } + encode() { + const size = 1 + 32 * this.path.length; + const buf = new Uint8Array(size); + buf.set([this.version]); + let offset = 1; + for (const pathLevel of this.path) { + buf.set(pathLevel, offset); + offset += 32; + } + return buf; + } + getHash() { + const encoding = this.encode(); + return crypto_1.hashAll(encoding); + } +} +exports.DiscoverableBucketTweak = DiscoverableBucketTweak; +/** + * Splits the path by forward slashes. + * + * @param path - The path to split. + * @returns - An array of path components. + */ +function splitPath(path) { + return path.split("/"); +} +exports.splitPath = splitPath; +/** + * Hashes the path component. + * + * @param component - The component extracted from the path. + * @returns - The hash. + */ +// TODO: Can we replace with hashString? +function hashPathComponent(component) { + return crypto_1.hashAll(string_1.stringToUint8ArrayUtf8(component)); +} +exports.hashPathComponent = hashPathComponent; diff --git a/node_modules/skynet-js/dist/cjs/mysky/utils.d.ts b/node_modules/skynet-js/dist/cjs/mysky/utils.d.ts new file mode 100644 index 0000000..904d36f --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/utils.d.ts @@ -0,0 +1,31 @@ +import { SkynetClient } from "../client"; +/** + * Constructs the full URL for the given component domain, + * e.g. "dac.hns" => "https://dac.hns.siasky.net" + * + * @param this - SkynetClient + * @param domain - Component domain. + * @returns - The full URL for the component. + */ +export declare function getFullDomainUrl(this: SkynetClient, domain: string): Promise; +/** + * Extracts the domain from the current portal URL, + * e.g. ("dac.hns.siasky.net") => "dac.hns" + * + * @param this - SkynetClient + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +export declare function extractDomain(this: SkynetClient, fullDomain: string): Promise; +/** + * Create a new popup window. From SkyID. + * + * @param url - The URL to open. + * @param title - The title of the popup window. + * @param w - The width of the popup window. + * @param h - the height of the popup window. + * @returns - The window. + * @throws - Will throw if the window could not be opened. + */ +export declare function popupCenter(url: string, title: string, w: number, h: number): Window; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/utils.d.ts.map b/node_modules/skynet-js/dist/cjs/mysky/utils.d.ts.map new file mode 100644 index 0000000..e3b3a46 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mysky/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI1F;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI3F;AAGD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCpF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/mysky/utils.js b/node_modules/skynet-js/dist/cjs/mysky/utils.js new file mode 100644 index 0000000..81438d6 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/mysky/utils.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.popupCenter = exports.extractDomain = exports.getFullDomainUrl = void 0; +const skynet_mysky_utils_1 = require("skynet-mysky-utils"); +const url_1 = require("../utils/url"); +/** + * Constructs the full URL for the given component domain, + * e.g. "dac.hns" => "https://dac.hns.siasky.net" + * + * @param this - SkynetClient + * @param domain - Component domain. + * @returns - The full URL for the component. + */ +async function getFullDomainUrl(domain) { + const portalUrl = await this.portalUrl(); + return url_1.getFullDomainUrlForPortal(portalUrl, domain); +} +exports.getFullDomainUrl = getFullDomainUrl; +/** + * Extracts the domain from the current portal URL, + * e.g. ("dac.hns.siasky.net") => "dac.hns" + * + * @param this - SkynetClient + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +async function extractDomain(fullDomain) { + const portalUrl = await this.portalUrl(); + return url_1.extractDomainForPortal(portalUrl, fullDomain); +} +exports.extractDomain = extractDomain; +/* istanbul ignore next */ +/** + * Create a new popup window. From SkyID. + * + * @param url - The URL to open. + * @param title - The title of the popup window. + * @param w - The width of the popup window. + * @param h - the height of the popup window. + * @returns - The window. + * @throws - Will throw if the window could not be opened. + */ +function popupCenter(url, title, w, h) { + url = skynet_mysky_utils_1.ensureUrl(url); + // Fixes dual-screen position Most browsers Firefox + const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; + const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; + const width = window.innerWidth + ? window.innerWidth + : document.documentElement.clientWidth + ? document.documentElement.clientWidth + : screen.width; + const height = window.innerHeight + ? window.innerHeight + : document.documentElement.clientHeight + ? document.documentElement.clientHeight + : screen.height; + const systemZoom = width / window.screen.availWidth; + const left = (width - w) / 2 / systemZoom + dualScreenLeft; + const top = (height - h) / 2 / systemZoom + dualScreenTop; + const newWindow = window.open(url, title, ` +scrollbars=yes, +width=${w / systemZoom}, +height=${h / systemZoom}, +top=${top}, +left=${left} +`); + if (!newWindow) { + throw new Error("could not open window"); + } + if (newWindow.focus) { + newWindow.focus(); + } + return newWindow; +} +exports.popupCenter = popupCenter; diff --git a/node_modules/skynet-js/dist/cjs/pin.d.ts b/node_modules/skynet-js/dist/cjs/pin.d.ts new file mode 100644 index 0000000..c4a05cd --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/pin.d.ts @@ -0,0 +1,36 @@ +import { SkynetClient } from "./client"; +import { BaseCustomOptions } from "./utils/options"; +/** + * Custom pin options. + * + * @property [endpointPin] - The relative URL path of the portal endpoint to contact. + */ +export declare type CustomPinOptions = BaseCustomOptions & { + endpointPin?: string; +}; +/** + * The response to a pin request. + * + * @property skylink - 46-character skylink. + */ +export declare type PinResponse = { + skylink: string; +}; +export declare const defaultPinOptions: { + endpointPin: string; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Re-pins the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and revision number. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export declare function pinSkylink(this: SkynetClient, skylinkUrl: string, customOptions?: CustomPinOptions): Promise; +//# sourceMappingURL=pin.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/pin.d.ts.map b/node_modules/skynet-js/dist/cjs/pin.d.ts.map new file mode 100644 index 0000000..2d7527f --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/pin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../../src/pin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAGxE;;;;GAIG;AACH,oBAAY,gBAAgB,GAAG,iBAAiB,GAAG;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAI7B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,WAAW,CAAC,CA4BtB"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/pin.js b/node_modules/skynet-js/dist/cjs/pin.js new file mode 100644 index 0000000..3b69ad3 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/pin.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pinSkylink = exports.defaultPinOptions = void 0; +const format_1 = require("./skylink/format"); +const parse_1 = require("./skylink/parse"); +const options_1 = require("./utils/options"); +const validation_1 = require("./utils/validation"); +exports.defaultPinOptions = { + ...options_1.defaultBaseOptions, + endpointPin: "/skynet/pin", +}; +/** + * Re-pins the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and revision number. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +async function pinSkylink(skylinkUrl, customOptions) { + const skylink = validation_1.validateSkylinkString("skylinkUrl", skylinkUrl, "parameter"); + const opts = { ...exports.defaultPinOptions, ...this.customOptions, ...customOptions }; + // Don't include the path since the endpoint doesn't support it. + const path = parse_1.parseSkylink(skylinkUrl, { onlyPath: true }); + if (path) { + throw new Error("Skylink string should not contain a path"); + } + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointPin, + method: "post", + extraPath: skylink, + }); + // Sanity check. + validatePinResponse(response); + // Get the skylink. + let returnedSkylink = response.headers["skynet-skylink"]; + // Format the skylink. + returnedSkylink = format_1.formatSkylink(returnedSkylink); + return { skylink: returnedSkylink }; +} +exports.pinSkylink = pinSkylink; +/** + * Validates the pin response. + * + * @param response - The pin response. + * @throws - Will throw if not a valid pin response. + */ +function validatePinResponse(response) { + try { + if (!response.headers) { + throw new Error("response.headers field missing"); + } + validation_1.validateString('response.headers["skynet-skylink"]', response.headers["skynet-skylink"], "pin response field"); + } + catch (err) { + throw new Error(`Did not get a complete pin response despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} diff --git a/node_modules/skynet-js/dist/cjs/registry.d.ts b/node_modules/skynet-js/dist/cjs/registry.d.ts new file mode 100644 index 0000000..0f49ac3 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/registry.d.ts @@ -0,0 +1,150 @@ +import { SkynetClient } from "./client"; +import { BaseCustomOptions } from "./utils/options"; +import { Signature } from "./crypto"; +/** + * Custom get entry options. + * + * @property [endpointGetEntry] - The relative URL path of the portal endpoint to contact. + * @property [hashedDataKeyHex] - Whether the data key is already hashed and in hex format. If not, we hash the data key. + */ +export declare type CustomGetEntryOptions = BaseCustomOptions & { + endpointGetEntry?: string; + hashedDataKeyHex?: boolean; +}; +/** + * Custom set entry options. + * + * @property [endpointSetEntry] - The relative URL path of the portal endpoint to contact. + * @property [hashedDataKeyHex] - Whether the data key is already hashed and in hex format. If not, we hash the data key. + */ +export declare type CustomSetEntryOptions = BaseCustomOptions & { + endpointSetEntry?: string; + hashedDataKeyHex?: boolean; +}; +export declare const defaultGetEntryOptions: { + endpointGetEntry: string; + hashedDataKeyHex: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +export declare const defaultSetEntryOptions: { + endpointSetEntry: string; + hashedDataKeyHex: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +export declare const DEFAULT_GET_ENTRY_TIMEOUT = 5; +/** + * Regex for JSON revision value without quotes. + */ +export declare const regexRevisionNoQuotes: RegExp; +/** + * Registry entry. + * + * @property dataKey - The key of the data for the given entry. + * @property data - The data stored in the entry. + * @property revision - The revision number for the entry. + */ +export declare type RegistryEntry = { + dataKey: string; + data: Uint8Array; + revision: bigint; +}; +/** + * Signed registry entry. + * + * @property entry - The registry entry. + * @property signature - The signature of the registry entry. + */ +export declare type SignedRegistryEntry = { + entry: RegistryEntry | null; + signature: Signature | null; +}; +/** + * Gets the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The signed registry entry. + * @throws - Will throw if the returned signature does not match the returned entry or the provided timeout is invalid or the given key is not valid. + */ +export declare function getEntry(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets the registry entry URL corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the provided timeout is invalid or the given key is not valid. + */ +export declare function getEntryUrl(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets the registry entry URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the given key is not valid. + */ +export declare function getEntryUrlForPortal(portalUrl: string, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): string; +/** + * Gets the entry link for the entry at the given public key and data key. This link stays the same even if the content at the entry changes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry link. + * @throws - Will throw if the given key is not valid. + */ +export declare function getEntryLink(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Sets the registry entry. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param entry - The entry to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the entry revision does not fit in 64 bits or the given key is not valid. + */ +export declare function setEntry(this: SkynetClient, privateKey: string, entry: RegistryEntry, customOptions?: CustomSetEntryOptions): Promise; +/** + * Signs the entry with the given private key. + * + * @param privateKey - The user private key. + * @param entry - The entry to sign. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - The signature. + */ +export declare function signEntry(privateKey: string, entry: RegistryEntry, hashedDataKeyHex: boolean): Promise; +/** + * Posts the entry with the given public key and signature to Skynet. + * + * @param this - The Skynet client. + * @param publicKey - The user public key. + * @param entry - The entry to set. + * @param signature - The signature. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + */ +export declare function postSignedEntry(this: SkynetClient, publicKey: string, entry: RegistryEntry, signature: Uint8Array, customOptions?: CustomSetEntryOptions): Promise; +/** + * Validates the given registry entry. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + */ +export declare function validateRegistryEntry(name: string, value: unknown, valueKind: string): void; +//# sourceMappingURL=registry.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/registry.d.ts.map b/node_modules/skynet-js/dist/cjs/registry.d.ts.map new file mode 100644 index 0000000..3a080db --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/registry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAGxE,OAAO,EAAkC,SAAS,EAAE,MAAM,UAAU,CAAC;AAarE;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAA2B,CAAC;AAS9D;;;;;;GAMG;AACH,oBAAY,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,mBAAmB,CAAC,CAgF9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,MAAM,CA2BR;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,EACpB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,EACpB,gBAAgB,EAAE,OAAO,GACxB,OAAO,CAAC,UAAU,CAAC,CAQrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,IAAI,CAAC,CA8Cf;AA0BD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAK3F"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/registry.js b/node_modules/skynet-js/dist/cjs/registry.js new file mode 100644 index 0000000..c39f6a8 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/registry.js @@ -0,0 +1,345 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateRegistryEntry = exports.postSignedEntry = exports.signEntry = exports.setEntry = exports.getEntryLink = exports.getEntryUrlForPortal = exports.getEntryUrl = exports.getEntry = exports.regexRevisionNoQuotes = exports.DEFAULT_GET_ENTRY_TIMEOUT = exports.defaultSetEntryOptions = exports.defaultGetEntryOptions = void 0; +const buffer_1 = require("buffer"); +const tweetnacl_1 = require("tweetnacl"); +const number_1 = require("./utils/number"); +const options_1 = require("./utils/options"); +const string_1 = require("./utils/string"); +const url_1 = require("./utils/url"); +const crypto_1 = require("./crypto"); +const validation_1 = require("./utils/validation"); +const sia_1 = require("./skylink/sia"); +const format_1 = require("./skylink/format"); +exports.defaultGetEntryOptions = { + ...options_1.defaultBaseOptions, + endpointGetEntry: "/skynet/registry", + hashedDataKeyHex: false, +}; +exports.defaultSetEntryOptions = { + ...options_1.defaultBaseOptions, + endpointSetEntry: "/skynet/registry", + hashedDataKeyHex: false, +}; +exports.DEFAULT_GET_ENTRY_TIMEOUT = 5; // 5 seconds +/** + * Regex for JSON revision value without quotes. + */ +exports.regexRevisionNoQuotes = /"revision":\s*([0-9]+)/; +/** + * Regex for JSON revision value with quotes. + */ +const regexRevisionWithQuotes = /"revision":\s*"([0-9]+)"/; +const ED25519_PREFIX = "ed25519:"; +/** + * Gets the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The signed registry entry. + * @throws - Will throw if the returned signature does not match the returned entry or the provided timeout is invalid or the given key is not valid. + */ +async function getEntry(publicKey, dataKey, customOptions) { + // Validation is done in `getEntryUrl`. + const opts = { + ...exports.defaultGetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const url = await this.registry.getEntryUrl(publicKey, dataKey, opts); + let response; + try { + response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointGetEntry, + url, + method: "get", + // Transform the response to add quotes, since uint64 cannot be accurately + // read by JS so the revision needs to be parsed as a string. + transformResponse: function (data) { + if (data === undefined) { + return {}; + } + // Change the revision value from a JSON integer to a string. + data = data.replace(exports.regexRevisionNoQuotes, '"revision":"$1"'); + // Try converting the JSON data to an object. + try { + return JSON.parse(data); + } + catch { + // The data is not JSON, it's likely an HTML error response. + return data; + } + }, + }); + } + catch (err) { + return handleGetEntryErrResponse(err); + } + // Sanity check. + try { + validation_1.validateString("response.data.data", response.data.data, "entry response field"); + validation_1.validateString("response.data.revision", response.data.revision, "entry response field"); + validation_1.validateString("response.data.signature", response.data.signature, "entry response field"); + } + catch (err) { + throw new Error(`Did not get a complete entry response despite a successful request. Please try again and report this issue to the devs if it persists. Error: ${err}`); + } + // Convert the revision from a string to bigint. + const revision = BigInt(response.data.revision); + const signature = buffer_1.Buffer.from(string_1.hexToUint8Array(response.data.signature)); + // Use empty array if the data is empty. + let data = new Uint8Array([]); + if (response.data.data) { + data = string_1.hexToUint8Array(response.data.data); + } + const signedEntry = { + entry: { + dataKey, + data, + revision, + }, + signature, + }; + // Try verifying the returned data. + if (tweetnacl_1.sign.detached.verify(crypto_1.hashRegistryEntry(signedEntry.entry, opts.hashedDataKeyHex), new Uint8Array(signedEntry.signature), string_1.hexToUint8Array(publicKey))) { + return signedEntry; + } + // The response could not be verified. + throw new Error("could not verify signature from retrieved, signed registry entry -- possible corrupted entry"); +} +exports.getEntry = getEntry; +/** + * Gets the registry entry URL corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the provided timeout is invalid or the given key is not valid. + */ +async function getEntryUrl(publicKey, dataKey, customOptions) { + // Validation is done in `getEntryUrlForPortal`. + const opts = { + ...exports.defaultGetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const portalUrl = await this.portalUrl(); + return getEntryUrlForPortal(portalUrl, publicKey, dataKey, opts); +} +exports.getEntryUrl = getEntryUrl; +/** + * Gets the registry entry URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the given key is not valid. + */ +function getEntryUrlForPortal(portalUrl, publicKey, dataKey, customOptions) { + validation_1.validateString("portalUrl", portalUrl, "parameter"); + validatePublicKey("publicKey", publicKey, "parameter"); + validation_1.validateString("dataKey", dataKey, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultGetEntryOptions); + const opts = { + ...exports.defaultGetEntryOptions, + ...customOptions, + }; + // Hash and hex encode the given data key if it is not a hash already. + let dataKeyHashHex = dataKey; + if (!opts.hashedDataKeyHex) { + dataKeyHashHex = string_1.toHexString(crypto_1.hashDataKey(dataKey)); + } + const query = { + publickey: string_1.ensurePrefix(publicKey, ED25519_PREFIX), + datakey: dataKeyHashHex, + timeout: exports.DEFAULT_GET_ENTRY_TIMEOUT, + }; + let url = url_1.makeUrl(portalUrl, opts.endpointGetEntry); + url = url_1.addUrlQuery(url, query); + return url; +} +exports.getEntryUrlForPortal = getEntryUrlForPortal; +/** + * Gets the entry link for the entry at the given public key and data key. This link stays the same even if the content at the entry changes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry link. + * @throws - Will throw if the given key is not valid. + */ +async function getEntryLink(publicKey, dataKey, customOptions) { + validatePublicKey("publicKey", publicKey, "parameter"); + validation_1.validateString("dataKey", dataKey, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultGetEntryOptions); + const opts = { + ...exports.defaultGetEntryOptions, + ...customOptions, + }; + const siaPublicKey = sia_1.newEd25519PublicKey(string_1.trimPrefix(publicKey, ED25519_PREFIX)); + let tweak; + if (opts.hashedDataKeyHex) { + tweak = string_1.hexToUint8Array(dataKey); + } + else { + tweak = crypto_1.hashDataKey(dataKey); + } + const skylink = sia_1.newSkylinkV2(siaPublicKey, tweak).toString(); + return format_1.formatSkylink(skylink); +} +exports.getEntryLink = getEntryLink; +/** + * Sets the registry entry. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param entry - The entry to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the entry revision does not fit in 64 bits or the given key is not valid. + */ +async function setEntry(privateKey, entry, customOptions) { + validation_1.validateHexString("privateKey", privateKey, "parameter"); + validateRegistryEntry("entry", entry, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultSetEntryOptions); + // Assert the input is 64 bits. + number_1.assertUint64(entry.revision); + const opts = { + ...exports.defaultSetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const privateKeyArray = string_1.hexToUint8Array(privateKey); + const signature = await signEntry(privateKey, entry, opts.hashedDataKeyHex); + const { publicKey: publicKeyArray } = tweetnacl_1.sign.keyPair.fromSecretKey(privateKeyArray); + return await this.registry.postSignedEntry(string_1.toHexString(publicKeyArray), entry, signature, opts); +} +exports.setEntry = setEntry; +/** + * Signs the entry with the given private key. + * + * @param privateKey - The user private key. + * @param entry - The entry to sign. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - The signature. + */ +async function signEntry(privateKey, entry, hashedDataKeyHex) { + // TODO: Publicly available, validate input. + const privateKeyArray = string_1.hexToUint8Array(privateKey); + // Sign the entry. + // TODO: signature type should be Signature? + return tweetnacl_1.sign(crypto_1.hashRegistryEntry(entry, hashedDataKeyHex), privateKeyArray); +} +exports.signEntry = signEntry; +/** + * Posts the entry with the given public key and signature to Skynet. + * + * @param this - The Skynet client. + * @param publicKey - The user public key. + * @param entry - The entry to set. + * @param signature - The signature. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + */ +async function postSignedEntry(publicKey, entry, signature, customOptions) { + validation_1.validateHexString("publicKey", publicKey, "parameter"); + validateRegistryEntry("entry", entry, "parameter"); + validation_1.validateUint8Array("signature", signature, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultSetEntryOptions); + const opts = { + ...exports.defaultSetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + // Hash and hex encode the given data key if it is not a hash already. + let datakey = entry.dataKey; + if (!opts.hashedDataKeyHex) { + datakey = string_1.toHexString(crypto_1.hashDataKey(datakey)); + } + // Convert the entry data to an array from raw bytes. + const entryData = Array.from(entry.data); + const data = { + publickey: { + algorithm: "ed25519", + key: Array.from(string_1.hexToUint8Array(publicKey)), + }, + datakey, + // Set the revision as a string here. The value may be up to 64 bits and the limit for a JS number is 53 bits. + // We remove the quotes later in transformRequest, as JSON does support 64 bit numbers. + revision: entry.revision.toString(), + data: entryData, + signature: Array.from(signature), + }; + await this.executeRequest({ + ...opts, + endpointPath: opts.endpointSetEntry, + method: "post", + data, + // Transform the request to remove quotes, since the revision needs to be + // parsed as a uint64 on the Go side. + transformRequest: function (data) { + // Convert the object data to JSON. + const json = JSON.stringify(data); + // Change the revision value from a string to a JSON integer. + return json.replace(regexRevisionWithQuotes, '"revision":$1'); + }, + }); +} +exports.postSignedEntry = postSignedEntry; +/** + * Handles error responses returned in getEntry. + * + * @param err - The Axios error. + * @returns - An empty signed registry entry if the status code is 404. + * @throws - Will throw if the status code is not 404. + */ +function handleGetEntryErrResponse(err) { + /* istanbul ignore next */ + if (!err.response) { + throw new Error(`Error response field not found, incomplete Axios error. Full error: ${err}`); + } + /* istanbul ignore next */ + if (!err.response.status) { + throw new Error(`Error response did not contain expected field 'status'. Full error: ${err}`); + } + // Check if status was 404 "not found" and return null if so. + if (err.response.status === 404) { + return { entry: null, signature: null }; + } + throw err; +} +/** + * Validates the given registry entry. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + */ +function validateRegistryEntry(name, value, valueKind) { + validation_1.validateObject(name, value, valueKind); + validation_1.validateString(`${name}.dataKey`, value.dataKey, `${valueKind} field`); + validation_1.validateUint8Array(`${name}.data`, value.data, `${valueKind} field`); + validation_1.validateBigint(`${name}.revision`, value.revision, `${valueKind} field`); +} +exports.validateRegistryEntry = validateRegistryEntry; +/** + * Validates the given value as a hex-encoded, potentially prefixed public key. + * + * @param name - The name of the value. + * @param publicKey - The public key. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid hex-encoded public key. + */ +function validatePublicKey(name, publicKey, valueKind) { + if (!string_1.isHexString(string_1.trimPrefix(publicKey, ED25519_PREFIX))) { + validation_1.throwValidationError(name, publicKey, valueKind, "a hex-encoded string with a valid prefix"); + } +} diff --git a/node_modules/skynet-js/dist/cjs/skydb.d.ts b/node_modules/skynet-js/dist/cjs/skydb.d.ts new file mode 100644 index 0000000..fb6b092 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skydb.d.ts @@ -0,0 +1,185 @@ +import { SkynetClient } from "./client"; +import { CustomDownloadOptions } from "./download"; +import { CustomGetEntryOptions, RegistryEntry, CustomSetEntryOptions } from "./registry"; +import { CustomUploadOptions } from "./upload"; +export declare type JsonData = Record; +export declare type JsonFullData = { + _data: JsonData; + _v: number; +}; +/** + * Custom get JSON options. + * + * @property [cachedDataLink] - The last known data link. If it hasn't changed, do not download the file contents again. + */ +export declare type CustomGetJSONOptions = CustomGetEntryOptions & CustomDownloadOptions & { + cachedDataLink?: string; +}; +export declare const defaultGetJSONOptions: { + cachedDataLink: undefined; + endpointDownload: string; + download: boolean; + path: undefined; + range: undefined; + responseType: undefined; + query: undefined; + subdomain: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; + endpointGetEntry: string; + hashedDataKeyHex: boolean; +}; +/** + * Custom set JSON options. + */ +export declare type CustomSetJSONOptions = CustomGetJSONOptions & CustomSetEntryOptions & CustomUploadOptions; +export declare const defaultSetJSONOptions: { + endpointUpload: string; + endpointLargeUpload: string; + customFilename: string; /** + * Gets the JSON object corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ + largeFileSize: number; + retryDelays: number[]; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; + endpointSetEntry: string; + hashedDataKeyHex: boolean; + cachedDataLink: undefined; + endpointDownload: string; + download: boolean; + path: undefined; + range: undefined; + responseType: undefined; + query: undefined; + subdomain: boolean; + endpointGetEntry: string; +}; +export declare type JSONResponse = { + data: JsonData | null; + dataLink: string | null; +}; +export declare type RawBytesResponse = { + data: Uint8Array | null; + dataLink: string | null; +}; +/** + * Gets the JSON object corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export declare function getJSON(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetJSONOptions): Promise; +/** + * Sets a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param json - The JSON data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the input keys are not valid strings. + */ +export declare function setJSON(this: SkynetClient, privateKey: string, dataKey: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise; +/** + * Deletes a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +export declare function deleteJSON(this: SkynetClient, privateKey: string, dataKey: string, customOptions?: CustomSetJSONOptions): Promise; +/** + * Sets the datalink for the entry at the given private key and data key. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The data key. + * @param dataLink - The data link to set at the entry. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +export declare function setDataLink(this: SkynetClient, privateKey: string, dataKey: string, dataLink: string, customOptions?: CustomSetJSONOptions): Promise; +/** + * Gets the raw bytes corresponding to the publicKey and dataKey. The caller is responsible for setting any metadata in the bytes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned bytes. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export declare function getRawBytes(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetJSONOptions): Promise; +/** + * Gets the registry entry for the given raw bytes or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The raw byte data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export declare function getOrCreateRawBytesRegistryEntry(client: SkynetClient, publicKey: string, dataKey: string, data: Uint8Array, customOptions?: CustomSetJSONOptions): Promise; +/** + * Gets the next entry for the given public key and data key, setting the data to be the given data and the revision number accordingly. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export declare function getNextRegistryEntry(client: SkynetClient, publicKey: string, dataKey: string, data: Uint8Array, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets the registry entry and data link or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param json - The JSON to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export declare function getOrCreateRegistryEntry(client: SkynetClient, publicKey: string, dataKey: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise<[RegistryEntry, string]>; +/** + * Gets the next revision from a returned entry (or 0 if the entry was not found). + * + * @param entry - The returned registry entry. + * @returns - The revision. + * @throws - Will throw if the next revision would be beyond the maximum allowed value. + */ +export declare function getNextRevisionFromEntry(entry: RegistryEntry | null): bigint; +/** + * Checks whether the raw data link matches the cached data link, if provided. + * + * @param rawDataLink - The raw, unformatted data link. + * @param cachedDataLink - The cached data link, if provided. + * @returns - Whether the cached data link is a match. + * @throws - Will throw if the given cached data link is not a valid skylink. + */ +export declare function checkCachedDataLink(rawDataLink: string, cachedDataLink?: string): boolean; +//# sourceMappingURL=skydb.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skydb.d.ts.map b/node_modules/skynet-js/dist/cjs/skydb.d.ts.map new file mode 100644 index 0000000..fdec674 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skydb.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"skydb.d.ts","sourceRoot":"","sources":["../../src/skydb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAA0B,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAGL,qBAAqB,EACrB,aAAa,EAEb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAwB,mBAAmB,EAAyB,MAAM,UAAU,CAAC;AAe5F,oBAAY,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,QAAQ,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAIF;;;;GAIG;AACH,oBAAY,oBAAoB,GAAG,qBAAqB,GACtD,qBAAqB,GAAG;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEJ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;CAKjC,CAAC;AAEF;;GAEG;AACH,oBAAY,oBAAoB,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;AAEtG,eAAO,MAAM,qBAAqB;;;4BAqBlC;;;;;;;;;OASG;;;;;;;;;;;;;;;;;;CAzBF,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAMF;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,YAAY,CAAC,CA2CvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,QAAQ,EACd,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,YAAY,CAAC,CAqBvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAMD;;;;;;;;;GASG;AAEH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAEf,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA8B3B;AAGD;;;;;;;;;;GAUG;AAEH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,aAAa,CAAC,CA4CxB;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,QAAQ,EACd,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CA+ClC;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,CAc5E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAMzF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skydb.js b/node_modules/skynet-js/dist/cjs/skydb.js new file mode 100644 index 0000000..404b571 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skydb.js @@ -0,0 +1,420 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkCachedDataLink = exports.getNextRevisionFromEntry = exports.getOrCreateRegistryEntry = exports.getNextRegistryEntry = exports.getOrCreateRawBytesRegistryEntry = exports.getRawBytes = exports.setDataLink = exports.deleteJSON = exports.setJSON = exports.getJSON = exports.defaultSetJSONOptions = exports.defaultGetJSONOptions = void 0; +const tweetnacl_1 = require("tweetnacl"); +const download_1 = require("./download"); +const registry_1 = require("./registry"); +const sia_1 = require("./skylink/sia"); +const number_1 = require("./utils/number"); +const url_1 = require("./utils/url"); +const string_1 = require("./utils/string"); +const format_1 = require("./skylink/format"); +const upload_1 = require("./upload"); +const encoding_1 = require("./utils/encoding"); +const options_1 = require("./utils/options"); +const validation_1 = require("./utils/validation"); +const array_1 = require("./utils/array"); +const JSON_RESPONSE_VERSION = 2; +exports.defaultGetJSONOptions = { + ...options_1.defaultBaseOptions, + ...registry_1.defaultGetEntryOptions, + ...download_1.defaultDownloadOptions, + cachedDataLink: undefined, +}; +exports.defaultSetJSONOptions = { + ...options_1.defaultBaseOptions, + ...exports.defaultGetJSONOptions, + ...registry_1.defaultSetEntryOptions, + ...upload_1.defaultUploadOptions, +}; +// ==== +// JSON +// ==== +/** + * Gets the JSON object corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +async function getJSON(publicKey, dataKey, customOptions) { + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultGetJSONOptions); + // Rest of validation is done in `getEntry`. + const opts = { + ...exports.defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + // Lookup the registry entry. + const entry = await getSkyDBRegistryEntry(this, publicKey, dataKey, opts); + if (entry === null) { + return { data: null, dataLink: null }; + } + // Determine the data link. + // TODO: Can this still be an entry link which hasn't yet resolved to a data link? + const { rawDataLink, dataLink } = parseDataLink(entry.data, true); + // If a cached data link is provided and the data link hasn't changed, return. + if (checkCachedDataLink(rawDataLink, opts.cachedDataLink)) { + return { data: null, dataLink }; + } + // Download the data in the returned data link. + const downloadOpts = options_1.extractOptions(opts, download_1.defaultDownloadOptions); + const { data } = await this.getFileContent(dataLink, downloadOpts); + if (typeof data !== "object" || data === null) { + throw new Error(`File data for the entry at data key '${dataKey}' is not JSON.`); + } + if (!(data["_data"] && data["_v"])) { + // Legacy data prior to skynet-js v4, return as-is. + return { data, dataLink }; + } + const actualData = data["_data"]; + if (typeof actualData !== "object" || data === null) { + throw new Error(`File data '_data' for the entry at data key '${dataKey}' is not JSON.`); + } + return { data: actualData, dataLink }; +} +exports.getJSON = getJSON; +/** + * Sets a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param json - The JSON data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the input keys are not valid strings. + */ +async function setJSON(privateKey, dataKey, json, customOptions) { + validation_1.validateHexString("privateKey", privateKey, "parameter"); + validation_1.validateString("dataKey", dataKey, "parameter"); + validation_1.validateObject("json", json, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultSetJSONOptions); + const opts = { + ...exports.defaultSetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const { publicKey: publicKeyArray } = tweetnacl_1.sign.keyPair.fromSecretKey(string_1.hexToUint8Array(privateKey)); + const [entry, dataLink] = await getOrCreateRegistryEntry(this, string_1.toHexString(publicKeyArray), dataKey, json, opts); + // Update the registry. + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.registry.setEntry(privateKey, entry, setEntryOpts); + return { data: json, dataLink: format_1.formatSkylink(dataLink) }; +} +exports.setJSON = setJSON; +/** + * Deletes a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +async function deleteJSON(privateKey, dataKey, customOptions) { + validation_1.validateHexString("privateKey", privateKey, "parameter"); + validation_1.validateString("dataKey", dataKey, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultSetJSONOptions); + const opts = { + ...exports.defaultSetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const { publicKey: publicKeyArray } = tweetnacl_1.sign.keyPair.fromSecretKey(string_1.hexToUint8Array(privateKey)); + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this, string_1.toHexString(publicKeyArray), dataKey, new Uint8Array(sia_1.RAW_SKYLINK_SIZE), getEntryOpts); + // Update the registry. + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.registry.setEntry(privateKey, entry, setEntryOpts); +} +exports.deleteJSON = deleteJSON; +/** + * Sets the datalink for the entry at the given private key and data key. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The data key. + * @param dataLink - The data link to set at the entry. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +async function setDataLink(privateKey, dataKey, dataLink, customOptions) { + validation_1.validateHexString("privateKey", privateKey, "parameter"); + validation_1.validateString("dataKey", dataKey, "parameter"); + validation_1.validateString("dataLink", dataLink, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultSetJSONOptions); + const opts = { + ...exports.defaultSetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const { publicKey: publicKeyArray } = tweetnacl_1.sign.keyPair.fromSecretKey(string_1.hexToUint8Array(privateKey)); + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this, string_1.toHexString(publicKeyArray), dataKey, sia_1.decodeSkylink(dataLink), getEntryOpts); + // Update the registry. + const setEntryOpts = options_1.extractOptions(opts, registry_1.defaultSetEntryOptions); + await this.registry.setEntry(privateKey, entry, setEntryOpts); +} +exports.setDataLink = setDataLink; +// ========= +// Raw Bytes +// ========= +/** + * Gets the raw bytes corresponding to the publicKey and dataKey. The caller is responsible for setting any metadata in the bytes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned bytes. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +// TODO: Should we expose this in the API? +async function getRawBytes(publicKey, dataKey, +// TODO: Take a new options type? +customOptions) { + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultGetJSONOptions); + // Rest of validation is done in `getEntry`. + const opts = { + ...exports.defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + // Lookup the registry entry. + const entry = await getSkyDBRegistryEntry(this, publicKey, dataKey, opts); + if (entry === null) { + return { data: null, dataLink: null }; + } + // Determine the data link. + // TODO: Can this still be an entry link which hasn't yet resolved to a data link? + const { rawDataLink, dataLink } = parseDataLink(entry.data, false); + // If a cached data link is provided and the data link hasn't changed, return. + if (checkCachedDataLink(rawDataLink, opts.cachedDataLink)) { + return { data: null, dataLink }; + } + // Download the data in the returned data link. + const downloadOpts = { ...options_1.extractOptions(opts, download_1.defaultDownloadOptions), responseType: "arraybuffer" }; + const { data: buffer } = await this.getFileContent(dataLink, downloadOpts); + return { data: new Uint8Array(buffer), dataLink }; +} +exports.getRawBytes = getRawBytes; +/* istanbul ignore next */ +/** + * Gets the registry entry for the given raw bytes or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The raw byte data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +// TODO: Rename & refactor after the SkyDB caching refactor. +async function getOrCreateRawBytesRegistryEntry(client, publicKey, dataKey, data, customOptions) { + // Not publicly available, don't validate input. + const opts = { + ...exports.defaultSetJSONOptions, + ...client.customOptions, + ...customOptions, + }; + // Create the data to upload to acquire its skylink. + let dataKeyHex = dataKey; + if (!opts.hashedDataKeyHex) { + dataKeyHex = string_1.toHexString(string_1.stringToUint8ArrayUtf8(dataKey)); + } + const file = new File([data], `dk:${dataKeyHex}`, { type: "application/octet-stream" }); + // Start file upload, do not block. + const uploadOpts = options_1.extractOptions(opts, upload_1.defaultUploadOptions); + const skyfilePromise = client.uploadFile(file, uploadOpts); + // Fetch the current value to find out the revision. + // + // Start getEntry, do not block. + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entryPromise = client.registry.getEntry(publicKey, dataKey, getEntryOpts); + // Block until both getEntry and uploadFile are finished. + const [signedEntry, skyfile] = await Promise.all([ + entryPromise, + skyfilePromise, + ]); + const revision = getNextRevisionFromEntry(signedEntry.entry); + // Build the registry entry. + const dataLink = string_1.trimUriPrefix(skyfile.skylink, url_1.uriSkynetPrefix); + const rawDataLink = encoding_1.decodeSkylinkBase64(dataLink); + validation_1.validateUint8ArrayLen("rawDataLink", rawDataLink, "skylink byte array", sia_1.RAW_SKYLINK_SIZE); + const entry = { + dataKey, + data: rawDataLink, + revision, + }; + return entry; +} +exports.getOrCreateRawBytesRegistryEntry = getOrCreateRawBytesRegistryEntry; +// ======= +// Helpers +// ======= +/** + * Gets the next entry for the given public key and data key, setting the data to be the given data and the revision number accordingly. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +async function getNextRegistryEntry(client, publicKey, dataKey, data, customOptions) { + // Not publicly available, don't validate input. + const opts = { + ...registry_1.defaultGetEntryOptions, + ...client.customOptions, + ...customOptions, + }; + // Get the latest entry. + // TODO: Can remove this once we start caching the latest revision. + const signedEntry = await client.registry.getEntry(publicKey, dataKey, opts); + const revision = getNextRevisionFromEntry(signedEntry.entry); + // Build the registry entry. + const entry = { + dataKey, + data, + revision, + }; + return entry; +} +exports.getNextRegistryEntry = getNextRegistryEntry; +/** + * Gets the registry entry and data link or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param json - The JSON to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +async function getOrCreateRegistryEntry(client, publicKey, dataKey, json, customOptions) { + // Not publicly available, don't validate input. + const opts = { + ...exports.defaultSetJSONOptions, + ...client.customOptions, + ...customOptions, + }; + // Set the hidden _data and _v fields. + const fullData = { _data: json, _v: JSON_RESPONSE_VERSION }; + // Create the data to upload to acquire its skylink. + let dataKeyHex = dataKey; + if (!opts.hashedDataKeyHex) { + dataKeyHex = string_1.toHexString(string_1.stringToUint8ArrayUtf8(dataKey)); + } + const file = new File([JSON.stringify(fullData)], `dk:${dataKeyHex}`, { type: "application/json" }); + // Start file upload, do not block. + const uploadOpts = options_1.extractOptions(opts, upload_1.defaultUploadOptions); + const skyfilePromise = client.uploadFile(file, uploadOpts); + // Fetch the current value to find out the revision. + // + // Start getEntry, do not block. + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const entryPromise = client.registry.getEntry(publicKey, dataKey, getEntryOpts); + // Block until both getEntry and uploadFile are finished. + const [signedEntry, skyfile] = await Promise.all([ + entryPromise, + skyfilePromise, + ]); + const revision = getNextRevisionFromEntry(signedEntry.entry); + // Build the registry entry. + const dataLink = string_1.trimUriPrefix(skyfile.skylink, url_1.uriSkynetPrefix); + const data = encoding_1.decodeSkylinkBase64(dataLink); + validation_1.validateUint8ArrayLen("data", data, "skylink byte array", sia_1.RAW_SKYLINK_SIZE); + const entry = { + dataKey, + data, + revision, + }; + return [entry, format_1.formatSkylink(dataLink)]; +} +exports.getOrCreateRegistryEntry = getOrCreateRegistryEntry; +/** + * Gets the next revision from a returned entry (or 0 if the entry was not found). + * + * @param entry - The returned registry entry. + * @returns - The revision. + * @throws - Will throw if the next revision would be beyond the maximum allowed value. + */ +function getNextRevisionFromEntry(entry) { + let revision; + if (entry === null) { + revision = BigInt(0); + } + else { + revision = entry.revision + BigInt(1); + } + // Throw if the revision is already the maximum value. + if (revision > number_1.MAX_REVISION) { + throw new Error("Current entry already has maximum allowed revision, could not update the entry"); + } + return revision; +} +exports.getNextRevisionFromEntry = getNextRevisionFromEntry; +/** + * Checks whether the raw data link matches the cached data link, if provided. + * + * @param rawDataLink - The raw, unformatted data link. + * @param cachedDataLink - The cached data link, if provided. + * @returns - Whether the cached data link is a match. + * @throws - Will throw if the given cached data link is not a valid skylink. + */ +function checkCachedDataLink(rawDataLink, cachedDataLink) { + if (cachedDataLink) { + cachedDataLink = validation_1.validateSkylinkString("cachedDataLink", cachedDataLink, "optional parameter"); + return rawDataLink === cachedDataLink; + } + return false; +} +exports.checkCachedDataLink = checkCachedDataLink; +/** + * Gets the registry entry, returning null if the entry contains an empty skylink (the deletion sentinel). + * + * @param client - The Skynet Client + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param opts - Additional settings. + * @returns - The registry entry, or null if not found or deleted. + */ +async function getSkyDBRegistryEntry(client, publicKey, dataKey, opts) { + const getEntryOpts = options_1.extractOptions(opts, registry_1.defaultGetEntryOptions); + const { entry } = await client.registry.getEntry(publicKey, dataKey, getEntryOpts); + if (entry === null || array_1.areEqualUint8Arrays(entry.data, sia_1.EMPTY_SKYLINK)) { + return null; + } + return entry; +} +/** + * Parses a data link out of the given registry entry data. + * + * @param data - The raw registry entry data. + * @param legacy - Whether to check for possible legacy skylink data, encoded as base64. + * @returns - The raw, unformatted data link and the formatted data link. + * @throws - Will throw if the data is not of the expected length for a skylink. + */ +function parseDataLink(data, legacy) { + let rawDataLink = ""; + if (legacy && data.length === sia_1.BASE64_ENCODED_SKYLINK_SIZE) { + // Legacy data, convert to string for backwards compatibility. + rawDataLink = string_1.uint8ArrayToStringUtf8(data); + } + else if (data.length === sia_1.RAW_SKYLINK_SIZE) { + // Convert the bytes to a base64 skylink. + rawDataLink = encoding_1.encodeSkylinkBase64(data); + } + else { + validation_1.throwValidationError("entry.data", data, "returned entry data", `length ${sia_1.RAW_SKYLINK_SIZE} bytes`); + } + return { rawDataLink, dataLink: format_1.formatSkylink(rawDataLink) }; +} diff --git a/node_modules/skynet-js/dist/cjs/skylink/format.d.ts b/node_modules/skynet-js/dist/cjs/skylink/format.d.ts new file mode 100644 index 0000000..37fd625 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/format.d.ts @@ -0,0 +1,22 @@ +/** + * Converts the given base64 skylink to base32. + * + * @param skylink - The base64 skylink. + * @returns - The converted base32 skylink. + */ +export declare function convertSkylinkToBase32(skylink: string): string; +/** + * Converts the given base32 skylink to base64. + * + * @param skylink - The base32 skylink. + * @returns - The converted base64 skylink. + */ +export declare function convertSkylinkToBase64(skylink: string): string; +/** + * Formats the skylink by adding the sia: prefix. + * + * @param skylink - The skylink. + * @returns - The formatted skylink. + */ +export declare function formatSkylink(skylink: string): string; +//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skylink/format.d.ts.map b/node_modules/skynet-js/dist/cjs/skylink/format.d.ts.map new file mode 100644 index 0000000..986051c --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/format.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/skylink/format.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQrD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skylink/format.js b/node_modules/skynet-js/dist/cjs/skylink/format.js new file mode 100644 index 0000000..654d087 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/format.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatSkylink = exports.convertSkylinkToBase64 = exports.convertSkylinkToBase32 = void 0; +const sia_1 = require("./sia"); +const encoding_1 = require("../utils/encoding"); +const string_1 = require("../utils/string"); +const url_1 = require("../utils/url"); +const validation_1 = require("../utils/validation"); +/** + * Converts the given base64 skylink to base32. + * + * @param skylink - The base64 skylink. + * @returns - The converted base32 skylink. + */ +function convertSkylinkToBase32(skylink) { + skylink = string_1.trimUriPrefix(skylink, url_1.uriSkynetPrefix); + validation_1.validateStringLen("skylink", skylink, "parameter", sia_1.BASE64_ENCODED_SKYLINK_SIZE); + const bytes = encoding_1.decodeSkylinkBase64(skylink); + return encoding_1.encodeSkylinkBase32(bytes); +} +exports.convertSkylinkToBase32 = convertSkylinkToBase32; +/** + * Converts the given base32 skylink to base64. + * + * @param skylink - The base32 skylink. + * @returns - The converted base64 skylink. + */ +function convertSkylinkToBase64(skylink) { + skylink = string_1.trimUriPrefix(skylink, url_1.uriSkynetPrefix); + validation_1.validateStringLen("skylink", skylink, "parameter", sia_1.BASE32_ENCODED_SKYLINK_SIZE); + const bytes = encoding_1.decodeSkylinkBase32(skylink); + return encoding_1.encodeSkylinkBase64(bytes); +} +exports.convertSkylinkToBase64 = convertSkylinkToBase64; +/** + * Formats the skylink by adding the sia: prefix. + * + * @param skylink - The skylink. + * @returns - The formatted skylink. + */ +function formatSkylink(skylink) { + if (skylink === "") { + return skylink; + } + if (!skylink.startsWith(url_1.uriSkynetPrefix)) { + skylink = `${url_1.uriSkynetPrefix}${skylink}`; + } + return skylink; +} +exports.formatSkylink = formatSkylink; diff --git a/node_modules/skynet-js/dist/cjs/skylink/parse.d.ts b/node_modules/skynet-js/dist/cjs/skylink/parse.d.ts new file mode 100644 index 0000000..8d29f5e --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/parse.d.ts @@ -0,0 +1,30 @@ +/** + * Parse skylink options. + * + * @property [fromSubdomain] - Whether to parse the skylink as a base32 subdomain in a URL. + * @property [includePath] - Whether to include the path after the skylink, e.g. //foo/bar. + * @property [onlyPath] - Whether to parse out just the path, e.g. /foo/bar. Will still return null if the string does not contain a skylink. + */ +export declare type ParseSkylinkOptions = { + fromSubdomain?: boolean; + includePath?: boolean; + onlyPath?: boolean; +}; +/** + * Parses the given string for a base64 skylink, or base32 if opts.fromSubdomain is given. If the given string is prefixed with sia:, sia://, or a portal URL, those will be removed and the raw skylink returned. + * + * @param skylinkUrl - Plain skylink, skylink with URI prefix, or URL with skylink as the first path element. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base64 (or base32) skylink, optionally with the path included. + * @throws - Will throw on invalid combination of options. + */ +export declare function parseSkylink(skylinkUrl: string, customOptions?: ParseSkylinkOptions): string | null; +/** + * Helper function that parses the given string for a base32 skylink. + * + * @param skylinkUrl - Base32 skylink. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base32 skylink. + */ +export declare function parseSkylinkBase32(skylinkUrl: string, customOptions?: ParseSkylinkOptions): string | null; +//# sourceMappingURL=parse.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skylink/parse.d.ts.map b/node_modules/skynet-js/dist/cjs/skylink/parse.d.ts.map new file mode 100644 index 0000000..d59641b --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/parse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/skylink/parse.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,oBAAY,mBAAmB,GAAG;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAgBF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CA+CnG;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAmBzG"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skylink/parse.js b/node_modules/skynet-js/dist/cjs/skylink/parse.js new file mode 100644 index 0000000..08bfd3b --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/parse.js @@ -0,0 +1,98 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseSkylinkBase32 = exports.parseSkylink = void 0; +const url_parse_1 = __importDefault(require("url-parse")); +const string_1 = require("../utils/string"); +const url_1 = require("../utils/url"); +const validation_1 = require("../utils/validation"); +const defaultParseSkylinkOptions = { + fromSubdomain: false, + includePath: false, + onlyPath: false, +}; +const SKYLINK_MATCHER = "([a-zA-Z0-9_-]{46})"; +const SKYLINK_MATCHER_SUBDOMAIN = "([a-z0-9_-]{55})"; +const SKYLINK_DIRECT_REGEX = new RegExp(`^${SKYLINK_MATCHER}$`); +const SKYLINK_PATHNAME_REGEX = new RegExp(`^/?${SKYLINK_MATCHER}((/.*)?)$`); +const SKYLINK_SUBDOMAIN_REGEX = new RegExp(`^${SKYLINK_MATCHER_SUBDOMAIN}(\\..*)?$`); +const SKYLINK_DIRECT_MATCH_POSITION = 1; +const SKYLINK_PATH_MATCH_POSITION = 2; +/** + * Parses the given string for a base64 skylink, or base32 if opts.fromSubdomain is given. If the given string is prefixed with sia:, sia://, or a portal URL, those will be removed and the raw skylink returned. + * + * @param skylinkUrl - Plain skylink, skylink with URI prefix, or URL with skylink as the first path element. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base64 (or base32) skylink, optionally with the path included. + * @throws - Will throw on invalid combination of options. + */ +function parseSkylink(skylinkUrl, customOptions) { + validation_1.validateString("skylinkUrl", skylinkUrl, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", defaultParseSkylinkOptions); + const opts = { ...defaultParseSkylinkOptions, ...customOptions }; + if (opts.includePath && opts.onlyPath) { + throw new Error("The includePath and onlyPath options cannot both be set"); + } + if (opts.includePath && opts.fromSubdomain) { + throw new Error("The includePath and fromSubdomain options cannot both be set"); + } + if (opts.fromSubdomain) { + return parseSkylinkBase32(skylinkUrl, opts); + } + // Check for skylink prefixed with sia: or sia:// and extract it. + // Example: sia:XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg + // Example: sia://XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg + skylinkUrl = string_1.trimUriPrefix(skylinkUrl, url_1.uriSkynetPrefix); + // Check for direct base64 skylink match. + const matchDirect = skylinkUrl.match(SKYLINK_DIRECT_REGEX); + if (matchDirect) { + if (opts.onlyPath) { + return ""; + } + return matchDirect[SKYLINK_DIRECT_MATCH_POSITION]; + } + // Check for skylink passed in an url and extract it. + // Example: https://siasky.net/XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg + // Example: https://bg06v2tidkir84hg0s1s4t97jaeoaa1jse1svrad657u070c9calq4g.siasky.net (if opts.fromSubdomain = true) + // Pass empty object as second param to disable using location as base url + // when parsing in browser. + const parsed = url_parse_1.default(skylinkUrl, {}); + const skylinkAndPath = string_1.trimSuffix(parsed.pathname, "/"); + const matchPathname = skylinkAndPath.match(SKYLINK_PATHNAME_REGEX); + if (!matchPathname) + return null; + const path = matchPathname[SKYLINK_PATH_MATCH_POSITION]; + if (opts.includePath) + return string_1.trimForwardSlash(skylinkAndPath); + else if (opts.onlyPath) + return path; + else + return matchPathname[SKYLINK_DIRECT_MATCH_POSITION]; +} +exports.parseSkylink = parseSkylink; +/** + * Helper function that parses the given string for a base32 skylink. + * + * @param skylinkUrl - Base32 skylink. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base32 skylink. + */ +function parseSkylinkBase32(skylinkUrl, customOptions) { + // Do not validate, this helper function should only be called from parseSkylink. + const opts = { ...defaultParseSkylinkOptions, ...customOptions }; + // Pass empty object as second param to disable using location as base url + // when parsing in browser. + const parsed = url_parse_1.default(skylinkUrl, {}); + // Check if the hostname contains a skylink subdomain. + const matchHostname = parsed.hostname.match(SKYLINK_SUBDOMAIN_REGEX); + if (matchHostname) { + if (opts.onlyPath) { + return string_1.trimSuffix(parsed.pathname, "/"); + } + return matchHostname[SKYLINK_DIRECT_MATCH_POSITION]; + } + return null; +} +exports.parseSkylinkBase32 = parseSkylinkBase32; diff --git a/node_modules/skynet-js/dist/cjs/skylink/sia.d.ts b/node_modules/skynet-js/dist/cjs/skylink/sia.d.ts new file mode 100644 index 0000000..4ff235e --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/sia.d.ts @@ -0,0 +1,101 @@ +/** + * The string length of the Skylink after it has been encoded using base32. + */ +export declare const BASE32_ENCODED_SKYLINK_SIZE = 55; +/** + * The string length of the Skylink after it has been encoded using base64. + */ +export declare const BASE64_ENCODED_SKYLINK_SIZE = 46; +/** + * Returned when a string could not be decoded into a Skylink due to it having + * an incorrect size. + */ +export declare const ERR_SKYLINK_INCORRECT_SIZE = "skylink has incorrect size"; +/** + * The raw size in bytes of the data that gets put into a link. + */ +export declare const RAW_SKYLINK_SIZE = 34; +/** + * An empty skylink. + */ +export declare const EMPTY_SKYLINK: Uint8Array; +export declare class SiaSkylink { + bitfield: number; + merkleRoot: Uint8Array; + constructor(bitfield: number, merkleRoot: Uint8Array); + toBytes(): Uint8Array; + toString(): string; + /** + * Loads the given raw data and returns the result. Based on sl.LoadBytes in + * skyd. + * + * @param data - The raw bytes to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromBytes(data: Uint8Array): SiaSkylink; + /** + * Converts from a string and returns the result. Based on sl.LoadString in + * skyd. + * + * @param skylink - The skylink string to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromString(skylink: string): SiaSkylink; +} +/** + * Checks if the given string is a V1 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V1 skylink. + */ +export declare function isSkylinkV1(skylink: string): boolean; +/** + * Checks if the given string is a V2 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V2 skylink. + */ +export declare function isSkylinkV2(skylink: string): boolean; +/** + * Returns a specifier for given name, a specifier can only be 16 bytes so we + * panic if the given name is too long. + * + * @param name - The name. + * @returns - The specifier, if valid. + */ +export declare function newSpecifier(name: string): Uint8Array; +declare class SiaPublicKey { + algorithm: Uint8Array; + key: Uint8Array; + constructor(algorithm: Uint8Array, key: Uint8Array); + marshalSia(): Uint8Array; +} +/** + * Creates a new sia public key. Matches Ed25519PublicKey in sia. + * + * @param publicKey - The hex-encoded public key. + * @returns - The SiaPublicKey. + */ +export declare function newEd25519PublicKey(publicKey: string): SiaPublicKey; +/** + * Creates a new v2 skylink. Matches `NewSkylinkV2` in skyd. + * + * @param siaPublicKey - The public key as a SiaPublicKey. + * @param tweak - The hashed tweak. + * @returns - The v2 skylink. + */ +export declare function newSkylinkV2(siaPublicKey: SiaPublicKey, tweak: Uint8Array): SiaSkylink; +/** + * A helper function that decodes the given string representation of a skylink + * into raw bytes. It either performs a base32 decoding, or base64 decoding, + * depending on the length. + * + * @param encoded - The encoded string. + * @returns - The decoded raw bytes. + * @throws - Will throw if the skylink is not a V1 or V2 skylink string. + */ +export declare function decodeSkylink(encoded: string): Uint8Array; +export {}; +//# sourceMappingURL=sia.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skylink/sia.d.ts.map b/node_modules/skynet-js/dist/cjs/skylink/sia.d.ts.map new file mode 100644 index 0000000..3d7e319 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/sia.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sia.d.ts","sourceRoot":"","sources":["../../../src/skylink/sia.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,aAAa,YAAmC,CAAC;AAE9D,qBAAa,UAAU;IACF,QAAQ,EAAE,MAAM;IAAS,UAAU,EAAE,UAAU;gBAA/C,QAAQ,EAAE,MAAM,EAAS,UAAU,EAAE,UAAU;IAKlE,OAAO,IAAI,UAAU;IAWrB,QAAQ,IAAI,MAAM;IAIlB;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAe9C;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAI/C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQpD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CASpD;AA0BD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAMrD;AAID,cAAM,YAAY;IACG,SAAS,EAAE,UAAU;IAAS,GAAG,EAAE,UAAU;gBAA7C,SAAS,EAAE,UAAU,EAAS,GAAG,EAAE,UAAU;IAEhE,UAAU,IAAI,UAAU;CAMzB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAQnE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAKtF;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAmBzD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/skylink/sia.js b/node_modules/skynet-js/dist/cjs/skylink/sia.js new file mode 100644 index 0000000..2412625 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/skylink/sia.js @@ -0,0 +1,223 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decodeSkylink = exports.newSkylinkV2 = exports.newEd25519PublicKey = exports.newSpecifier = exports.isSkylinkV2 = exports.isSkylinkV1 = exports.SiaSkylink = exports.EMPTY_SKYLINK = exports.RAW_SKYLINK_SIZE = exports.ERR_SKYLINK_INCORRECT_SIZE = exports.BASE64_ENCODED_SKYLINK_SIZE = exports.BASE32_ENCODED_SKYLINK_SIZE = void 0; +const crypto_1 = require("../crypto"); +const encoding_1 = require("../utils/encoding"); +const string_1 = require("../utils/string"); +const url_1 = require("../utils/url"); +const validation_1 = require("../utils/validation"); +/** + * The string length of the Skylink after it has been encoded using base32. + */ +exports.BASE32_ENCODED_SKYLINK_SIZE = 55; +/** + * The string length of the Skylink after it has been encoded using base64. + */ +exports.BASE64_ENCODED_SKYLINK_SIZE = 46; +/** + * Returned when a string could not be decoded into a Skylink due to it having + * an incorrect size. + */ +exports.ERR_SKYLINK_INCORRECT_SIZE = "skylink has incorrect size"; +/** + * The raw size in bytes of the data that gets put into a link. + */ +exports.RAW_SKYLINK_SIZE = 34; +/** + * An empty skylink. + */ +exports.EMPTY_SKYLINK = new Uint8Array(exports.RAW_SKYLINK_SIZE); +class SiaSkylink { + constructor(bitfield, merkleRoot) { + this.bitfield = bitfield; + this.merkleRoot = merkleRoot; + validation_1.validateNumber("bitfield", bitfield, "constructor parameter"); + validation_1.validateUint8ArrayLen("merkleRoot", merkleRoot, "constructor parameter", 32); + } + toBytes() { + const buf = new ArrayBuffer(exports.RAW_SKYLINK_SIZE); + const view = new DataView(buf); + view.setUint16(0, this.bitfield, true); + const uint8Bytes = new Uint8Array(buf); + uint8Bytes.set(this.merkleRoot, 2); + return uint8Bytes; + } + toString() { + return encoding_1.encodeSkylinkBase64(this.toBytes()); + } + /** + * Loads the given raw data and returns the result. Based on sl.LoadBytes in + * skyd. + * + * @param data - The raw bytes to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromBytes(data) { + validation_1.validateUint8ArrayLen("data", data, "parameter", exports.RAW_SKYLINK_SIZE); + const view = new DataView(data.buffer); + // Load the bitfield. + const bitfield = view.getUint16(0, true); + // TODO: Validate v1 bitfields. + const merkleRoot = new Uint8Array(32); + merkleRoot.set(data.slice(2)); + return new SiaSkylink(bitfield, merkleRoot); + } + /** + * Converts from a string and returns the result. Based on sl.LoadString in + * skyd. + * + * @param skylink - The skylink string to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromString(skylink) { + const bytes = decodeSkylink(skylink); + return SiaSkylink.fromBytes(bytes); + } +} +exports.SiaSkylink = SiaSkylink; +/** + * Checks if the given string is a V1 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V1 skylink. + */ +function isSkylinkV1(skylink) { + const raw = decodeSkylink(skylink); + // Load and check the bitfield. + const view = new DataView(raw.buffer); + const bitfield = view.getUint16(0, true); + return isBitfieldSkylinkV1(bitfield); +} +exports.isSkylinkV1 = isSkylinkV1; +/** + * Checks if the given string is a V2 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V2 skylink. + */ +function isSkylinkV2(skylink) { + // Decode the base into raw data. + const raw = decodeSkylink(skylink); + // Load and check the bitfield. + const view = new DataView(raw.buffer); + const bitfield = view.getUint16(0, true); + return isBitfieldSkylinkV2(bitfield); +} +exports.isSkylinkV2 = isSkylinkV2; +/** + * Returns a boolean indicating if the Skylink is a V1 skylink + * + * @param bitfield - The bitfield to check. + * @returns - Whether the bitfield corresponds to a V1 skylink. + */ +function isBitfieldSkylinkV1(bitfield) { + return (bitfield & 3) === 0; +} +/** + * Returns a boolean indicating if the Skylink is a V2 skylink + * + * @param bitfield - The bitfield to check. + * @returns - Whether the bitfield corresponds to a V2 skylink. + */ +function isBitfieldSkylinkV2(bitfield) { + // We compare against 1 here because a V2 skylink only uses the version + // bits. All other bits should be set to 0. + return bitfield == 1; +} +const SPECIFIER_LEN = 16; +/** + * Returns a specifier for given name, a specifier can only be 16 bytes so we + * panic if the given name is too long. + * + * @param name - The name. + * @returns - The specifier, if valid. + */ +function newSpecifier(name) { + validation_1.validateString("name", name, "parameter"); + const specifier = new Uint8Array(SPECIFIER_LEN); + specifier.set(string_1.stringToUint8ArrayUtf8(name)); + return specifier; +} +exports.newSpecifier = newSpecifier; +const PUBLIC_KEY_SIZE = 32; +class SiaPublicKey { + constructor(algorithm, key) { + this.algorithm = algorithm; + this.key = key; + } + marshalSia() { + const bytes = new Uint8Array(SPECIFIER_LEN + 8 + PUBLIC_KEY_SIZE); + bytes.set(this.algorithm); + bytes.set(encoding_1.encodePrefixedBytes(this.key), SPECIFIER_LEN); + return bytes; + } +} +/** + * Creates a new sia public key. Matches Ed25519PublicKey in sia. + * + * @param publicKey - The hex-encoded public key. + * @returns - The SiaPublicKey. + */ +function newEd25519PublicKey(publicKey) { + validation_1.validateHexString("publicKey", publicKey, "parameter"); + const algorithm = newSpecifier("ed25519"); + const publicKeyBytes = string_1.hexToUint8Array(publicKey); + validation_1.validateUint8ArrayLen("publicKeyBytes", publicKeyBytes, "converted publicKey", PUBLIC_KEY_SIZE); + return new SiaPublicKey(algorithm, publicKeyBytes); +} +exports.newEd25519PublicKey = newEd25519PublicKey; +/** + * Creates a new v2 skylink. Matches `NewSkylinkV2` in skyd. + * + * @param siaPublicKey - The public key as a SiaPublicKey. + * @param tweak - The hashed tweak. + * @returns - The v2 skylink. + */ +function newSkylinkV2(siaPublicKey, tweak) { + const version = 2; + const bitfield = version - 1; + const merkleRoot = deriveRegistryEntryID(siaPublicKey, tweak); + return new SiaSkylink(bitfield, merkleRoot); +} +exports.newSkylinkV2 = newSkylinkV2; +/** + * A helper function that decodes the given string representation of a skylink + * into raw bytes. It either performs a base32 decoding, or base64 decoding, + * depending on the length. + * + * @param encoded - The encoded string. + * @returns - The decoded raw bytes. + * @throws - Will throw if the skylink is not a V1 or V2 skylink string. + */ +function decodeSkylink(encoded) { + encoded = string_1.trimUriPrefix(encoded, url_1.uriSkynetPrefix); + let bytes; + if (encoded.length === exports.BASE32_ENCODED_SKYLINK_SIZE) { + bytes = encoding_1.decodeSkylinkBase32(encoded); + } + else if (encoded.length === exports.BASE64_ENCODED_SKYLINK_SIZE) { + bytes = encoding_1.decodeSkylinkBase64(encoded); + } + else { + throw new Error(exports.ERR_SKYLINK_INCORRECT_SIZE); + } + // Sanity check the size of the given data. + /* istanbul ignore next */ + if (bytes.length != exports.RAW_SKYLINK_SIZE) { + throw new Error("failed to load skylink data"); + } + return bytes; +} +exports.decodeSkylink = decodeSkylink; +/** + * A helper to derive an entry id for a registry key value pair. Matches `DeriveRegistryEntryID` in sia. + * + * @param pubKey - The sia public key. + * @param tweak - The tweak. + * @returns - The entry ID as a hash of the inputs. + */ +function deriveRegistryEntryID(pubKey, tweak) { + return crypto_1.hashAll(pubKey.marshalSia(), tweak); +} diff --git a/node_modules/skynet-js/dist/cjs/upload.d.ts b/node_modules/skynet-js/dist/cjs/upload.d.ts new file mode 100644 index 0000000..e1bba4e --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/upload.d.ts @@ -0,0 +1,117 @@ +import { AxiosResponse } from "axios"; +import { BaseCustomOptions } from "./utils/options"; +import { SkynetClient } from "./client"; +/** + * Custom upload options. + * + * @property [endpointUpload] - The relative URL path of the portal endpoint to contact. + * @property [endpointLargeUpload] - The relative URL path of the portal endpoint to contact for large uploads. + * @property [customFilename] - The custom filename to use when uploading files. + * @property [largeFileSize=41943040] - The size at which files are considered "large" and will be uploaded using the tus resumable upload protocol. This is the size of one chunk by default (40 mib). + * @property [retryDelays=[0, 5_000, 15_000, 60_000, 300_000, 600_000]] - An array or undefined, indicating how many milliseconds should pass before the next attempt to uploading will be started after the transfer has been interrupted. The array's length indicates the maximum number of attempts. + */ +export declare type CustomUploadOptions = BaseCustomOptions & { + endpointUpload?: string; + endpointLargeUpload?: string; + customFilename?: string; + largeFileSize?: number; + retryDelays?: number[]; +}; +/** + * The response to an upload request. + * + * @property skylink - 46-character skylink. + */ +export declare type UploadRequestResponse = { + skylink: string; +}; +export declare const defaultUploadOptions: { + endpointUpload: string; + endpointLargeUpload: string; + customFilename: string; + largeFileSize: number; + retryDelays: number[]; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Uploads a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact for small uploads. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact for large uploads. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadFile(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Uploads a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadSmallFile(this: SkynetClient, file: File, customOptions: CustomUploadOptions): Promise; +/** + * Makes a request to upload a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +export declare function uploadSmallFileRequest(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Uploads a large file to Skynet using tus. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadLargeFile(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Makes a request to upload a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +export declare function uploadLargeFileRequest(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Uploads a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadDirectory(this: SkynetClient, directory: Record, filename: string, customOptions?: CustomUploadOptions): Promise; +/** + * Makes a request to upload a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + * @throws - Will throw if the input filename is not a string. + */ +export declare function uploadDirectoryRequest(this: SkynetClient, directory: Record, filename: string, customOptions?: CustomUploadOptions): Promise; +//# sourceMappingURL=upload.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/upload.d.ts.map b/node_modules/skynet-js/dist/cjs/upload.d.ts.map new file mode 100644 index 0000000..9bc91a1 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/upload.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAwC,YAAY,EAAE,MAAM,UAAU,CAAC;AAuB9E;;;;;;;;GAQG;AACH,oBAAY,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;CAShC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAUhC;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,mBAAmB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CAShC;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAGD;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAehC;AAGD;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAmExB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAWhC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAsBxB"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/upload.js b/node_modules/skynet-js/dist/cjs/upload.js new file mode 100644 index 0000000..ef0b16c --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/upload.js @@ -0,0 +1,309 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uploadDirectoryRequest = exports.uploadDirectory = exports.uploadLargeFileRequest = exports.uploadLargeFile = exports.uploadSmallFileRequest = exports.uploadSmallFile = exports.uploadFile = exports.defaultUploadOptions = void 0; +const tus_js_client_1 = require("tus-js-client"); +const file_1 = require("./utils/file"); +const options_1 = require("./utils/options"); +const format_1 = require("./skylink/format"); +const client_1 = require("./client"); +const validation_1 = require("./utils/validation"); +/** + * The tus chunk size is (4MiB - encryptionOverhead) * dataPieces, set in skyd. + */ +const TUS_CHUNK_SIZE = (1 << 22) * 10; +/** + * The retry delays, in ms. Data is stored in skyd for up to 20 minutes, so the + * total delays should not exceed that length of time. + */ +const DEFAULT_TUS_RETRY_DELAYS = [0, 5000, 15000, 60000, 300000, 600000]; +/** + * The portal file field name. + */ +const PORTAL_FILE_FIELD_NAME = "file"; +/** + * The portal directory file field name. + */ +const PORTAL_DIRECTORY_FILE_FIELD_NAME = "files[]"; +exports.defaultUploadOptions = { + ...options_1.defaultBaseOptions, + endpointUpload: "/skynet/skyfile", + endpointLargeUpload: "/skynet/tus", + customFilename: "", + largeFileSize: TUS_CHUNK_SIZE, + retryDelays: DEFAULT_TUS_RETRY_DELAYS, +}; +/** + * Uploads a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact for small uploads. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact for large uploads. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +async function uploadFile(file, customOptions) { + // Validation is done in `uploadFileRequest` or `uploadLargeFileRequest`. + const opts = { ...exports.defaultUploadOptions, ...this.customOptions, ...customOptions }; + if (file.size < opts.largeFileSize) { + return this.uploadSmallFile(file, opts); + } + else { + return this.uploadLargeFile(file, opts); + } +} +exports.uploadFile = uploadFile; +/** + * Uploads a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +async function uploadSmallFile(file, customOptions) { + const response = await this.uploadSmallFileRequest(file, customOptions); + // Sanity check. + validateUploadResponse(response); + const skylink = format_1.formatSkylink(response.data.skylink); + return { skylink }; +} +exports.uploadSmallFile = uploadSmallFile; +/** + * Makes a request to upload a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +async function uploadSmallFileRequest(file, customOptions) { + validateFile("file", file, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultUploadOptions); + const opts = { ...exports.defaultUploadOptions, ...this.customOptions, ...customOptions }; + const formData = new FormData(); + file = ensureFileObjectConsistency(file); + if (opts.customFilename) { + formData.append(PORTAL_FILE_FIELD_NAME, file, opts.customFilename); + } + else { + formData.append(PORTAL_FILE_FIELD_NAME, file); + } + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointUpload, + method: "post", + data: formData, + }); + return response; +} +exports.uploadSmallFileRequest = uploadSmallFileRequest; +/* istanbul ignore next */ +/** + * Uploads a large file to Skynet using tus. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +async function uploadLargeFile(file, customOptions) { + // Validation is done in `uploadLargeFileRequest`. + const response = await this.uploadLargeFileRequest(file, customOptions); + // Sanity check. + validateLargeUploadResponse(response); + // Get the skylink. + let skylink = response.headers["skynet-skylink"]; + // Format the skylink. + skylink = format_1.formatSkylink(skylink); + return { skylink }; +} +exports.uploadLargeFile = uploadLargeFile; +/* istanbul ignore next */ +/** + * Makes a request to upload a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +async function uploadLargeFileRequest(file, customOptions) { + validateFile("file", file, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultUploadOptions); + const opts = { ...exports.defaultUploadOptions, ...this.customOptions, ...customOptions }; + // TODO: Add back upload options once they are implemented in skyd. + const url = await client_1.buildRequestUrl(this, opts.endpointLargeUpload); + const headers = client_1.buildRequestHeaders(undefined, opts.customUserAgent, opts.customCookie); + file = ensureFileObjectConsistency(file); + let filename = file.name; + if (opts.customFilename) { + filename = opts.customFilename; + } + const onProgress = opts.onUploadProgress && + function (bytesSent, bytesTotal) { + const progress = bytesSent / bytesTotal; + // @ts-expect-error TS complains. + opts.onUploadProgress(progress, { loaded: bytesSent, total: bytesTotal }); + }; + return new Promise((resolve, reject) => { + const tusOpts = { + endpoint: url, + chunkSize: TUS_CHUNK_SIZE, + retryDelays: opts.retryDelays, + metadata: { + filename, + filetype: file.type, + }, + headers, + onProgress, + onBeforeRequest: function (req) { + const xhr = req.getUnderlyingObject(); + xhr.withCredentials = true; + }, + onError: (error) => { + // @ts-expect-error tus-client-js Error is not typed correctly. + const res = error.originalResponse; + const message = res ? res.getBody() || error : error; + reject(new Error(message.trim())); + }, + onSuccess: async () => { + if (!upload.url) { + reject(new Error("'upload.url' was not set")); + return; + } + // Call HEAD to get the metadata, including the skylink. + const resp = await this.executeRequest({ + ...opts, + url: upload.url, + endpointPath: opts.endpointLargeUpload, + method: "head", + headers: { ...headers, "Tus-Resumable": "1.0.0" }, + }); + resolve(resp); + }, + }; + const upload = new tus_js_client_1.Upload(file, tusOpts); + upload.start(); + }); +} +exports.uploadLargeFileRequest = uploadLargeFileRequest; +/** + * Uploads a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +async function uploadDirectory(directory, filename, customOptions) { + // Validation is done in `uploadDirectoryRequest`. + const response = await this.uploadDirectoryRequest(directory, filename, customOptions); + // Sanity check. + validateUploadResponse(response); + const skylink = format_1.formatSkylink(response.data.skylink); + return { skylink }; +} +exports.uploadDirectory = uploadDirectory; +/** + * Makes a request to upload a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + * @throws - Will throw if the input filename is not a string. + */ +async function uploadDirectoryRequest(directory, filename, customOptions) { + validation_1.validateObject("directory", directory, "parameter"); + validation_1.validateString("filename", filename, "parameter"); + validation_1.validateOptionalObject("customOptions", customOptions, "parameter", exports.defaultUploadOptions); + const opts = { ...exports.defaultUploadOptions, ...this.customOptions, ...customOptions }; + const formData = new FormData(); + Object.entries(directory).forEach(([path, file]) => { + file = ensureFileObjectConsistency(file); + formData.append(PORTAL_DIRECTORY_FILE_FIELD_NAME, file, path); + }); + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointUpload, + method: "post", + data: formData, + query: { filename }, + }); + return response; +} +exports.uploadDirectoryRequest = uploadDirectoryRequest; +/** + * Sometimes file object might have had the type property defined manually with + * Object.defineProperty and some browsers (namely firefox) can have problems + * reading it after the file has been appended to form data. To overcome this, + * we recreate the file object using native File constructor with a type defined + * as a constructor argument. + * + * @param file - The input file. + * @returns - The processed file. + */ +function ensureFileObjectConsistency(file) { + return new File([file], file.name, { type: file_1.getFileMimeType(file) }); +} +/** + * Validates the given value as a file. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid file. + */ +function validateFile(name, value, valueKind) { + if (!(value instanceof File)) { + validation_1.throwValidationError(name, value, valueKind, "type 'File'"); + } +} +/** + * Validates the upload response. + * + * @param response - The upload response. + * @throws - Will throw if not a valid upload response. + */ +function validateUploadResponse(response) { + try { + if (!response.data) { + throw new Error("response.data field missing"); + } + validation_1.validateString("skylink", response.data.skylink, "upload response field"); + } + catch (err) { + throw new Error(`Did not get a complete upload response despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} +/* istanbul ignore next */ +/** + * Validates the large upload response. + * + * @param response - The upload response. + * @throws - Will throw if not a valid upload response. + */ +function validateLargeUploadResponse(response) { + try { + if (!response.headers) { + throw new Error("response.headers field missing"); + } + validation_1.validateString('response.headers["skynet-skylink"]', response.headers["skynet-skylink"], "upload response field"); + } + catch (err) { + throw new Error(`Did not get a complete upload response despite a successful request. Please try again and report this issue to the devs if it persists. Error: ${err}`); + } +} diff --git a/node_modules/skynet-js/dist/cjs/utils/array.d.ts b/node_modules/skynet-js/dist/cjs/utils/array.d.ts new file mode 100644 index 0000000..c2c6ba7 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/array.d.ts @@ -0,0 +1,10 @@ +/** + * Returns true if the two uint8 arrays are equal. From + * https://stackoverflow.com/a/60818105/6085242 + * + * @param array1 - The first uint8 array. + * @param array2 - The second uint8 array. + * @returns - Whether the arrays are equal. + */ +export declare function areEqualUint8Arrays(array1: Uint8Array, array2: Uint8Array): boolean; +//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/array.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/array.d.ts.map new file mode 100644 index 0000000..5da7682 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/utils/array.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAUnF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/array.js b/node_modules/skynet-js/dist/cjs/utils/array.js new file mode 100644 index 0000000..bc5433b --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/array.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.areEqualUint8Arrays = void 0; +/** + * Returns true if the two uint8 arrays are equal. From + * https://stackoverflow.com/a/60818105/6085242 + * + * @param array1 - The first uint8 array. + * @param array2 - The second uint8 array. + * @returns - Whether the arrays are equal. + */ +function areEqualUint8Arrays(array1, array2) { + if (array1.length != array2.length) { + return false; + } + for (let i = 0; i < array1.length; i++) { + if (array1[i] != array2[i]) { + return false; + } + } + return true; +} +exports.areEqualUint8Arrays = areEqualUint8Arrays; diff --git a/node_modules/skynet-js/dist/cjs/utils/encoding.d.ts b/node_modules/skynet-js/dist/cjs/utils/encoding.d.ts new file mode 100644 index 0000000..5c5061b --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/encoding.d.ts @@ -0,0 +1,58 @@ +/** + * Decodes the skylink encoded using base32 encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +export declare function decodeSkylinkBase32(skylink: string): Uint8Array; +/** + * Encodes the bytes to a skylink encoded using base32 encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +export declare function encodeSkylinkBase32(bytes: Uint8Array): string; +/** + * Decodes the skylink encoded using base64 raw URL encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +export declare function decodeSkylinkBase64(skylink: string): Uint8Array; +/** + * Encodes the bytes to a skylink encoded using base64 raw URL encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +export declare function encodeSkylinkBase64(bytes: Uint8Array): string; +/** + * Converts the given number into a uint8 array + * + * @param num - Number to encode. + * @returns - Number encoded as a byte array. + */ +export declare function encodeNumber(num: number): Uint8Array; +/** + * Encodes the given bigint into a uint8 array. + * + * @param int - Bigint to encode. + * @returns - Bigint encoded as a byte array. + * @throws - Will throw if the int does not fit in 64 bits. + */ +export declare function encodeBigintAsUint64(int: bigint): Uint8Array; +/** + * Encodes the uint8array, prefixed by its length. + * + * @param bytes - The input array. + * @returns - The encoded byte array. + */ +export declare function encodePrefixedBytes(bytes: Uint8Array): Uint8Array; +/** + * Encodes the given UTF-8 string into a uint8 array containing the string length and the string. + * + * @param str - String to encode. + * @returns - String encoded as a byte array. + */ +export declare function encodeUtf8String(str: string): Uint8Array; +//# sourceMappingURL=encoding.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/encoding.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/encoding.d.ts.map new file mode 100644 index 0000000..872ff07 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/encoding.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAI/D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAM/D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAO7D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAQpD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAW5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAWjE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMxD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/encoding.js b/node_modules/skynet-js/dist/cjs/utils/encoding.js new file mode 100644 index 0000000..9e9e7dc --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/encoding.js @@ -0,0 +1,129 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.encodeUtf8String = exports.encodePrefixedBytes = exports.encodeBigintAsUint64 = exports.encodeNumber = exports.encodeSkylinkBase64 = exports.decodeSkylinkBase64 = exports.encodeSkylinkBase32 = exports.decodeSkylinkBase32 = void 0; +const base32_decode_1 = __importDefault(require("base32-decode")); +const base32_encode_1 = __importDefault(require("base32-encode")); +const base64_js_1 = require("base64-js"); +const number_1 = require("./number"); +const string_1 = require("./string"); +const BASE32_ENCODING_VARIANT = "RFC4648-HEX"; +/** + * Decodes the skylink encoded using base32 encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +function decodeSkylinkBase32(skylink) { + skylink = skylink.toUpperCase(); + const bytes = base32_decode_1.default(skylink, BASE32_ENCODING_VARIANT); + return new Uint8Array(bytes); +} +exports.decodeSkylinkBase32 = decodeSkylinkBase32; +/** + * Encodes the bytes to a skylink encoded using base32 encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +function encodeSkylinkBase32(bytes) { + return base32_encode_1.default(bytes, BASE32_ENCODING_VARIANT, { padding: false }).toLowerCase(); +} +exports.encodeSkylinkBase32 = encodeSkylinkBase32; +/** + * Decodes the skylink encoded using base64 raw URL encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +function decodeSkylinkBase64(skylink) { + // Add padding. + skylink = `${skylink}==`; + // Convert from URL encoding. + skylink = skylink.replace(/-/g, "+").replace(/_/g, "/"); + return base64_js_1.toByteArray(skylink); +} +exports.decodeSkylinkBase64 = decodeSkylinkBase64; +/** + * Encodes the bytes to a skylink encoded using base64 raw URL encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +function encodeSkylinkBase64(bytes) { + let base64 = base64_js_1.fromByteArray(bytes); + // Convert to URL encoding. + base64 = base64.replace(/\+/g, "-").replace(/\//g, "_"); + // Remove trailing "==". This will always be present as the skylink encoding + // gets padded so that the string is a multiple of 4 characters in length. + return base64.slice(0, -2); +} +exports.encodeSkylinkBase64 = encodeSkylinkBase64; +/** + * Converts the given number into a uint8 array + * + * @param num - Number to encode. + * @returns - Number encoded as a byte array. + */ +function encodeNumber(num) { + const encoded = new Uint8Array(8); + for (let index = 0; index < encoded.length; index++) { + const byte = num & 0xff; + encoded[index] = byte; + num = num >> 8; + } + return encoded; +} +exports.encodeNumber = encodeNumber; +/** + * Encodes the given bigint into a uint8 array. + * + * @param int - Bigint to encode. + * @returns - Bigint encoded as a byte array. + * @throws - Will throw if the int does not fit in 64 bits. + */ +function encodeBigintAsUint64(int) { + // Assert the input is 64 bits. + number_1.assertUint64(int); + const encoded = new Uint8Array(8); + for (let index = 0; index < encoded.length; index++) { + const byte = int & BigInt(0xff); + encoded[index] = Number(byte); + int = int >> BigInt(8); + } + return encoded; +} +exports.encodeBigintAsUint64 = encodeBigintAsUint64; +/** + * Encodes the uint8array, prefixed by its length. + * + * @param bytes - The input array. + * @returns - The encoded byte array. + */ +function encodePrefixedBytes(bytes) { + const len = bytes.length; + const buf = new ArrayBuffer(8 + len); + const view = new DataView(buf); + // Sia uses setUint64 which is unavailable in JS. + view.setUint32(0, len, true); + const uint8Bytes = new Uint8Array(buf); + uint8Bytes.set(bytes, 8); + return uint8Bytes; +} +exports.encodePrefixedBytes = encodePrefixedBytes; +/** + * Encodes the given UTF-8 string into a uint8 array containing the string length and the string. + * + * @param str - String to encode. + * @returns - String encoded as a byte array. + */ +function encodeUtf8String(str) { + const byteArray = string_1.stringToUint8ArrayUtf8(str); + const encoded = new Uint8Array(8 + byteArray.length); + encoded.set(encodeNumber(byteArray.length)); + encoded.set(byteArray, 8); + return encoded; +} +exports.encodeUtf8String = encodeUtf8String; diff --git a/node_modules/skynet-js/dist/cjs/utils/file.d.ts b/node_modules/skynet-js/dist/cjs/utils/file.d.ts new file mode 100644 index 0000000..cd71c48 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/file.d.ts @@ -0,0 +1,23 @@ +/** + * Gets the file path relative to the root directory of the path, e.g. `bar` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The relative file path. + */ +export declare function getRelativeFilePath(file: File): string; +/** + * Gets the root directory of the file path, e.g. `foo` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The root directory. + */ +export declare function getRootDirectory(file: File): string; +/** + * Get the file mime type. In case the type is not provided, use mime-db and try + * to guess the file type based on the extension. + * + * @param file - The file. + * @returns - The mime type. + */ +export declare function getFileMimeType(file: File): string; +//# sourceMappingURL=file.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/file.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/file.d.ts.map new file mode 100644 index 0000000..2d0f173 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/file.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/utils/file.ts"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMtD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKnD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAWlD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/file.js b/node_modules/skynet-js/dist/cjs/utils/file.js new file mode 100644 index 0000000..fdd30ad --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/file.js @@ -0,0 +1,65 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFileMimeType = exports.getRootDirectory = exports.getRelativeFilePath = void 0; +const lite_1 = __importDefault(require("mime/lite")); +const path_browserify_1 = __importDefault(require("path-browserify")); +const string_1 = require("./string"); +/** + * Gets the path for the file. + * + * @param file - The file. + * @returns - The path. + */ +function getFilePath(file) { + /* istanbul ignore next */ + return file.webkitRelativePath || file.path || file.name; +} +/** + * Gets the file path relative to the root directory of the path, e.g. `bar` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The relative file path. + */ +function getRelativeFilePath(file) { + const filePath = getFilePath(file); + const { root, dir, base } = path_browserify_1.default.parse(filePath); + const relative = path_browserify_1.default.normalize(dir).slice(root.length).split(path_browserify_1.default.sep).slice(1); + return path_browserify_1.default.join(...relative, base); +} +exports.getRelativeFilePath = getRelativeFilePath; +/** + * Gets the root directory of the file path, e.g. `foo` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The root directory. + */ +function getRootDirectory(file) { + const filePath = getFilePath(file); + const { root, dir } = path_browserify_1.default.parse(filePath); + return path_browserify_1.default.normalize(dir).slice(root.length).split(path_browserify_1.default.sep)[0]; +} +exports.getRootDirectory = getRootDirectory; +/** + * Get the file mime type. In case the type is not provided, use mime-db and try + * to guess the file type based on the extension. + * + * @param file - The file. + * @returns - The mime type. + */ +function getFileMimeType(file) { + if (file.type) + return file.type; + let { ext } = path_browserify_1.default.parse(file.name); + ext = string_1.trimPrefix(ext, "."); + if (ext !== "") { + const mimeType = lite_1.default.getType(ext); + if (mimeType) { + return mimeType; + } + } + return ""; +} +exports.getFileMimeType = getFileMimeType; diff --git a/node_modules/skynet-js/dist/cjs/utils/number.d.ts b/node_modules/skynet-js/dist/cjs/utils/number.d.ts new file mode 100644 index 0000000..64cefda --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/number.d.ts @@ -0,0 +1,13 @@ +/** + * The maximum allowed value for an entry revision. Setting an entry revision to this value prevents it from being updated further. + */ +export declare const MAX_REVISION: bigint; +/** + * Checks if the provided bigint can fit in a 64-bit unsigned integer. + * + * @param int - The provided integer. + * @throws - Will throw if the int does not fit in 64 bits. + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN | MDN Demo} + */ +export declare function assertUint64(int: bigint): void; +//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/number.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/number.d.ts.map new file mode 100644 index 0000000..69c925e --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/number.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/utils/number.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAiC,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAU9C"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/number.js b/node_modules/skynet-js/dist/cjs/utils/number.js new file mode 100644 index 0000000..0d578bf --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/number.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertUint64 = exports.MAX_REVISION = void 0; +const validation_1 = require("./validation"); +/** + * The maximum allowed value for an entry revision. Setting an entry revision to this value prevents it from being updated further. + */ +exports.MAX_REVISION = BigInt("18446744073709551615"); // max uint64 +/** + * Checks if the provided bigint can fit in a 64-bit unsigned integer. + * + * @param int - The provided integer. + * @throws - Will throw if the int does not fit in 64 bits. + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN | MDN Demo} + */ +function assertUint64(int) { + validation_1.validateBigint("int", int, "parameter"); + if (int < BigInt(0)) { + throw new Error(`Argument ${int} must be an unsigned 64-bit integer; was negative`); + } + if (int > exports.MAX_REVISION) { + throw new Error(`Argument ${int} does not fit in a 64-bit unsigned integer; exceeds 2^64-1`); + } +} +exports.assertUint64 = assertUint64; diff --git a/node_modules/skynet-js/dist/cjs/utils/options.d.ts b/node_modules/skynet-js/dist/cjs/utils/options.d.ts new file mode 100644 index 0000000..171bd14 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/options.d.ts @@ -0,0 +1,24 @@ +import { CustomClientOptions } from "../client"; +/** + * Base custom options for methods hitting the API. + */ +export declare type BaseCustomOptions = CustomClientOptions; +/** + * The default base custom options. + */ +export declare const defaultBaseOptions: { + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Extract only the model's custom options from the given options. + * + * @param opts - The given options. + * @param model - The model options. + * @returns - The extracted custom options. + * @throws - If the given opts don't contain all properties of the model. + */ +export declare function extractOptions>(opts: Record, model: T): T; +//# sourceMappingURL=options.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/options.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/options.d.ts.map new file mode 100644 index 0000000..f77efc4 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/utils/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;GAEG;AACH,oBAAY,iBAAiB,GAAG,mBAAmB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAe5G"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/options.js b/node_modules/skynet-js/dist/cjs/utils/options.js new file mode 100644 index 0000000..7553982 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/options.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extractOptions = exports.defaultBaseOptions = void 0; +/** + * The default base custom options. + */ +exports.defaultBaseOptions = { + APIKey: "", + customUserAgent: "", + customCookie: "", + onUploadProgress: undefined, +}; +/** + * Extract only the model's custom options from the given options. + * + * @param opts - The given options. + * @param model - The model options. + * @returns - The extracted custom options. + * @throws - If the given opts don't contain all properties of the model. + */ +function extractOptions(opts, model) { + const result = {}; + for (const property in model) { + /* istanbul ignore next */ + if (!Object.prototype.hasOwnProperty.call(model, property)) { + continue; + } + // Throw if the given options don't contain the model's property. + if (!Object.prototype.hasOwnProperty.call(opts, property)) { + throw new Error(`Property '${property}' not found`); + } + result[property] = opts[property]; + } + return result; +} +exports.extractOptions = extractOptions; diff --git a/node_modules/skynet-js/dist/cjs/utils/string.d.ts b/node_modules/skynet-js/dist/cjs/utils/string.d.ts new file mode 100644 index 0000000..80e45da --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/string.d.ts @@ -0,0 +1,81 @@ +/** + * Prepends the prefix to the given string only if the string does not already start with the prefix. + * + * @param str - The string. + * @param prefix - The prefix. + * @returns - The prefixed string. + */ +export declare function ensurePrefix(str: string, prefix: string): string; +/** + * Removes slashes from the beginning and end of the string. + * + * @param str - The string to process. + * @returns - The processed string. + */ +export declare function trimForwardSlash(str: string): string; +/** + * Removes a prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export declare function trimPrefix(str: string, prefix: string, limit?: number): string; +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export declare function trimSuffix(str: string, suffix: string, limit?: number): string; +/** + * Removes a URI prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @returns - The processed string. + */ +export declare function trimUriPrefix(str: string, prefix: string): string; +/** + * Converts a UTF-8 string to a uint8 array containing valid UTF-8 bytes. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a string. + */ +export declare function stringToUint8ArrayUtf8(str: string): Uint8Array; +/** + * Converts a uint8 array containing valid utf-8 bytes to a string. + * + * @param array - The uint8 array to convert. + * @returns - The string. + */ +export declare function uint8ArrayToStringUtf8(array: Uint8Array): string; +/** + * Converts a hex encoded string to a uint8 array. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a valid hex-encoded string or is an empty string. + */ +export declare function hexToUint8Array(str: string): Uint8Array; +/** + * Returns true if the input is a valid hex-encoded string. + * + * @param str - The input string. + * @returns - True if the input is hex-encoded. + * @throws - Will throw if the input is not a string. + */ +export declare function isHexString(str: string): boolean; +/** + * Convert a byte array to a hex string. + * + * @param byteArray - The byte array to convert. + * @returns - The hex string. + * @see {@link https://stackoverflow.com/a/44608819|Stack Overflow} + */ +export declare function toHexString(byteArray: Uint8Array): string; +//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/string.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/string.d.ts.map new file mode 100644 index 0000000..aa9031d --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAGD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9E;AAGD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWjE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAI9D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CASvD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAMzD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/string.js b/node_modules/skynet-js/dist/cjs/utils/string.js new file mode 100644 index 0000000..ca781f0 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/string.js @@ -0,0 +1,158 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toHexString = exports.isHexString = exports.hexToUint8Array = exports.uint8ArrayToStringUtf8 = exports.stringToUint8ArrayUtf8 = exports.trimUriPrefix = exports.trimSuffix = exports.trimPrefix = exports.trimForwardSlash = exports.ensurePrefix = void 0; +const buffer_1 = require("buffer"); +const validation_1 = require("./validation"); +/** + * Prepends the prefix to the given string only if the string does not already start with the prefix. + * + * @param str - The string. + * @param prefix - The prefix. + * @returns - The prefixed string. + */ +function ensurePrefix(str, prefix) { + if (!str.startsWith(prefix)) { + str = `${prefix}${str}`; + } + return str; +} +exports.ensurePrefix = ensurePrefix; +/** + * Removes slashes from the beginning and end of the string. + * + * @param str - The string to process. + * @returns - The processed string. + */ +function trimForwardSlash(str) { + return trimPrefix(trimSuffix(str, "/"), "/"); +} +exports.trimForwardSlash = trimForwardSlash; +// TODO: Move to mysky-utils +/** + * Removes a prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +function trimPrefix(str, prefix, limit) { + while (str.startsWith(prefix)) { + if (limit !== undefined && limit <= 0) { + break; + } + str = str.slice(prefix.length); + if (limit) { + limit -= 1; + } + } + return str; +} +exports.trimPrefix = trimPrefix; +// TODO: Move to mysky-utils +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +function trimSuffix(str, suffix, limit) { + while (str.endsWith(suffix)) { + if (limit !== undefined && limit <= 0) { + break; + } + str = str.substring(0, str.length - suffix.length); + if (limit) { + limit -= 1; + } + } + return str; +} +exports.trimSuffix = trimSuffix; +/** + * Removes a URI prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @returns - The processed string. + */ +function trimUriPrefix(str, prefix) { + const shortPrefix = trimSuffix(prefix, "/"); + if (str.startsWith(prefix)) { + // longPrefix is exactly at the beginning + return str.slice(prefix.length); + } + if (str.startsWith(shortPrefix)) { + // else prefix is exactly at the beginning + return str.slice(shortPrefix.length); + } + return str; +} +exports.trimUriPrefix = trimUriPrefix; +/** + * Converts a UTF-8 string to a uint8 array containing valid UTF-8 bytes. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a string. + */ +function stringToUint8ArrayUtf8(str) { + validation_1.validateString("str", str, "parameter"); + return Uint8Array.from(buffer_1.Buffer.from(str, "utf-8")); +} +exports.stringToUint8ArrayUtf8 = stringToUint8ArrayUtf8; +/** + * Converts a uint8 array containing valid utf-8 bytes to a string. + * + * @param array - The uint8 array to convert. + * @returns - The string. + */ +function uint8ArrayToStringUtf8(array) { + return buffer_1.Buffer.from(array).toString("utf-8"); +} +exports.uint8ArrayToStringUtf8 = uint8ArrayToStringUtf8; +/** + * Converts a hex encoded string to a uint8 array. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a valid hex-encoded string or is an empty string. + */ +function hexToUint8Array(str) { + validation_1.validateHexString("str", str, "parameter"); + const matches = str.match(/.{1,2}/g); + if (matches === null) { + throw validation_1.throwValidationError("str", str, "parameter", "a hex-encoded string"); + } + return new Uint8Array(matches.map((byte) => parseInt(byte, 16))); +} +exports.hexToUint8Array = hexToUint8Array; +/** + * Returns true if the input is a valid hex-encoded string. + * + * @param str - The input string. + * @returns - True if the input is hex-encoded. + * @throws - Will throw if the input is not a string. + */ +function isHexString(str) { + validation_1.validateString("str", str, "parameter"); + return /^[0-9A-Fa-f]*$/g.test(str); +} +exports.isHexString = isHexString; +/** + * Convert a byte array to a hex string. + * + * @param byteArray - The byte array to convert. + * @returns - The hex string. + * @see {@link https://stackoverflow.com/a/44608819|Stack Overflow} + */ +function toHexString(byteArray) { + let s = ""; + byteArray.forEach(function (byte) { + s += ("0" + (byte & 0xff).toString(16)).slice(-2); + }); + return s; +} +exports.toHexString = toHexString; diff --git a/node_modules/skynet-js/dist/cjs/utils/url.d.ts b/node_modules/skynet-js/dist/cjs/utils/url.d.ts new file mode 100644 index 0000000..6bed9f0 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/url.d.ts @@ -0,0 +1,60 @@ +export declare const defaultSkynetPortalUrl = "https://siasky.net"; +export declare const uriHandshakePrefix = "hns://"; +export declare const uriSkynetPrefix = "sia://"; +/** + * Returns the default portal URL. + * + * @returns - The portal URL. + */ +export declare function defaultPortalUrl(): string; +/** + * Adds a path to the given URL. + * + * @param url - The URL. + * @param path - The given path. + * @returns - The final URL. + */ +export declare function addPath(url: string, path: string): string; +/** + * Adds a subdomain to the given URL. + * + * @param url - The URL. + * @param subdomain - The subdomain to add. + * @returns - The final URL. + */ +export declare function addSubdomain(url: string, subdomain: string): string; +/** + * Adds a query to the given URL. + * + * @param url - The URL. + * @param query - The query parameters. + * @returns - The final URL. + */ +export declare function addUrlQuery(url: string, query: Record): string; +/** + * Properly joins paths together to create a URL. Takes a variable number of + * arguments. + * + * @param args - Array of URL parts to join. + * @returns - Final URL constructed from the input parts. + */ +export declare function makeUrl(...args: string[]): string; +/** + * Constructs the full URL for the given domain, + * e.g. ("https://siasky.net", "dac.hns/path/file") => "https://dac.hns.siasky.net/path/file" + * + * @param portalUrl - The portal URL. + * @param domain - Domain. + * @returns - The full URL for the given domain. + */ +export declare function getFullDomainUrlForPortal(portalUrl: string, domain: string): string; +/** + * Extracts the domain from the given portal URL, + * e.g. ("https://siasky.net", "dac.hns.siasky.net/path/file") => "dac.hns/path/file" + * + * @param portalUrl - The portal URL. + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +export declare function extractDomainForPortal(portalUrl: string, fullDomain: string): string; +//# sourceMappingURL=url.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/url.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/url.d.ts.map new file mode 100644 index 0000000..24344dc --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/url.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,eAAe,WAAW,CAAC;AAIxC;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBzD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKnE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAM/E;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAKjD;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAwBnF;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAiCpF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/url.js b/node_modules/skynet-js/dist/cjs/utils/url.js new file mode 100644 index 0000000..532fe75 --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/url.js @@ -0,0 +1,168 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extractDomainForPortal = exports.getFullDomainUrlForPortal = exports.makeUrl = exports.addUrlQuery = exports.addSubdomain = exports.addPath = exports.defaultPortalUrl = exports.uriSkynetPrefix = exports.uriHandshakePrefix = exports.defaultSkynetPortalUrl = void 0; +const url_parse_1 = __importDefault(require("url-parse")); +const url_join_1 = __importDefault(require("url-join")); +const string_1 = require("./string"); +const validation_1 = require("./validation"); +exports.defaultSkynetPortalUrl = "https://siasky.net"; +exports.uriHandshakePrefix = "hns://"; +exports.uriSkynetPrefix = "sia://"; +// TODO: This will be smarter. See +// https://github.com/SkynetLabs/skynet-docs/issues/5. +/** + * Returns the default portal URL. + * + * @returns - The portal URL. + */ +function defaultPortalUrl() { + /* istanbul ignore next */ + if (typeof window === "undefined") + return "/"; // default to path root on ssr + return window.location.origin; +} +exports.defaultPortalUrl = defaultPortalUrl; +/** + * Adds a path to the given URL. + * + * @param url - The URL. + * @param path - The given path. + * @returns - The final URL. + */ +function addPath(url, path) { + validation_1.validateString("url", url, "parameter"); + validation_1.validateString("path", path, "parameter"); + path = string_1.trimForwardSlash(path); + let str; + if (url === "localhost") { + // Special handling for localhost. + str = `localhost/${path}`; + } + else { + // Construct a URL object and set the pathname property. + const urlObj = new URL(url); + urlObj.pathname = path; + str = urlObj.toString(); + } + return string_1.trimSuffix(str, "/"); +} +exports.addPath = addPath; +/** + * Adds a subdomain to the given URL. + * + * @param url - The URL. + * @param subdomain - The subdomain to add. + * @returns - The final URL. + */ +function addSubdomain(url, subdomain) { + const urlObj = new URL(url); + urlObj.hostname = `${subdomain}.${urlObj.hostname}`; + const str = urlObj.toString(); + return string_1.trimSuffix(str, "/"); +} +exports.addSubdomain = addSubdomain; +/** + * Adds a query to the given URL. + * + * @param url - The URL. + * @param query - The query parameters. + * @returns - The final URL. + */ +function addUrlQuery(url, query) { + const parsed = url_parse_1.default(url, true); + // Combine the desired query params with the already existing ones. + query = { ...parsed.query, ...query }; + parsed.set("query", query); + return parsed.toString(); +} +exports.addUrlQuery = addUrlQuery; +/** + * Properly joins paths together to create a URL. Takes a variable number of + * arguments. + * + * @param args - Array of URL parts to join. + * @returns - Final URL constructed from the input parts. + */ +function makeUrl(...args) { + if (args.length === 0) { + validation_1.throwValidationError("args", args, "parameter", "non-empty"); + } + return args.reduce((acc, cur) => url_join_1.default(acc, cur)); +} +exports.makeUrl = makeUrl; +/** + * Constructs the full URL for the given domain, + * e.g. ("https://siasky.net", "dac.hns/path/file") => "https://dac.hns.siasky.net/path/file" + * + * @param portalUrl - The portal URL. + * @param domain - Domain. + * @returns - The full URL for the given domain. + */ +function getFullDomainUrlForPortal(portalUrl, domain) { + validation_1.validateString("portalUrl", portalUrl, "parameter"); + validation_1.validateString("domain", domain, "parameter"); + domain = string_1.trimUriPrefix(domain, exports.uriSkynetPrefix); + domain = string_1.trimForwardSlash(domain); + // Split on first / to get the path. + let path; + [domain, path] = domain.split(/\/(.+)/); + // Add to subdomain. + let url; + if (domain === "localhost") { + // Special handling for localhost. + url = "localhost"; + } + else { + url = addSubdomain(portalUrl, domain); + } + // Add back the path if there was one. + if (path) { + url = addPath(url, path); + } + return url; +} +exports.getFullDomainUrlForPortal = getFullDomainUrlForPortal; +/** + * Extracts the domain from the given portal URL, + * e.g. ("https://siasky.net", "dac.hns.siasky.net/path/file") => "dac.hns/path/file" + * + * @param portalUrl - The portal URL. + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +function extractDomainForPortal(portalUrl, fullDomain) { + validation_1.validateString("portalUrl", portalUrl, "parameter"); + validation_1.validateString("fullDomain", fullDomain, "parameter"); + let path; + try { + // Try to extract the domain from the fullDomain. + const fullDomainObj = new URL(fullDomain); + fullDomain = fullDomainObj.hostname; + path = fullDomainObj.pathname; + path = string_1.trimForwardSlash(path); + } + catch { + // If fullDomain is not a URL, ignore the error and use it as-is. + // + // Trim any slashes from the input URL. + fullDomain = string_1.trimForwardSlash(fullDomain); + // Split on first / to get the path. + [fullDomain, path] = fullDomain.split(/\/(.+)/); + } + // Get the portal domain. + const portalUrlObj = new URL(portalUrl); + const portalDomain = string_1.trimForwardSlash(portalUrlObj.hostname); + // Remove the portal domain from the domain. + let domain = string_1.trimSuffix(fullDomain, portalDomain, 1); + domain = string_1.trimSuffix(domain, "."); + // Add back the path if there is one. + if (path && path !== "") { + path = string_1.trimForwardSlash(path); + domain = `${domain}/${path}`; + } + return domain; +} +exports.extractDomainForPortal = extractDomainForPortal; diff --git a/node_modules/skynet-js/dist/cjs/utils/validation.d.ts b/node_modules/skynet-js/dist/cjs/utils/validation.d.ts new file mode 100644 index 0000000..9a31b3f --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/validation.d.ts @@ -0,0 +1,114 @@ +/** + * Validates the given value as a bigint. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid bigint. + */ +export declare function validateBigint(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a boolean. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid boolean. + */ +export declare function validateBoolean(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as an object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid object. + */ +export declare function validateObject(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as an optional object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param model - A model object that contains all possible fields. 'value' does not need to have all fields, but it may not have any fields not contained in 'model'. + * @throws - Will throw if not a valid optional object. + */ +export declare function validateOptionalObject(name: string, value: unknown, valueKind: string, model: Record): void; +/** + * Validates the given value as a number. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid number. + */ +export declare function validateNumber(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a skylink string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @returns - The validated and parsed skylink. + * @throws - Will throw if not a valid skylink string. + */ +export declare function validateSkylinkString(name: string, value: unknown, valueKind: string): string; +/** + * Validates the given value as a string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid string. + */ +export declare function validateString(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a string of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid string of the given length. + */ +export declare function validateStringLen(name: string, value: unknown, valueKind: string, len: number): void; +/** + * Validates the given value as a hex-encoded string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid hex-encoded string. + */ +export declare function validateHexString(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a uint8array. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid uint8array. + */ +export declare function validateUint8Array(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a uint8array of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid uint8array of the given length. + */ +export declare function validateUint8ArrayLen(name: string, value: unknown, valueKind: string, len: number): void; +/** + * Throws an error for the given value + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param expected - The expected aspect of the value that could not be validated (e.g. "type 'string'" or "non-null"). + * @throws - Will always throw. + */ +export declare function throwValidationError(name: string, value: unknown, valueKind: string, expected: string): void; +//# sourceMappingURL=validation.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/validation.d.ts.map b/node_modules/skynet-js/dist/cjs/utils/validation.d.ts.map new file mode 100644 index 0000000..0929ffe --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/validation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIpF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIrF;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAOpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI,CAaN;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS7F;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAMpG;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAKvF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIxF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAMxG;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAU5G"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/cjs/utils/validation.js b/node_modules/skynet-js/dist/cjs/utils/validation.js new file mode 100644 index 0000000..34e07cb --- /dev/null +++ b/node_modules/skynet-js/dist/cjs/utils/validation.js @@ -0,0 +1,205 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.throwValidationError = exports.validateUint8ArrayLen = exports.validateUint8Array = exports.validateHexString = exports.validateStringLen = exports.validateString = exports.validateSkylinkString = exports.validateNumber = exports.validateOptionalObject = exports.validateObject = exports.validateBoolean = exports.validateBigint = void 0; +const parse_1 = require("../skylink/parse"); +const string_1 = require("./string"); +/** + * Validates the given value as a bigint. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid bigint. + */ +function validateBigint(name, value, valueKind) { + if (typeof value !== "bigint") { + throwValidationError(name, value, valueKind, "type 'bigint'"); + } +} +exports.validateBigint = validateBigint; +/** + * Validates the given value as a boolean. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid boolean. + */ +function validateBoolean(name, value, valueKind) { + if (typeof value !== "boolean") { + throwValidationError(name, value, valueKind, "type 'boolean'"); + } +} +exports.validateBoolean = validateBoolean; +/** + * Validates the given value as an object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid object. + */ +function validateObject(name, value, valueKind) { + if (typeof value !== "object") { + throwValidationError(name, value, valueKind, "type 'object'"); + } + if (value === null) { + throwValidationError(name, value, valueKind, "non-null"); + } +} +exports.validateObject = validateObject; +/** + * Validates the given value as an optional object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param model - A model object that contains all possible fields. 'value' does not need to have all fields, but it may not have any fields not contained in 'model'. + * @throws - Will throw if not a valid optional object. + */ +function validateOptionalObject(name, value, valueKind, model) { + if (!value) { + // This is okay, the object is optional. + return; + } + validateObject(name, value, valueKind); + // Check if all given properties of value also exist in the model. + for (const property in value) { + if (!(property in model)) { + throw new Error(`Object ${valueKind} '${name}' contains unexpected property '${property}'`); + } + } +} +exports.validateOptionalObject = validateOptionalObject; +/** + * Validates the given value as a number. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid number. + */ +function validateNumber(name, value, valueKind) { + if (typeof value !== "number") { + throwValidationError(name, value, valueKind, "type 'number'"); + } +} +exports.validateNumber = validateNumber; +/** + * Validates the given value as a skylink string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @returns - The validated and parsed skylink. + * @throws - Will throw if not a valid skylink string. + */ +function validateSkylinkString(name, value, valueKind) { + validateString(name, value, valueKind); + const parsedSkylink = parse_1.parseSkylink(value); + if (parsedSkylink === null) { + throw throwValidationError(name, value, valueKind, `valid skylink of type 'string'`); + } + return parsedSkylink; +} +exports.validateSkylinkString = validateSkylinkString; +/** + * Validates the given value as a string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid string. + */ +function validateString(name, value, valueKind) { + if (typeof value !== "string") { + throwValidationError(name, value, valueKind, "type 'string'"); + } +} +exports.validateString = validateString; +/** + * Validates the given value as a string of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid string of the given length. + */ +function validateStringLen(name, value, valueKind, len) { + validateString(name, value, valueKind); + const actualLen = value.length; + if (actualLen !== len) { + throwValidationError(name, value, valueKind, `type 'string' of length ${len}, was length ${actualLen}`); + } +} +exports.validateStringLen = validateStringLen; +/** + * Validates the given value as a hex-encoded string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid hex-encoded string. + */ +function validateHexString(name, value, valueKind) { + validateString(name, value, valueKind); + if (!string_1.isHexString(value)) { + throwValidationError(name, value, valueKind, "a hex-encoded string"); + } +} +exports.validateHexString = validateHexString; +/** + * Validates the given value as a uint8array. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid uint8array. + */ +function validateUint8Array(name, value, valueKind) { + if (!(value instanceof Uint8Array)) { + throwValidationError(name, value, valueKind, "type 'Uint8Array'"); + } +} +exports.validateUint8Array = validateUint8Array; +/** + * Validates the given value as a uint8array of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid uint8array of the given length. + */ +function validateUint8ArrayLen(name, value, valueKind, len) { + validateUint8Array(name, value, valueKind); + const actualLen = value.length; + if (actualLen !== len) { + throwValidationError(name, value, valueKind, `type 'Uint8Array' of length ${len}, was length ${actualLen}`); + } +} +exports.validateUint8ArrayLen = validateUint8ArrayLen; +/** + * Throws an error for the given value + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param expected - The expected aspect of the value that could not be validated (e.g. "type 'string'" or "non-null"). + * @throws - Will always throw. + */ +function throwValidationError(name, value, valueKind, expected) { + let actualValue; + if (value === undefined) { + actualValue = "type 'undefined'"; + } + else if (value === null) { + actualValue = "type 'null'"; + } + else { + actualValue = `type '${typeof value}', value '${value}'`; + } + throw new Error(`Expected ${valueKind} '${name}' to be ${expected}, was ${actualValue}`); +} +exports.throwValidationError = throwValidationError; diff --git a/node_modules/skynet-js/dist/client.d.ts b/node_modules/skynet-js/dist/client.d.ts deleted file mode 100644 index 12d237f..0000000 --- a/node_modules/skynet-js/dist/client.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { AxiosResponse } from "axios"; -import { uploadFile, uploadDirectory, uploadDirectoryRequest, uploadFileRequest } from "./upload"; -import { addSkykey, createSkykey, getSkykeyById, getSkykeyByName, getSkykeys } from "./encryption"; -import { downloadFile, downloadFileHns, getSkylinkUrl, getHnsUrl, getHnsresUrl, getMetadata, openFile, openFileHns, resolveHns } from "./download"; -export declare type CustomClientOptions = { - /** authentication password to use */ - APIKey?: string; - /** custom user agent header to set */ - customUserAgent?: string; - /** optional callback to track upload progress */ - onUploadProgress?: (progress: number, event: ProgressEvent) => void; -}; -export declare class SkynetClient { - portalUrl: string; - customOptions: CustomClientOptions; - /** - * The Skynet Client which can be used to access Skynet. - * @param [portalUrl] The portal URL to use to access Skynet, if specified. To use the default portal while passing custom options, use "" - * @param [customOptions] Configuration for the client - */ - constructor(portalUrl?: string, customOptions?: CustomClientOptions); - uploadFile: typeof uploadFile; - uploadDirectory: typeof uploadDirectory; - uploadDirectoryRequest: typeof uploadDirectoryRequest; - uploadFileRequest: typeof uploadFileRequest; - addSkykey: typeof addSkykey; - createSkykey: typeof createSkykey; - getSkykeyById: typeof getSkykeyById; - getSkykeyByName: typeof getSkykeyByName; - getSkykeys: typeof getSkykeys; - downloadFile: typeof downloadFile; - downloadFileHns: typeof downloadFileHns; - getSkylinkUrl: typeof getSkylinkUrl; - getHnsUrl: typeof getHnsUrl; - getHnsresUrl: typeof getHnsresUrl; - getMetadata: typeof getMetadata; - openFile: typeof openFile; - openFileHns: typeof openFileHns; - resolveHns: typeof resolveHns; - db: { - getJSON: any; - setJSON: any; - }; - registry: { - getEntry: any; - getEntryUrl: any; - setEntry: any; - }; - /** - * Creates and executes a request. - * @param {Object} config - Configuration for the request. See docs for constructor for the full list of options. - */ - executeRequest(config: any): Promise; -} -//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/client.d.ts.map b/node_modules/skynet-js/dist/client.d.ts.map deleted file mode 100644 index 2dcde99..0000000 --- a/node_modules/skynet-js/dist/client.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,EACL,YAAY,EACZ,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,oBAAY,mBAAmB,GAAG;IAChC,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CACrE,CAAC;AAEF,qBAAa,YAAY;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,mBAAmB,CAAC;IAEnC;;;;OAIG;gBACS,SAAS,GAAE,MAA2B,EAAE,aAAa,GAAE,mBAAwB;IAK3F,UAAU,oBAAc;IACxB,eAAe,yBAAmB;IAClC,sBAAsB,gCAA0B;IAChD,iBAAiB,2BAAqB;IAEtC,SAAS,mBAAa;IACtB,YAAY,sBAAgB;IAC5B,aAAa,uBAAiB;IAC9B,eAAe,yBAAmB;IAClC,UAAU,oBAAc;IAExB,YAAY,sBAAgB;IAC5B,eAAe,yBAAmB;IAClC,aAAa,uBAAiB;IAC9B,SAAS,mBAAa;IACtB,YAAY,sBAAgB;IAC5B,WAAW,qBAAe;IAC1B,QAAQ,kBAAY;IACpB,WAAW,qBAAe;IAC1B,UAAU,oBAAc;IAGxB,EAAE;;;MAGA;IAGF,QAAQ;;;;MAIN;IAEF;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC;CA0BpD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/client.js b/node_modules/skynet-js/dist/client.js deleted file mode 100644 index 8ca2f83..0000000 --- a/node_modules/skynet-js/dist/client.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -exports.__esModule = true; -exports.SkynetClient = void 0; -var axios_1 = __importDefault(require("axios")); -var upload_1 = require("./upload"); -var encryption_1 = require("./encryption"); -var download_1 = require("./download"); -var skydb_1 = require("./skydb"); -var registry_1 = require("./registry"); -var utils_1 = require("./utils"); -var SkynetClient = /** @class */ (function () { - /** - * The Skynet Client which can be used to access Skynet. - * @param [portalUrl] The portal URL to use to access Skynet, if specified. To use the default portal while passing custom options, use "" - * @param [customOptions] Configuration for the client - */ - function SkynetClient(portalUrl, customOptions) { - if (portalUrl === void 0) { portalUrl = utils_1.defaultPortalUrl(); } - if (customOptions === void 0) { customOptions = {}; } - this.uploadFile = upload_1.uploadFile; - this.uploadDirectory = upload_1.uploadDirectory; - this.uploadDirectoryRequest = upload_1.uploadDirectoryRequest; - this.uploadFileRequest = upload_1.uploadFileRequest; - this.addSkykey = encryption_1.addSkykey; - this.createSkykey = encryption_1.createSkykey; - this.getSkykeyById = encryption_1.getSkykeyById; - this.getSkykeyByName = encryption_1.getSkykeyByName; - this.getSkykeys = encryption_1.getSkykeys; - this.downloadFile = download_1.downloadFile; - this.downloadFileHns = download_1.downloadFileHns; - this.getSkylinkUrl = download_1.getSkylinkUrl; - this.getHnsUrl = download_1.getHnsUrl; - this.getHnsresUrl = download_1.getHnsresUrl; - this.getMetadata = download_1.getMetadata; - this.openFile = download_1.openFile; - this.openFileHns = download_1.openFileHns; - this.resolveHns = download_1.resolveHns; - // SkyDB - this.db = { - getJSON: skydb_1.getJSON.bind(this), - setJSON: skydb_1.setJSON.bind(this) - }; - // SkyDB helpers - this.registry = { - getEntry: registry_1.getEntry.bind(this), - getEntryUrl: registry_1.getEntryUrl.bind(this), - setEntry: registry_1.setEntry.bind(this) - }; - this.portalUrl = portalUrl; - this.customOptions = customOptions; - } - /** - * Creates and executes a request. - * @param {Object} config - Configuration for the request. See docs for constructor for the full list of options. - */ - SkynetClient.prototype.executeRequest = function (config) { - var _a; - var url = config.url; - if (!url) { - url = utils_1.makeUrl(this.portalUrl, config.endpointPath, (_a = config.extraPath) !== null && _a !== void 0 ? _a : ""); - url = utils_1.addUrlQuery(url, config.query); - } - // No other headers. - var headers = config.customUserAgent && { "User-Agent": config.customUserAgent }; - return axios_1["default"]({ - url: url, - method: config.method, - data: config.data, - headers: headers, - auth: config.APIKey && { username: "", password: config.APIKey }, - onUploadProgress: config.onUploadProgress && - function (event) { - var progress = event.loaded / event.total; - config.onUploadProgress(progress, event); - }, - timeout: config.timeout - }); - }; - return SkynetClient; -}()); -exports.SkynetClient = SkynetClient; diff --git a/node_modules/skynet-js/dist/crypto.d.ts b/node_modules/skynet-js/dist/crypto.d.ts deleted file mode 100644 index 775b7d2..0000000 --- a/node_modules/skynet-js/dist/crypto.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { pki } from "node-forge"; -import { RegistryEntry } from "./registry"; -export declare type PublicKey = pki.ed25519.NativeBuffer; -export declare type SecretKey = pki.ed25519.NativeBuffer; -export declare type Signature = pki.ed25519.NativeBuffer; -export declare function hashAll(...args: Uint8Array[]): Uint8Array; -export declare function hashDataKey(datakey: string): Uint8Array; -export declare function hashRegistryEntry(registryEntry: RegistryEntry): Uint8Array; -export declare function deriveChildSeed(masterSeed: string, seed: string): string; -/** - * Generates a master key pair and seed. - * @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. - */ -export declare function genKeyPairAndSeed(length?: number): { - publicKey: string; - privateKey: string; - seed: string; -}; -/** - * Generates a public and private key from a provided, secure seed. - * @param seed - A secure seed. - */ -export declare function genKeyPairFromSeed(seed: string): { - publicKey: string; - privateKey: string; -}; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/crypto.d.ts.map b/node_modules/skynet-js/dist/crypto.d.ts.map deleted file mode 100644 index 2aaac47..0000000 --- a/node_modules/skynet-js/dist/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,oBAAY,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;AACjD,oBAAY,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;AACjD,oBAAY,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;AAQjD,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,CAMzD;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAEvD;AAGD,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,UAAU,CAM1E;AAqBD,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,SAAK,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAGtG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAK1F"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/crypto.js b/node_modules/skynet-js/dist/crypto.js deleted file mode 100644 index 7f13402..0000000 --- a/node_modules/skynet-js/dist/crypto.js +++ /dev/null @@ -1,96 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -exports.__esModule = true; -exports.genKeyPairFromSeed = exports.genKeyPairAndSeed = exports.deriveChildSeed = exports.hashRegistryEntry = exports.hashDataKey = exports.hashAll = void 0; -var node_forge_1 = require("node-forge"); -var blakejs_1 = __importDefault(require("blakejs")); -var utils_1 = require("./utils"); -var randombytes_1 = __importDefault(require("randombytes")); -// Returns a blake2b 256bit hasher. See `NewHash` in Sia. -function newHash() { - return blakejs_1["default"].blake2bInit(32, null); -} -// Takes all given arguments and hashes them. -function hashAll() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var hasher = newHash(); - for (var i = 0; i < args.length; i++) { - blakejs_1["default"].blake2bUpdate(hasher, args[i]); - } - return blakejs_1["default"].blake2bFinal(hasher); -} -exports.hashAll = hashAll; -// Hash the given data key. -function hashDataKey(datakey) { - return hashAll(encodeString(datakey)); -} -exports.hashDataKey = hashDataKey; -// Hashes the given registry entry. -function hashRegistryEntry(registryEntry) { - return hashAll(hashDataKey(registryEntry.datakey), encodeString(registryEntry.data), encodeNumber(registryEntry.revision)); -} -exports.hashRegistryEntry = hashRegistryEntry; -// Converts the given number into a uint8 array -function encodeNumber(num) { - var encoded = new Uint8Array(8); - for (var index = 0; index < encoded.length; index++) { - var byte = num & 0xff; - encoded[index] = byte; - num = num >> 8; - } - return encoded; -} -// Converts the given string into a uint8 array -function encodeString(str) { - var encoded = new Uint8Array(8 + str.length); - encoded.set(encodeNumber(str.length)); - encoded.set(utils_1.stringToUint8Array(str), 8); - return encoded; -} -function deriveChildSeed(masterSeed, seed) { - return utils_1.toHexString(hashAll(encodeString(masterSeed), encodeString(seed))); -} -exports.deriveChildSeed = deriveChildSeed; -/** - * Generates a master key pair and seed. - * @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. - */ -function genKeyPairAndSeed(length) { - if (length === void 0) { length = 64; } - var seed = makeSeed(length); - return __assign(__assign({}, genKeyPairFromSeed(seed)), { seed: seed }); -} -exports.genKeyPairAndSeed = genKeyPairAndSeed; -/** - * Generates a public and private key from a provided, secure seed. - * @param seed - A secure seed. - */ -function genKeyPairFromSeed(seed) { - // Get a 32-byte seed. - seed = node_forge_1.pkcs5.pbkdf2(seed, "", 1000, 32, node_forge_1.md.sha256.create()); - var _a = node_forge_1.pki.ed25519.generateKeyPair({ seed: seed }), publicKey = _a.publicKey, privateKey = _a.privateKey; - return { publicKey: utils_1.toHexString(publicKey), privateKey: utils_1.toHexString(privateKey) }; -} -exports.genKeyPairFromSeed = genKeyPairFromSeed; -function makeSeed(length) { - // Cryptographically-secure random number generator. It should use the - // built-in crypto.getRandomValues in the browser. - var array = randombytes_1["default"](length); - return utils_1.toHexString(array); -} diff --git a/node_modules/skynet-js/dist/download.d.ts b/node_modules/skynet-js/dist/download.d.ts deleted file mode 100644 index 7054fa5..0000000 --- a/node_modules/skynet-js/dist/download.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { SkynetClient } from "./client"; -/** - * Initiates a download of the content of the skylink within the browser. - * @param {string} skylink - 46 character skylink. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. - */ -export declare function downloadFile(this: SkynetClient, skylink: string, customOptions?: any): void; -/** - * Initiates a download of the content of the skylink at the Handshake domain. - * @param {string} domain - Handshake domain. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. - */ -export declare function downloadFileHns(this: SkynetClient, domain: string, customOptions?: any): Promise; -export declare function getSkylinkUrl(this: SkynetClient, skylink: string, customOptions?: any): string; -export declare function getHnsUrl(this: SkynetClient, domain: string, customOptions?: any): string; -export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: any): string; -export declare function getMetadata(this: SkynetClient, skylink: string, customOptions?: any): Promise; -/** - * Opens the content of the skylink within the browser. - * @param {string} skylink - 46 character skylink. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. - */ -export declare function openFile(this: SkynetClient, skylink: string, customOptions?: {}): void; -/** - * Opens the content of the skylink from the given Handshake domain within the browser. - * @param {string} domain - Handshake domain. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. - */ -export declare function openFileHns(this: SkynetClient, domain: string, customOptions?: {}): Promise; -/** - * @param {string} domain - Handshake resolver domain. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. - */ -export declare function resolveHns(this: SkynetClient, domain: string, customOptions?: {}): Promise; -//# sourceMappingURL=download.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/download.d.ts.map b/node_modules/skynet-js/dist/download.d.ts.map deleted file mode 100644 index ef87d84..0000000 --- a/node_modules/skynet-js/dist/download.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../src/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAqBxC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAE,GAAQ,GAAG,IAAI,CAM/F;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAE,GAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhH;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAE,GAAQ,GAAG,MAAM,CAMlG;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAE,GAAQ,GAAG,MAAM,CAM7F;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAE,GAAQ,GAAG,MAAM,CAIhG;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAE,GAAQ,gBAe7F;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,KAAK,GAAG,IAAI,CAKtF;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvG;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAYrG"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/download.js b/node_modules/skynet-js/dist/download.js deleted file mode 100644 index acf5a5f..0000000 --- a/node_modules/skynet-js/dist/download.js +++ /dev/null @@ -1,191 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -exports.__esModule = true; -exports.resolveHns = exports.openFileHns = exports.openFile = exports.getMetadata = exports.getHnsresUrl = exports.getHnsUrl = exports.getSkylinkUrl = exports.downloadFileHns = exports.downloadFile = void 0; -var utils_1 = require("./utils"); -var defaultDownloadOptions = __assign({}, utils_1.defaultOptions("/")); -var defaultDownloadHnsOptions = __assign({}, utils_1.defaultOptions("/hns")); -var defaultResolveHnsOptions = __assign({}, utils_1.defaultOptions("/hnsres")); -/** - * Initiates a download of the content of the skylink within the browser. - * @param {string} skylink - 46 character skylink. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. - */ -function downloadFile(skylink, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - var opts = __assign(__assign(__assign(__assign({}, defaultDownloadOptions), this.customOptions), customOptions), { download: true }); - var url = this.getSkylinkUrl(skylink, opts); - // Download the url. - window.location.assign(url); -} -exports.downloadFile = downloadFile; -/** - * Initiates a download of the content of the skylink at the Handshake domain. - * @param {string} domain - Handshake domain. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. - */ -function downloadFileHns(domain, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, url; - return __generator(this, function (_a) { - opts = __assign(__assign(__assign(__assign({}, defaultDownloadHnsOptions), this.customOptions), customOptions), { download: true }); - url = this.getHnsUrl(domain, opts); - // Download the url. - window.location.assign(url); - return [2 /*return*/]; - }); - }); -} -exports.downloadFileHns = downloadFileHns; -function getSkylinkUrl(skylink, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - var opts = __assign(__assign(__assign({}, defaultDownloadOptions), this.customOptions), customOptions); - var query = opts.download ? { attachment: true } : {}; - var url = utils_1.makeUrl(this.portalUrl, opts.endpointPath, utils_1.parseSkylink(skylink)); - return utils_1.addUrlQuery(url, query); -} -exports.getSkylinkUrl = getSkylinkUrl; -function getHnsUrl(domain, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - var opts = __assign(__assign(__assign({}, defaultDownloadHnsOptions), this.customOptions), customOptions); - var query = opts.download ? { attachment: true } : {}; - var url = utils_1.makeUrl(this.portalUrl, opts.endpointPath, utils_1.trimUriPrefix(domain, utils_1.uriHandshakePrefix)); - return utils_1.addUrlQuery(url, query); -} -exports.getHnsUrl = getHnsUrl; -function getHnsresUrl(domain, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - var opts = __assign(__assign(__assign({}, defaultResolveHnsOptions), this.customOptions), customOptions); - return utils_1.makeUrl(this.portalUrl, opts.endpointPath, utils_1.trimUriPrefix(domain, utils_1.uriHandshakeResolverPrefix)); -} -exports.getHnsresUrl = getHnsresUrl; -function getMetadata(skylink, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, url, response, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign(__assign({}, defaultDownloadOptions), this.customOptions), customOptions); - url = this.getSkylinkUrl(skylink, opts); - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "head", url: url }))]; - case 2: - response = _a.sent(); - return [2 /*return*/, response.headers["skynet-file-metadata"] ? JSON.parse(response.headers["skynet-file-metadata"]) : {}]; - case 3: - error_1 = _a.sent(); - throw new Error("Error getting skynet-file-metadata from skylink"); - case 4: return [2 /*return*/]; - } - }); - }); -} -exports.getMetadata = getMetadata; -/** - * Opens the content of the skylink within the browser. - * @param {string} skylink - 46 character skylink. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. - */ -function openFile(skylink, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - var opts = __assign(__assign(__assign({}, defaultDownloadOptions), this.customOptions), customOptions); - var url = this.getSkylinkUrl(skylink, opts); - window.open(url, "_blank"); -} -exports.openFile = openFile; -/** - * Opens the content of the skylink from the given Handshake domain within the browser. - * @param {string} domain - Handshake domain. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. - */ -function openFileHns(domain, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, url; - return __generator(this, function (_a) { - opts = __assign(__assign(__assign({}, defaultDownloadHnsOptions), this.customOptions), customOptions); - url = this.getHnsUrl(domain, opts); - // Open the url in a new tab. - window.open(url, "_blank"); - return [2 /*return*/]; - }); - }); -} -exports.openFileHns = openFileHns; -/** - * @param {string} domain - Handshake resolver domain. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. - */ -function resolveHns(domain, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, url, response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign(__assign({}, defaultResolveHnsOptions), this.customOptions), customOptions); - url = this.getHnsresUrl(domain, opts); - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "get", url: url }))]; - case 1: - response = _a.sent(); - return [2 /*return*/, response.data]; - } - }); - }); -} -exports.resolveHns = resolveHns; diff --git a/node_modules/skynet-js/dist/encryption.d.ts b/node_modules/skynet-js/dist/encryption.d.ts deleted file mode 100644 index 6d8c6a2..0000000 --- a/node_modules/skynet-js/dist/encryption.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SkynetClient } from "./client"; -export declare function addSkykey(this: SkynetClient, skykey: string, customOptions?: {}): Promise; -export declare function createSkykey(this: SkynetClient, skykeyName: string, skykeyType: string, customOptions?: {}): Promise; -export declare function getSkykeyById(this: SkynetClient, skykeyId: string, customOptions?: {}): Promise; -export declare function getSkykeyByName(this: SkynetClient, skykeyName: string, customOptions?: {}): Promise; -export declare function getSkykeys(this: SkynetClient, customOptions?: {}): Promise; -//# sourceMappingURL=encryption.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/encryption.d.ts.map b/node_modules/skynet-js/dist/encryption.d.ts.map deleted file mode 100644 index 5176697..0000000 --- a/node_modules/skynet-js/dist/encryption.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../src/encryption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAmBxC,wBAAsB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,KAAK,iBAErF;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,KAAK,iBAEhH;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,KAAK,iBAE3F;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,KAAK,iBAE/F;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,aAAa,KAAK,iBAEtE"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/encryption.js b/node_modules/skynet-js/dist/encryption.js deleted file mode 100644 index f46599b..0000000 --- a/node_modules/skynet-js/dist/encryption.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -exports.__esModule = true; -exports.getSkykeys = exports.getSkykeyByName = exports.getSkykeyById = exports.createSkykey = exports.addSkykey = void 0; -var utils_1 = require("./utils"); -var defaultAddSkykeyOptions = __assign({}, utils_1.defaultOptions("/skynet/addskykey")); -var defaultCreateSkykeyOptions = __assign({}, utils_1.defaultOptions("/skynet/createskykey")); -var defaultGetSkykeyOptions = __assign({}, utils_1.defaultOptions("/skynet/skykey")); -var defaultGetSkykeysOptions = __assign({}, utils_1.defaultOptions("/skynet/skykeys")); -function addSkykey(skykey, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - throw new Error("Unimplemented"); - }); - }); -} -exports.addSkykey = addSkykey; -function createSkykey(skykeyName, skykeyType, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - throw new Error("Unimplemented"); - }); - }); -} -exports.createSkykey = createSkykey; -function getSkykeyById(skykeyId, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - throw new Error("Unimplemented"); - }); - }); -} -exports.getSkykeyById = getSkykeyById; -function getSkykeyByName(skykeyName, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - throw new Error("Unimplemented"); - }); - }); -} -exports.getSkykeyByName = getSkykeyByName; -function getSkykeys(customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - throw new Error("Unimplemented"); - }); - }); -} -exports.getSkykeys = getSkykeys; diff --git a/node_modules/skynet-js/dist/index.d.ts b/node_modules/skynet-js/dist/index.d.ts deleted file mode 100644 index 95dc41f..0000000 --- a/node_modules/skynet-js/dist/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { SkynetClient } from "./client"; -export { deriveChildSeed, genKeyPairAndSeed, genKeyPairFromSeed } from "./crypto"; -export type { PublicKey, SecretKey, Signature } from "./crypto"; -export type { SignedRegistryEntry, RegistryEntry } from "./registry"; -export { defaultPortalUrl, defaultSkynetPortalUrl, getRelativeFilePath, getRootDirectory, parseSkylink, uriHandshakePrefix, uriHandshakeResolverPrefix, uriSkynetPrefix, } from "./utils"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/index.d.ts.map b/node_modules/skynet-js/dist/index.d.ts.map deleted file mode 100644 index 05436f6..0000000 --- a/node_modules/skynet-js/dist/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAElF,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEhE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/index.js b/node_modules/skynet-js/dist/index.js deleted file mode 100644 index 59b83f2..0000000 --- a/node_modules/skynet-js/dist/index.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -exports.__esModule = true; -exports.uriSkynetPrefix = exports.uriHandshakeResolverPrefix = exports.uriHandshakePrefix = exports.parseSkylink = exports.getRootDirectory = exports.getRelativeFilePath = exports.defaultSkynetPortalUrl = exports.defaultPortalUrl = exports.genKeyPairFromSeed = exports.genKeyPairAndSeed = exports.deriveChildSeed = exports.SkynetClient = void 0; -var client_1 = require("./client"); -__createBinding(exports, client_1, "SkynetClient"); -var crypto_1 = require("./crypto"); -__createBinding(exports, crypto_1, "deriveChildSeed"); -__createBinding(exports, crypto_1, "genKeyPairAndSeed"); -__createBinding(exports, crypto_1, "genKeyPairFromSeed"); -var utils_1 = require("./utils"); -__createBinding(exports, utils_1, "defaultPortalUrl"); -__createBinding(exports, utils_1, "defaultSkynetPortalUrl"); -__createBinding(exports, utils_1, "getRelativeFilePath"); -__createBinding(exports, utils_1, "getRootDirectory"); -__createBinding(exports, utils_1, "parseSkylink"); -__createBinding(exports, utils_1, "uriHandshakePrefix"); -__createBinding(exports, utils_1, "uriHandshakeResolverPrefix"); -__createBinding(exports, utils_1, "uriSkynetPrefix"); diff --git a/node_modules/skynet-js/dist/mjs/client.d.ts b/node_modules/skynet-js/dist/mjs/client.d.ts new file mode 100644 index 0000000..0a72204 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/client.d.ts @@ -0,0 +1,151 @@ +import { AxiosResponse, ResponseType } from "axios"; +import type { Method } from "axios"; +import { uploadFile, uploadLargeFile, uploadDirectory, uploadDirectoryRequest, uploadSmallFile, uploadSmallFileRequest, uploadLargeFileRequest } from "./upload"; +import { downloadFile, downloadFileHns, getSkylinkUrl, getHnsUrl, getHnsresUrl, getMetadata, getFileContent, getFileContentHns, getFileContentRequest, openFile, openFileHns, resolveHns } from "./download"; +import { pinSkylink } from "./pin"; +import { loadMySky } from "./mysky"; +import { extractDomain, getFullDomainUrl } from "./mysky/utils"; +/** + * Custom client options. + * + * @property [APIKey] - Authentication password to use. + * @property [customUserAgent] - Custom user agent header to set. + * @property [customCookie] - Custom cookie header to set. + * @property [onUploadProgress] - Optional callback to track upload progress. + */ +export declare type CustomClientOptions = { + APIKey?: string; + customUserAgent?: string; + customCookie?: string; + onUploadProgress?: (progress: number, event: ProgressEvent) => void; +}; +/** + * Config options for a single request. + * + * @property endpointPath - The endpoint to contact. + * @property [data] - The data for a POST request. + * @property [url] - The full url to contact. Will be computed from the portalUrl and endpointPath if not provided. + * @property [method] - The request method. + * @property [query] - Query parameters. + * @property [extraPath] - An additional path to append to the URL, e.g. a 46-character skylink. + * @property [headers] - Any request headers to set. + * @property [responseType] - The response type. + * @property [transformRequest] - A function that allows manually transforming the request. + * @property [transformResponse] - A function that allows manually transforming the response. + */ +export declare type RequestConfig = CustomClientOptions & { + endpointPath: string; + data?: FormData | Record; + url?: string; + method?: Method; + headers?: Headers; + query?: Record; + extraPath?: string; + responseType?: ResponseType; + transformRequest?: (data: unknown) => string; + transformResponse?: (data: string) => Record; +}; +/** + * The Skynet Client which can be used to access Skynet. + */ +export declare class SkynetClient { + customOptions: CustomClientOptions; + protected initialPortalUrl: string; + protected static resolvedPortalUrl?: Promise; + protected customPortalUrl?: string; + uploadFile: typeof uploadFile; + protected uploadSmallFile: typeof uploadSmallFile; + protected uploadSmallFileRequest: typeof uploadSmallFileRequest; + protected uploadLargeFile: typeof uploadLargeFile; + protected uploadLargeFileRequest: typeof uploadLargeFileRequest; + uploadDirectory: typeof uploadDirectory; + protected uploadDirectoryRequest: typeof uploadDirectoryRequest; + downloadFile: typeof downloadFile; + downloadFileHns: typeof downloadFileHns; + getSkylinkUrl: typeof getSkylinkUrl; + getHnsUrl: typeof getHnsUrl; + getHnsresUrl: typeof getHnsresUrl; + getMetadata: typeof getMetadata; + getFileContent: typeof getFileContent; + getFileContentHns: typeof getFileContentHns; + protected getFileContentRequest: typeof getFileContentRequest; + openFile: typeof openFile; + openFileHns: typeof openFileHns; + resolveHns: typeof resolveHns; + pinSkylink: typeof pinSkylink; + extractDomain: typeof extractDomain; + getFullDomainUrl: typeof getFullDomainUrl; + loadMySky: typeof loadMySky; + file: { + getJSON: (userID: string, path: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + getEntryData: (userID: string, path: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + getEntryLink: (userID: string, path: string) => Promise; + getJSONEncrypted: (userID: string, pathSeed: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + }; + db: { + deleteJSON: (privateKey: string, dataKey: string, customOptions?: import("./skydb").CustomSetJSONOptions | undefined) => Promise; + getJSON: (publicKey: string, dataKey: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + setJSON: (privateKey: string, dataKey: string, json: import("./skydb").JsonData, customOptions?: import("./skydb").CustomSetJSONOptions | undefined) => Promise; + setDataLink: (privateKey: string, dataKey: string, dataLink: string, customOptions?: import("./skydb").CustomSetJSONOptions | undefined) => Promise; + getRawBytes: (publicKey: string, dataKey: string, customOptions?: import("./skydb").CustomGetJSONOptions | undefined) => Promise; + }; + registry: { + getEntry: (publicKey: string, dataKey: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + getEntryUrl: (publicKey: string, dataKey: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + getEntryLink: (publicKey: string, dataKey: string, customOptions?: import("./registry").CustomGetEntryOptions | undefined) => Promise; + setEntry: (privateKey: string, entry: import("./registry").RegistryEntry, customOptions?: import("./registry").CustomSetEntryOptions | undefined) => Promise; + postSignedEntry: (publicKey: string, entry: import("./registry").RegistryEntry, signature: Uint8Array, customOptions?: import("./registry").CustomSetEntryOptions | undefined) => Promise; + }; + /** + * The Skynet Client which can be used to access Skynet. + * + * @class + * @param [initialPortalUrl] The initial portal URL to use to access Skynet, if specified. A request will be made to this URL to get the actual portal URL. To use the default portal while passing custom options, pass "". + * @param [customOptions] Configuration for the client. + */ + constructor(initialPortalUrl?: string, customOptions?: CustomClientOptions); + /** + * Make the request for the API portal URL. + * + * @returns - A promise that resolves when the request is complete. + */ + initPortalUrl(): Promise; + /** + * Returns the API portal URL. Makes the request to get it if not done so already. + * + * @returns - the portal URL. + */ + portalUrl(): Promise; + /** + * Creates and executes a request. + * + * @param config - Configuration for the request. + * @returns - The response from axios. + */ + protected executeRequest(config: RequestConfig): Promise; +} +/** + * Helper function that builds the request URL. + * + * @param client - The Skynet client. + * @param endpointPath - The endpoint to contact. + * @param [url] - The base URL to use, instead of the portal URL. + * @param [extraPath] - An optional path to append to the URL. + * @param [query] - Optional query parameters to append to the URL. + * @returns - The built URL. + */ +export declare function buildRequestUrl(client: SkynetClient, endpointPath: string, url?: string, extraPath?: string, query?: Record): Promise; +declare type Headers = { + [key: string]: string; +}; +/** + * Helper function that builds the request headers. + * + * @param [headers] - Any base headers. + * @param [customUserAgent] - A custom user agent to set. + * @param [customCookie] - A custom cookie. + * @returns - The built headers. + */ +export declare function buildRequestHeaders(headers?: Headers, customUserAgent?: string, customCookie?: string): Headers; +export {}; +//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/client.d.ts.map b/node_modules/skynet-js/dist/mjs/client.d.ts.map new file mode 100644 index 0000000..1f68c98 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/client.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,eAAe,EACf,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,QAAQ,EACR,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGhE;;;;;;;GAOG;AACH,oBAAY,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CACrE,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,oBAAY,aAAa,GAAG,mBAAmB,GAAG;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAY;IACvB,aAAa,EAAE,mBAAmB,CAAC;IAGnC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAEnC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAErD,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAMnC,UAAU,oBAAc;IACxB,SAAS,CAAC,eAAe,yBAAmB;IAC5C,SAAS,CAAC,sBAAsB,gCAA0B;IAC1D,SAAS,CAAC,eAAe,yBAAmB;IAC5C,SAAS,CAAC,sBAAsB,gCAA0B;IAC1D,eAAe,yBAAmB;IAClC,SAAS,CAAC,sBAAsB,gCAA0B;IAI1D,YAAY,sBAAgB;IAC5B,eAAe,yBAAmB;IAClC,aAAa,uBAAiB;IAC9B,SAAS,mBAAa;IACtB,YAAY,sBAAgB;IAC5B,WAAW,qBAAe;IAC1B,cAAc,wBAAkB;IAChC,iBAAiB,2BAAqB;IACtC,SAAS,CAAC,qBAAqB,+BAAyB;IACxD,QAAQ,kBAAY;IACpB,WAAW,qBAAe;IAC1B,UAAU,oBAAc;IAIxB,UAAU,oBAAc;IAIxB,aAAa,uBAAiB;IAC9B,gBAAgB,0BAAoB;IACpC,SAAS,mBAAa;IAItB,IAAI;;;;;MAKF;IAIF,EAAE;;;;;;MAMA;IAIF,QAAQ;;;;;;MAMN;IAEF;;;;;;OAMG;gBACS,gBAAgB,SAAK,EAAE,aAAa,GAAE,mBAAwB;IAY1E;;;;OAIG;IAEG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCpC;;;;OAIG;IAEG,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAWlC;;;;;OAKG;cACa,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAmC9E;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED,aAAK,OAAO,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAY/G"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/client.js b/node_modules/skynet-js/dist/mjs/client.js new file mode 100644 index 0000000..374176d --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/client.js @@ -0,0 +1,210 @@ +import axios from "axios"; +import { uploadFile, uploadLargeFile, uploadDirectory, uploadDirectoryRequest, uploadSmallFile, uploadSmallFileRequest, uploadLargeFileRequest, } from "./upload"; +import { downloadFile, downloadFileHns, getSkylinkUrl, getHnsUrl, getHnsresUrl, getMetadata, getFileContent, getFileContentHns, getFileContentRequest, openFile, openFileHns, resolveHns, } from "./download"; +import { getJSONEncrypted, getEntryData, getEntryLink as fileGetEntryLink, getJSON as fileGetJSON } from "./file"; +import { pinSkylink } from "./pin"; +import { getEntry, getEntryUrl, getEntryLink, setEntry, postSignedEntry } from "./registry"; +import { deleteJSON, getJSON, setJSON, setDataLink, getRawBytes } from "./skydb"; +import { addUrlQuery, defaultPortalUrl, makeUrl } from "./utils/url"; +import { loadMySky } from "./mysky"; +import { extractDomain, getFullDomainUrl } from "./mysky/utils"; +import { trimSuffix } from "./utils/string"; +/** + * The Skynet Client which can be used to access Skynet. + */ +export class SkynetClient { + /** + * The Skynet Client which can be used to access Skynet. + * + * @class + * @param [initialPortalUrl] The initial portal URL to use to access Skynet, if specified. A request will be made to this URL to get the actual portal URL. To use the default portal while passing custom options, pass "". + * @param [customOptions] Configuration for the client. + */ + constructor(initialPortalUrl = "", customOptions = {}) { + // Set methods (defined in other files). + // Upload + this.uploadFile = uploadFile; + this.uploadSmallFile = uploadSmallFile; + this.uploadSmallFileRequest = uploadSmallFileRequest; + this.uploadLargeFile = uploadLargeFile; + this.uploadLargeFileRequest = uploadLargeFileRequest; + this.uploadDirectory = uploadDirectory; + this.uploadDirectoryRequest = uploadDirectoryRequest; + // Download + this.downloadFile = downloadFile; + this.downloadFileHns = downloadFileHns; + this.getSkylinkUrl = getSkylinkUrl; + this.getHnsUrl = getHnsUrl; + this.getHnsresUrl = getHnsresUrl; + this.getMetadata = getMetadata; + this.getFileContent = getFileContent; + this.getFileContentHns = getFileContentHns; + this.getFileContentRequest = getFileContentRequest; + this.openFile = openFile; + this.openFileHns = openFileHns; + this.resolveHns = resolveHns; + // Pin + this.pinSkylink = pinSkylink; + // MySky + this.extractDomain = extractDomain; + this.getFullDomainUrl = getFullDomainUrl; + this.loadMySky = loadMySky; + // File API + this.file = { + getJSON: fileGetJSON.bind(this), + getEntryData: getEntryData.bind(this), + getEntryLink: fileGetEntryLink.bind(this), + getJSONEncrypted: getJSONEncrypted.bind(this), + }; + // SkyDB + this.db = { + deleteJSON: deleteJSON.bind(this), + getJSON: getJSON.bind(this), + setJSON: setJSON.bind(this), + setDataLink: setDataLink.bind(this), + getRawBytes: getRawBytes.bind(this), + }; + // SkyDB helpers + this.registry = { + getEntry: getEntry.bind(this), + getEntryUrl: getEntryUrl.bind(this), + getEntryLink: getEntryLink.bind(this), + setEntry: setEntry.bind(this), + postSignedEntry: postSignedEntry.bind(this), + }; + if (initialPortalUrl === "") { + // Portal was not given, use the default portal URL. We'll still make a request for the resolved portal URL. + initialPortalUrl = defaultPortalUrl(); + } + else { + // Portal was given, don't make the request for the resolved portal URL. + this.customPortalUrl = initialPortalUrl; + } + this.initialPortalUrl = initialPortalUrl; + this.customOptions = customOptions; + } + /** + * Make the request for the API portal URL. + * + * @returns - A promise that resolves when the request is complete. + */ + /* istanbul ignore next */ + async initPortalUrl() { + if (this.customPortalUrl) { + // Tried to make a request for the API portal URL when a custom URL was already provided. + return; + } + if (!SkynetClient.resolvedPortalUrl) { + SkynetClient.resolvedPortalUrl = new Promise((resolve, reject) => { + this.executeRequest({ + ...this.customOptions, + method: "head", + url: this.initialPortalUrl, + endpointPath: "/", + }).then((response) => { + if (typeof response.headers === "undefined") { + reject(new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists.")); + } + const portalUrl = response.headers["skynet-portal-api"]; + if (!portalUrl) { + reject(new Error("Could not get portal URL for the given portal")); + } + resolve(trimSuffix(portalUrl, "/")); + }); + }); + } + await SkynetClient.resolvedPortalUrl; + return; + } + /** + * Returns the API portal URL. Makes the request to get it if not done so already. + * + * @returns - the portal URL. + */ + /* istanbul ignore next */ + async portalUrl() { + if (this.customPortalUrl) { + return this.customPortalUrl; + } + // Make the request if needed and not done so. + this.initPortalUrl(); + return await SkynetClient.resolvedPortalUrl; // eslint-disable-line + } + /** + * Creates and executes a request. + * + * @param config - Configuration for the request. + * @returns - The response from axios. + */ + async executeRequest(config) { + const url = await buildRequestUrl(this, config.endpointPath, config.url, config.extraPath, config.query); + // Build headers. + const headers = buildRequestHeaders(config.headers, config.customUserAgent, config.customCookie); + const auth = config.APIKey ? { username: "", password: config.APIKey } : undefined; + const onUploadProgress = config.onUploadProgress && + /* istanbul ignore next */ + function (event) { + const progress = event.loaded / event.total; + // Need the if-statement or TS complains. + if (config.onUploadProgress) + config.onUploadProgress(progress, event); + }; + return axios({ + url, + method: config.method, + data: config.data, + headers, + auth, + onUploadProgress, + responseType: config.responseType, + transformRequest: config.transformRequest, + transformResponse: config.transformResponse, + maxContentLength: Infinity, + maxBodyLength: Infinity, + // Allow cross-site cookies. + withCredentials: true, + }); + } +} +/** + * Helper function that builds the request URL. + * + * @param client - The Skynet client. + * @param endpointPath - The endpoint to contact. + * @param [url] - The base URL to use, instead of the portal URL. + * @param [extraPath] - An optional path to append to the URL. + * @param [query] - Optional query parameters to append to the URL. + * @returns - The built URL. + */ +export async function buildRequestUrl(client, endpointPath, url, extraPath, query) { + // Build the URL. + if (!url) { + const portalUrl = await client.portalUrl(); + url = makeUrl(portalUrl, endpointPath, extraPath !== null && extraPath !== void 0 ? extraPath : ""); + } + if (query) { + url = addUrlQuery(url, query); + } + return url; +} +/** + * Helper function that builds the request headers. + * + * @param [headers] - Any base headers. + * @param [customUserAgent] - A custom user agent to set. + * @param [customCookie] - A custom cookie. + * @returns - The built headers. + */ +export function buildRequestHeaders(headers, customUserAgent, customCookie) { + if (!headers) { + headers = {}; + } + // Set some headers from common options. + if (customUserAgent) { + headers["User-Agent"] = customUserAgent; + } + if (customCookie) { + headers["Cookie"] = customCookie; + } + return headers; +} diff --git a/node_modules/skynet-js/dist/mjs/crypto.d.ts b/node_modules/skynet-js/dist/mjs/crypto.d.ts new file mode 100644 index 0000000..d60c824 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/crypto.d.ts @@ -0,0 +1,76 @@ +/// +import { RegistryEntry } from "./registry"; +export declare type Signature = Buffer; +/** + * Key pair. + * + * @property publicKey - The public key. + * @property privateKey - The private key. + */ +export declare type KeyPair = { + publicKey: string; + privateKey: string; +}; +/** + * Key pair and seed. + * + * @property seed - The secure seed. + */ +export declare type KeyPairAndSeed = KeyPair & { + seed: string; +}; +export declare const HASH_LENGTH = 32; +/** + * Derives a child seed from the given master seed and sub seed. + * + * @param masterSeed - The master seed to derive from. + * @param seed - The sub seed for the derivation. + * @returns - The child seed derived from `masterSeed` using `seed`. + * @throws - Will throw if the inputs are not strings. + */ +export declare function deriveChildSeed(masterSeed: string, seed: string): string; +/** + * Generates a master key pair and seed. + * + * @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. + * @returns - The generated key pair and seed. + */ +export declare function genKeyPairAndSeed(length?: number): KeyPairAndSeed; +/** + * Generates a public and private key from a provided, secure seed. + * + * @param seed - A secure seed. + * @returns - The generated key pair. + * @throws - Will throw if the input is not a string. + */ +export declare function genKeyPairFromSeed(seed: string): KeyPair; +/** + * Takes all given arguments and hashes them. + * + * @param args - Byte arrays to hash. + * @returns - The final hash as a byte array. + */ +export declare function hashAll(...args: Uint8Array[]): Uint8Array; +/** + * Hash the given data key. + * + * @param dataKey - Data key to hash. + * @returns - Hash of the data key. + */ +export declare function hashDataKey(dataKey: string): Uint8Array; +/** + * Hashes the given registry entry. + * + * @param registryEntry - Registry entry to hash. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - Hash of the registry entry. + */ +export declare function hashRegistryEntry(registryEntry: RegistryEntry, hashedDataKeyHex: boolean): Uint8Array; +/** + * Hashes the given string or byte array using sha512. + * + * @param message - The string or byte array to hash. + * @returns - The resulting hash. + */ +export declare function sha512(message: Uint8Array | string): Uint8Array; +//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/crypto.d.ts.map b/node_modules/skynet-js/dist/mjs/crypto.d.ts.map new file mode 100644 index 0000000..234d44f --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK3C,oBAAY,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;GAKG;AACH,oBAAY,OAAO,GAAG;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,cAAc,GAAG,OAAO,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,WAAW,KAAK,CAAC;AAW9B;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKxE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,SAAK,GAAG,cAAc,CAK7D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASxD;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,CAIzD;AAGD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,OAAO,GAAG,UAAU,CAWrG;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAM/D"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/crypto.js b/node_modules/skynet-js/dist/mjs/crypto.js new file mode 100644 index 0000000..f4323f9 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/crypto.js @@ -0,0 +1,120 @@ +import { misc, codec } from "sjcl"; +import { blake2bFinal, blake2bInit, blake2bUpdate } from "blakejs"; +import randomBytes from "randombytes"; +import { hash, sign } from "tweetnacl"; +import { hexToUint8Array, stringToUint8ArrayUtf8, toHexString } from "./utils/string"; +import { validateNumber, validateString } from "./utils/validation"; +import { encodeBigintAsUint64, encodePrefixedBytes, encodeUtf8String } from "./utils/encoding"; +export const HASH_LENGTH = 32; +/** + * Returns a blake2b 256bit hasher. See `NewHash` in Sia. + * + * @returns - blake2b 256bit hasher. + */ +function newHash() { + return blake2bInit(32, null); +} +/** + * Derives a child seed from the given master seed and sub seed. + * + * @param masterSeed - The master seed to derive from. + * @param seed - The sub seed for the derivation. + * @returns - The child seed derived from `masterSeed` using `seed`. + * @throws - Will throw if the inputs are not strings. + */ +export function deriveChildSeed(masterSeed, seed) { + validateString("masterSeed", masterSeed, "parameter"); + validateString("seed", seed, "parameter"); + return toHexString(hashAll(encodeUtf8String(masterSeed), encodeUtf8String(seed))); +} +/** + * Generates a master key pair and seed. + * + * @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. + * @returns - The generated key pair and seed. + */ +export function genKeyPairAndSeed(length = 64) { + validateNumber("length", length, "parameter"); + const seed = makeSeed(length); + return { ...genKeyPairFromSeed(seed), seed }; +} +/** + * Generates a public and private key from a provided, secure seed. + * + * @param seed - A secure seed. + * @returns - The generated key pair. + * @throws - Will throw if the input is not a string. + */ +export function genKeyPairFromSeed(seed) { + validateString("seed", seed, "parameter"); + // Get a 32-byte key. + const derivedKey = misc.pbkdf2(seed, "", 1000, 32 * 8); + const derivedKeyHex = codec.hex.fromBits(derivedKey); + const { publicKey, secretKey } = sign.keyPair.fromSeed(hexToUint8Array(derivedKeyHex)); + return { publicKey: toHexString(publicKey), privateKey: toHexString(secretKey) }; +} +/** + * Takes all given arguments and hashes them. + * + * @param args - Byte arrays to hash. + * @returns - The final hash as a byte array. + */ +export function hashAll(...args) { + const hasher = newHash(); + args.forEach((arg) => blake2bUpdate(hasher, arg)); + return blake2bFinal(hasher); +} +// TODO: Is this the same as hashString? +/** + * Hash the given data key. + * + * @param dataKey - Data key to hash. + * @returns - Hash of the data key. + */ +export function hashDataKey(dataKey) { + return hashAll(encodeUtf8String(dataKey)); +} +/** + * Hashes the given registry entry. + * + * @param registryEntry - Registry entry to hash. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - Hash of the registry entry. + */ +export function hashRegistryEntry(registryEntry, hashedDataKeyHex) { + let dataKeyBytes; + if (hashedDataKeyHex) { + dataKeyBytes = hexToUint8Array(registryEntry.dataKey); + } + else { + dataKeyBytes = hashDataKey(registryEntry.dataKey); + } + const dataBytes = encodePrefixedBytes(registryEntry.data); + return hashAll(dataKeyBytes, dataBytes, encodeBigintAsUint64(registryEntry.revision)); +} +/** + * Hashes the given string or byte array using sha512. + * + * @param message - The string or byte array to hash. + * @returns - The resulting hash. + */ +export function sha512(message) { + if (typeof message === "string") { + return hash(stringToUint8ArrayUtf8(message)); + } + else { + return hash(message); + } +} +/** + * Generates a random seed of the given length in bytes. + * + * @param length - Length of the seed in bytes. + * @returns - The generated seed. + */ +function makeSeed(length) { + // Cryptographically-secure random number generator. It should use the + // built-in crypto.getRandomValues in the browser. + const array = randomBytes(length); + return toHexString(array); +} diff --git a/node_modules/skynet-js/dist/mjs/download.d.ts b/node_modules/skynet-js/dist/mjs/download.d.ts new file mode 100644 index 0000000..62d9812 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/download.d.ts @@ -0,0 +1,231 @@ +import { ResponseType } from "axios"; +import { SkynetClient } from "./client"; +import { JsonData } from "./skydb"; +import { BaseCustomOptions } from "./utils/options"; +/** + * Custom download options. + * + * @property [endpointDownload] - The relative URL path of the portal endpoint to contact. + * @property [download=false] - Indicates to `getSkylinkUrl` whether the file should be downloaded (true) or opened in the browser (false). `downloadFile` and `openFile` override this value. + * @property [path] - A path to append to the skylink, e.g. `dir1/dir2/file`. A Unix-style path is expected. Each path component will be URL-encoded. + * @property [range] - The Range request header to set for the download. Not applicable for in-borwser downloads. + * @property [responseType] - The response type. + * @property [query] - A query object to convert to a query parameter string and append to the URL. + * @property [subdomain=false] - Whether to return the final skylink in subdomain format. + */ +export declare type CustomDownloadOptions = BaseCustomOptions & { + endpointDownload?: string; + download?: boolean; + path?: string; + range?: string; + responseType?: ResponseType; + subdomain?: boolean; +}; +/** + * Custom HNS download options. + * + * @property [endpointDownloadHns] - The relative URL path of the portal endpoint to contact. + * @property [hnsSubdomain="hns"] - The name of the hns subdomain on the portal. + */ +export declare type CustomHnsDownloadOptions = CustomDownloadOptions & { + endpointDownloadHns?: string; + hnsSubdomain?: string; +}; +export declare type CustomGetMetadataOptions = BaseCustomOptions & { + endpointGetMetadata?: string; + query?: Record; +}; +export declare type CustomHnsResolveOptions = BaseCustomOptions & { + endpointResolveHns?: string; +}; +/** + * The response for a get file content request. + * + * @property data - The returned file content. Its type is stored in contentType. + * @property contentType - The type of the content. + * @property portalUrl - The URL of the portal. + * @property skylink - 46-character skylink. + */ +export declare type GetFileContentResponse = { + data: T; + contentType: string; + portalUrl: string; + skylink: string; +}; +/** + * The response for a get metadata request. + * + * @property metadata - The metadata in JSON format. + * @property portalUrl - The URL of the portal. + * @property skylink - 46-character skylink. + */ +export declare type GetMetadataResponse = { + metadata: Record; + portalUrl: string; + skylink: string; +}; +/** + * The response for a resolve HNS request. + * + * @property skylink - 46-character skylink. + */ +export declare type ResolveHnsResponse = { + data: JsonData; + skylink: string; +}; +export declare const defaultDownloadOptions: { + endpointDownload: string; + download: boolean; + path: undefined; + range: undefined; + responseType: undefined; + query: undefined; + subdomain: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Initiates a download of the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. Can be followed by a path. Note that the skylink will not be encoded, so if your path might contain special characters, consider using `customOptions.path`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function downloadFile(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Initiates a download of the content of the skylink at the Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +export declare function downloadFileHns(this: SkynetClient, domain: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Constructs the full URL for the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getSkylinkUrl(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Gets the skylink URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getSkylinkUrlForPortal(portalUrl: string, skylinkUrl: string, customOptions?: CustomDownloadOptions): string; +/** + * Constructs the full URL for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +export declare function getHnsUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise; +/** + * Constructs the full URL for the resolver for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the resolver for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise; +/** + * Gets only the metadata for the given skylink without the contents. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The metadata in JSON format. Empty if no metadata was found. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getMetadata(this: SkynetClient, skylinkUrl: string, customOptions?: CustomGetMetadataOptions): Promise; +/** + * Gets the contents of the file at the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function getFileContent(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise>; +/** + * Gets the contents of the file at the given Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the domain does not contain a skylink. + */ +export declare function getFileContentHns(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise>; +/** + * Does a GET request of the skylink, returning the data property of the response. + * + * @param this - SkynetClient + * @param url - URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the request does not succeed or the response is missing data. + */ +export declare function getFileContentRequest(this: SkynetClient, url: string, customOptions?: CustomDownloadOptions): Promise>; +/** + * Opens the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export declare function openFile(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise; +/** + * Opens the content of the skylink from the given Handshake domain within the browser. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +export declare function openFileHns(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise; +/** + * Resolves the given HNS domain to its skylink and returns it and the raw data. + * + * @param this - SkynetClient + * @param domain - Handshake resolver domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The raw data and corresponding skylink. + * @throws - Will throw if the input domain is not a string. + */ +export declare function resolveHns(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise; +//# sourceMappingURL=download.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/download.d.ts.map b/node_modules/skynet-js/dist/mjs/download.d.ts.map new file mode 100644 index 0000000..ba6c35e --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/download.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAIxE;;;;;;;;;;GAUG;AACH,oBAAY,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,wBAAwB,GAAG,iBAAiB,GAAG;IACzD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF,oBAAY,uBAAuB,GAAG,iBAAiB,GAAG;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;;;;GAOG;AACH,oBAAY,sBAAsB,CAAC,CAAC,GAAG,OAAO,IAAI;IAChD,IAAI,EAAE,CAAC,CAAC;IACR,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CASlC,CAAC;AAiBF;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,MAAM,CA0DR;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,uBAAuB,GACtC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,mBAAmB,CAAC,CAkC9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAQpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EACjD,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAQpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,GAAG,OAAO,EACrD,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,MAAM,EACX,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAgCpC;AAED;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,wBAAwB,GACvC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,uBAAuB,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAyB7B"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/download.js b/node_modules/skynet-js/dist/mjs/download.js new file mode 100644 index 0000000..1c1cd8b --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/download.js @@ -0,0 +1,402 @@ +import { convertSkylinkToBase32, formatSkylink } from "./skylink/format"; +import { parseSkylink } from "./skylink/parse"; +import { trimUriPrefix } from "./utils/string"; +import { defaultBaseOptions } from "./utils/options"; +import { addSubdomain, addUrlQuery, makeUrl, uriHandshakePrefix } from "./utils/url"; +import { throwValidationError, validateObject, validateOptionalObject, validateString } from "./utils/validation"; +export const defaultDownloadOptions = { + ...defaultBaseOptions, + endpointDownload: "/", + download: false, + path: undefined, + range: undefined, + responseType: undefined, + query: undefined, + subdomain: false, +}; +const defaultGetMetadataOptions = { + endpointGetMetadata: "/skynet/metadata", + query: undefined, +}; +const defaultDownloadHnsOptions = { + ...defaultDownloadOptions, + endpointDownloadHns: "hns", + hnsSubdomain: "hns", + // Default to subdomain format for HNS URLs. + subdomain: true, +}; +const defaultResolveHnsOptions = { + ...defaultBaseOptions, + endpointResolveHns: "hnsres", +}; +/** + * Initiates a download of the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. Can be followed by a path. Note that the skylink will not be encoded, so if your path might contain special characters, consider using `customOptions.path`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export async function downloadFile(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + const opts = { ...defaultDownloadOptions, ...this.customOptions, ...customOptions, download: true }; + const url = await this.getSkylinkUrl(skylinkUrl, opts); + // Download the url. + window.location.assign(url); + return url; +} +/** + * Initiates a download of the content of the skylink at the Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +export async function downloadFileHns(domain, customOptions) { + // Validation is done in `getHnsUrl`. + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions, download: true }; + const url = await this.getHnsUrl(domain, opts); + // Download the url. + window.location.assign(url); + return url; +} +/** + * Constructs the full URL for the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export async function getSkylinkUrl(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrlForPortal`. + const opts = { ...defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const portalUrl = await this.portalUrl(); + return getSkylinkUrlForPortal(portalUrl, skylinkUrl, opts); +} +/** + * Gets the skylink URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. + * @returns - The full URL for the skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export function getSkylinkUrlForPortal(portalUrl, skylinkUrl, customOptions) { + var _a; + validateString("portalUrl", portalUrl, "parameter"); + validateString("skylinkUrl", skylinkUrl, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultDownloadOptions); + const opts = { ...defaultDownloadOptions, ...customOptions }; + const query = {}; + if (opts.download) { + // Set the "attachment" parameter. + query.attachment = true; + } + // URL-encode the path. + let path = ""; + if (opts.path) { + if (typeof opts.path !== "string") { + throw new Error(`opts.path has to be a string, ${typeof opts.path} provided`); + } + // Encode each element of the path separately and join them. + // + // Don't use encodeURI because it does not encode characters such as '?' + // etc. These are allowed as filenames on Skynet and should be encoded so + // they are not treated as URL separators. + path = opts.path + .split("/") + .map((element) => encodeURIComponent(element)) + .join("/"); + } + let url; + if (opts.subdomain) { + // The caller wants to use a URL with the skylink as a base32 subdomain. + // + // Get the path from the skylink. Use the empty string if not found. + const skylinkPath = (_a = parseSkylink(skylinkUrl, { onlyPath: true })) !== null && _a !== void 0 ? _a : ""; + // Get just the skylink. + let skylink = parseSkylink(skylinkUrl); + if (skylink === null) { + throw new Error(`Could not get skylink out of input '${skylinkUrl}'`); + } + // Convert the skylink (without the path) to base32. + skylink = convertSkylinkToBase32(skylink); + url = addSubdomain(portalUrl, skylink); + url = makeUrl(url, skylinkPath, path); + } + else { + // Get the skylink including the path. + const skylink = parseSkylink(skylinkUrl, { includePath: true }); + if (skylink === null) { + throw new Error(`Could not get skylink with path out of input '${skylinkUrl}'`); + } + // Add additional path if passed in. + url = makeUrl(portalUrl, opts.endpointDownload, skylink); + url = makeUrl(url, path); + } + return addUrlQuery(url, query); +} +/** + * Constructs the full URL for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +export async function getHnsUrl(domain, customOptions) { + validateString("domain", domain, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultDownloadHnsOptions); + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; + const query = {}; + if (opts.download) { + query.attachment = true; + } + domain = trimUriPrefix(domain, uriHandshakePrefix); + const portalUrl = await this.portalUrl(); + const url = opts.subdomain + ? addSubdomain(addSubdomain(portalUrl, opts.hnsSubdomain), domain) + : makeUrl(portalUrl, opts.endpointDownloadHns, domain); + return addUrlQuery(url, query); +} +/** + * Constructs the full URL for the resolver for the given HNS domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL for the resolver for the HNS domain. + * @throws - Will throw if the input domain is not a string. + */ +export async function getHnsresUrl(domain, customOptions) { + validateString("domain", domain, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultResolveHnsOptions); + const opts = { ...defaultResolveHnsOptions, ...this.customOptions, ...customOptions }; + domain = trimUriPrefix(domain, uriHandshakePrefix); + const portalUrl = await this.portalUrl(); + return makeUrl(portalUrl, opts.endpointResolveHns, domain); +} +/** + * Gets only the metadata for the given skylink without the contents. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The metadata in JSON format. Empty if no metadata was found. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export async function getMetadata(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + var _a; + const opts = { ...defaultGetMetadataOptions, ...this.customOptions, ...customOptions }; + // Don't include the path for now since the endpoint doesn't support it. + const path = parseSkylink(skylinkUrl, { onlyPath: true }); + if (path) { + throw new Error("Skylink string should not contain a path"); + } + const getSkylinkUrlOpts = { endpointDownload: opts.endpointGetMetadata, query: opts.query }; + const url = await this.getSkylinkUrl(skylinkUrl, getSkylinkUrlOpts); + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointGetMetadata, + method: "GET", + url, + }); + validateGetMetadataResponse(response); + const metadata = response.data; + if (typeof response.headers === "undefined") { + throw new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists."); + } + const portalUrl = (_a = response.headers["skynet-portal-api"]) !== null && _a !== void 0 ? _a : ""; + const skylink = response.headers["skynet-skylink"] ? formatSkylink(response.headers["skynet-skylink"]) : ""; + return { metadata, portalUrl, skylink }; +} +/** + * Gets the contents of the file at the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export async function getFileContent(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + const opts = { ...defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const url = await this.getSkylinkUrl(skylinkUrl, opts); + return this.getFileContentRequest(url, opts); +} +/** + * Gets the contents of the file at the given Handshake domain. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the domain does not contain a skylink. + */ +export async function getFileContentHns(domain, customOptions) { + // Validation is done in `getHnsUrl`. + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; + const url = await this.getHnsUrl(domain, opts); + return this.getFileContentRequest(url, opts); +} +/** + * Does a GET request of the skylink, returning the data property of the response. + * + * @param this - SkynetClient + * @param url - URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. + * @throws - Will throw if the request does not succeed or the response is missing data. + */ +export async function getFileContentRequest(url, customOptions) { + // Not publicly available, don't validate input. + var _a, _b; + const opts = { ...defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const headers = opts.range ? { Range: opts.range } : undefined; + // GET request the data at the skylink. + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointDownload, + method: "get", + url, + headers, + }); + if (typeof response.data === "undefined") { + throw new Error("Did not get 'data' in response despite a successful request. Please try again and report this issue to the devs if it persists."); + } + if (typeof response.headers === "undefined") { + throw new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists."); + } + const contentType = (_a = response.headers["content-type"]) !== null && _a !== void 0 ? _a : ""; + const portalUrl = (_b = response.headers["skynet-portal-api"]) !== null && _b !== void 0 ? _b : ""; + const skylink = response.headers["skynet-skylink"] ? formatSkylink(response.headers["skynet-skylink"]) : ""; + return { data: response.data, contentType, portalUrl, skylink }; +} +/** + * Opens the content of the skylink within the browser. + * + * @param this - SkynetClient + * @param skylinkUrl - Skylink string. See `downloadFile`. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. + * @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. + */ +export async function openFile(skylinkUrl, customOptions) { + // Validation is done in `getSkylinkUrl`. + const opts = { ...defaultDownloadOptions, ...this.customOptions, ...customOptions }; + const url = await this.getSkylinkUrl(skylinkUrl, opts); + window.open(url, "_blank"); + return url; +} +/** + * Opens the content of the skylink from the given Handshake domain within the browser. + * + * @param this - SkynetClient + * @param domain - Handshake domain. + * @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. + * @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. + * @returns - The full URL that was used. + * @throws - Will throw if the input domain is not a string. + */ +export async function openFileHns(domain, customOptions) { + // Validation is done in `getHnsUrl`. + const opts = { ...defaultDownloadHnsOptions, ...this.customOptions, ...customOptions }; + const url = await this.getHnsUrl(domain, opts); + // Open the url in a new tab. + window.open(url, "_blank"); + return url; +} +/** + * Resolves the given HNS domain to its skylink and returns it and the raw data. + * + * @param this - SkynetClient + * @param domain - Handshake resolver domain. + * @param [customOptions={}] - Additional settings that can optionally be set. + * @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. + * @returns - The raw data and corresponding skylink. + * @throws - Will throw if the input domain is not a string. + */ +export async function resolveHns(domain, customOptions) { + // Validation is done in `getHnsresUrl`. + const opts = { ...defaultResolveHnsOptions, ...this.customOptions, ...customOptions }; + const url = await this.getHnsresUrl(domain, opts); + // Get the txt record from the hnsres domain on the portal. + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointResolveHns, + method: "get", + url, + }); + validateResolveHnsResponse(response); + if (response.data.skylink) { + return { data: response.data, skylink: response.data.skylink }; + } + else { + const skylink = await this.registry.getEntryLink(response.data.registry.publickey, response.data.registry.datakey, { + hashedDataKeyHex: true, + }); + return { data: response.data, skylink }; + } +} +/** + * Validates the response from getMetadata. + * + * @param response - The Axios response. + * @throws - Will throw if the response does not contain the expected fields. + */ +function validateGetMetadataResponse(response) { + try { + if (!response.data) { + throw new Error("response.data field missing"); + } + } + catch (err) { + throw new Error(`Metadata response invalid despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} +/** + * Validates the response from resolveHns. + * + * @param response - The Axios response. + * @throws - Will throw if the response contains an unexpected format. + */ +function validateResolveHnsResponse(response) { + try { + if (!response.data) { + throw new Error("response.data field missing"); + } + if (response.data.skylink) { + validateString("response.data.skylink", response.data.skylink, "resolveHns response field"); + } + else if (response.data.registry) { + validateObject("response.data.registry", response.data.registry, "resolveHns response field"); + validateString("response.data.registry.publickey", response.data.registry.publickey, "resolveHns response field"); + validateString("response.data.registry.datakey", response.data.registry.datakey, "resolveHns response field"); + } + else { + throwValidationError("response.data", response.data, "response data object", "object containing skylink or registry field"); + } + } + catch (err) { + throw new Error(`Did not get a complete resolve HNS response despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} diff --git a/node_modules/skynet-js/dist/mjs/file.d.ts b/node_modules/skynet-js/dist/mjs/file.d.ts new file mode 100644 index 0000000..da06002 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/file.d.ts @@ -0,0 +1,50 @@ +import { SkynetClient } from "./client"; +import { EntryData } from "./mysky"; +import { EncryptedJSONResponse } from "./mysky/encrypted_files"; +import { CustomGetEntryOptions } from "./registry"; +import { CustomGetJSONOptions, JSONResponse } from "./skydb"; +/** + * Gets Discoverable JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + */ +export declare function getJSON(this: SkynetClient, userID: string, path: string, customOptions?: CustomGetJSONOptions): Promise; +/** + * Gets the entry link for the entry set with MySky at the given data path, for + * the given public user ID. This is a v2 skylink. This link stays the same even + * if the content at the entry changes. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @returns - The entry link. + */ +export declare function getEntryLink(this: SkynetClient, userID: string, path: string): Promise; +/** + * Gets the entry data for the entry set with MySky at the given data path, for + * the given public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + */ +export declare function getEntryData(this: SkynetClient, userID: string, path: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets Encrypted JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param pathSeed - The share-able secret path seed. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + */ +export declare function getJSONEncrypted(this: SkynetClient, userID: string, pathSeed: string, customOptions?: CustomGetJSONOptions): Promise; +//# sourceMappingURL=file.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/file.d.ts.map b/node_modules/skynet-js/dist/mjs/file.d.ts.map new file mode 100644 index 0000000..10898e8 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/file.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAIL,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAA0B,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAyB,YAAY,EAAE,MAAM,SAAS,CAAC;AAOpF;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,YAAY,CAAC,CAevB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASpG;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,SAAS,CAAC,CAmBpB;AAMD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAEhB,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,qBAAqB,CAAC,CAuBhC"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/file.js b/node_modules/skynet-js/dist/mjs/file.js new file mode 100644 index 0000000..9db3bc0 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/file.js @@ -0,0 +1,114 @@ +import { decryptJSONFile, deriveEncryptedFileKeyEntropy, deriveEncryptedFileTweak, } from "./mysky/encrypted_files"; +import { deriveDiscoverableFileTweak } from "./mysky/tweak"; +import { defaultGetEntryOptions } from "./registry"; +import { defaultGetJSONOptions } from "./skydb"; +import { validateOptionalObject, validateString, validateStringLen } from "./utils/validation"; +// ==== +// JSON +// ==== +/** + * Gets Discoverable JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + */ +export async function getJSON(userID, path, customOptions) { + validateString("userID", userID, "parameter"); + validateString("path", path, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetJSONOptions); + const opts = { + ...defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + return await this.db.getJSON(userID, dataKey, opts); +} +// ===== +// Entry +// ===== +/** + * Gets the entry link for the entry set with MySky at the given data path, for + * the given public user ID. This is a v2 skylink. This link stays the same even + * if the content at the entry changes. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @returns - The entry link. + */ +export async function getEntryLink(userID, path) { + validateString("userID", userID, "parameter"); + validateString("path", path, "parameter"); + const dataKey = deriveDiscoverableFileTweak(path); + // Do not hash the tweak anymore. + const opts = { ...defaultGetEntryOptions, hashedDataKeyHex: true }; + return await this.registry.getEntryLink(userID, dataKey, opts); +} +/** + * Gets the entry data for the entry set with MySky at the given data path, for + * the given public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + */ +export async function getEntryData(userID, path, customOptions) { + validateString("userID", userID, "parameter"); + validateString("path", path, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetEntryOptions); + const opts = { + ...defaultGetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const { entry } = await this.registry.getEntry(userID, dataKey, opts); + if (!entry) { + return { data: null }; + } + return { data: entry.data }; +} +// =============== +// Encrypted Files +// =============== +/** + * Gets Encrypted JSON set with MySky at the given data path for the given + * public user ID. + * + * @param this - SkynetClient + * @param userID - The MySky public user ID. + * @param pathSeed - The share-able secret path seed. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + */ +export async function getJSONEncrypted(userID, pathSeed, +// TODO: Take a new options type? +customOptions) { + validateString("userID", userID, "parameter"); + validateStringLen("pathSeed", pathSeed, "parameter", 64); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetJSONOptions); + const opts = { + ...defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + hashedDataKeyHex: true, // Do not hash the tweak anymore. + }; + // Fetch the raw encrypted JSON data. + const dataKey = deriveEncryptedFileTweak(pathSeed); + const { data } = await this.db.getRawBytes(userID, dataKey, opts); + if (data === null) { + return { data: null }; + } + const key = deriveEncryptedFileKeyEntropy(pathSeed); + const json = decryptJSONFile(data, key); + return { data: json }; +} diff --git a/node_modules/skynet-js/dist/mjs/index.d.ts b/node_modules/skynet-js/dist/mjs/index.d.ts new file mode 100644 index 0000000..49adc00 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/index.d.ts @@ -0,0 +1,25 @@ +export { SkynetClient } from "./client"; +export { HASH_LENGTH, deriveChildSeed, genKeyPairAndSeed, genKeyPairFromSeed } from "./crypto"; +export { getSkylinkUrlForPortal } from "./download"; +export { getEntryUrlForPortal, signEntry } from "./registry"; +export { DacLibrary, MySky, mySkyDomain, mySkyDevDomain } from "./mysky"; +export { deriveEncryptedFileKeyEntropy, deriveEncryptedFileSeed, deriveEncryptedFileTweak, ENCRYPTION_PATH_SEED_LENGTH, } from "./mysky/encrypted_files"; +export { deriveDiscoverableFileTweak } from "./mysky/tweak"; +export { convertSkylinkToBase32, convertSkylinkToBase64 } from "./skylink/format"; +export { parseSkylink } from "./skylink/parse"; +export { isSkylinkV1, isSkylinkV2 } from "./skylink/sia"; +export { getRelativeFilePath, getRootDirectory } from "./utils/file"; +export { MAX_REVISION } from "./utils/number"; +export { stringToUint8ArrayUtf8, uint8ArrayToStringUtf8 } from "./utils/string"; +export { defaultPortalUrl, defaultSkynetPortalUrl, extractDomainForPortal, getFullDomainUrlForPortal, uriHandshakePrefix, uriSkynetPrefix, } from "./utils/url"; +export { Permission, PermCategory, PermType, PermRead, PermWrite, PermHidden, PermDiscoverable, PermLegacySkyID, } from "skynet-mysky-utils"; +export type { CustomClientOptions, RequestConfig } from "./client"; +export type { KeyPair, KeyPairAndSeed, Signature } from "./crypto"; +export type { CustomDownloadOptions, ResolveHnsResponse } from "./download"; +export type { CustomConnectorOptions } from "./mysky"; +export type { CustomPinOptions, PinResponse } from "./pin"; +export type { CustomGetEntryOptions, CustomSetEntryOptions, SignedRegistryEntry, RegistryEntry } from "./registry"; +export type { CustomGetJSONOptions, CustomSetJSONOptions, JsonData, JSONResponse, RawBytesResponse } from "./skydb"; +export type { CustomUploadOptions, UploadRequestResponse } from "./upload"; +export type { ParseSkylinkOptions } from "./skylink/parse"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/index.d.ts.map b/node_modules/skynet-js/dist/mjs/index.d.ts.map new file mode 100644 index 0000000..e5043ee --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,GAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAI5B,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACnE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC5E,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnH,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACpH,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC3E,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/index.js b/node_modules/skynet-js/dist/mjs/index.js new file mode 100644 index 0000000..f4d5b1a --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/index.js @@ -0,0 +1,17 @@ +/* istanbul ignore file */ +export { SkynetClient } from "./client"; +export { HASH_LENGTH, deriveChildSeed, genKeyPairAndSeed, genKeyPairFromSeed } from "./crypto"; +export { getSkylinkUrlForPortal } from "./download"; +export { getEntryUrlForPortal, signEntry } from "./registry"; +export { DacLibrary, MySky, mySkyDomain, mySkyDevDomain } from "./mysky"; +export { deriveEncryptedFileKeyEntropy, deriveEncryptedFileSeed, deriveEncryptedFileTweak, ENCRYPTION_PATH_SEED_LENGTH, } from "./mysky/encrypted_files"; +export { deriveDiscoverableFileTweak } from "./mysky/tweak"; +export { convertSkylinkToBase32, convertSkylinkToBase64 } from "./skylink/format"; +export { parseSkylink } from "./skylink/parse"; +export { isSkylinkV1, isSkylinkV2 } from "./skylink/sia"; +export { getRelativeFilePath, getRootDirectory } from "./utils/file"; +export { MAX_REVISION } from "./utils/number"; +export { stringToUint8ArrayUtf8, uint8ArrayToStringUtf8 } from "./utils/string"; +export { defaultPortalUrl, defaultSkynetPortalUrl, extractDomainForPortal, getFullDomainUrlForPortal, uriHandshakePrefix, uriSkynetPrefix, } from "./utils/url"; +// Re-export Permission API. +export { Permission, PermCategory, PermType, PermRead, PermWrite, PermHidden, PermDiscoverable, PermLegacySkyID, } from "skynet-mysky-utils"; diff --git a/node_modules/skynet-js/dist/mjs/mysky/connector.d.ts b/node_modules/skynet-js/dist/mjs/mysky/connector.d.ts new file mode 100644 index 0000000..1062df7 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/connector.d.ts @@ -0,0 +1,36 @@ +import { Connection } from "post-me"; +import { SkynetClient } from "../client"; +/** + * Custom connector options. + * + * @property [dev] - Whether to use the dev build of mysky. It is functionally equivalent to the default production mysky, except that all permissions are granted automatically and data lives in a separate sandbox from production. + * @property [debug] - Whether to tell mysky and DACs to print debug messages. + * @property [alpha] - Whether to use the alpha build of mysky. This is the build where development occurs and it can be expected to break. This takes precedence over the 'dev' option if that is also set. + * @property [handshakeMaxAttempts=150] - The amount of handshake attempts to make when starting a connection. + * @property [handshakeAttemptsInterval=100] - The time interval to wait between handshake attempts. + */ +export declare type CustomConnectorOptions = { + dev?: boolean; + debug?: boolean; + alpha?: boolean; + handshakeMaxAttempts?: number; + handshakeAttemptsInterval?: number; +}; +export declare const defaultConnectorOptions: { + dev: boolean; + debug: boolean; + alpha: boolean; + handshakeMaxAttempts: number; + handshakeAttemptsInterval: number; +}; +export declare class Connector { + url: string; + client: SkynetClient; + childFrame: HTMLIFrameElement; + connection: Connection; + options: CustomConnectorOptions; + constructor(url: string, client: SkynetClient, childFrame: HTMLIFrameElement, connection: Connection, options: CustomConnectorOptions); + static init(client: SkynetClient, domain: string, customOptions?: CustomConnectorOptions): Promise; + call(method: string, ...args: unknown[]): Promise; +} +//# sourceMappingURL=connector.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/connector.d.ts.map b/node_modules/skynet-js/dist/mjs/mysky/connector.d.ts.map new file mode 100644 index 0000000..0165d95 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/connector.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../src/mysky/connector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAoC,MAAM,SAAS,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;;GAQG;AACH,oBAAY,sBAAsB,GAAG;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;CAMnC,CAAC;AAEF,qBAAa,SAAS;IAEX,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,iBAAiB;IAC7B,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,sBAAsB;gBAJ/B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,sBAAsB;WAK3B,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsC7G,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGjE"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/connector.js b/node_modules/skynet-js/dist/mjs/mysky/connector.js new file mode 100644 index 0000000..a24f6de --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/connector.js @@ -0,0 +1,54 @@ +/* istanbul ignore file */ +import { ParentHandshake, WindowMessenger } from "post-me"; +import { createIframe, defaultHandshakeAttemptsInterval, defaultHandshakeMaxAttempts } from "skynet-mysky-utils"; +import { addUrlQuery } from "../utils/url"; +export const defaultConnectorOptions = { + dev: false, + debug: false, + alpha: false, + handshakeMaxAttempts: defaultHandshakeMaxAttempts, + handshakeAttemptsInterval: defaultHandshakeAttemptsInterval, +}; +export class Connector { + constructor(url, client, childFrame, connection, options) { + this.url = url; + this.client = client; + this.childFrame = childFrame; + this.connection = connection; + this.options = options; + } + // Static initializer + static async init(client, domain, customOptions) { + const opts = { ...defaultConnectorOptions, ...customOptions }; + // Get the URL for the domain on the current portal. + let domainUrl = await client.getFullDomainUrl(domain); + if (opts.dev) { + domainUrl = addUrlQuery(domainUrl, { dev: "true" }); + } + if (opts.debug) { + domainUrl = addUrlQuery(domainUrl, { debug: "true" }); + } + if (opts.alpha) { + domainUrl = addUrlQuery(domainUrl, { alpha: "true" }); + } + // Create the iframe. + const childFrame = createIframe(domainUrl, domainUrl); + // The frame window should always exist. Sanity check + make TS happy. + if (!childFrame.contentWindow) { + throw new Error("'childFrame.contentWindow' was null"); + } + const childWindow = childFrame.contentWindow; + // Connect to the iframe. + const messenger = new WindowMessenger({ + localWindow: window, + remoteWindow: childWindow, + remoteOrigin: "*", + }); + const connection = await ParentHandshake(messenger, {}, opts.handshakeMaxAttempts, opts.handshakeAttemptsInterval); + // Construct the component connector. + return new Connector(domainUrl, client, childFrame, connection, opts); + } + async call(method, ...args) { + return this.connection.remoteHandle().call(method, ...args); + } +} diff --git a/node_modules/skynet-js/dist/mjs/mysky/dac.d.ts b/node_modules/skynet-js/dist/mjs/mysky/dac.d.ts new file mode 100644 index 0000000..94d713b --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/dac.d.ts @@ -0,0 +1,12 @@ +import { Permission } from "skynet-mysky-utils"; +import { SkynetClient } from "../client"; +import { Connector, CustomConnectorOptions } from "./connector"; +export declare abstract class DacLibrary { + protected dacDomain: string; + protected connector?: Connector; + constructor(dacDomain: string); + init(client: SkynetClient, customOptions: CustomConnectorOptions): Promise; + abstract getPermissions(): Permission[]; + onUserLogin(): void; +} +//# sourceMappingURL=dac.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/dac.d.ts.map b/node_modules/skynet-js/dist/mjs/mysky/dac.d.ts.map new file mode 100644 index 0000000..af2bd90 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/dac.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dac.d.ts","sourceRoot":"","sources":["../../../src/mysky/dac.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEhE,8BAAsB,UAAU;IAGX,SAAS,CAAC,SAAS,EAAE,MAAM;IAF9C,SAAS,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;gBAEH,SAAS,EAAE,MAAM;IAEjC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7F,QAAQ,CAAC,cAAc,IAAI,UAAU,EAAE;IAEvC,WAAW,IAAI,IAAI;CAOpB"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/dac.js b/node_modules/skynet-js/dist/mjs/mysky/dac.js new file mode 100644 index 0000000..c05bfdb --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/dac.js @@ -0,0 +1,17 @@ +/* istanbul ignore file */ +import { Connector } from "./connector"; +export class DacLibrary { + constructor(dacDomain) { + this.dacDomain = dacDomain; + } + async init(client, customOptions) { + this.connector = await Connector.init(client, this.dacDomain, customOptions); + await this.connector.connection.remoteHandle().call("init"); + } + onUserLogin() { + if (!this.connector) { + throw new Error("init was not called"); + } + this.connector.connection.remoteHandle().call("onUserLogin"); + } +} diff --git a/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.d.ts b/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.d.ts new file mode 100644 index 0000000..a9f4af8 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.d.ts @@ -0,0 +1,127 @@ +import { JsonData } from "../skydb"; +/** + * The current response version for encrypted JSON files. Part of the metadata + * prepended to encrypted data. + */ +export declare const ENCRYPTED_JSON_RESPONSE_VERSION = 1; +/** + * The length of the encryption key. + */ +export declare const ENCRYPTION_KEY_LENGTH = 32; +/** + * The length of the hidden field metadata stored along with encrypted files. + * Note that this is hidden from the user, but not actually encrypted. It is + * stored after the nonce. + */ +export declare const ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH = 16; +/** + * The length of the random nonce, prepended to the encrypted bytes. It comes + * before the unencrypted hidden field metadata. + */ +export declare const ENCRYPTION_NONCE_LENGTH = 24; +/** + * The length of the share-able path seed. + */ +export declare const ENCRYPTION_PATH_SEED_LENGTH = 32; +export declare type EncryptedJSONResponse = { + data: JsonData | null; +}; +declare type EncryptedFileMetadata = { + version: number; +}; +/** + * Decrypts the given bytes as an encrypted JSON file. + * + * @param data - The given raw bytes. + * @param key - The encryption key. + * @returns - The JSON data and metadata. + * @throws - Will throw if the bytes could not be decrypted. + */ +export declare function decryptJSONFile(data: Uint8Array, key: Uint8Array): JsonData; +/** + * Encrypts the given JSON data and metadata. + * + * @param json - The given JSON data. + * @param metadata - The given metadata. + * @param key - The encryption key. + * @returns - The encrypted data. + */ +export declare function encryptJSONFile(json: JsonData, metadata: EncryptedFileMetadata, key: Uint8Array): Uint8Array; +/** + * Derives key entropy for the given path seed. + * + * @param pathSeed - The given path seed. + * @returns - The key entropy. + */ +export declare function deriveEncryptedFileKeyEntropy(pathSeed: string): Uint8Array; +/** + * Derives the encrypted file tweak for the given path seed. + * + * @param pathSeed - the given path seed. + * @returns - The encrypted file tweak. + */ +export declare function deriveEncryptedFileTweak(pathSeed: string): string; +/** + * Derives the path seed for the relative path, given the starting path seed and + * whether it is a directory. The path can be an absolute path if the root seed + * is given. + * + * @param pathSeed - The given starting path seed. + * @param subPath - The path. + * @param isDirectory - Whether the path is a directory. + * @returns - The path seed for the given path. + */ +export declare function deriveEncryptedFileSeed(pathSeed: string, subPath: string, isDirectory: boolean): string; +/** + * To prevent analysis that can occur by looking at the sizes of files, all + * encrypted files will be padded to the nearest "pad block" (after encryption). + * A pad block is minimally 4 kib in size, is always a power of 2, and is always + * at least 5% of the size of the file. + * + * For example, a 1 kib encrypted file would be padded to 4 kib, a 5 kib file + * would be padded to 8 kib, and a 105 kib file would be padded to 112 kib. + * Below is a short table of valid file sizes: + * + * ``` + * 4 KiB 8 KiB 12 KiB 16 KiB 20 KiB + * 24 KiB 28 KiB 32 KiB 36 KiB 40 KiB + * 44 KiB 48 KiB 52 KiB 56 KiB 60 KiB + * 64 KiB 68 KiB 72 KiB 76 KiB 80 KiB + * + * 88 KiB 96 KiB 104 KiB 112 KiB 120 KiB + * 128 KiB 136 KiB 144 KiB 152 KiB 160 KiB + * + * 176 KiB 192 Kib 208 KiB 224 KiB 240 KiB + * 256 KiB 272 KiB 288 KiB 304 KiB 320 KiB + * + * 352 KiB ... etc + * ``` + * + * Note that the first 20 valid sizes are all a multiple of 4 KiB, the next 10 + * are a multiple of 8 KiB, and each 10 after that the multiple doubles. We use + * this method of padding files to prevent an adversary from guessing the + * contents or structure of the file based on its size. + * + * @param initialSize - The size of the file. + * @returns - The final size, padded to a pad block. + * @throws - Will throw if the size would overflow the JS number type. + */ +export declare function padFileSize(initialSize: number): number; +/** + * Checks if the given size corresponds to the correct padded block. + * + * @param size - The given file size. + * @returns - Whether the size corresponds to a padded block. + * @throws - Will throw if the size would overflow the JS number type. + */ +export declare function checkPaddedBlock(size: number): boolean; +/** + * Encodes the given encrypted file metadata. + * + * @param metadata - The given metadata. + * @returns - The encoded metadata bytes. + * @throws - Will throw if the version does not fit in a byte. + */ +export declare function encodeEncryptedFileMetadata(metadata: EncryptedFileMetadata): Uint8Array; +export {}; +//# sourceMappingURL=encrypted_files.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.d.ts.map b/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.d.ts.map new file mode 100644 index 0000000..2d00efe --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encrypted_files.d.ts","sourceRoot":"","sources":["../../../src/mysky/encrypted_files.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAYpC;;;GAGG;AACH,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAO1C;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAW9C,oBAAY,qBAAqB,GAAG;IAClC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB,CAAC;AAQF,aAAK,qBAAqB,GAAG;IAE3B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,QAAQ,CA2C3E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,qBAAqB,EAAE,GAAG,EAAE,UAAU,GAAG,UAAU,CAyB5G;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAK1E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,CAuBvG;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAevD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWtD;AAoBD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,UAAU,CAWvF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.js b/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.js new file mode 100644 index 0000000..7e09760 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/encrypted_files.js @@ -0,0 +1,274 @@ +import randomBytes from "randombytes"; +import { sanitizePath } from "skynet-mysky-utils"; +import { secretbox } from "tweetnacl"; +import { HASH_LENGTH, sha512 } from "../crypto"; +import { hexToUint8Array, stringToUint8ArrayUtf8, toHexString, uint8ArrayToStringUtf8 } from "../utils/string"; +import { validateBoolean, validateHexString, validateNumber, validateObject, validateString, validateUint8Array, validateUint8ArrayLen, } from "../utils/validation"; +/** + * The current response version for encrypted JSON files. Part of the metadata + * prepended to encrypted data. + */ +export const ENCRYPTED_JSON_RESPONSE_VERSION = 1; +/** + * The length of the encryption key. + */ +export const ENCRYPTION_KEY_LENGTH = 32; +/** + * The length of the hidden field metadata stored along with encrypted files. + * Note that this is hidden from the user, but not actually encrypted. It is + * stored after the nonce. + */ +export const ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH = 16; +/** + * The length of the random nonce, prepended to the encrypted bytes. It comes + * before the unencrypted hidden field metadata. + */ +export const ENCRYPTION_NONCE_LENGTH = 24; +/** + * The length of the overhead introduced by encryption. + */ +const ENCRYPTION_OVERHEAD_LENGTH = 16; +/** + * The length of the share-able path seed. + */ +export const ENCRYPTION_PATH_SEED_LENGTH = 32; +// Descriptive salt that should not be changed. +const SALT_ENCRYPTED_CHILD = "encrypted filesystem child"; +// Descriptive salt that should not be changed. +const SALT_ENCRYPTED_TWEAK = "encrypted filesystem tweak"; +// Descriptive salt that should not be changed. +const SALT_ENCRYPTION = "encryption"; +/** + * Decrypts the given bytes as an encrypted JSON file. + * + * @param data - The given raw bytes. + * @param key - The encryption key. + * @returns - The JSON data and metadata. + * @throws - Will throw if the bytes could not be decrypted. + */ +export function decryptJSONFile(data, key) { + validateUint8Array("data", data, "parameter"); + validateUint8ArrayLen("key", key, "parameter", ENCRYPTION_KEY_LENGTH); + // Validate that the size of the data corresponds to a padded block. + if (!checkPaddedBlock(data.length)) { + throw new Error(`Expected parameter 'data' to be padded encrypted data, length was '${data.length}', nearest padded block is '${padFileSize(data.length)}'`); + } + // Extract the nonce. + const nonce = data.slice(0, ENCRYPTION_NONCE_LENGTH); + data = data.slice(ENCRYPTION_NONCE_LENGTH); + // Extract the unencrypted hidden field metadata. + const metadataBytes = data.slice(0, ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + data = data.slice(ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + const metadata = decodeEncryptedFileMetadata(metadataBytes); + if (metadata.version !== ENCRYPTED_JSON_RESPONSE_VERSION) { + throw new Error(`Received unrecognized JSON response version '${metadata.version}' in metadata, expected '${ENCRYPTED_JSON_RESPONSE_VERSION}'`); + } + // Decrypt the non-nonce part of the data. + let decryptedBytes = secretbox.open(data, nonce, key); + if (!decryptedBytes) { + throw new Error("Could not decrypt given encrypted JSON file"); + } + // Trim the 0-byte padding off the end of the decrypted bytes. This should never remove real data as + // properly-formatted JSON must end with '}'. + let paddingIndex = decryptedBytes.length; + while (paddingIndex > 0 && decryptedBytes[paddingIndex - 1] === 0) { + paddingIndex--; + } + decryptedBytes = decryptedBytes.slice(0, paddingIndex); + // Parse the final decrypted message as json. + return JSON.parse(uint8ArrayToStringUtf8(decryptedBytes)); +} +/** + * Encrypts the given JSON data and metadata. + * + * @param json - The given JSON data. + * @param metadata - The given metadata. + * @param key - The encryption key. + * @returns - The encrypted data. + */ +export function encryptJSONFile(json, metadata, key) { + validateObject("json", json, "parameter"); + validateNumber("metadata.version", metadata.version, "parameter"); + validateUint8ArrayLen("key", key, "parameter", ENCRYPTION_KEY_LENGTH); + // Stringify the json and convert to bytes. + let data = stringToUint8ArrayUtf8(JSON.stringify(json)); + // Add padding so that the final size will be a padded block. The overhead will be added by encryption and we add the nonce at the end. + const totalOverhead = ENCRYPTION_OVERHEAD_LENGTH + ENCRYPTION_NONCE_LENGTH + ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH; + const finalSize = padFileSize(data.length + totalOverhead) - totalOverhead; + data = new Uint8Array([...data, ...new Uint8Array(finalSize - data.length)]); + // Generate a random nonce. + const nonce = new Uint8Array(randomBytes(ENCRYPTION_NONCE_LENGTH)); + // Encrypt the data. + const encryptedBytes = secretbox(data, nonce, key); + // Prepend the metadata. + const metadataBytes = encodeEncryptedFileMetadata(metadata); + const finalBytes = new Uint8Array([...metadataBytes, ...encryptedBytes]); + // Prepend the nonce to the final data. + return new Uint8Array([...nonce, ...finalBytes]); +} +/** + * Derives key entropy for the given path seed. + * + * @param pathSeed - The given path seed. + * @returns - The key entropy. + */ +export function deriveEncryptedFileKeyEntropy(pathSeed) { + const bytes = new Uint8Array([...sha512(SALT_ENCRYPTION), ...sha512(pathSeed)]); + const hashBytes = sha512(bytes); + // Truncate the hash to the size of an encryption key. + return hashBytes.slice(0, ENCRYPTION_KEY_LENGTH); +} +/** + * Derives the encrypted file tweak for the given path seed. + * + * @param pathSeed - the given path seed. + * @returns - The encrypted file tweak. + */ +export function deriveEncryptedFileTweak(pathSeed) { + let hashBytes = sha512(new Uint8Array([...sha512(SALT_ENCRYPTED_TWEAK), ...sha512(pathSeed)])); + // Truncate the hash or it will be rejected in skyd. + hashBytes = hashBytes.slice(0, HASH_LENGTH); + return toHexString(hashBytes); +} +/** + * Derives the path seed for the relative path, given the starting path seed and + * whether it is a directory. The path can be an absolute path if the root seed + * is given. + * + * @param pathSeed - The given starting path seed. + * @param subPath - The path. + * @param isDirectory - Whether the path is a directory. + * @returns - The path seed for the given path. + */ +export function deriveEncryptedFileSeed(pathSeed, subPath, isDirectory) { + validateHexString("pathSeed", pathSeed, "parameter"); + validateString("subPath", subPath, "parameter"); + validateBoolean("isDirectory", isDirectory, "parameter"); + let pathSeedBytes = hexToUint8Array(pathSeed); + subPath = sanitizePath(subPath); + const names = subPath.split("/"); + names.forEach((name, index) => { + const directory = index === names.length - 1 ? isDirectory : true; + const derivationPathObj = { + pathSeed: pathSeedBytes, + directory, + name, + }; + const derivationPath = hashDerivationPathObject(derivationPathObj); + const bytes = new Uint8Array([...sha512(SALT_ENCRYPTED_CHILD), ...derivationPath]); + pathSeedBytes = sha512(bytes); + }); + // Truncate and hex-encode the final output. + return toHexString(pathSeedBytes.slice(0, ENCRYPTION_PATH_SEED_LENGTH)); +} +/** + * Hashes the derivation path object. + * + * @param obj - The given object containing the derivation path. + * @returns - The hash. + */ +function hashDerivationPathObject(obj) { + const bytes = new Uint8Array([...obj.pathSeed, obj.directory ? 1 : 0, ...stringToUint8ArrayUtf8(obj.name)]); + return sha512(bytes); +} +/** + * To prevent analysis that can occur by looking at the sizes of files, all + * encrypted files will be padded to the nearest "pad block" (after encryption). + * A pad block is minimally 4 kib in size, is always a power of 2, and is always + * at least 5% of the size of the file. + * + * For example, a 1 kib encrypted file would be padded to 4 kib, a 5 kib file + * would be padded to 8 kib, and a 105 kib file would be padded to 112 kib. + * Below is a short table of valid file sizes: + * + * ``` + * 4 KiB 8 KiB 12 KiB 16 KiB 20 KiB + * 24 KiB 28 KiB 32 KiB 36 KiB 40 KiB + * 44 KiB 48 KiB 52 KiB 56 KiB 60 KiB + * 64 KiB 68 KiB 72 KiB 76 KiB 80 KiB + * + * 88 KiB 96 KiB 104 KiB 112 KiB 120 KiB + * 128 KiB 136 KiB 144 KiB 152 KiB 160 KiB + * + * 176 KiB 192 Kib 208 KiB 224 KiB 240 KiB + * 256 KiB 272 KiB 288 KiB 304 KiB 320 KiB + * + * 352 KiB ... etc + * ``` + * + * Note that the first 20 valid sizes are all a multiple of 4 KiB, the next 10 + * are a multiple of 8 KiB, and each 10 after that the multiple doubles. We use + * this method of padding files to prevent an adversary from guessing the + * contents or structure of the file based on its size. + * + * @param initialSize - The size of the file. + * @returns - The final size, padded to a pad block. + * @throws - Will throw if the size would overflow the JS number type. + */ +export function padFileSize(initialSize) { + const kib = 1 << 10; + // Only iterate to 53 (the maximum safe power of 2). + for (let n = 0; n < 53; n++) { + if (initialSize <= (1 << n) * 80 * kib) { + const paddingBlock = (1 << n) * 4 * kib; + let finalSize = initialSize; + if (finalSize % paddingBlock !== 0) { + finalSize = initialSize - (initialSize % paddingBlock) + paddingBlock; + } + return finalSize; + } + } + // Prevent overflow. Max JS number size is 2^53-1. + throw new Error("Could not pad file size, overflow detected."); +} +/** + * Checks if the given size corresponds to the correct padded block. + * + * @param size - The given file size. + * @returns - Whether the size corresponds to a padded block. + * @throws - Will throw if the size would overflow the JS number type. + */ +export function checkPaddedBlock(size) { + const kib = 1 << 10; + // Only iterate to 53 (the maximum safe power of 2). + for (let n = 0; n < 53; n++) { + if (size <= (1 << n) * 80 * kib) { + const paddingBlock = (1 << n) * 4 * kib; + return size % paddingBlock === 0; + } + } + // Prevent overflow. Max JS number size is 2^53-1. + throw new Error("Could not check padded file size, overflow detected."); +} +/** + * Decodes the encoded encrypted file metadata. + * + * @param bytes - The encoded metadata. + * @returns - The decoded metadata. + * @throws - Will throw if the given bytes are of the wrong length. + */ +function decodeEncryptedFileMetadata(bytes) { + // Ensure input is correct length. + validateUint8ArrayLen("bytes", bytes, "encrypted file metadata bytes", ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + const version = bytes[0]; + return { + version, + }; +} +/** + * Encodes the given encrypted file metadata. + * + * @param metadata - The given metadata. + * @returns - The encoded metadata bytes. + * @throws - Will throw if the version does not fit in a byte. + */ +export function encodeEncryptedFileMetadata(metadata) { + const bytes = new Uint8Array(ENCRYPTION_HIDDEN_FIELD_METADATA_LENGTH); + // Encode the version + if (metadata.version >= 1 << 8 || metadata.version < 0) { + throw new Error(`Metadata version '${metadata.version}' could not be stored in a uint8`); + } + // Don't need to use a DataView or worry about endianness for a uint8. + bytes[0] = metadata.version; + return bytes; +} diff --git a/node_modules/skynet-js/dist/mjs/mysky/index.d.ts b/node_modules/skynet-js/dist/mjs/mysky/index.d.ts new file mode 100644 index 0000000..73c6d93 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/index.d.ts @@ -0,0 +1,171 @@ +export type { CustomConnectorOptions } from "./connector"; +export { DacLibrary } from "./dac"; +import { Connection } from "post-me"; +import { Permission } from "skynet-mysky-utils"; +import { Connector, CustomConnectorOptions } from "./connector"; +import { SkynetClient } from "../client"; +import { DacLibrary } from "./dac"; +import { CustomGetEntryOptions, RegistryEntry } from "../registry"; +import { CustomGetJSONOptions, CustomSetJSONOptions, JsonData, JSONResponse } from "../skydb"; +import { Signature } from "../crypto"; +import { EncryptedJSONResponse } from "./encrypted_files"; +export declare const mySkyDomain = "skynet-mysky.hns"; +export declare const mySkyDevDomain = "skynet-mysky-dev.hns"; +export declare const mySkyAlphaDomain = "sandbridge.hns"; +export declare const MAX_ENTRY_LENGTH = 70; +export declare type EntryData = { + data: Uint8Array | null; +}; +/** + * Loads MySky. Note that this does not log in the user. + * + * @param this - The Skynet client. + * @param skappDomain - The domain of the host skapp. For this domain permissions will be requested and, by default, automatically granted. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - Loaded (but not logged-in) MySky instance. + */ +export declare function loadMySky(this: SkynetClient, skappDomain?: string, customOptions?: CustomConnectorOptions): Promise; +export declare class MySky { + protected connector: Connector; + protected hostDomain: string; + static instance: MySky | null; + dacs: DacLibrary[]; + grantedPermissions: Permission[]; + pendingPermissions: Permission[]; + constructor(connector: Connector, permissions: Permission[], hostDomain: string); + static New(client: SkynetClient, skappDomain?: string, customOptions?: CustomConnectorOptions): Promise; + /** + * Loads the given DACs. + * + * @param dacs - The DAC library instances to call `init` on. + */ + loadDacs(...dacs: DacLibrary[]): Promise; + addPermissions(...permissions: Permission[]): Promise; + checkLogin(): Promise; + /** + * Destroys the mysky connection by: + * + * 1. Destroying the connected DACs. + * + * 2. Closing the connection. + * + * 3. Closing the child iframe. + * + * @throws - Will throw if there is an unexpected DOM error. + */ + destroy(): Promise; + logout(): Promise; + requestLoginAccess(): Promise; + userID(): Promise; + /** + * Gets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + getJSON(path: string, customOptions?: CustomGetJSONOptions): Promise; + /** + * Gets the entry link for the entry at the given path. This is a v2 skylink. + * This link stays the same even if the content at the entry changes. + * + * @param path - The data path. + * @returns - The entry link. + */ + getEntryLink(path: string): Promise; + /** + * Sets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + setJSON(path: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise; + /** + * Sets entry at the given path to point to the data link. Like setJSON, but it doesn't upload a file. + * + * @param path - The data path. + * @param dataLink - The data link to set at the path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + setDataLink(path: string, dataLink: string, customOptions?: CustomSetJSONOptions): Promise; + /** + * Deletes Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the revision is already the maximum value. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + deleteJSON(path: string, customOptions?: CustomSetJSONOptions): Promise; + /** + * Gets the raw registry entry data for the given path, if the user has given + * Discoverable Read permissions. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + getEntryData(path: string, customOptions?: CustomGetEntryOptions): Promise; + /** + * Sets the entry data at the given path, if the user has given Discoverable + * Write permissions. + * + * @param path - The data path. + * @param data - The raw entry data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the length of the data is > 70 bytes. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + setEntryData(path: string, data: Uint8Array, customOptions?: CustomSetJSONOptions): Promise; + /** + * Lets you get the share-able path seed, which can be passed to + * file.getJSONEncrypted. Requires Hidden Read permission on the path. + * + * @param path - The given path. + * @param isDirectory - Whether the path is a directory. + * @returns - The seed for the path. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + getEncryptedFileSeed(path: string, isDirectory: boolean): Promise; + /** + * Gets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + getJSONEncrypted(path: string, customOptions?: CustomGetJSONOptions): Promise; + /** + * Sets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to encrypt and set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the original json data. + * @throws - Will throw if the user does not have Hidden Write permission on the path. + */ + setJSONEncrypted(path: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise; + protected catchError(errorMsg: string): Promise; + protected launchUI(): Promise; + protected connectUi(childWindow: Window): Promise; + protected loadDac(dac: DacLibrary): Promise; + protected handleLogin(loggedIn: boolean): void; + protected signRegistryEntry(entry: RegistryEntry, path: string): Promise; + protected signEncryptedRegistryEntry(entry: RegistryEntry, path: string): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/index.d.ts.map b/node_modules/skynet-js/dist/mjs/mysky/index.d.ts.map new file mode 100644 index 0000000..c21ce56 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mysky/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAoC,MAAM,SAAS,CAAC;AACvE,OAAO,EAML,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAA2B,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAkD,aAAa,EAAE,MAAM,aAAa,CAAC;AACnH,OAAO,EAGL,oBAAoB,EACpB,oBAAoB,EAEpB,QAAQ,EACR,YAAY,EAGb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAatC,OAAO,EAIL,qBAAqB,EAGtB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAMnC,oBAAY,SAAS,GAAG;IACtB,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,YAAY,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,sBAAsB,GACrC,OAAO,CAAC,KAAK,CAAC,CAIhB;AAED,qBAAa,KAAK;IAgBJ,SAAS,CAAC,SAAS,EAAE,SAAS;IAA6B,SAAS,CAAC,UAAU,EAAE,MAAM;IAfnG,MAAM,CAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,CAAQ;IAGrC,IAAI,EAAE,UAAU,EAAE,CAAM;IAGxB,kBAAkB,EAAE,UAAU,EAAE,CAAM;IAGtC,kBAAkB,EAAE,UAAU,EAAE,CAAC;gBAMX,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,EAAY,UAAU,EAAE,MAAM;WAItF,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,KAAK,CAAC;IAiCpH;;;;OAIG;IACG,QAAQ,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9C,cAAc,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAepC;;;;;;;;;;OAUG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBxB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAqEtC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/B;;;;;;;;OAQG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IAiBxF;;;;;;OAMG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWjD;;;;;;;;;OASG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyBxG;;;;;;;;OAQG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BtG;;;;;;;;;OASG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BnF;;;;;;;;OAQG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqB3F;;;;;;;;;;OAUG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;IAuC5G;;;;;;;;OAQG;IACG,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAO/E;;;;;;;;OAQG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA2B1G;;;;;;;;;OASG;IACG,gBAAgB,CACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,qBAAqB,CAAC;cAmCjB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAK3C,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;cAe3B,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;cAuBnD,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IASvD,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;cAQ9B,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;cAIzE,0BAA0B,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAGnG"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/index.js b/node_modules/skynet-js/dist/mjs/mysky/index.js new file mode 100644 index 0000000..1e266af --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/index.js @@ -0,0 +1,502 @@ +/* istanbul ignore file */ +export { DacLibrary } from "./dac"; +import { ParentHandshake, WindowMessenger } from "post-me"; +import { dispatchedErrorEvent, errorWindowClosed, monitorWindowError, PermCategory, Permission, PermType, } from "skynet-mysky-utils"; +import { Connector, defaultConnectorOptions } from "./connector"; +import { defaultGetEntryOptions, defaultSetEntryOptions } from "../registry"; +import { defaultGetJSONOptions, defaultSetJSONOptions, getOrCreateRegistryEntry, getNextRegistryEntry, getOrCreateRawBytesRegistryEntry, } from "../skydb"; +import { deriveDiscoverableFileTweak } from "./tweak"; +import { popupCenter } from "./utils"; +import { extractOptions } from "../utils/options"; +import { throwValidationError, validateBoolean, validateObject, validateOptionalObject, validateString, validateUint8Array, } from "../utils/validation"; +import { decodeSkylink, RAW_SKYLINK_SIZE } from "../skylink/sia"; +import { decryptJSONFile, deriveEncryptedFileKeyEntropy, deriveEncryptedFileTweak, ENCRYPTED_JSON_RESPONSE_VERSION, encryptJSONFile, } from "./encrypted_files"; +export const mySkyDomain = "skynet-mysky.hns"; +export const mySkyDevDomain = "skynet-mysky-dev.hns"; +export const mySkyAlphaDomain = "sandbridge.hns"; +export const MAX_ENTRY_LENGTH = 70; +const mySkyUiRelativeUrl = "ui.html"; +const mySkyUiTitle = "MySky UI"; +const [mySkyUiW, mySkyUiH] = [600, 600]; +/** + * Loads MySky. Note that this does not log in the user. + * + * @param this - The Skynet client. + * @param skappDomain - The domain of the host skapp. For this domain permissions will be requested and, by default, automatically granted. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - Loaded (but not logged-in) MySky instance. + */ +export async function loadMySky(skappDomain, customOptions) { + const mySky = await MySky.New(this, skappDomain, customOptions); + return mySky; +} +export class MySky { + // ============ + // Constructors + // ============ + constructor(connector, permissions, hostDomain) { + this.connector = connector; + this.hostDomain = hostDomain; + // Holds the loaded DACs. + this.dacs = []; + // Holds the currently granted permissions. + this.grantedPermissions = []; + this.pendingPermissions = permissions; + } + static async New(client, skappDomain, customOptions) { + const opts = { ...defaultConnectorOptions, ...customOptions }; + // Enforce singleton. + if (MySky.instance) { + return MySky.instance; + } + let domain = mySkyDomain; + if (opts.alpha) { + domain = mySkyAlphaDomain; + } + else if (opts.dev) { + domain = mySkyDevDomain; + } + const connector = await Connector.init(client, domain, customOptions); + const hostDomain = await client.extractDomain(window.location.hostname); + const permissions = []; + if (skappDomain) { + // TODO: Are these permissions correct? + const perm1 = new Permission(hostDomain, skappDomain, PermCategory.Hidden, PermType.Read); + const perm2 = new Permission(hostDomain, skappDomain, PermCategory.Hidden, PermType.Write); + permissions.push(perm1, perm2); + } + MySky.instance = new MySky(connector, permissions, hostDomain); + return MySky.instance; + } + // ========== + // Public API + // ========== + /** + * Loads the given DACs. + * + * @param dacs - The DAC library instances to call `init` on. + */ + async loadDacs(...dacs) { + const promises = []; + for (const dac of dacs) { + promises.push(this.loadDac(dac)); + } + this.dacs.push(...dacs); + await Promise.all(promises); + } + async addPermissions(...permissions) { + this.pendingPermissions.push(...permissions); + } + async checkLogin() { + const [seedFound, permissionsResponse] = await this.connector.connection + .remoteHandle() + .call("checkLogin", this.pendingPermissions); + // Save granted and failed permissions. + const { grantedPermissions, failedPermissions } = permissionsResponse; + this.grantedPermissions = grantedPermissions; + this.pendingPermissions = failedPermissions; + const loggedIn = seedFound && failedPermissions.length === 0; + this.handleLogin(loggedIn); + return loggedIn; + } + /** + * Destroys the mysky connection by: + * + * 1. Destroying the connected DACs. + * + * 2. Closing the connection. + * + * 3. Closing the child iframe. + * + * @throws - Will throw if there is an unexpected DOM error. + */ + async destroy() { + // TODO: For all connected dacs, send a destroy call. + // TODO: Delete all connected dacs. + // Close the connection. + this.connector.connection.close(); + // Close the child iframe. + const frame = this.connector.childFrame; + if (frame) { + // The parent node should always exist. Sanity check + make TS happy. + if (!frame.parentNode) { + throw new Error("'childFrame.parentNode' was not set"); + } + frame.parentNode.removeChild(frame); + } + } + async logout() { + return await this.connector.connection.remoteHandle().call("logout"); + } + async requestLoginAccess() { + let uiWindow; + let uiConnection; + let seedFound = false; + // Add error listener. + const { promise: promiseError, controller: controllerError } = monitorWindowError(); + // eslint-disable-next-line no-async-promise-executor + const promise = new Promise(async (resolve, reject) => { + // Make this promise run in the background and reject on window close or any errors. + promiseError.catch((err) => { + if (err === errorWindowClosed) { + // Resolve without updating the pending permissions. + resolve(); + return; + } + reject(err); + }); + try { + // Launch the UI. + uiWindow = await this.launchUI(); + uiConnection = await this.connectUi(uiWindow); + // Send the UI the list of required permissions. + // TODO: This should be a dual-promise that also calls ping() on an interval and rejects if no response was found in a given amount of time. + const [seedFoundResponse, permissionsResponse] = await uiConnection + .remoteHandle() + .call("requestLoginAccess", this.pendingPermissions); + seedFound = seedFoundResponse; + // Save failed permissions. + const { grantedPermissions, failedPermissions } = permissionsResponse; + this.grantedPermissions = grantedPermissions; + this.pendingPermissions = failedPermissions; + resolve(); + } + catch (err) { + reject(err); + } + }); + await promise + .catch((err) => { + throw err; + }) + .finally(() => { + // Close the window. + if (uiWindow) { + uiWindow.close(); + } + // Close the connection. + if (uiConnection) { + uiConnection.close(); + } + // Clean up the event listeners and promises. + controllerError.cleanup(); + }); + const loggedIn = seedFound && this.pendingPermissions.length === 0; + this.handleLogin(loggedIn); + return loggedIn; + } + async userID() { + return await this.connector.connection.remoteHandle().call("userID"); + } + /** + * Gets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + async getJSON(path, customOptions) { + validateString("path", path, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetJSONOptions); + const opts = { + ...defaultGetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + return await this.connector.client.db.getJSON(publicKey, dataKey, opts); + } + /** + * Gets the entry link for the entry at the given path. This is a v2 skylink. + * This link stays the same even if the content at the entry changes. + * + * @param path - The data path. + * @returns - The entry link. + */ + async getEntryLink(path) { + validateString("path", path, "parameter"); + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + // Do not hash the tweak anymore. + const opts = { ...defaultGetEntryOptions, hashedDataKeyHex: true }; + return await this.connector.client.registry.getEntryLink(publicKey, dataKey, opts); + } + /** + * Sets Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the json data as well as the skylink for the data. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async setJSON(path, json, customOptions) { + validateString("path", path, "parameter"); + validateObject("json", json, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const [entry, dataLink] = await getOrCreateRegistryEntry(this.connector.client, publicKey, dataKey, json, opts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + return { data: json, dataLink }; + } + /** + * Sets entry at the given path to point to the data link. Like setJSON, but it doesn't upload a file. + * + * @param path - The data path. + * @param dataLink - The data link to set at the path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async setDataLink(path, dataLink, customOptions) { + validateString("path", path, "parameter"); + validateString("dataLink", dataLink, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this.connector.client, publicKey, dataKey, decodeSkylink(dataLink), getEntryOpts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + } + /** + * Deletes Discoverable JSON at the given path through MySky, if the user has + * given Discoverable Write permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the revision is already the maximum value. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async deleteJSON(path, customOptions) { + validateString("path", path, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this.connector.client, publicKey, dataKey, new Uint8Array(RAW_SKYLINK_SIZE), getEntryOpts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + } + /** + * Gets the raw registry entry data for the given path, if the user has given + * Discoverable Read permissions. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the user does not have Discoverable Read permission on the path. + */ + async getEntryData(path, customOptions) { + validateString("path", path, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetEntryOptions); + const opts = { + ...defaultGetEntryOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const { entry } = await this.connector.client.registry.getEntry(publicKey, dataKey, opts); + if (!entry) { + return { data: null }; + } + return { data: entry.data }; + } + /** + * Sets the entry data at the given path, if the user has given Discoverable + * Write permissions. + * + * @param path - The data path. + * @param data - The raw entry data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry data. + * @throws - Will throw if the length of the data is > 70 bytes. + * @throws - Will throw if the user does not have Discoverable Write permission on the path. + */ + async setEntryData(path, data, customOptions) { + validateString("path", path, "parameter"); + validateUint8Array("data", data, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetEntryOptions); + if (data.length > MAX_ENTRY_LENGTH) { + throwValidationError("data", data, "parameter", `'Uint8Array' of length <= ${MAX_ENTRY_LENGTH}, was length ${data.length}`); + } + const opts = { + ...defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + const publicKey = await this.userID(); + const dataKey = deriveDiscoverableFileTweak(path); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this.connector.client, publicKey, dataKey, data, getEntryOpts); + const signature = await this.signRegistryEntry(entry, path); + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + return { data: entry.data }; + } + // =============== + // Encrypted Files + // =============== + /** + * Lets you get the share-able path seed, which can be passed to + * file.getJSONEncrypted. Requires Hidden Read permission on the path. + * + * @param path - The given path. + * @param isDirectory - Whether the path is a directory. + * @returns - The seed for the path. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + async getEncryptedFileSeed(path, isDirectory) { + validateString("path", path, "parameter"); + validateBoolean("isDirectory", isDirectory, "parameter"); + return await this.connector.connection.remoteHandle().call("getEncryptedFileSeed", path, isDirectory); + } + /** + * Gets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Read permissions to do so. + * + * @param path - The data path. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the decrypted json data. + * @throws - Will throw if the user does not have Hidden Read permission on the path. + */ + async getJSONEncrypted(path, customOptions) { + validateString("path", path, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetJSONOptions); + const opts = { + ...defaultGetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + hashedDataKeyHex: true, // Do not hash the tweak anymore. + }; + // Call MySky which checks for read permissions on the path. + const [publicKey, pathSeed] = await Promise.all([this.userID(), this.getEncryptedFileSeed(path, false)]); + // Fetch the raw encrypted JSON data. + const dataKey = deriveEncryptedFileTweak(pathSeed); + const { data } = await this.connector.client.db.getRawBytes(publicKey, dataKey, opts); + if (data === null) { + return { data: null }; + } + const encryptionKey = deriveEncryptedFileKeyEntropy(pathSeed); + const json = decryptJSONFile(data, encryptionKey); + return { data: json }; + } + /** + * Sets Encrypted JSON at the given path through MySky, if the user has given + * Hidden Write permissions to do so. + * + * @param path - The data path. + * @param json - The json to encrypt and set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An object containing the original json data. + * @throws - Will throw if the user does not have Hidden Write permission on the path. + */ + async setJSONEncrypted(path, json, customOptions) { + validateString("path", path, "parameter"); + validateObject("json", json, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.connector.client.customOptions, + ...customOptions, + }; + // Call MySky which checks for read permissions on the path. + const [publicKey, pathSeed] = await Promise.all([this.userID(), this.getEncryptedFileSeed(path, false)]); + const dataKey = deriveEncryptedFileTweak(pathSeed); + opts.hashedDataKeyHex = true; // Do not hash the tweak anymore. + const encryptionKey = deriveEncryptedFileKeyEntropy(pathSeed); + // Pad and encrypt json file. + const data = encryptJSONFile(json, { version: ENCRYPTED_JSON_RESPONSE_VERSION }, encryptionKey); + const entry = await getOrCreateRawBytesRegistryEntry(this.connector.client, publicKey, dataKey, data, opts); + // Call MySky which checks for write permissions on the path. + const signature = await this.signEncryptedRegistryEntry(entry, path); + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.connector.client.registry.postSignedEntry(publicKey, entry, signature, setEntryOpts); + return { data: json }; + } + // ================ + // Internal Methods + // ================ + async catchError(errorMsg) { + const event = new CustomEvent(dispatchedErrorEvent, { detail: errorMsg }); + window.dispatchEvent(event); + } + async launchUI() { + const mySkyUrl = new URL(this.connector.url); + mySkyUrl.pathname = mySkyUiRelativeUrl; + const uiUrl = mySkyUrl.toString(); + // Open the window. + const childWindow = popupCenter(uiUrl, mySkyUiTitle, mySkyUiW, mySkyUiH); + if (!childWindow) { + throw new Error(`Could not open window at '${uiUrl}'`); + } + return childWindow; + } + async connectUi(childWindow) { + const options = this.connector.options; + // Complete handshake with UI window. + const messenger = new WindowMessenger({ + localWindow: window, + remoteWindow: childWindow, + remoteOrigin: "*", + }); + const methods = { + catchError: this.catchError, + }; + const connection = await ParentHandshake(messenger, methods, options.handshakeMaxAttempts, options.handshakeAttemptsInterval); + return connection; + } + async loadDac(dac) { + // Initialize DAC. + await dac.init(this.connector.client, this.connector.options); + // Add DAC permissions. + const perms = dac.getPermissions(); + this.addPermissions(...perms); + } + handleLogin(loggedIn) { + if (loggedIn) { + for (const dac of this.dacs) { + dac.onUserLogin(); + } + } + } + async signRegistryEntry(entry, path) { + return await this.connector.connection.remoteHandle().call("signRegistryEntry", entry, path); + } + async signEncryptedRegistryEntry(entry, path) { + return await this.connector.connection.remoteHandle().call("signEncryptedRegistryEntry", entry, path); + } +} +MySky.instance = null; diff --git a/node_modules/skynet-js/dist/mjs/mysky/tweak.d.ts b/node_modules/skynet-js/dist/mjs/mysky/tweak.d.ts new file mode 100644 index 0000000..ceee529 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/tweak.d.ts @@ -0,0 +1,29 @@ +/** + * Derives the discoverable file tweak for the given path. + * + * @param path - The given path. + * @returns - The hex-encoded tweak. + */ +export declare function deriveDiscoverableFileTweak(path: string): string; +export declare class DiscoverableBucketTweak { + version: number; + path: Array; + constructor(path: string); + encode(): Uint8Array; + getHash(): Uint8Array; +} +/** + * Splits the path by forward slashes. + * + * @param path - The path to split. + * @returns - An array of path components. + */ +export declare function splitPath(path: string): Array; +/** + * Hashes the path component. + * + * @param component - The component extracted from the path. + * @returns - The hash. + */ +export declare function hashPathComponent(component: string): Uint8Array; +//# sourceMappingURL=tweak.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/tweak.d.ts.map b/node_modules/skynet-js/dist/mjs/mysky/tweak.d.ts.map new file mode 100644 index 0000000..35e6bd2 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/tweak.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tweak.d.ts","sourceRoot":"","sources":["../../../src/mysky/tweak.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,qBAAa,uBAAuB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;gBAEZ,IAAI,EAAE,MAAM;IAOxB,MAAM,IAAI,UAAU;IAapB,OAAO,IAAI,UAAU;CAItB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAErD;AAED;;;;;GAKG;AAEH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAE/D"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/tweak.js b/node_modules/skynet-js/dist/mjs/mysky/tweak.js new file mode 100644 index 0000000..48c3d37 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/tweak.js @@ -0,0 +1,56 @@ +import { hashAll } from "../crypto"; +import { stringToUint8ArrayUtf8, toHexString } from "../utils/string"; +const discoverableBucketTweakVersion = 1; +/** + * Derives the discoverable file tweak for the given path. + * + * @param path - The given path. + * @returns - The hex-encoded tweak. + */ +export function deriveDiscoverableFileTweak(path) { + const dbt = new DiscoverableBucketTweak(path); + const bytes = dbt.getHash(); + return toHexString(bytes); +} +export class DiscoverableBucketTweak { + constructor(path) { + const paths = splitPath(path); + const pathHashes = paths.map(hashPathComponent); + this.version = discoverableBucketTweakVersion; + this.path = pathHashes; + } + encode() { + const size = 1 + 32 * this.path.length; + const buf = new Uint8Array(size); + buf.set([this.version]); + let offset = 1; + for (const pathLevel of this.path) { + buf.set(pathLevel, offset); + offset += 32; + } + return buf; + } + getHash() { + const encoding = this.encode(); + return hashAll(encoding); + } +} +/** + * Splits the path by forward slashes. + * + * @param path - The path to split. + * @returns - An array of path components. + */ +export function splitPath(path) { + return path.split("/"); +} +/** + * Hashes the path component. + * + * @param component - The component extracted from the path. + * @returns - The hash. + */ +// TODO: Can we replace with hashString? +export function hashPathComponent(component) { + return hashAll(stringToUint8ArrayUtf8(component)); +} diff --git a/node_modules/skynet-js/dist/mjs/mysky/utils.d.ts b/node_modules/skynet-js/dist/mjs/mysky/utils.d.ts new file mode 100644 index 0000000..904d36f --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/utils.d.ts @@ -0,0 +1,31 @@ +import { SkynetClient } from "../client"; +/** + * Constructs the full URL for the given component domain, + * e.g. "dac.hns" => "https://dac.hns.siasky.net" + * + * @param this - SkynetClient + * @param domain - Component domain. + * @returns - The full URL for the component. + */ +export declare function getFullDomainUrl(this: SkynetClient, domain: string): Promise; +/** + * Extracts the domain from the current portal URL, + * e.g. ("dac.hns.siasky.net") => "dac.hns" + * + * @param this - SkynetClient + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +export declare function extractDomain(this: SkynetClient, fullDomain: string): Promise; +/** + * Create a new popup window. From SkyID. + * + * @param url - The URL to open. + * @param title - The title of the popup window. + * @param w - The width of the popup window. + * @param h - the height of the popup window. + * @returns - The window. + * @throws - Will throw if the window could not be opened. + */ +export declare function popupCenter(url: string, title: string, w: number, h: number): Window; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/utils.d.ts.map b/node_modules/skynet-js/dist/mjs/mysky/utils.d.ts.map new file mode 100644 index 0000000..e3b3a46 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/mysky/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI1F;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI3F;AAGD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCpF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/mysky/utils.js b/node_modules/skynet-js/dist/mjs/mysky/utils.js new file mode 100644 index 0000000..609b70e --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/mysky/utils.js @@ -0,0 +1,70 @@ +import { ensureUrl } from "skynet-mysky-utils"; +import { getFullDomainUrlForPortal, extractDomainForPortal } from "../utils/url"; +/** + * Constructs the full URL for the given component domain, + * e.g. "dac.hns" => "https://dac.hns.siasky.net" + * + * @param this - SkynetClient + * @param domain - Component domain. + * @returns - The full URL for the component. + */ +export async function getFullDomainUrl(domain) { + const portalUrl = await this.portalUrl(); + return getFullDomainUrlForPortal(portalUrl, domain); +} +/** + * Extracts the domain from the current portal URL, + * e.g. ("dac.hns.siasky.net") => "dac.hns" + * + * @param this - SkynetClient + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +export async function extractDomain(fullDomain) { + const portalUrl = await this.portalUrl(); + return extractDomainForPortal(portalUrl, fullDomain); +} +/* istanbul ignore next */ +/** + * Create a new popup window. From SkyID. + * + * @param url - The URL to open. + * @param title - The title of the popup window. + * @param w - The width of the popup window. + * @param h - the height of the popup window. + * @returns - The window. + * @throws - Will throw if the window could not be opened. + */ +export function popupCenter(url, title, w, h) { + url = ensureUrl(url); + // Fixes dual-screen position Most browsers Firefox + const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; + const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; + const width = window.innerWidth + ? window.innerWidth + : document.documentElement.clientWidth + ? document.documentElement.clientWidth + : screen.width; + const height = window.innerHeight + ? window.innerHeight + : document.documentElement.clientHeight + ? document.documentElement.clientHeight + : screen.height; + const systemZoom = width / window.screen.availWidth; + const left = (width - w) / 2 / systemZoom + dualScreenLeft; + const top = (height - h) / 2 / systemZoom + dualScreenTop; + const newWindow = window.open(url, title, ` +scrollbars=yes, +width=${w / systemZoom}, +height=${h / systemZoom}, +top=${top}, +left=${left} +`); + if (!newWindow) { + throw new Error("could not open window"); + } + if (newWindow.focus) { + newWindow.focus(); + } + return newWindow; +} diff --git a/node_modules/skynet-js/dist/mjs/pin.d.ts b/node_modules/skynet-js/dist/mjs/pin.d.ts new file mode 100644 index 0000000..c4a05cd --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/pin.d.ts @@ -0,0 +1,36 @@ +import { SkynetClient } from "./client"; +import { BaseCustomOptions } from "./utils/options"; +/** + * Custom pin options. + * + * @property [endpointPin] - The relative URL path of the portal endpoint to contact. + */ +export declare type CustomPinOptions = BaseCustomOptions & { + endpointPin?: string; +}; +/** + * The response to a pin request. + * + * @property skylink - 46-character skylink. + */ +export declare type PinResponse = { + skylink: string; +}; +export declare const defaultPinOptions: { + endpointPin: string; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Re-pins the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and revision number. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export declare function pinSkylink(this: SkynetClient, skylinkUrl: string, customOptions?: CustomPinOptions): Promise; +//# sourceMappingURL=pin.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/pin.d.ts.map b/node_modules/skynet-js/dist/mjs/pin.d.ts.map new file mode 100644 index 0000000..2d7527f --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/pin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pin.d.ts","sourceRoot":"","sources":["../../src/pin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAGxE;;;;GAIG;AACH,oBAAY,gBAAgB,GAAG,iBAAiB,GAAG;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAI7B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,WAAW,CAAC,CA4BtB"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/pin.js b/node_modules/skynet-js/dist/mjs/pin.js new file mode 100644 index 0000000..ea121d2 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/pin.js @@ -0,0 +1,56 @@ +import { formatSkylink } from "./skylink/format"; +import { parseSkylink } from "./skylink/parse"; +import { defaultBaseOptions } from "./utils/options"; +import { validateSkylinkString, validateString } from "./utils/validation"; +export const defaultPinOptions = { + ...defaultBaseOptions, + endpointPin: "/skynet/pin", +}; +/** + * Re-pins the given skylink. + * + * @param this - SkynetClient + * @param skylinkUrl - 46-character skylink, or a valid skylink URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and revision number. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export async function pinSkylink(skylinkUrl, customOptions) { + const skylink = validateSkylinkString("skylinkUrl", skylinkUrl, "parameter"); + const opts = { ...defaultPinOptions, ...this.customOptions, ...customOptions }; + // Don't include the path since the endpoint doesn't support it. + const path = parseSkylink(skylinkUrl, { onlyPath: true }); + if (path) { + throw new Error("Skylink string should not contain a path"); + } + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointPin, + method: "post", + extraPath: skylink, + }); + // Sanity check. + validatePinResponse(response); + // Get the skylink. + let returnedSkylink = response.headers["skynet-skylink"]; + // Format the skylink. + returnedSkylink = formatSkylink(returnedSkylink); + return { skylink: returnedSkylink }; +} +/** + * Validates the pin response. + * + * @param response - The pin response. + * @throws - Will throw if not a valid pin response. + */ +function validatePinResponse(response) { + try { + if (!response.headers) { + throw new Error("response.headers field missing"); + } + validateString('response.headers["skynet-skylink"]', response.headers["skynet-skylink"], "pin response field"); + } + catch (err) { + throw new Error(`Did not get a complete pin response despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} diff --git a/node_modules/skynet-js/dist/mjs/registry.d.ts b/node_modules/skynet-js/dist/mjs/registry.d.ts new file mode 100644 index 0000000..0f49ac3 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/registry.d.ts @@ -0,0 +1,150 @@ +import { SkynetClient } from "./client"; +import { BaseCustomOptions } from "./utils/options"; +import { Signature } from "./crypto"; +/** + * Custom get entry options. + * + * @property [endpointGetEntry] - The relative URL path of the portal endpoint to contact. + * @property [hashedDataKeyHex] - Whether the data key is already hashed and in hex format. If not, we hash the data key. + */ +export declare type CustomGetEntryOptions = BaseCustomOptions & { + endpointGetEntry?: string; + hashedDataKeyHex?: boolean; +}; +/** + * Custom set entry options. + * + * @property [endpointSetEntry] - The relative URL path of the portal endpoint to contact. + * @property [hashedDataKeyHex] - Whether the data key is already hashed and in hex format. If not, we hash the data key. + */ +export declare type CustomSetEntryOptions = BaseCustomOptions & { + endpointSetEntry?: string; + hashedDataKeyHex?: boolean; +}; +export declare const defaultGetEntryOptions: { + endpointGetEntry: string; + hashedDataKeyHex: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +export declare const defaultSetEntryOptions: { + endpointSetEntry: string; + hashedDataKeyHex: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +export declare const DEFAULT_GET_ENTRY_TIMEOUT = 5; +/** + * Regex for JSON revision value without quotes. + */ +export declare const regexRevisionNoQuotes: RegExp; +/** + * Registry entry. + * + * @property dataKey - The key of the data for the given entry. + * @property data - The data stored in the entry. + * @property revision - The revision number for the entry. + */ +export declare type RegistryEntry = { + dataKey: string; + data: Uint8Array; + revision: bigint; +}; +/** + * Signed registry entry. + * + * @property entry - The registry entry. + * @property signature - The signature of the registry entry. + */ +export declare type SignedRegistryEntry = { + entry: RegistryEntry | null; + signature: Signature | null; +}; +/** + * Gets the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The signed registry entry. + * @throws - Will throw if the returned signature does not match the returned entry or the provided timeout is invalid or the given key is not valid. + */ +export declare function getEntry(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets the registry entry URL corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the provided timeout is invalid or the given key is not valid. + */ +export declare function getEntryUrl(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets the registry entry URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the given key is not valid. + */ +export declare function getEntryUrlForPortal(portalUrl: string, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): string; +/** + * Gets the entry link for the entry at the given public key and data key. This link stays the same even if the content at the entry changes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry link. + * @throws - Will throw if the given key is not valid. + */ +export declare function getEntryLink(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetEntryOptions): Promise; +/** + * Sets the registry entry. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param entry - The entry to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the entry revision does not fit in 64 bits or the given key is not valid. + */ +export declare function setEntry(this: SkynetClient, privateKey: string, entry: RegistryEntry, customOptions?: CustomSetEntryOptions): Promise; +/** + * Signs the entry with the given private key. + * + * @param privateKey - The user private key. + * @param entry - The entry to sign. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - The signature. + */ +export declare function signEntry(privateKey: string, entry: RegistryEntry, hashedDataKeyHex: boolean): Promise; +/** + * Posts the entry with the given public key and signature to Skynet. + * + * @param this - The Skynet client. + * @param publicKey - The user public key. + * @param entry - The entry to set. + * @param signature - The signature. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + */ +export declare function postSignedEntry(this: SkynetClient, publicKey: string, entry: RegistryEntry, signature: Uint8Array, customOptions?: CustomSetEntryOptions): Promise; +/** + * Validates the given registry entry. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + */ +export declare function validateRegistryEntry(name: string, value: unknown, valueKind: string): void; +//# sourceMappingURL=registry.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/registry.d.ts.map b/node_modules/skynet-js/dist/mjs/registry.d.ts.map new file mode 100644 index 0000000..3a080db --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/registry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAGxE,OAAO,EAAkC,SAAS,EAAE,MAAM,UAAU,CAAC;AAarE;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG,iBAAiB,GAAG;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAA2B,CAAC;AAS9D;;;;;;GAMG;AACH,oBAAY,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,mBAAmB,CAAC,CAgF9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,MAAM,CA2BR;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,EACpB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,EACpB,gBAAgB,EAAE,OAAO,GACxB,OAAO,CAAC,UAAU,CAAC,CAQrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,IAAI,CAAC,CA8Cf;AA0BD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAK3F"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/registry.js b/node_modules/skynet-js/dist/mjs/registry.js new file mode 100644 index 0000000..96409ae --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/registry.js @@ -0,0 +1,334 @@ +import { Buffer } from "buffer"; +import { sign } from "tweetnacl"; +import { assertUint64 } from "./utils/number"; +import { defaultBaseOptions } from "./utils/options"; +import { ensurePrefix, hexToUint8Array, isHexString, toHexString, trimPrefix } from "./utils/string"; +import { addUrlQuery, makeUrl } from "./utils/url"; +import { hashDataKey, hashRegistryEntry } from "./crypto"; +import { throwValidationError, validateBigint, validateHexString, validateObject, validateOptionalObject, validateString, validateUint8Array, } from "./utils/validation"; +import { newEd25519PublicKey, newSkylinkV2 } from "./skylink/sia"; +import { formatSkylink } from "./skylink/format"; +export const defaultGetEntryOptions = { + ...defaultBaseOptions, + endpointGetEntry: "/skynet/registry", + hashedDataKeyHex: false, +}; +export const defaultSetEntryOptions = { + ...defaultBaseOptions, + endpointSetEntry: "/skynet/registry", + hashedDataKeyHex: false, +}; +export const DEFAULT_GET_ENTRY_TIMEOUT = 5; // 5 seconds +/** + * Regex for JSON revision value without quotes. + */ +export const regexRevisionNoQuotes = /"revision":\s*([0-9]+)/; +/** + * Regex for JSON revision value with quotes. + */ +const regexRevisionWithQuotes = /"revision":\s*"([0-9]+)"/; +const ED25519_PREFIX = "ed25519:"; +/** + * Gets the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The signed registry entry. + * @throws - Will throw if the returned signature does not match the returned entry or the provided timeout is invalid or the given key is not valid. + */ +export async function getEntry(publicKey, dataKey, customOptions) { + // Validation is done in `getEntryUrl`. + const opts = { + ...defaultGetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const url = await this.registry.getEntryUrl(publicKey, dataKey, opts); + let response; + try { + response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointGetEntry, + url, + method: "get", + // Transform the response to add quotes, since uint64 cannot be accurately + // read by JS so the revision needs to be parsed as a string. + transformResponse: function (data) { + if (data === undefined) { + return {}; + } + // Change the revision value from a JSON integer to a string. + data = data.replace(regexRevisionNoQuotes, '"revision":"$1"'); + // Try converting the JSON data to an object. + try { + return JSON.parse(data); + } + catch { + // The data is not JSON, it's likely an HTML error response. + return data; + } + }, + }); + } + catch (err) { + return handleGetEntryErrResponse(err); + } + // Sanity check. + try { + validateString("response.data.data", response.data.data, "entry response field"); + validateString("response.data.revision", response.data.revision, "entry response field"); + validateString("response.data.signature", response.data.signature, "entry response field"); + } + catch (err) { + throw new Error(`Did not get a complete entry response despite a successful request. Please try again and report this issue to the devs if it persists. Error: ${err}`); + } + // Convert the revision from a string to bigint. + const revision = BigInt(response.data.revision); + const signature = Buffer.from(hexToUint8Array(response.data.signature)); + // Use empty array if the data is empty. + let data = new Uint8Array([]); + if (response.data.data) { + data = hexToUint8Array(response.data.data); + } + const signedEntry = { + entry: { + dataKey, + data, + revision, + }, + signature, + }; + // Try verifying the returned data. + if (sign.detached.verify(hashRegistryEntry(signedEntry.entry, opts.hashedDataKeyHex), new Uint8Array(signedEntry.signature), hexToUint8Array(publicKey))) { + return signedEntry; + } + // The response could not be verified. + throw new Error("could not verify signature from retrieved, signed registry entry -- possible corrupted entry"); +} +/** + * Gets the registry entry URL corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the provided timeout is invalid or the given key is not valid. + */ +export async function getEntryUrl(publicKey, dataKey, customOptions) { + // Validation is done in `getEntryUrlForPortal`. + const opts = { + ...defaultGetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const portalUrl = await this.portalUrl(); + return getEntryUrlForPortal(portalUrl, publicKey, dataKey, opts); +} +/** + * Gets the registry entry URL without an initialized client. + * + * @param portalUrl - The portal URL. + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The full get entry URL. + * @throws - Will throw if the given key is not valid. + */ +export function getEntryUrlForPortal(portalUrl, publicKey, dataKey, customOptions) { + validateString("portalUrl", portalUrl, "parameter"); + validatePublicKey("publicKey", publicKey, "parameter"); + validateString("dataKey", dataKey, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetEntryOptions); + const opts = { + ...defaultGetEntryOptions, + ...customOptions, + }; + // Hash and hex encode the given data key if it is not a hash already. + let dataKeyHashHex = dataKey; + if (!opts.hashedDataKeyHex) { + dataKeyHashHex = toHexString(hashDataKey(dataKey)); + } + const query = { + publickey: ensurePrefix(publicKey, ED25519_PREFIX), + datakey: dataKeyHashHex, + timeout: DEFAULT_GET_ENTRY_TIMEOUT, + }; + let url = makeUrl(portalUrl, opts.endpointGetEntry); + url = addUrlQuery(url, query); + return url; +} +/** + * Gets the entry link for the entry at the given public key and data key. This link stays the same even if the content at the entry changes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The entry link. + * @throws - Will throw if the given key is not valid. + */ +export async function getEntryLink(publicKey, dataKey, customOptions) { + validatePublicKey("publicKey", publicKey, "parameter"); + validateString("dataKey", dataKey, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetEntryOptions); + const opts = { + ...defaultGetEntryOptions, + ...customOptions, + }; + const siaPublicKey = newEd25519PublicKey(trimPrefix(publicKey, ED25519_PREFIX)); + let tweak; + if (opts.hashedDataKeyHex) { + tweak = hexToUint8Array(dataKey); + } + else { + tweak = hashDataKey(dataKey); + } + const skylink = newSkylinkV2(siaPublicKey, tweak).toString(); + return formatSkylink(skylink); +} +/** + * Sets the registry entry. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param entry - The entry to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + * @throws - Will throw if the entry revision does not fit in 64 bits or the given key is not valid. + */ +export async function setEntry(privateKey, entry, customOptions) { + validateHexString("privateKey", privateKey, "parameter"); + validateRegistryEntry("entry", entry, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetEntryOptions); + // Assert the input is 64 bits. + assertUint64(entry.revision); + const opts = { + ...defaultSetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + const privateKeyArray = hexToUint8Array(privateKey); + const signature = await signEntry(privateKey, entry, opts.hashedDataKeyHex); + const { publicKey: publicKeyArray } = sign.keyPair.fromSecretKey(privateKeyArray); + return await this.registry.postSignedEntry(toHexString(publicKeyArray), entry, signature, opts); +} +/** + * Signs the entry with the given private key. + * + * @param privateKey - The user private key. + * @param entry - The entry to sign. + * @param hashedDataKeyHex - Whether the data key is already hashed and in hex format. If not, we hash the data key. + * @returns - The signature. + */ +export async function signEntry(privateKey, entry, hashedDataKeyHex) { + // TODO: Publicly available, validate input. + const privateKeyArray = hexToUint8Array(privateKey); + // Sign the entry. + // TODO: signature type should be Signature? + return sign(hashRegistryEntry(entry, hashedDataKeyHex), privateKeyArray); +} +/** + * Posts the entry with the given public key and signature to Skynet. + * + * @param this - The Skynet client. + * @param publicKey - The user public key. + * @param entry - The entry to set. + * @param signature - The signature. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - An empty promise. + */ +export async function postSignedEntry(publicKey, entry, signature, customOptions) { + validateHexString("publicKey", publicKey, "parameter"); + validateRegistryEntry("entry", entry, "parameter"); + validateUint8Array("signature", signature, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetEntryOptions); + const opts = { + ...defaultSetEntryOptions, + ...this.customOptions, + ...customOptions, + }; + // Hash and hex encode the given data key if it is not a hash already. + let datakey = entry.dataKey; + if (!opts.hashedDataKeyHex) { + datakey = toHexString(hashDataKey(datakey)); + } + // Convert the entry data to an array from raw bytes. + const entryData = Array.from(entry.data); + const data = { + publickey: { + algorithm: "ed25519", + key: Array.from(hexToUint8Array(publicKey)), + }, + datakey, + // Set the revision as a string here. The value may be up to 64 bits and the limit for a JS number is 53 bits. + // We remove the quotes later in transformRequest, as JSON does support 64 bit numbers. + revision: entry.revision.toString(), + data: entryData, + signature: Array.from(signature), + }; + await this.executeRequest({ + ...opts, + endpointPath: opts.endpointSetEntry, + method: "post", + data, + // Transform the request to remove quotes, since the revision needs to be + // parsed as a uint64 on the Go side. + transformRequest: function (data) { + // Convert the object data to JSON. + const json = JSON.stringify(data); + // Change the revision value from a string to a JSON integer. + return json.replace(regexRevisionWithQuotes, '"revision":$1'); + }, + }); +} +/** + * Handles error responses returned in getEntry. + * + * @param err - The Axios error. + * @returns - An empty signed registry entry if the status code is 404. + * @throws - Will throw if the status code is not 404. + */ +function handleGetEntryErrResponse(err) { + /* istanbul ignore next */ + if (!err.response) { + throw new Error(`Error response field not found, incomplete Axios error. Full error: ${err}`); + } + /* istanbul ignore next */ + if (!err.response.status) { + throw new Error(`Error response did not contain expected field 'status'. Full error: ${err}`); + } + // Check if status was 404 "not found" and return null if so. + if (err.response.status === 404) { + return { entry: null, signature: null }; + } + throw err; +} +/** + * Validates the given registry entry. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + */ +export function validateRegistryEntry(name, value, valueKind) { + validateObject(name, value, valueKind); + validateString(`${name}.dataKey`, value.dataKey, `${valueKind} field`); + validateUint8Array(`${name}.data`, value.data, `${valueKind} field`); + validateBigint(`${name}.revision`, value.revision, `${valueKind} field`); +} +/** + * Validates the given value as a hex-encoded, potentially prefixed public key. + * + * @param name - The name of the value. + * @param publicKey - The public key. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid hex-encoded public key. + */ +function validatePublicKey(name, publicKey, valueKind) { + if (!isHexString(trimPrefix(publicKey, ED25519_PREFIX))) { + throwValidationError(name, publicKey, valueKind, "a hex-encoded string with a valid prefix"); + } +} diff --git a/node_modules/skynet-js/dist/mjs/skydb.d.ts b/node_modules/skynet-js/dist/mjs/skydb.d.ts new file mode 100644 index 0000000..fb6b092 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skydb.d.ts @@ -0,0 +1,185 @@ +import { SkynetClient } from "./client"; +import { CustomDownloadOptions } from "./download"; +import { CustomGetEntryOptions, RegistryEntry, CustomSetEntryOptions } from "./registry"; +import { CustomUploadOptions } from "./upload"; +export declare type JsonData = Record; +export declare type JsonFullData = { + _data: JsonData; + _v: number; +}; +/** + * Custom get JSON options. + * + * @property [cachedDataLink] - The last known data link. If it hasn't changed, do not download the file contents again. + */ +export declare type CustomGetJSONOptions = CustomGetEntryOptions & CustomDownloadOptions & { + cachedDataLink?: string; +}; +export declare const defaultGetJSONOptions: { + cachedDataLink: undefined; + endpointDownload: string; + download: boolean; + path: undefined; + range: undefined; + responseType: undefined; + query: undefined; + subdomain: boolean; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; + endpointGetEntry: string; + hashedDataKeyHex: boolean; +}; +/** + * Custom set JSON options. + */ +export declare type CustomSetJSONOptions = CustomGetJSONOptions & CustomSetEntryOptions & CustomUploadOptions; +export declare const defaultSetJSONOptions: { + endpointUpload: string; + endpointLargeUpload: string; + customFilename: string; /** + * Gets the JSON object corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ + largeFileSize: number; + retryDelays: number[]; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; + endpointSetEntry: string; + hashedDataKeyHex: boolean; + cachedDataLink: undefined; + endpointDownload: string; + download: boolean; + path: undefined; + range: undefined; + responseType: undefined; + query: undefined; + subdomain: boolean; + endpointGetEntry: string; +}; +export declare type JSONResponse = { + data: JsonData | null; + dataLink: string | null; +}; +export declare type RawBytesResponse = { + data: Uint8Array | null; + dataLink: string | null; +}; +/** + * Gets the JSON object corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export declare function getJSON(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetJSONOptions): Promise; +/** + * Sets a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param json - The JSON data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the input keys are not valid strings. + */ +export declare function setJSON(this: SkynetClient, privateKey: string, dataKey: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise; +/** + * Deletes a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +export declare function deleteJSON(this: SkynetClient, privateKey: string, dataKey: string, customOptions?: CustomSetJSONOptions): Promise; +/** + * Sets the datalink for the entry at the given private key and data key. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The data key. + * @param dataLink - The data link to set at the entry. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +export declare function setDataLink(this: SkynetClient, privateKey: string, dataKey: string, dataLink: string, customOptions?: CustomSetJSONOptions): Promise; +/** + * Gets the raw bytes corresponding to the publicKey and dataKey. The caller is responsible for setting any metadata in the bytes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned bytes. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export declare function getRawBytes(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: CustomGetJSONOptions): Promise; +/** + * Gets the registry entry for the given raw bytes or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The raw byte data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export declare function getOrCreateRawBytesRegistryEntry(client: SkynetClient, publicKey: string, dataKey: string, data: Uint8Array, customOptions?: CustomSetJSONOptions): Promise; +/** + * Gets the next entry for the given public key and data key, setting the data to be the given data and the revision number accordingly. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export declare function getNextRegistryEntry(client: SkynetClient, publicKey: string, dataKey: string, data: Uint8Array, customOptions?: CustomGetEntryOptions): Promise; +/** + * Gets the registry entry and data link or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param json - The JSON to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export declare function getOrCreateRegistryEntry(client: SkynetClient, publicKey: string, dataKey: string, json: JsonData, customOptions?: CustomSetJSONOptions): Promise<[RegistryEntry, string]>; +/** + * Gets the next revision from a returned entry (or 0 if the entry was not found). + * + * @param entry - The returned registry entry. + * @returns - The revision. + * @throws - Will throw if the next revision would be beyond the maximum allowed value. + */ +export declare function getNextRevisionFromEntry(entry: RegistryEntry | null): bigint; +/** + * Checks whether the raw data link matches the cached data link, if provided. + * + * @param rawDataLink - The raw, unformatted data link. + * @param cachedDataLink - The cached data link, if provided. + * @returns - Whether the cached data link is a match. + * @throws - Will throw if the given cached data link is not a valid skylink. + */ +export declare function checkCachedDataLink(rawDataLink: string, cachedDataLink?: string): boolean; +//# sourceMappingURL=skydb.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skydb.d.ts.map b/node_modules/skynet-js/dist/mjs/skydb.d.ts.map new file mode 100644 index 0000000..fdec674 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skydb.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"skydb.d.ts","sourceRoot":"","sources":["../../src/skydb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAA0B,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAGL,qBAAqB,EACrB,aAAa,EAEb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAwB,mBAAmB,EAAyB,MAAM,UAAU,CAAC;AAe5F,oBAAY,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,QAAQ,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAIF;;;;GAIG;AACH,oBAAY,oBAAoB,GAAG,qBAAqB,GACtD,qBAAqB,GAAG;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEJ,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;CAKjC,CAAC;AAEF;;GAEG;AACH,oBAAY,oBAAoB,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;AAEtG,eAAO,MAAM,qBAAqB;;;4BAqBlC;;;;;;;;;OASG;;;;;;;;;;;;;;;;;;CAzBF,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAMF;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,YAAY,CAAC,CA2CvB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,QAAQ,EACd,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,YAAY,CAAC,CAqBvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAMD;;;;;;;;;GASG;AAEH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EAEf,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,gBAAgB,CAAC,CA8B3B;AAGD;;;;;;;;;;GAUG;AAEH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,aAAa,CAAC,CA4CxB;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,aAAa,CAAC,EAAE,qBAAqB,GACpC,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,QAAQ,EACd,aAAa,CAAC,EAAE,oBAAoB,GACnC,OAAO,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CA+ClC;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,MAAM,CAc5E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAMzF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skydb.js b/node_modules/skynet-js/dist/mjs/skydb.js new file mode 100644 index 0000000..dc47503 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skydb.js @@ -0,0 +1,407 @@ +import { sign } from "tweetnacl"; +import { defaultDownloadOptions } from "./download"; +import { defaultGetEntryOptions, defaultSetEntryOptions, } from "./registry"; +import { BASE64_ENCODED_SKYLINK_SIZE, decodeSkylink, EMPTY_SKYLINK, RAW_SKYLINK_SIZE } from "./skylink/sia"; +import { MAX_REVISION } from "./utils/number"; +import { uriSkynetPrefix } from "./utils/url"; +import { hexToUint8Array, trimUriPrefix, toHexString, stringToUint8ArrayUtf8, uint8ArrayToStringUtf8, } from "./utils/string"; +import { formatSkylink } from "./skylink/format"; +import { defaultUploadOptions } from "./upload"; +import { decodeSkylinkBase64, encodeSkylinkBase64 } from "./utils/encoding"; +import { defaultBaseOptions, extractOptions } from "./utils/options"; +import { throwValidationError, validateHexString, validateObject, validateOptionalObject, validateSkylinkString, validateString, validateUint8ArrayLen, } from "./utils/validation"; +import { areEqualUint8Arrays } from "./utils/array"; +const JSON_RESPONSE_VERSION = 2; +export const defaultGetJSONOptions = { + ...defaultBaseOptions, + ...defaultGetEntryOptions, + ...defaultDownloadOptions, + cachedDataLink: undefined, +}; +export const defaultSetJSONOptions = { + ...defaultBaseOptions, + ...defaultGetJSONOptions, + ...defaultSetEntryOptions, + ...defaultUploadOptions, +}; +// ==== +// JSON +// ==== +/** + * Gets the JSON object corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +export async function getJSON(publicKey, dataKey, customOptions) { + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetJSONOptions); + // Rest of validation is done in `getEntry`. + const opts = { + ...defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + // Lookup the registry entry. + const entry = await getSkyDBRegistryEntry(this, publicKey, dataKey, opts); + if (entry === null) { + return { data: null, dataLink: null }; + } + // Determine the data link. + // TODO: Can this still be an entry link which hasn't yet resolved to a data link? + const { rawDataLink, dataLink } = parseDataLink(entry.data, true); + // If a cached data link is provided and the data link hasn't changed, return. + if (checkCachedDataLink(rawDataLink, opts.cachedDataLink)) { + return { data: null, dataLink }; + } + // Download the data in the returned data link. + const downloadOpts = extractOptions(opts, defaultDownloadOptions); + const { data } = await this.getFileContent(dataLink, downloadOpts); + if (typeof data !== "object" || data === null) { + throw new Error(`File data for the entry at data key '${dataKey}' is not JSON.`); + } + if (!(data["_data"] && data["_v"])) { + // Legacy data prior to skynet-js v4, return as-is. + return { data, dataLink }; + } + const actualData = data["_data"]; + if (typeof actualData !== "object" || data === null) { + throw new Error(`File data '_data' for the entry at data key '${dataKey}' is not JSON.`); + } + return { data: actualData, dataLink }; +} +/** + * Sets a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param json - The JSON data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned JSON and corresponding data link. + * @throws - Will throw if the input keys are not valid strings. + */ +export async function setJSON(privateKey, dataKey, json, customOptions) { + validateHexString("privateKey", privateKey, "parameter"); + validateString("dataKey", dataKey, "parameter"); + validateObject("json", json, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const { publicKey: publicKeyArray } = sign.keyPair.fromSecretKey(hexToUint8Array(privateKey)); + const [entry, dataLink] = await getOrCreateRegistryEntry(this, toHexString(publicKeyArray), dataKey, json, opts); + // Update the registry. + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.registry.setEntry(privateKey, entry, setEntryOpts); + return { data: json, dataLink: formatSkylink(dataLink) }; +} +/** + * Deletes a JSON object at the registry entry corresponding to the publicKey and dataKey. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +export async function deleteJSON(privateKey, dataKey, customOptions) { + validateHexString("privateKey", privateKey, "parameter"); + validateString("dataKey", dataKey, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const { publicKey: publicKeyArray } = sign.keyPair.fromSecretKey(hexToUint8Array(privateKey)); + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this, toHexString(publicKeyArray), dataKey, new Uint8Array(RAW_SKYLINK_SIZE), getEntryOpts); + // Update the registry. + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.registry.setEntry(privateKey, entry, setEntryOpts); +} +/** + * Sets the datalink for the entry at the given private key and data key. + * + * @param this - SkynetClient + * @param privateKey - The user private key. + * @param dataKey - The data key. + * @param dataLink - The data link to set at the entry. + * @param [customOptions] - Additional settings that can optionally be set. + * @throws - Will throw if the input keys are not valid strings. + */ +export async function setDataLink(privateKey, dataKey, dataLink, customOptions) { + validateHexString("privateKey", privateKey, "parameter"); + validateString("dataKey", dataKey, "parameter"); + validateString("dataLink", dataLink, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultSetJSONOptions); + const opts = { + ...defaultSetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + const { publicKey: publicKeyArray } = sign.keyPair.fromSecretKey(hexToUint8Array(privateKey)); + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entry = await getNextRegistryEntry(this, toHexString(publicKeyArray), dataKey, decodeSkylink(dataLink), getEntryOpts); + // Update the registry. + const setEntryOpts = extractOptions(opts, defaultSetEntryOptions); + await this.registry.setEntry(privateKey, entry, setEntryOpts); +} +// ========= +// Raw Bytes +// ========= +/** + * Gets the raw bytes corresponding to the publicKey and dataKey. The caller is responsible for setting any metadata in the bytes. + * + * @param this - SkynetClient + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The returned bytes. + * @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. + */ +// TODO: Should we expose this in the API? +export async function getRawBytes(publicKey, dataKey, +// TODO: Take a new options type? +customOptions) { + validateOptionalObject("customOptions", customOptions, "parameter", defaultGetJSONOptions); + // Rest of validation is done in `getEntry`. + const opts = { + ...defaultGetJSONOptions, + ...this.customOptions, + ...customOptions, + }; + // Lookup the registry entry. + const entry = await getSkyDBRegistryEntry(this, publicKey, dataKey, opts); + if (entry === null) { + return { data: null, dataLink: null }; + } + // Determine the data link. + // TODO: Can this still be an entry link which hasn't yet resolved to a data link? + const { rawDataLink, dataLink } = parseDataLink(entry.data, false); + // If a cached data link is provided and the data link hasn't changed, return. + if (checkCachedDataLink(rawDataLink, opts.cachedDataLink)) { + return { data: null, dataLink }; + } + // Download the data in the returned data link. + const downloadOpts = { ...extractOptions(opts, defaultDownloadOptions), responseType: "arraybuffer" }; + const { data: buffer } = await this.getFileContent(dataLink, downloadOpts); + return { data: new Uint8Array(buffer), dataLink }; +} +/* istanbul ignore next */ +/** + * Gets the registry entry for the given raw bytes or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The raw byte data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +// TODO: Rename & refactor after the SkyDB caching refactor. +export async function getOrCreateRawBytesRegistryEntry(client, publicKey, dataKey, data, customOptions) { + // Not publicly available, don't validate input. + const opts = { + ...defaultSetJSONOptions, + ...client.customOptions, + ...customOptions, + }; + // Create the data to upload to acquire its skylink. + let dataKeyHex = dataKey; + if (!opts.hashedDataKeyHex) { + dataKeyHex = toHexString(stringToUint8ArrayUtf8(dataKey)); + } + const file = new File([data], `dk:${dataKeyHex}`, { type: "application/octet-stream" }); + // Start file upload, do not block. + const uploadOpts = extractOptions(opts, defaultUploadOptions); + const skyfilePromise = client.uploadFile(file, uploadOpts); + // Fetch the current value to find out the revision. + // + // Start getEntry, do not block. + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entryPromise = client.registry.getEntry(publicKey, dataKey, getEntryOpts); + // Block until both getEntry and uploadFile are finished. + const [signedEntry, skyfile] = await Promise.all([ + entryPromise, + skyfilePromise, + ]); + const revision = getNextRevisionFromEntry(signedEntry.entry); + // Build the registry entry. + const dataLink = trimUriPrefix(skyfile.skylink, uriSkynetPrefix); + const rawDataLink = decodeSkylinkBase64(dataLink); + validateUint8ArrayLen("rawDataLink", rawDataLink, "skylink byte array", RAW_SKYLINK_SIZE); + const entry = { + dataKey, + data: rawDataLink, + revision, + }; + return entry; +} +// ======= +// Helpers +// ======= +/** + * Gets the next entry for the given public key and data key, setting the data to be the given data and the revision number accordingly. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param data - The data to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export async function getNextRegistryEntry(client, publicKey, dataKey, data, customOptions) { + // Not publicly available, don't validate input. + const opts = { + ...defaultGetEntryOptions, + ...client.customOptions, + ...customOptions, + }; + // Get the latest entry. + // TODO: Can remove this once we start caching the latest revision. + const signedEntry = await client.registry.getEntry(publicKey, dataKey, opts); + const revision = getNextRevisionFromEntry(signedEntry.entry); + // Build the registry entry. + const entry = { + dataKey, + data, + revision, + }; + return entry; +} +/** + * Gets the registry entry and data link or creates the entry if it doesn't exist. + * + * @param client - The Skynet client. + * @param publicKey - The user public key. + * @param dataKey - The dat akey. + * @param json - The JSON to set. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The registry entry and corresponding data link. + * @throws - Will throw if the revision is already the maximum value. + */ +export async function getOrCreateRegistryEntry(client, publicKey, dataKey, json, customOptions) { + // Not publicly available, don't validate input. + const opts = { + ...defaultSetJSONOptions, + ...client.customOptions, + ...customOptions, + }; + // Set the hidden _data and _v fields. + const fullData = { _data: json, _v: JSON_RESPONSE_VERSION }; + // Create the data to upload to acquire its skylink. + let dataKeyHex = dataKey; + if (!opts.hashedDataKeyHex) { + dataKeyHex = toHexString(stringToUint8ArrayUtf8(dataKey)); + } + const file = new File([JSON.stringify(fullData)], `dk:${dataKeyHex}`, { type: "application/json" }); + // Start file upload, do not block. + const uploadOpts = extractOptions(opts, defaultUploadOptions); + const skyfilePromise = client.uploadFile(file, uploadOpts); + // Fetch the current value to find out the revision. + // + // Start getEntry, do not block. + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const entryPromise = client.registry.getEntry(publicKey, dataKey, getEntryOpts); + // Block until both getEntry and uploadFile are finished. + const [signedEntry, skyfile] = await Promise.all([ + entryPromise, + skyfilePromise, + ]); + const revision = getNextRevisionFromEntry(signedEntry.entry); + // Build the registry entry. + const dataLink = trimUriPrefix(skyfile.skylink, uriSkynetPrefix); + const data = decodeSkylinkBase64(dataLink); + validateUint8ArrayLen("data", data, "skylink byte array", RAW_SKYLINK_SIZE); + const entry = { + dataKey, + data, + revision, + }; + return [entry, formatSkylink(dataLink)]; +} +/** + * Gets the next revision from a returned entry (or 0 if the entry was not found). + * + * @param entry - The returned registry entry. + * @returns - The revision. + * @throws - Will throw if the next revision would be beyond the maximum allowed value. + */ +export function getNextRevisionFromEntry(entry) { + let revision; + if (entry === null) { + revision = BigInt(0); + } + else { + revision = entry.revision + BigInt(1); + } + // Throw if the revision is already the maximum value. + if (revision > MAX_REVISION) { + throw new Error("Current entry already has maximum allowed revision, could not update the entry"); + } + return revision; +} +/** + * Checks whether the raw data link matches the cached data link, if provided. + * + * @param rawDataLink - The raw, unformatted data link. + * @param cachedDataLink - The cached data link, if provided. + * @returns - Whether the cached data link is a match. + * @throws - Will throw if the given cached data link is not a valid skylink. + */ +export function checkCachedDataLink(rawDataLink, cachedDataLink) { + if (cachedDataLink) { + cachedDataLink = validateSkylinkString("cachedDataLink", cachedDataLink, "optional parameter"); + return rawDataLink === cachedDataLink; + } + return false; +} +/** + * Gets the registry entry, returning null if the entry contains an empty skylink (the deletion sentinel). + * + * @param client - The Skynet Client + * @param publicKey - The user public key. + * @param dataKey - The key of the data to fetch for the given user. + * @param opts - Additional settings. + * @returns - The registry entry, or null if not found or deleted. + */ +async function getSkyDBRegistryEntry(client, publicKey, dataKey, opts) { + const getEntryOpts = extractOptions(opts, defaultGetEntryOptions); + const { entry } = await client.registry.getEntry(publicKey, dataKey, getEntryOpts); + if (entry === null || areEqualUint8Arrays(entry.data, EMPTY_SKYLINK)) { + return null; + } + return entry; +} +/** + * Parses a data link out of the given registry entry data. + * + * @param data - The raw registry entry data. + * @param legacy - Whether to check for possible legacy skylink data, encoded as base64. + * @returns - The raw, unformatted data link and the formatted data link. + * @throws - Will throw if the data is not of the expected length for a skylink. + */ +function parseDataLink(data, legacy) { + let rawDataLink = ""; + if (legacy && data.length === BASE64_ENCODED_SKYLINK_SIZE) { + // Legacy data, convert to string for backwards compatibility. + rawDataLink = uint8ArrayToStringUtf8(data); + } + else if (data.length === RAW_SKYLINK_SIZE) { + // Convert the bytes to a base64 skylink. + rawDataLink = encodeSkylinkBase64(data); + } + else { + throwValidationError("entry.data", data, "returned entry data", `length ${RAW_SKYLINK_SIZE} bytes`); + } + return { rawDataLink, dataLink: formatSkylink(rawDataLink) }; +} diff --git a/node_modules/skynet-js/dist/mjs/skylink/format.d.ts b/node_modules/skynet-js/dist/mjs/skylink/format.d.ts new file mode 100644 index 0000000..37fd625 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/format.d.ts @@ -0,0 +1,22 @@ +/** + * Converts the given base64 skylink to base32. + * + * @param skylink - The base64 skylink. + * @returns - The converted base32 skylink. + */ +export declare function convertSkylinkToBase32(skylink: string): string; +/** + * Converts the given base32 skylink to base64. + * + * @param skylink - The base32 skylink. + * @returns - The converted base64 skylink. + */ +export declare function convertSkylinkToBase64(skylink: string): string; +/** + * Formats the skylink by adding the sia: prefix. + * + * @param skylink - The skylink. + * @returns - The formatted skylink. + */ +export declare function formatSkylink(skylink: string): string; +//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skylink/format.d.ts.map b/node_modules/skynet-js/dist/mjs/skylink/format.d.ts.map new file mode 100644 index 0000000..986051c --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/format.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/skylink/format.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQrD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skylink/format.js b/node_modules/skynet-js/dist/mjs/skylink/format.js new file mode 100644 index 0000000..fef9b2d --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/format.js @@ -0,0 +1,44 @@ +import { BASE32_ENCODED_SKYLINK_SIZE, BASE64_ENCODED_SKYLINK_SIZE } from "./sia"; +import { decodeSkylinkBase32, decodeSkylinkBase64, encodeSkylinkBase32, encodeSkylinkBase64 } from "../utils/encoding"; +import { trimUriPrefix } from "../utils/string"; +import { uriSkynetPrefix } from "../utils/url"; +import { validateStringLen } from "../utils/validation"; +/** + * Converts the given base64 skylink to base32. + * + * @param skylink - The base64 skylink. + * @returns - The converted base32 skylink. + */ +export function convertSkylinkToBase32(skylink) { + skylink = trimUriPrefix(skylink, uriSkynetPrefix); + validateStringLen("skylink", skylink, "parameter", BASE64_ENCODED_SKYLINK_SIZE); + const bytes = decodeSkylinkBase64(skylink); + return encodeSkylinkBase32(bytes); +} +/** + * Converts the given base32 skylink to base64. + * + * @param skylink - The base32 skylink. + * @returns - The converted base64 skylink. + */ +export function convertSkylinkToBase64(skylink) { + skylink = trimUriPrefix(skylink, uriSkynetPrefix); + validateStringLen("skylink", skylink, "parameter", BASE32_ENCODED_SKYLINK_SIZE); + const bytes = decodeSkylinkBase32(skylink); + return encodeSkylinkBase64(bytes); +} +/** + * Formats the skylink by adding the sia: prefix. + * + * @param skylink - The skylink. + * @returns - The formatted skylink. + */ +export function formatSkylink(skylink) { + if (skylink === "") { + return skylink; + } + if (!skylink.startsWith(uriSkynetPrefix)) { + skylink = `${uriSkynetPrefix}${skylink}`; + } + return skylink; +} diff --git a/node_modules/skynet-js/dist/mjs/skylink/parse.d.ts b/node_modules/skynet-js/dist/mjs/skylink/parse.d.ts new file mode 100644 index 0000000..8d29f5e --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/parse.d.ts @@ -0,0 +1,30 @@ +/** + * Parse skylink options. + * + * @property [fromSubdomain] - Whether to parse the skylink as a base32 subdomain in a URL. + * @property [includePath] - Whether to include the path after the skylink, e.g. //foo/bar. + * @property [onlyPath] - Whether to parse out just the path, e.g. /foo/bar. Will still return null if the string does not contain a skylink. + */ +export declare type ParseSkylinkOptions = { + fromSubdomain?: boolean; + includePath?: boolean; + onlyPath?: boolean; +}; +/** + * Parses the given string for a base64 skylink, or base32 if opts.fromSubdomain is given. If the given string is prefixed with sia:, sia://, or a portal URL, those will be removed and the raw skylink returned. + * + * @param skylinkUrl - Plain skylink, skylink with URI prefix, or URL with skylink as the first path element. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base64 (or base32) skylink, optionally with the path included. + * @throws - Will throw on invalid combination of options. + */ +export declare function parseSkylink(skylinkUrl: string, customOptions?: ParseSkylinkOptions): string | null; +/** + * Helper function that parses the given string for a base32 skylink. + * + * @param skylinkUrl - Base32 skylink. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base32 skylink. + */ +export declare function parseSkylinkBase32(skylinkUrl: string, customOptions?: ParseSkylinkOptions): string | null; +//# sourceMappingURL=parse.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skylink/parse.d.ts.map b/node_modules/skynet-js/dist/mjs/skylink/parse.d.ts.map new file mode 100644 index 0000000..d59641b --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/parse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/skylink/parse.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,oBAAY,mBAAmB,GAAG;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAgBF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CA+CnG;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,IAAI,CAmBzG"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skylink/parse.js b/node_modules/skynet-js/dist/mjs/skylink/parse.js new file mode 100644 index 0000000..e678beb --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/parse.js @@ -0,0 +1,90 @@ +import parse from "url-parse"; +import { trimForwardSlash, trimSuffix, trimUriPrefix } from "../utils/string"; +import { uriSkynetPrefix } from "../utils/url"; +import { validateOptionalObject, validateString } from "../utils/validation"; +const defaultParseSkylinkOptions = { + fromSubdomain: false, + includePath: false, + onlyPath: false, +}; +const SKYLINK_MATCHER = "([a-zA-Z0-9_-]{46})"; +const SKYLINK_MATCHER_SUBDOMAIN = "([a-z0-9_-]{55})"; +const SKYLINK_DIRECT_REGEX = new RegExp(`^${SKYLINK_MATCHER}$`); +const SKYLINK_PATHNAME_REGEX = new RegExp(`^/?${SKYLINK_MATCHER}((/.*)?)$`); +const SKYLINK_SUBDOMAIN_REGEX = new RegExp(`^${SKYLINK_MATCHER_SUBDOMAIN}(\\..*)?$`); +const SKYLINK_DIRECT_MATCH_POSITION = 1; +const SKYLINK_PATH_MATCH_POSITION = 2; +/** + * Parses the given string for a base64 skylink, or base32 if opts.fromSubdomain is given. If the given string is prefixed with sia:, sia://, or a portal URL, those will be removed and the raw skylink returned. + * + * @param skylinkUrl - Plain skylink, skylink with URI prefix, or URL with skylink as the first path element. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base64 (or base32) skylink, optionally with the path included. + * @throws - Will throw on invalid combination of options. + */ +export function parseSkylink(skylinkUrl, customOptions) { + validateString("skylinkUrl", skylinkUrl, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultParseSkylinkOptions); + const opts = { ...defaultParseSkylinkOptions, ...customOptions }; + if (opts.includePath && opts.onlyPath) { + throw new Error("The includePath and onlyPath options cannot both be set"); + } + if (opts.includePath && opts.fromSubdomain) { + throw new Error("The includePath and fromSubdomain options cannot both be set"); + } + if (opts.fromSubdomain) { + return parseSkylinkBase32(skylinkUrl, opts); + } + // Check for skylink prefixed with sia: or sia:// and extract it. + // Example: sia:XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg + // Example: sia://XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg + skylinkUrl = trimUriPrefix(skylinkUrl, uriSkynetPrefix); + // Check for direct base64 skylink match. + const matchDirect = skylinkUrl.match(SKYLINK_DIRECT_REGEX); + if (matchDirect) { + if (opts.onlyPath) { + return ""; + } + return matchDirect[SKYLINK_DIRECT_MATCH_POSITION]; + } + // Check for skylink passed in an url and extract it. + // Example: https://siasky.net/XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg + // Example: https://bg06v2tidkir84hg0s1s4t97jaeoaa1jse1svrad657u070c9calq4g.siasky.net (if opts.fromSubdomain = true) + // Pass empty object as second param to disable using location as base url + // when parsing in browser. + const parsed = parse(skylinkUrl, {}); + const skylinkAndPath = trimSuffix(parsed.pathname, "/"); + const matchPathname = skylinkAndPath.match(SKYLINK_PATHNAME_REGEX); + if (!matchPathname) + return null; + const path = matchPathname[SKYLINK_PATH_MATCH_POSITION]; + if (opts.includePath) + return trimForwardSlash(skylinkAndPath); + else if (opts.onlyPath) + return path; + else + return matchPathname[SKYLINK_DIRECT_MATCH_POSITION]; +} +/** + * Helper function that parses the given string for a base32 skylink. + * + * @param skylinkUrl - Base32 skylink. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The base32 skylink. + */ +export function parseSkylinkBase32(skylinkUrl, customOptions) { + // Do not validate, this helper function should only be called from parseSkylink. + const opts = { ...defaultParseSkylinkOptions, ...customOptions }; + // Pass empty object as second param to disable using location as base url + // when parsing in browser. + const parsed = parse(skylinkUrl, {}); + // Check if the hostname contains a skylink subdomain. + const matchHostname = parsed.hostname.match(SKYLINK_SUBDOMAIN_REGEX); + if (matchHostname) { + if (opts.onlyPath) { + return trimSuffix(parsed.pathname, "/"); + } + return matchHostname[SKYLINK_DIRECT_MATCH_POSITION]; + } + return null; +} diff --git a/node_modules/skynet-js/dist/mjs/skylink/sia.d.ts b/node_modules/skynet-js/dist/mjs/skylink/sia.d.ts new file mode 100644 index 0000000..4ff235e --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/sia.d.ts @@ -0,0 +1,101 @@ +/** + * The string length of the Skylink after it has been encoded using base32. + */ +export declare const BASE32_ENCODED_SKYLINK_SIZE = 55; +/** + * The string length of the Skylink after it has been encoded using base64. + */ +export declare const BASE64_ENCODED_SKYLINK_SIZE = 46; +/** + * Returned when a string could not be decoded into a Skylink due to it having + * an incorrect size. + */ +export declare const ERR_SKYLINK_INCORRECT_SIZE = "skylink has incorrect size"; +/** + * The raw size in bytes of the data that gets put into a link. + */ +export declare const RAW_SKYLINK_SIZE = 34; +/** + * An empty skylink. + */ +export declare const EMPTY_SKYLINK: Uint8Array; +export declare class SiaSkylink { + bitfield: number; + merkleRoot: Uint8Array; + constructor(bitfield: number, merkleRoot: Uint8Array); + toBytes(): Uint8Array; + toString(): string; + /** + * Loads the given raw data and returns the result. Based on sl.LoadBytes in + * skyd. + * + * @param data - The raw bytes to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromBytes(data: Uint8Array): SiaSkylink; + /** + * Converts from a string and returns the result. Based on sl.LoadString in + * skyd. + * + * @param skylink - The skylink string to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromString(skylink: string): SiaSkylink; +} +/** + * Checks if the given string is a V1 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V1 skylink. + */ +export declare function isSkylinkV1(skylink: string): boolean; +/** + * Checks if the given string is a V2 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V2 skylink. + */ +export declare function isSkylinkV2(skylink: string): boolean; +/** + * Returns a specifier for given name, a specifier can only be 16 bytes so we + * panic if the given name is too long. + * + * @param name - The name. + * @returns - The specifier, if valid. + */ +export declare function newSpecifier(name: string): Uint8Array; +declare class SiaPublicKey { + algorithm: Uint8Array; + key: Uint8Array; + constructor(algorithm: Uint8Array, key: Uint8Array); + marshalSia(): Uint8Array; +} +/** + * Creates a new sia public key. Matches Ed25519PublicKey in sia. + * + * @param publicKey - The hex-encoded public key. + * @returns - The SiaPublicKey. + */ +export declare function newEd25519PublicKey(publicKey: string): SiaPublicKey; +/** + * Creates a new v2 skylink. Matches `NewSkylinkV2` in skyd. + * + * @param siaPublicKey - The public key as a SiaPublicKey. + * @param tweak - The hashed tweak. + * @returns - The v2 skylink. + */ +export declare function newSkylinkV2(siaPublicKey: SiaPublicKey, tweak: Uint8Array): SiaSkylink; +/** + * A helper function that decodes the given string representation of a skylink + * into raw bytes. It either performs a base32 decoding, or base64 decoding, + * depending on the length. + * + * @param encoded - The encoded string. + * @returns - The decoded raw bytes. + * @throws - Will throw if the skylink is not a V1 or V2 skylink string. + */ +export declare function decodeSkylink(encoded: string): Uint8Array; +export {}; +//# sourceMappingURL=sia.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skylink/sia.d.ts.map b/node_modules/skynet-js/dist/mjs/skylink/sia.d.ts.map new file mode 100644 index 0000000..3d7e319 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/sia.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sia.d.ts","sourceRoot":"","sources":["../../../src/skylink/sia.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,aAAa,YAAmC,CAAC;AAE9D,qBAAa,UAAU;IACF,QAAQ,EAAE,MAAM;IAAS,UAAU,EAAE,UAAU;gBAA/C,QAAQ,EAAE,MAAM,EAAS,UAAU,EAAE,UAAU;IAKlE,OAAO,IAAI,UAAU;IAWrB,QAAQ,IAAI,MAAM;IAIlB;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAe9C;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAI/C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQpD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CASpD;AA0BD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAMrD;AAID,cAAM,YAAY;IACG,SAAS,EAAE,UAAU;IAAS,GAAG,EAAE,UAAU;gBAA7C,SAAS,EAAE,UAAU,EAAS,GAAG,EAAE,UAAU;IAEhE,UAAU,IAAI,UAAU;CAMzB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAQnE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAKtF;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAmBzD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/skylink/sia.js b/node_modules/skynet-js/dist/mjs/skylink/sia.js new file mode 100644 index 0000000..3f14040 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/skylink/sia.js @@ -0,0 +1,213 @@ +import { hashAll } from "../crypto"; +import { decodeSkylinkBase64, encodeSkylinkBase64, encodePrefixedBytes, decodeSkylinkBase32 } from "../utils/encoding"; +import { hexToUint8Array, stringToUint8ArrayUtf8, trimUriPrefix } from "../utils/string"; +import { uriSkynetPrefix } from "../utils/url"; +import { validateHexString, validateNumber, validateString, validateUint8ArrayLen } from "../utils/validation"; +/** + * The string length of the Skylink after it has been encoded using base32. + */ +export const BASE32_ENCODED_SKYLINK_SIZE = 55; +/** + * The string length of the Skylink after it has been encoded using base64. + */ +export const BASE64_ENCODED_SKYLINK_SIZE = 46; +/** + * Returned when a string could not be decoded into a Skylink due to it having + * an incorrect size. + */ +export const ERR_SKYLINK_INCORRECT_SIZE = "skylink has incorrect size"; +/** + * The raw size in bytes of the data that gets put into a link. + */ +export const RAW_SKYLINK_SIZE = 34; +/** + * An empty skylink. + */ +export const EMPTY_SKYLINK = new Uint8Array(RAW_SKYLINK_SIZE); +export class SiaSkylink { + constructor(bitfield, merkleRoot) { + this.bitfield = bitfield; + this.merkleRoot = merkleRoot; + validateNumber("bitfield", bitfield, "constructor parameter"); + validateUint8ArrayLen("merkleRoot", merkleRoot, "constructor parameter", 32); + } + toBytes() { + const buf = new ArrayBuffer(RAW_SKYLINK_SIZE); + const view = new DataView(buf); + view.setUint16(0, this.bitfield, true); + const uint8Bytes = new Uint8Array(buf); + uint8Bytes.set(this.merkleRoot, 2); + return uint8Bytes; + } + toString() { + return encodeSkylinkBase64(this.toBytes()); + } + /** + * Loads the given raw data and returns the result. Based on sl.LoadBytes in + * skyd. + * + * @param data - The raw bytes to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromBytes(data) { + validateUint8ArrayLen("data", data, "parameter", RAW_SKYLINK_SIZE); + const view = new DataView(data.buffer); + // Load the bitfield. + const bitfield = view.getUint16(0, true); + // TODO: Validate v1 bitfields. + const merkleRoot = new Uint8Array(32); + merkleRoot.set(data.slice(2)); + return new SiaSkylink(bitfield, merkleRoot); + } + /** + * Converts from a string and returns the result. Based on sl.LoadString in + * skyd. + * + * @param skylink - The skylink string to load. + * @returns - The sia skylink. + * @throws - Will throw if the data has an unexpected size. + */ + static fromString(skylink) { + const bytes = decodeSkylink(skylink); + return SiaSkylink.fromBytes(bytes); + } +} +/** + * Checks if the given string is a V1 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V1 skylink. + */ +export function isSkylinkV1(skylink) { + const raw = decodeSkylink(skylink); + // Load and check the bitfield. + const view = new DataView(raw.buffer); + const bitfield = view.getUint16(0, true); + return isBitfieldSkylinkV1(bitfield); +} +/** + * Checks if the given string is a V2 skylink. + * + * @param skylink - The skylink to check. + * @returns - Whether the skylink is a V2 skylink. + */ +export function isSkylinkV2(skylink) { + // Decode the base into raw data. + const raw = decodeSkylink(skylink); + // Load and check the bitfield. + const view = new DataView(raw.buffer); + const bitfield = view.getUint16(0, true); + return isBitfieldSkylinkV2(bitfield); +} +/** + * Returns a boolean indicating if the Skylink is a V1 skylink + * + * @param bitfield - The bitfield to check. + * @returns - Whether the bitfield corresponds to a V1 skylink. + */ +function isBitfieldSkylinkV1(bitfield) { + return (bitfield & 3) === 0; +} +/** + * Returns a boolean indicating if the Skylink is a V2 skylink + * + * @param bitfield - The bitfield to check. + * @returns - Whether the bitfield corresponds to a V2 skylink. + */ +function isBitfieldSkylinkV2(bitfield) { + // We compare against 1 here because a V2 skylink only uses the version + // bits. All other bits should be set to 0. + return bitfield == 1; +} +const SPECIFIER_LEN = 16; +/** + * Returns a specifier for given name, a specifier can only be 16 bytes so we + * panic if the given name is too long. + * + * @param name - The name. + * @returns - The specifier, if valid. + */ +export function newSpecifier(name) { + validateString("name", name, "parameter"); + const specifier = new Uint8Array(SPECIFIER_LEN); + specifier.set(stringToUint8ArrayUtf8(name)); + return specifier; +} +const PUBLIC_KEY_SIZE = 32; +class SiaPublicKey { + constructor(algorithm, key) { + this.algorithm = algorithm; + this.key = key; + } + marshalSia() { + const bytes = new Uint8Array(SPECIFIER_LEN + 8 + PUBLIC_KEY_SIZE); + bytes.set(this.algorithm); + bytes.set(encodePrefixedBytes(this.key), SPECIFIER_LEN); + return bytes; + } +} +/** + * Creates a new sia public key. Matches Ed25519PublicKey in sia. + * + * @param publicKey - The hex-encoded public key. + * @returns - The SiaPublicKey. + */ +export function newEd25519PublicKey(publicKey) { + validateHexString("publicKey", publicKey, "parameter"); + const algorithm = newSpecifier("ed25519"); + const publicKeyBytes = hexToUint8Array(publicKey); + validateUint8ArrayLen("publicKeyBytes", publicKeyBytes, "converted publicKey", PUBLIC_KEY_SIZE); + return new SiaPublicKey(algorithm, publicKeyBytes); +} +/** + * Creates a new v2 skylink. Matches `NewSkylinkV2` in skyd. + * + * @param siaPublicKey - The public key as a SiaPublicKey. + * @param tweak - The hashed tweak. + * @returns - The v2 skylink. + */ +export function newSkylinkV2(siaPublicKey, tweak) { + const version = 2; + const bitfield = version - 1; + const merkleRoot = deriveRegistryEntryID(siaPublicKey, tweak); + return new SiaSkylink(bitfield, merkleRoot); +} +/** + * A helper function that decodes the given string representation of a skylink + * into raw bytes. It either performs a base32 decoding, or base64 decoding, + * depending on the length. + * + * @param encoded - The encoded string. + * @returns - The decoded raw bytes. + * @throws - Will throw if the skylink is not a V1 or V2 skylink string. + */ +export function decodeSkylink(encoded) { + encoded = trimUriPrefix(encoded, uriSkynetPrefix); + let bytes; + if (encoded.length === BASE32_ENCODED_SKYLINK_SIZE) { + bytes = decodeSkylinkBase32(encoded); + } + else if (encoded.length === BASE64_ENCODED_SKYLINK_SIZE) { + bytes = decodeSkylinkBase64(encoded); + } + else { + throw new Error(ERR_SKYLINK_INCORRECT_SIZE); + } + // Sanity check the size of the given data. + /* istanbul ignore next */ + if (bytes.length != RAW_SKYLINK_SIZE) { + throw new Error("failed to load skylink data"); + } + return bytes; +} +/** + * A helper to derive an entry id for a registry key value pair. Matches `DeriveRegistryEntryID` in sia. + * + * @param pubKey - The sia public key. + * @param tweak - The tweak. + * @returns - The entry ID as a hash of the inputs. + */ +function deriveRegistryEntryID(pubKey, tweak) { + return hashAll(pubKey.marshalSia(), tweak); +} diff --git a/node_modules/skynet-js/dist/mjs/upload.d.ts b/node_modules/skynet-js/dist/mjs/upload.d.ts new file mode 100644 index 0000000..e1bba4e --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/upload.d.ts @@ -0,0 +1,117 @@ +import { AxiosResponse } from "axios"; +import { BaseCustomOptions } from "./utils/options"; +import { SkynetClient } from "./client"; +/** + * Custom upload options. + * + * @property [endpointUpload] - The relative URL path of the portal endpoint to contact. + * @property [endpointLargeUpload] - The relative URL path of the portal endpoint to contact for large uploads. + * @property [customFilename] - The custom filename to use when uploading files. + * @property [largeFileSize=41943040] - The size at which files are considered "large" and will be uploaded using the tus resumable upload protocol. This is the size of one chunk by default (40 mib). + * @property [retryDelays=[0, 5_000, 15_000, 60_000, 300_000, 600_000]] - An array or undefined, indicating how many milliseconds should pass before the next attempt to uploading will be started after the transfer has been interrupted. The array's length indicates the maximum number of attempts. + */ +export declare type CustomUploadOptions = BaseCustomOptions & { + endpointUpload?: string; + endpointLargeUpload?: string; + customFilename?: string; + largeFileSize?: number; + retryDelays?: number[]; +}; +/** + * The response to an upload request. + * + * @property skylink - 46-character skylink. + */ +export declare type UploadRequestResponse = { + skylink: string; +}; +export declare const defaultUploadOptions: { + endpointUpload: string; + endpointLargeUpload: string; + customFilename: string; + largeFileSize: number; + retryDelays: number[]; + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Uploads a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact for small uploads. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact for large uploads. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadFile(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Uploads a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadSmallFile(this: SkynetClient, file: File, customOptions: CustomUploadOptions): Promise; +/** + * Makes a request to upload a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +export declare function uploadSmallFileRequest(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Uploads a large file to Skynet using tus. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadLargeFile(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Makes a request to upload a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +export declare function uploadLargeFileRequest(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; +/** + * Uploads a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export declare function uploadDirectory(this: SkynetClient, directory: Record, filename: string, customOptions?: CustomUploadOptions): Promise; +/** + * Makes a request to upload a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + * @throws - Will throw if the input filename is not a string. + */ +export declare function uploadDirectoryRequest(this: SkynetClient, directory: Record, filename: string, customOptions?: CustomUploadOptions): Promise; +//# sourceMappingURL=upload.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/upload.d.ts.map b/node_modules/skynet-js/dist/mjs/upload.d.ts.map new file mode 100644 index 0000000..9bc91a1 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/upload.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,EAAE,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAwC,YAAY,EAAE,MAAM,UAAU,CAAC;AAuB9E;;;;;;;;GAQG;AACH,oBAAY,mBAAmB,GAAG,iBAAiB,GAAG;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;CAShC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAUhC;AAED;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,mBAAmB,GACjC,OAAO,CAAC,qBAAqB,CAAC,CAShC;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAGD;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAehC;AAGD;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAmExB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAWhC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,aAAa,CAAC,CAsBxB"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/upload.js b/node_modules/skynet-js/dist/mjs/upload.js new file mode 100644 index 0000000..13184c6 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/upload.js @@ -0,0 +1,299 @@ +import { Upload } from "tus-js-client"; +import { getFileMimeType } from "./utils/file"; +import { defaultBaseOptions } from "./utils/options"; +import { formatSkylink } from "./skylink/format"; +import { buildRequestHeaders, buildRequestUrl } from "./client"; +import { throwValidationError, validateObject, validateOptionalObject, validateString } from "./utils/validation"; +/** + * The tus chunk size is (4MiB - encryptionOverhead) * dataPieces, set in skyd. + */ +const TUS_CHUNK_SIZE = (1 << 22) * 10; +/** + * The retry delays, in ms. Data is stored in skyd for up to 20 minutes, so the + * total delays should not exceed that length of time. + */ +const DEFAULT_TUS_RETRY_DELAYS = [0, 5000, 15000, 60000, 300000, 600000]; +/** + * The portal file field name. + */ +const PORTAL_FILE_FIELD_NAME = "file"; +/** + * The portal directory file field name. + */ +const PORTAL_DIRECTORY_FILE_FIELD_NAME = "files[]"; +export const defaultUploadOptions = { + ...defaultBaseOptions, + endpointUpload: "/skynet/skyfile", + endpointLargeUpload: "/skynet/tus", + customFilename: "", + largeFileSize: TUS_CHUNK_SIZE, + retryDelays: DEFAULT_TUS_RETRY_DELAYS, +}; +/** + * Uploads a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact for small uploads. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact for large uploads. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export async function uploadFile(file, customOptions) { + // Validation is done in `uploadFileRequest` or `uploadLargeFileRequest`. + const opts = { ...defaultUploadOptions, ...this.customOptions, ...customOptions }; + if (file.size < opts.largeFileSize) { + return this.uploadSmallFile(file, opts); + } + else { + return this.uploadLargeFile(file, opts); + } +} +/** + * Uploads a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export async function uploadSmallFile(file, customOptions) { + const response = await this.uploadSmallFileRequest(file, customOptions); + // Sanity check. + validateUploadResponse(response); + const skylink = formatSkylink(response.data.skylink); + return { skylink }; +} +/** + * Makes a request to upload a small file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +export async function uploadSmallFileRequest(file, customOptions) { + validateFile("file", file, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultUploadOptions); + const opts = { ...defaultUploadOptions, ...this.customOptions, ...customOptions }; + const formData = new FormData(); + file = ensureFileObjectConsistency(file); + if (opts.customFilename) { + formData.append(PORTAL_FILE_FIELD_NAME, file, opts.customFilename); + } + else { + formData.append(PORTAL_FILE_FIELD_NAME, file); + } + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointUpload, + method: "post", + data: formData, + }); + return response; +} +/* istanbul ignore next */ +/** + * Uploads a large file to Skynet using tus. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export async function uploadLargeFile(file, customOptions) { + // Validation is done in `uploadLargeFileRequest`. + const response = await this.uploadLargeFileRequest(file, customOptions); + // Sanity check. + validateLargeUploadResponse(response); + // Get the skylink. + let skylink = response.headers["skynet-skylink"]; + // Format the skylink. + skylink = formatSkylink(skylink); + return { skylink }; +} +/* istanbul ignore next */ +/** + * Makes a request to upload a file to Skynet. + * + * @param this - SkynetClient + * @param file - The file to upload. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointLargeUpload="/skynet/tus"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + */ +export async function uploadLargeFileRequest(file, customOptions) { + validateFile("file", file, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultUploadOptions); + const opts = { ...defaultUploadOptions, ...this.customOptions, ...customOptions }; + // TODO: Add back upload options once they are implemented in skyd. + const url = await buildRequestUrl(this, opts.endpointLargeUpload); + const headers = buildRequestHeaders(undefined, opts.customUserAgent, opts.customCookie); + file = ensureFileObjectConsistency(file); + let filename = file.name; + if (opts.customFilename) { + filename = opts.customFilename; + } + const onProgress = opts.onUploadProgress && + function (bytesSent, bytesTotal) { + const progress = bytesSent / bytesTotal; + // @ts-expect-error TS complains. + opts.onUploadProgress(progress, { loaded: bytesSent, total: bytesTotal }); + }; + return new Promise((resolve, reject) => { + const tusOpts = { + endpoint: url, + chunkSize: TUS_CHUNK_SIZE, + retryDelays: opts.retryDelays, + metadata: { + filename, + filetype: file.type, + }, + headers, + onProgress, + onBeforeRequest: function (req) { + const xhr = req.getUnderlyingObject(); + xhr.withCredentials = true; + }, + onError: (error) => { + // @ts-expect-error tus-client-js Error is not typed correctly. + const res = error.originalResponse; + const message = res ? res.getBody() || error : error; + reject(new Error(message.trim())); + }, + onSuccess: async () => { + if (!upload.url) { + reject(new Error("'upload.url' was not set")); + return; + } + // Call HEAD to get the metadata, including the skylink. + const resp = await this.executeRequest({ + ...opts, + url: upload.url, + endpointPath: opts.endpointLargeUpload, + method: "head", + headers: { ...headers, "Tus-Resumable": "1.0.0" }, + }); + resolve(resp); + }, + }; + const upload = new Upload(file, tusOpts); + upload.start(); + }); +} +/** + * Uploads a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The returned skylink. + * @throws - Will throw if the request is successful but the upload response does not contain a complete response. + */ +export async function uploadDirectory(directory, filename, customOptions) { + // Validation is done in `uploadDirectoryRequest`. + const response = await this.uploadDirectoryRequest(directory, filename, customOptions); + // Sanity check. + validateUploadResponse(response); + const skylink = formatSkylink(response.data.skylink); + return { skylink }; +} +/** + * Makes a request to upload a directory to Skynet. + * + * @param this - SkynetClient + * @param directory - File objects to upload, indexed by their path strings. + * @param filename - The name of the directory. + * @param [customOptions] - Additional settings that can optionally be set. + * @param [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. + * @returns - The upload response. + * @throws - Will throw if the input filename is not a string. + */ +export async function uploadDirectoryRequest(directory, filename, customOptions) { + validateObject("directory", directory, "parameter"); + validateString("filename", filename, "parameter"); + validateOptionalObject("customOptions", customOptions, "parameter", defaultUploadOptions); + const opts = { ...defaultUploadOptions, ...this.customOptions, ...customOptions }; + const formData = new FormData(); + Object.entries(directory).forEach(([path, file]) => { + file = ensureFileObjectConsistency(file); + formData.append(PORTAL_DIRECTORY_FILE_FIELD_NAME, file, path); + }); + const response = await this.executeRequest({ + ...opts, + endpointPath: opts.endpointUpload, + method: "post", + data: formData, + query: { filename }, + }); + return response; +} +/** + * Sometimes file object might have had the type property defined manually with + * Object.defineProperty and some browsers (namely firefox) can have problems + * reading it after the file has been appended to form data. To overcome this, + * we recreate the file object using native File constructor with a type defined + * as a constructor argument. + * + * @param file - The input file. + * @returns - The processed file. + */ +function ensureFileObjectConsistency(file) { + return new File([file], file.name, { type: getFileMimeType(file) }); +} +/** + * Validates the given value as a file. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid file. + */ +function validateFile(name, value, valueKind) { + if (!(value instanceof File)) { + throwValidationError(name, value, valueKind, "type 'File'"); + } +} +/** + * Validates the upload response. + * + * @param response - The upload response. + * @throws - Will throw if not a valid upload response. + */ +function validateUploadResponse(response) { + try { + if (!response.data) { + throw new Error("response.data field missing"); + } + validateString("skylink", response.data.skylink, "upload response field"); + } + catch (err) { + throw new Error(`Did not get a complete upload response despite a successful request. Please try again and report this issue to the devs if it persists. ${err}`); + } +} +/* istanbul ignore next */ +/** + * Validates the large upload response. + * + * @param response - The upload response. + * @throws - Will throw if not a valid upload response. + */ +function validateLargeUploadResponse(response) { + try { + if (!response.headers) { + throw new Error("response.headers field missing"); + } + validateString('response.headers["skynet-skylink"]', response.headers["skynet-skylink"], "upload response field"); + } + catch (err) { + throw new Error(`Did not get a complete upload response despite a successful request. Please try again and report this issue to the devs if it persists. Error: ${err}`); + } +} diff --git a/node_modules/skynet-js/dist/mjs/utils/array.d.ts b/node_modules/skynet-js/dist/mjs/utils/array.d.ts new file mode 100644 index 0000000..c2c6ba7 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/array.d.ts @@ -0,0 +1,10 @@ +/** + * Returns true if the two uint8 arrays are equal. From + * https://stackoverflow.com/a/60818105/6085242 + * + * @param array1 - The first uint8 array. + * @param array2 - The second uint8 array. + * @returns - Whether the arrays are equal. + */ +export declare function areEqualUint8Arrays(array1: Uint8Array, array2: Uint8Array): boolean; +//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/array.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/array.d.ts.map new file mode 100644 index 0000000..5da7682 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/utils/array.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAUnF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/array.js b/node_modules/skynet-js/dist/mjs/utils/array.js new file mode 100644 index 0000000..8aa8245 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/array.js @@ -0,0 +1,19 @@ +/** + * Returns true if the two uint8 arrays are equal. From + * https://stackoverflow.com/a/60818105/6085242 + * + * @param array1 - The first uint8 array. + * @param array2 - The second uint8 array. + * @returns - Whether the arrays are equal. + */ +export function areEqualUint8Arrays(array1, array2) { + if (array1.length != array2.length) { + return false; + } + for (let i = 0; i < array1.length; i++) { + if (array1[i] != array2[i]) { + return false; + } + } + return true; +} diff --git a/node_modules/skynet-js/dist/mjs/utils/encoding.d.ts b/node_modules/skynet-js/dist/mjs/utils/encoding.d.ts new file mode 100644 index 0000000..5c5061b --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/encoding.d.ts @@ -0,0 +1,58 @@ +/** + * Decodes the skylink encoded using base32 encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +export declare function decodeSkylinkBase32(skylink: string): Uint8Array; +/** + * Encodes the bytes to a skylink encoded using base32 encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +export declare function encodeSkylinkBase32(bytes: Uint8Array): string; +/** + * Decodes the skylink encoded using base64 raw URL encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +export declare function decodeSkylinkBase64(skylink: string): Uint8Array; +/** + * Encodes the bytes to a skylink encoded using base64 raw URL encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +export declare function encodeSkylinkBase64(bytes: Uint8Array): string; +/** + * Converts the given number into a uint8 array + * + * @param num - Number to encode. + * @returns - Number encoded as a byte array. + */ +export declare function encodeNumber(num: number): Uint8Array; +/** + * Encodes the given bigint into a uint8 array. + * + * @param int - Bigint to encode. + * @returns - Bigint encoded as a byte array. + * @throws - Will throw if the int does not fit in 64 bits. + */ +export declare function encodeBigintAsUint64(int: bigint): Uint8Array; +/** + * Encodes the uint8array, prefixed by its length. + * + * @param bytes - The input array. + * @returns - The encoded byte array. + */ +export declare function encodePrefixedBytes(bytes: Uint8Array): Uint8Array; +/** + * Encodes the given UTF-8 string into a uint8 array containing the string length and the string. + * + * @param str - String to encode. + * @returns - String encoded as a byte array. + */ +export declare function encodeUtf8String(str: string): Uint8Array; +//# sourceMappingURL=encoding.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/encoding.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/encoding.d.ts.map new file mode 100644 index 0000000..872ff07 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/encoding.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAI/D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAM/D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAO7D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAQpD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAW5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAWjE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMxD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/encoding.js b/node_modules/skynet-js/dist/mjs/utils/encoding.js new file mode 100644 index 0000000..40c69cc --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/encoding.js @@ -0,0 +1,115 @@ +import base32Decode from "base32-decode"; +import base32Encode from "base32-encode"; +import { fromByteArray, toByteArray } from "base64-js"; +import { assertUint64 } from "./number"; +import { stringToUint8ArrayUtf8 } from "./string"; +const BASE32_ENCODING_VARIANT = "RFC4648-HEX"; +/** + * Decodes the skylink encoded using base32 encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +export function decodeSkylinkBase32(skylink) { + skylink = skylink.toUpperCase(); + const bytes = base32Decode(skylink, BASE32_ENCODING_VARIANT); + return new Uint8Array(bytes); +} +/** + * Encodes the bytes to a skylink encoded using base32 encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +export function encodeSkylinkBase32(bytes) { + return base32Encode(bytes, BASE32_ENCODING_VARIANT, { padding: false }).toLowerCase(); +} +/** + * Decodes the skylink encoded using base64 raw URL encoding to bytes. + * + * @param skylink - The encoded skylink. + * @returns - The decoded bytes. + */ +export function decodeSkylinkBase64(skylink) { + // Add padding. + skylink = `${skylink}==`; + // Convert from URL encoding. + skylink = skylink.replace(/-/g, "+").replace(/_/g, "/"); + return toByteArray(skylink); +} +/** + * Encodes the bytes to a skylink encoded using base64 raw URL encoding. + * + * @param bytes - The bytes to encode. + * @returns - The encoded skylink. + */ +export function encodeSkylinkBase64(bytes) { + let base64 = fromByteArray(bytes); + // Convert to URL encoding. + base64 = base64.replace(/\+/g, "-").replace(/\//g, "_"); + // Remove trailing "==". This will always be present as the skylink encoding + // gets padded so that the string is a multiple of 4 characters in length. + return base64.slice(0, -2); +} +/** + * Converts the given number into a uint8 array + * + * @param num - Number to encode. + * @returns - Number encoded as a byte array. + */ +export function encodeNumber(num) { + const encoded = new Uint8Array(8); + for (let index = 0; index < encoded.length; index++) { + const byte = num & 0xff; + encoded[index] = byte; + num = num >> 8; + } + return encoded; +} +/** + * Encodes the given bigint into a uint8 array. + * + * @param int - Bigint to encode. + * @returns - Bigint encoded as a byte array. + * @throws - Will throw if the int does not fit in 64 bits. + */ +export function encodeBigintAsUint64(int) { + // Assert the input is 64 bits. + assertUint64(int); + const encoded = new Uint8Array(8); + for (let index = 0; index < encoded.length; index++) { + const byte = int & BigInt(0xff); + encoded[index] = Number(byte); + int = int >> BigInt(8); + } + return encoded; +} +/** + * Encodes the uint8array, prefixed by its length. + * + * @param bytes - The input array. + * @returns - The encoded byte array. + */ +export function encodePrefixedBytes(bytes) { + const len = bytes.length; + const buf = new ArrayBuffer(8 + len); + const view = new DataView(buf); + // Sia uses setUint64 which is unavailable in JS. + view.setUint32(0, len, true); + const uint8Bytes = new Uint8Array(buf); + uint8Bytes.set(bytes, 8); + return uint8Bytes; +} +/** + * Encodes the given UTF-8 string into a uint8 array containing the string length and the string. + * + * @param str - String to encode. + * @returns - String encoded as a byte array. + */ +export function encodeUtf8String(str) { + const byteArray = stringToUint8ArrayUtf8(str); + const encoded = new Uint8Array(8 + byteArray.length); + encoded.set(encodeNumber(byteArray.length)); + encoded.set(byteArray, 8); + return encoded; +} diff --git a/node_modules/skynet-js/dist/mjs/utils/file.d.ts b/node_modules/skynet-js/dist/mjs/utils/file.d.ts new file mode 100644 index 0000000..cd71c48 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/file.d.ts @@ -0,0 +1,23 @@ +/** + * Gets the file path relative to the root directory of the path, e.g. `bar` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The relative file path. + */ +export declare function getRelativeFilePath(file: File): string; +/** + * Gets the root directory of the file path, e.g. `foo` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The root directory. + */ +export declare function getRootDirectory(file: File): string; +/** + * Get the file mime type. In case the type is not provided, use mime-db and try + * to guess the file type based on the extension. + * + * @param file - The file. + * @returns - The mime type. + */ +export declare function getFileMimeType(file: File): string; +//# sourceMappingURL=file.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/file.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/file.d.ts.map new file mode 100644 index 0000000..2d0f173 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/file.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/utils/file.ts"],"names":[],"mappings":"AAoBA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMtD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKnD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAWlD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/file.js b/node_modules/skynet-js/dist/mjs/utils/file.js new file mode 100644 index 0000000..1c36d56 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/file.js @@ -0,0 +1,56 @@ +import mime from "mime/lite"; +import path from "path-browserify"; +import { trimPrefix } from "./string"; +/** + * Gets the path for the file. + * + * @param file - The file. + * @returns - The path. + */ +function getFilePath(file) { + /* istanbul ignore next */ + return file.webkitRelativePath || file.path || file.name; +} +/** + * Gets the file path relative to the root directory of the path, e.g. `bar` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The relative file path. + */ +export function getRelativeFilePath(file) { + const filePath = getFilePath(file); + const { root, dir, base } = path.parse(filePath); + const relative = path.normalize(dir).slice(root.length).split(path.sep).slice(1); + return path.join(...relative, base); +} +/** + * Gets the root directory of the file path, e.g. `foo` in `/foo/bar`. + * + * @param file - The input file. + * @returns - The root directory. + */ +export function getRootDirectory(file) { + const filePath = getFilePath(file); + const { root, dir } = path.parse(filePath); + return path.normalize(dir).slice(root.length).split(path.sep)[0]; +} +/** + * Get the file mime type. In case the type is not provided, use mime-db and try + * to guess the file type based on the extension. + * + * @param file - The file. + * @returns - The mime type. + */ +export function getFileMimeType(file) { + if (file.type) + return file.type; + let { ext } = path.parse(file.name); + ext = trimPrefix(ext, "."); + if (ext !== "") { + const mimeType = mime.getType(ext); + if (mimeType) { + return mimeType; + } + } + return ""; +} diff --git a/node_modules/skynet-js/dist/mjs/utils/number.d.ts b/node_modules/skynet-js/dist/mjs/utils/number.d.ts new file mode 100644 index 0000000..64cefda --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/number.d.ts @@ -0,0 +1,13 @@ +/** + * The maximum allowed value for an entry revision. Setting an entry revision to this value prevents it from being updated further. + */ +export declare const MAX_REVISION: bigint; +/** + * Checks if the provided bigint can fit in a 64-bit unsigned integer. + * + * @param int - The provided integer. + * @throws - Will throw if the int does not fit in 64 bits. + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN | MDN Demo} + */ +export declare function assertUint64(int: bigint): void; +//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/number.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/number.d.ts.map new file mode 100644 index 0000000..69c925e --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/number.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/utils/number.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAiC,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAU9C"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/number.js b/node_modules/skynet-js/dist/mjs/utils/number.js new file mode 100644 index 0000000..3edd3eb --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/number.js @@ -0,0 +1,21 @@ +import { validateBigint } from "./validation"; +/** + * The maximum allowed value for an entry revision. Setting an entry revision to this value prevents it from being updated further. + */ +export const MAX_REVISION = BigInt("18446744073709551615"); // max uint64 +/** + * Checks if the provided bigint can fit in a 64-bit unsigned integer. + * + * @param int - The provided integer. + * @throws - Will throw if the int does not fit in 64 bits. + * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/asUintN | MDN Demo} + */ +export function assertUint64(int) { + validateBigint("int", int, "parameter"); + if (int < BigInt(0)) { + throw new Error(`Argument ${int} must be an unsigned 64-bit integer; was negative`); + } + if (int > MAX_REVISION) { + throw new Error(`Argument ${int} does not fit in a 64-bit unsigned integer; exceeds 2^64-1`); + } +} diff --git a/node_modules/skynet-js/dist/mjs/utils/options.d.ts b/node_modules/skynet-js/dist/mjs/utils/options.d.ts new file mode 100644 index 0000000..171bd14 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/options.d.ts @@ -0,0 +1,24 @@ +import { CustomClientOptions } from "../client"; +/** + * Base custom options for methods hitting the API. + */ +export declare type BaseCustomOptions = CustomClientOptions; +/** + * The default base custom options. + */ +export declare const defaultBaseOptions: { + APIKey: string; + customUserAgent: string; + customCookie: string; + onUploadProgress: undefined; +}; +/** + * Extract only the model's custom options from the given options. + * + * @param opts - The given options. + * @param model - The model options. + * @returns - The extracted custom options. + * @throws - If the given opts don't contain all properties of the model. + */ +export declare function extractOptions>(opts: Record, model: T): T; +//# sourceMappingURL=options.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/options.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/options.d.ts.map new file mode 100644 index 0000000..f77efc4 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/options.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/utils/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;GAEG;AACH,oBAAY,iBAAiB,GAAG,mBAAmB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAe5G"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/options.js b/node_modules/skynet-js/dist/mjs/utils/options.js new file mode 100644 index 0000000..3aa1ce9 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/options.js @@ -0,0 +1,32 @@ +/** + * The default base custom options. + */ +export const defaultBaseOptions = { + APIKey: "", + customUserAgent: "", + customCookie: "", + onUploadProgress: undefined, +}; +/** + * Extract only the model's custom options from the given options. + * + * @param opts - The given options. + * @param model - The model options. + * @returns - The extracted custom options. + * @throws - If the given opts don't contain all properties of the model. + */ +export function extractOptions(opts, model) { + const result = {}; + for (const property in model) { + /* istanbul ignore next */ + if (!Object.prototype.hasOwnProperty.call(model, property)) { + continue; + } + // Throw if the given options don't contain the model's property. + if (!Object.prototype.hasOwnProperty.call(opts, property)) { + throw new Error(`Property '${property}' not found`); + } + result[property] = opts[property]; + } + return result; +} diff --git a/node_modules/skynet-js/dist/mjs/utils/string.d.ts b/node_modules/skynet-js/dist/mjs/utils/string.d.ts new file mode 100644 index 0000000..80e45da --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/string.d.ts @@ -0,0 +1,81 @@ +/** + * Prepends the prefix to the given string only if the string does not already start with the prefix. + * + * @param str - The string. + * @param prefix - The prefix. + * @returns - The prefixed string. + */ +export declare function ensurePrefix(str: string, prefix: string): string; +/** + * Removes slashes from the beginning and end of the string. + * + * @param str - The string to process. + * @returns - The processed string. + */ +export declare function trimForwardSlash(str: string): string; +/** + * Removes a prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export declare function trimPrefix(str: string, prefix: string, limit?: number): string; +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export declare function trimSuffix(str: string, suffix: string, limit?: number): string; +/** + * Removes a URI prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @returns - The processed string. + */ +export declare function trimUriPrefix(str: string, prefix: string): string; +/** + * Converts a UTF-8 string to a uint8 array containing valid UTF-8 bytes. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a string. + */ +export declare function stringToUint8ArrayUtf8(str: string): Uint8Array; +/** + * Converts a uint8 array containing valid utf-8 bytes to a string. + * + * @param array - The uint8 array to convert. + * @returns - The string. + */ +export declare function uint8ArrayToStringUtf8(array: Uint8Array): string; +/** + * Converts a hex encoded string to a uint8 array. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a valid hex-encoded string or is an empty string. + */ +export declare function hexToUint8Array(str: string): Uint8Array; +/** + * Returns true if the input is a valid hex-encoded string. + * + * @param str - The input string. + * @returns - True if the input is hex-encoded. + * @throws - Will throw if the input is not a string. + */ +export declare function isHexString(str: string): boolean; +/** + * Convert a byte array to a hex string. + * + * @param byteArray - The byte array to convert. + * @returns - The hex string. + * @see {@link https://stackoverflow.com/a/44608819|Stack Overflow} + */ +export declare function toHexString(byteArray: Uint8Array): string; +//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/string.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/string.d.ts.map new file mode 100644 index 0000000..aa9031d --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAGD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9E;AAGD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWjE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAI9D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CASvD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAMzD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/string.js b/node_modules/skynet-js/dist/mjs/utils/string.js new file mode 100644 index 0000000..7a2eb2a --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/string.js @@ -0,0 +1,145 @@ +import { Buffer } from "buffer"; +import { throwValidationError, validateHexString, validateString } from "./validation"; +/** + * Prepends the prefix to the given string only if the string does not already start with the prefix. + * + * @param str - The string. + * @param prefix - The prefix. + * @returns - The prefixed string. + */ +export function ensurePrefix(str, prefix) { + if (!str.startsWith(prefix)) { + str = `${prefix}${str}`; + } + return str; +} +/** + * Removes slashes from the beginning and end of the string. + * + * @param str - The string to process. + * @returns - The processed string. + */ +export function trimForwardSlash(str) { + return trimPrefix(trimSuffix(str, "/"), "/"); +} +// TODO: Move to mysky-utils +/** + * Removes a prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export function trimPrefix(str, prefix, limit) { + while (str.startsWith(prefix)) { + if (limit !== undefined && limit <= 0) { + break; + } + str = str.slice(prefix.length); + if (limit) { + limit -= 1; + } + } + return str; +} +// TODO: Move to mysky-utils +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export function trimSuffix(str, suffix, limit) { + while (str.endsWith(suffix)) { + if (limit !== undefined && limit <= 0) { + break; + } + str = str.substring(0, str.length - suffix.length); + if (limit) { + limit -= 1; + } + } + return str; +} +/** + * Removes a URI prefix from the beginning of the string. + * + * @param str - The string to process. + * @param prefix - The prefix to remove. + * @returns - The processed string. + */ +export function trimUriPrefix(str, prefix) { + const shortPrefix = trimSuffix(prefix, "/"); + if (str.startsWith(prefix)) { + // longPrefix is exactly at the beginning + return str.slice(prefix.length); + } + if (str.startsWith(shortPrefix)) { + // else prefix is exactly at the beginning + return str.slice(shortPrefix.length); + } + return str; +} +/** + * Converts a UTF-8 string to a uint8 array containing valid UTF-8 bytes. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a string. + */ +export function stringToUint8ArrayUtf8(str) { + validateString("str", str, "parameter"); + return Uint8Array.from(Buffer.from(str, "utf-8")); +} +/** + * Converts a uint8 array containing valid utf-8 bytes to a string. + * + * @param array - The uint8 array to convert. + * @returns - The string. + */ +export function uint8ArrayToStringUtf8(array) { + return Buffer.from(array).toString("utf-8"); +} +/** + * Converts a hex encoded string to a uint8 array. + * + * @param str - The string to convert. + * @returns - The uint8 array. + * @throws - Will throw if the input is not a valid hex-encoded string or is an empty string. + */ +export function hexToUint8Array(str) { + validateHexString("str", str, "parameter"); + const matches = str.match(/.{1,2}/g); + if (matches === null) { + throw throwValidationError("str", str, "parameter", "a hex-encoded string"); + } + return new Uint8Array(matches.map((byte) => parseInt(byte, 16))); +} +/** + * Returns true if the input is a valid hex-encoded string. + * + * @param str - The input string. + * @returns - True if the input is hex-encoded. + * @throws - Will throw if the input is not a string. + */ +export function isHexString(str) { + validateString("str", str, "parameter"); + return /^[0-9A-Fa-f]*$/g.test(str); +} +/** + * Convert a byte array to a hex string. + * + * @param byteArray - The byte array to convert. + * @returns - The hex string. + * @see {@link https://stackoverflow.com/a/44608819|Stack Overflow} + */ +export function toHexString(byteArray) { + let s = ""; + byteArray.forEach(function (byte) { + s += ("0" + (byte & 0xff).toString(16)).slice(-2); + }); + return s; +} diff --git a/node_modules/skynet-js/dist/mjs/utils/url.d.ts b/node_modules/skynet-js/dist/mjs/utils/url.d.ts new file mode 100644 index 0000000..6bed9f0 --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/url.d.ts @@ -0,0 +1,60 @@ +export declare const defaultSkynetPortalUrl = "https://siasky.net"; +export declare const uriHandshakePrefix = "hns://"; +export declare const uriSkynetPrefix = "sia://"; +/** + * Returns the default portal URL. + * + * @returns - The portal URL. + */ +export declare function defaultPortalUrl(): string; +/** + * Adds a path to the given URL. + * + * @param url - The URL. + * @param path - The given path. + * @returns - The final URL. + */ +export declare function addPath(url: string, path: string): string; +/** + * Adds a subdomain to the given URL. + * + * @param url - The URL. + * @param subdomain - The subdomain to add. + * @returns - The final URL. + */ +export declare function addSubdomain(url: string, subdomain: string): string; +/** + * Adds a query to the given URL. + * + * @param url - The URL. + * @param query - The query parameters. + * @returns - The final URL. + */ +export declare function addUrlQuery(url: string, query: Record): string; +/** + * Properly joins paths together to create a URL. Takes a variable number of + * arguments. + * + * @param args - Array of URL parts to join. + * @returns - Final URL constructed from the input parts. + */ +export declare function makeUrl(...args: string[]): string; +/** + * Constructs the full URL for the given domain, + * e.g. ("https://siasky.net", "dac.hns/path/file") => "https://dac.hns.siasky.net/path/file" + * + * @param portalUrl - The portal URL. + * @param domain - Domain. + * @returns - The full URL for the given domain. + */ +export declare function getFullDomainUrlForPortal(portalUrl: string, domain: string): string; +/** + * Extracts the domain from the given portal URL, + * e.g. ("https://siasky.net", "dac.hns.siasky.net/path/file") => "dac.hns/path/file" + * + * @param portalUrl - The portal URL. + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +export declare function extractDomainForPortal(portalUrl: string, fullDomain: string): string; +//# sourceMappingURL=url.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/url.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/url.d.ts.map new file mode 100644 index 0000000..24344dc --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/url.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,eAAe,WAAW,CAAC;AAIxC;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBzD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKnE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAM/E;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAKjD;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAwBnF;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAiCpF"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/url.js b/node_modules/skynet-js/dist/mjs/utils/url.js new file mode 100644 index 0000000..cf614cd --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/url.js @@ -0,0 +1,155 @@ +import parse from "url-parse"; +import urljoin from "url-join"; +import { trimForwardSlash, trimSuffix, trimUriPrefix } from "./string"; +import { throwValidationError, validateString } from "./validation"; +export const defaultSkynetPortalUrl = "https://siasky.net"; +export const uriHandshakePrefix = "hns://"; +export const uriSkynetPrefix = "sia://"; +// TODO: This will be smarter. See +// https://github.com/SkynetLabs/skynet-docs/issues/5. +/** + * Returns the default portal URL. + * + * @returns - The portal URL. + */ +export function defaultPortalUrl() { + /* istanbul ignore next */ + if (typeof window === "undefined") + return "/"; // default to path root on ssr + return window.location.origin; +} +/** + * Adds a path to the given URL. + * + * @param url - The URL. + * @param path - The given path. + * @returns - The final URL. + */ +export function addPath(url, path) { + validateString("url", url, "parameter"); + validateString("path", path, "parameter"); + path = trimForwardSlash(path); + let str; + if (url === "localhost") { + // Special handling for localhost. + str = `localhost/${path}`; + } + else { + // Construct a URL object and set the pathname property. + const urlObj = new URL(url); + urlObj.pathname = path; + str = urlObj.toString(); + } + return trimSuffix(str, "/"); +} +/** + * Adds a subdomain to the given URL. + * + * @param url - The URL. + * @param subdomain - The subdomain to add. + * @returns - The final URL. + */ +export function addSubdomain(url, subdomain) { + const urlObj = new URL(url); + urlObj.hostname = `${subdomain}.${urlObj.hostname}`; + const str = urlObj.toString(); + return trimSuffix(str, "/"); +} +/** + * Adds a query to the given URL. + * + * @param url - The URL. + * @param query - The query parameters. + * @returns - The final URL. + */ +export function addUrlQuery(url, query) { + const parsed = parse(url, true); + // Combine the desired query params with the already existing ones. + query = { ...parsed.query, ...query }; + parsed.set("query", query); + return parsed.toString(); +} +/** + * Properly joins paths together to create a URL. Takes a variable number of + * arguments. + * + * @param args - Array of URL parts to join. + * @returns - Final URL constructed from the input parts. + */ +export function makeUrl(...args) { + if (args.length === 0) { + throwValidationError("args", args, "parameter", "non-empty"); + } + return args.reduce((acc, cur) => urljoin(acc, cur)); +} +/** + * Constructs the full URL for the given domain, + * e.g. ("https://siasky.net", "dac.hns/path/file") => "https://dac.hns.siasky.net/path/file" + * + * @param portalUrl - The portal URL. + * @param domain - Domain. + * @returns - The full URL for the given domain. + */ +export function getFullDomainUrlForPortal(portalUrl, domain) { + validateString("portalUrl", portalUrl, "parameter"); + validateString("domain", domain, "parameter"); + domain = trimUriPrefix(domain, uriSkynetPrefix); + domain = trimForwardSlash(domain); + // Split on first / to get the path. + let path; + [domain, path] = domain.split(/\/(.+)/); + // Add to subdomain. + let url; + if (domain === "localhost") { + // Special handling for localhost. + url = "localhost"; + } + else { + url = addSubdomain(portalUrl, domain); + } + // Add back the path if there was one. + if (path) { + url = addPath(url, path); + } + return url; +} +/** + * Extracts the domain from the given portal URL, + * e.g. ("https://siasky.net", "dac.hns.siasky.net/path/file") => "dac.hns/path/file" + * + * @param portalUrl - The portal URL. + * @param fullDomain - Full URL. + * @returns - The extracted domain. + */ +export function extractDomainForPortal(portalUrl, fullDomain) { + validateString("portalUrl", portalUrl, "parameter"); + validateString("fullDomain", fullDomain, "parameter"); + let path; + try { + // Try to extract the domain from the fullDomain. + const fullDomainObj = new URL(fullDomain); + fullDomain = fullDomainObj.hostname; + path = fullDomainObj.pathname; + path = trimForwardSlash(path); + } + catch { + // If fullDomain is not a URL, ignore the error and use it as-is. + // + // Trim any slashes from the input URL. + fullDomain = trimForwardSlash(fullDomain); + // Split on first / to get the path. + [fullDomain, path] = fullDomain.split(/\/(.+)/); + } + // Get the portal domain. + const portalUrlObj = new URL(portalUrl); + const portalDomain = trimForwardSlash(portalUrlObj.hostname); + // Remove the portal domain from the domain. + let domain = trimSuffix(fullDomain, portalDomain, 1); + domain = trimSuffix(domain, "."); + // Add back the path if there is one. + if (path && path !== "") { + path = trimForwardSlash(path); + domain = `${domain}/${path}`; + } + return domain; +} diff --git a/node_modules/skynet-js/dist/mjs/utils/validation.d.ts b/node_modules/skynet-js/dist/mjs/utils/validation.d.ts new file mode 100644 index 0000000..9a31b3f --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/validation.d.ts @@ -0,0 +1,114 @@ +/** + * Validates the given value as a bigint. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid bigint. + */ +export declare function validateBigint(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a boolean. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid boolean. + */ +export declare function validateBoolean(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as an object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid object. + */ +export declare function validateObject(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as an optional object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param model - A model object that contains all possible fields. 'value' does not need to have all fields, but it may not have any fields not contained in 'model'. + * @throws - Will throw if not a valid optional object. + */ +export declare function validateOptionalObject(name: string, value: unknown, valueKind: string, model: Record): void; +/** + * Validates the given value as a number. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid number. + */ +export declare function validateNumber(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a skylink string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @returns - The validated and parsed skylink. + * @throws - Will throw if not a valid skylink string. + */ +export declare function validateSkylinkString(name: string, value: unknown, valueKind: string): string; +/** + * Validates the given value as a string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid string. + */ +export declare function validateString(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a string of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid string of the given length. + */ +export declare function validateStringLen(name: string, value: unknown, valueKind: string, len: number): void; +/** + * Validates the given value as a hex-encoded string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid hex-encoded string. + */ +export declare function validateHexString(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a uint8array. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid uint8array. + */ +export declare function validateUint8Array(name: string, value: unknown, valueKind: string): void; +/** + * Validates the given value as a uint8array of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid uint8array of the given length. + */ +export declare function validateUint8ArrayLen(name: string, value: unknown, valueKind: string, len: number): void; +/** + * Throws an error for the given value + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param expected - The expected aspect of the value that could not be validated (e.g. "type 'string'" or "non-null"). + * @throws - Will always throw. + */ +export declare function throwValidationError(name: string, value: unknown, valueKind: string, expected: string): void; +//# sourceMappingURL=validation.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/validation.d.ts.map b/node_modules/skynet-js/dist/mjs/utils/validation.d.ts.map new file mode 100644 index 0000000..0929ffe --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/validation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIpF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIrF;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAOpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI,CAaN;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS7F;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAMpG;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAKvF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAIxF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAMxG;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAU5G"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/mjs/utils/validation.js b/node_modules/skynet-js/dist/mjs/utils/validation.js new file mode 100644 index 0000000..7ed7f7d --- /dev/null +++ b/node_modules/skynet-js/dist/mjs/utils/validation.js @@ -0,0 +1,190 @@ +import { parseSkylink } from "../skylink/parse"; +import { isHexString } from "./string"; +/** + * Validates the given value as a bigint. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid bigint. + */ +export function validateBigint(name, value, valueKind) { + if (typeof value !== "bigint") { + throwValidationError(name, value, valueKind, "type 'bigint'"); + } +} +/** + * Validates the given value as a boolean. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid boolean. + */ +export function validateBoolean(name, value, valueKind) { + if (typeof value !== "boolean") { + throwValidationError(name, value, valueKind, "type 'boolean'"); + } +} +/** + * Validates the given value as an object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid object. + */ +export function validateObject(name, value, valueKind) { + if (typeof value !== "object") { + throwValidationError(name, value, valueKind, "type 'object'"); + } + if (value === null) { + throwValidationError(name, value, valueKind, "non-null"); + } +} +/** + * Validates the given value as an optional object. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param model - A model object that contains all possible fields. 'value' does not need to have all fields, but it may not have any fields not contained in 'model'. + * @throws - Will throw if not a valid optional object. + */ +export function validateOptionalObject(name, value, valueKind, model) { + if (!value) { + // This is okay, the object is optional. + return; + } + validateObject(name, value, valueKind); + // Check if all given properties of value also exist in the model. + for (const property in value) { + if (!(property in model)) { + throw new Error(`Object ${valueKind} '${name}' contains unexpected property '${property}'`); + } + } +} +/** + * Validates the given value as a number. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid number. + */ +export function validateNumber(name, value, valueKind) { + if (typeof value !== "number") { + throwValidationError(name, value, valueKind, "type 'number'"); + } +} +/** + * Validates the given value as a skylink string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @returns - The validated and parsed skylink. + * @throws - Will throw if not a valid skylink string. + */ +export function validateSkylinkString(name, value, valueKind) { + validateString(name, value, valueKind); + const parsedSkylink = parseSkylink(value); + if (parsedSkylink === null) { + throw throwValidationError(name, value, valueKind, `valid skylink of type 'string'`); + } + return parsedSkylink; +} +/** + * Validates the given value as a string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid string. + */ +export function validateString(name, value, valueKind) { + if (typeof value !== "string") { + throwValidationError(name, value, valueKind, "type 'string'"); + } +} +/** + * Validates the given value as a string of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid string of the given length. + */ +export function validateStringLen(name, value, valueKind, len) { + validateString(name, value, valueKind); + const actualLen = value.length; + if (actualLen !== len) { + throwValidationError(name, value, valueKind, `type 'string' of length ${len}, was length ${actualLen}`); + } +} +/** + * Validates the given value as a hex-encoded string. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid hex-encoded string. + */ +export function validateHexString(name, value, valueKind) { + validateString(name, value, valueKind); + if (!isHexString(value)) { + throwValidationError(name, value, valueKind, "a hex-encoded string"); + } +} +/** + * Validates the given value as a uint8array. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @throws - Will throw if not a valid uint8array. + */ +export function validateUint8Array(name, value, valueKind) { + if (!(value instanceof Uint8Array)) { + throwValidationError(name, value, valueKind, "type 'Uint8Array'"); + } +} +/** + * Validates the given value as a uint8array of the given length. + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param len - The length to check. + * @throws - Will throw if not a valid uint8array of the given length. + */ +export function validateUint8ArrayLen(name, value, valueKind, len) { + validateUint8Array(name, value, valueKind); + const actualLen = value.length; + if (actualLen !== len) { + throwValidationError(name, value, valueKind, `type 'Uint8Array' of length ${len}, was length ${actualLen}`); + } +} +/** + * Throws an error for the given value + * + * @param name - The name of the value. + * @param value - The actual value. + * @param valueKind - The kind of value that is being checked (e.g. "parameter", "response field", etc.) + * @param expected - The expected aspect of the value that could not be validated (e.g. "type 'string'" or "non-null"). + * @throws - Will always throw. + */ +export function throwValidationError(name, value, valueKind, expected) { + let actualValue; + if (value === undefined) { + actualValue = "type 'undefined'"; + } + else if (value === null) { + actualValue = "type 'null'"; + } + else { + actualValue = `type '${typeof value}', value '${value}'`; + } + throw new Error(`Expected ${valueKind} '${name}' to be ${expected}, was ${actualValue}`); +} diff --git a/node_modules/skynet-js/dist/registry.d.ts b/node_modules/skynet-js/dist/registry.d.ts deleted file mode 100644 index a809c00..0000000 --- a/node_modules/skynet-js/dist/registry.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { SkynetClient } from "./client"; -import { Signature } from "./crypto"; -export declare type RegistryEntry = { - datakey: string; - data: string; - revision: number; -}; -export declare type SignedRegistryEntry = { - entry: RegistryEntry; - signature: Signature; -}; -/** - * Gets the registry entry corresponding to the publicKey and dataKey. - * @param publicKey - The user public key. - * @param dataKey - The key of the data to fetch for the given user. - * @param [customOptions={}] - Additional settings that can optionally be set. - * @param [customOptions.timeout=5000] - Timeout in ms for the registry lookup. - */ -export declare function getEntry(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: {}): Promise; -export declare function getEntryUrl(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: {}): string; -export declare function setEntry(this: SkynetClient, privateKey: string, entry: RegistryEntry, customOptions?: {}): Promise; -//# sourceMappingURL=registry.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/registry.d.ts.map b/node_modules/skynet-js/dist/registry.d.ts.map deleted file mode 100644 index 5035442..0000000 --- a/node_modules/skynet-js/dist/registry.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAkC,SAAS,EAAE,MAAM,UAAU,CAAC;AAWrE,oBAAY,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,KAAK,GACjB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAkDrC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,KAAK,GAAG,MAAM,CAgB9G;AAED,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,aAAa,EACpB,aAAa,KAAK,GACjB,OAAO,CAAC,IAAI,CAAC,CAgCf"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/registry.js b/node_modules/skynet-js/dist/registry.js deleted file mode 100644 index 1e7015a..0000000 --- a/node_modules/skynet-js/dist/registry.js +++ /dev/null @@ -1,158 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -exports.__esModule = true; -exports.setEntry = exports.getEntryUrl = exports.getEntry = void 0; -var node_forge_1 = require("node-forge"); -var utils_1 = require("./utils"); -var buffer_1 = require("buffer"); -var crypto_1 = require("./crypto"); -var defaultGetEntryOptions = __assign(__assign({}, utils_1.defaultOptions("/skynet/registry")), { timeout: 5000 }); -var defaultSetEntryOptions = __assign({}, utils_1.defaultOptions("/skynet/registry")); -/** - * Gets the registry entry corresponding to the publicKey and dataKey. - * @param publicKey - The user public key. - * @param dataKey - The key of the data to fetch for the given user. - * @param [customOptions={}] - Additional settings that can optionally be set. - * @param [customOptions.timeout=5000] - Timeout in ms for the registry lookup. - */ -function getEntry(publicKey, dataKey, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, publicKeyBuffer, response, err_1, entry; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign(__assign({}, defaultGetEntryOptions), this.customOptions), customOptions); - publicKeyBuffer = buffer_1.Buffer.from(publicKey, "hex"); - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "get", query: { - publickey: "ed25519:" + publicKey, - datakey: utils_1.toHexString(crypto_1.hashDataKey(dataKey)) - }, timeout: opts.timeout }))]; - case 2: - response = _a.sent(); - return [3 /*break*/, 4]; - case 3: - err_1 = _a.sent(); - // unfortunately axios rejects anything that's not >= 200 and < 300 - return [2 /*return*/, { entry: null, signature: null }]; - case 4: - if (response.status !== 200) { - return [2 /*return*/, { entry: null, signature: null }]; - } - entry = { - entry: { - datakey: dataKey, - data: buffer_1.Buffer.from(utils_1.hexToUint8Array(response.data.data)).toString(), - // TODO: Handle uint64 properly. - revision: parseInt(response.data.revision, 10) - }, - signature: buffer_1.Buffer.from(utils_1.hexToUint8Array(response.data.signature)) - }; - if (entry && - !node_forge_1.pki.ed25519.verify({ - message: crypto_1.hashRegistryEntry(entry.entry), - signature: entry.signature, - publicKey: publicKeyBuffer - })) { - throw new Error("could not verify signature from retrieved, signed registry entry -- possible corrupted entry"); - } - return [2 /*return*/, entry]; - } - }); - }); -} -exports.getEntry = getEntry; -function getEntryUrl(publicKey, dataKey, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - var opts = __assign(__assign(__assign({}, defaultGetEntryOptions), this.customOptions), customOptions); - var query = { - publickey: "ed25519:" + publicKey, - datakey: utils_1.toHexString(crypto_1.hashDataKey(dataKey)) - }; - var url = utils_1.makeUrl(this.portalUrl, opts.endpointPath); - url = utils_1.addUrlQuery(url, query); - return url; -} -exports.getEntryUrl = getEntryUrl; -function setEntry(privateKey, entry, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, privateKeyBuffer, signature, publicKeyBuffer, data; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign(__assign({}, defaultSetEntryOptions), this.customOptions), customOptions); - privateKeyBuffer = buffer_1.Buffer.from(privateKey, "hex"); - signature = node_forge_1.pki.ed25519.sign({ - message: crypto_1.hashRegistryEntry(entry), - privateKey: privateKeyBuffer - }); - publicKeyBuffer = node_forge_1.pki.ed25519.publicKeyFromPrivateKey({ privateKey: privateKeyBuffer }); - data = { - publickey: { - algorithm: "ed25519", - key: Array.from(publicKeyBuffer) - }, - datakey: utils_1.toHexString(crypto_1.hashDataKey(entry.datakey)), - revision: entry.revision, - data: Array.from(buffer_1.Buffer.from(entry.data)), - signature: Array.from(signature) - }; - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "post", data: data }))]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); -} -exports.setEntry = setEntry; diff --git a/node_modules/skynet-js/dist/skydb.d.ts b/node_modules/skynet-js/dist/skydb.d.ts deleted file mode 100644 index 6b8ca99..0000000 --- a/node_modules/skynet-js/dist/skydb.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { SkynetClient } from "./client"; -/** - * Gets the JSON object corresponding to the publicKey and dataKey. - * @param publicKey - The user public key. - * @param dataKey - The key of the data to fetch for the given user. - * @param [customOptions={}] - Additional settings that can optionally be set. - * @param [customOptions.timeout=5000] - Timeout in ms for the registry lookup. - */ -export declare function getJSON(this: SkynetClient, publicKey: string, dataKey: string, customOptions?: {}): Promise<{ - data: Record; - revision: number; -} | null>; -/** - * Sets a JSON object at the registry entry corresponding to the publicKey and dataKey. - */ -export declare function setJSON(this: SkynetClient, privateKey: string, dataKey: string, json: Record, revision?: number, customOptions?: {}): Promise; -//# sourceMappingURL=skydb.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/skydb.d.ts.map b/node_modules/skynet-js/dist/skydb.d.ts.map deleted file mode 100644 index 6173ec2..0000000 --- a/node_modules/skynet-js/dist/skydb.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"skydb.d.ts","sourceRoot":"","sources":["../src/skydb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKxC;;;;;;GAMG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,aAAa,KAAK,GACjB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAuBrE;AAED;;GAEG;AACH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,CAAC,EAAE,MAAM,EACjB,aAAa,KAAK,GACjB,OAAO,CAAC,IAAI,CAAC,CAkCf"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/skydb.js b/node_modules/skynet-js/dist/skydb.js deleted file mode 100644 index a354e21..0000000 --- a/node_modules/skynet-js/dist/skydb.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -exports.__esModule = true; -exports.setJSON = exports.getJSON = void 0; -var node_forge_1 = require("node-forge"); -var utils_1 = require("./utils"); -var buffer_1 = require("buffer"); -/** - * Gets the JSON object corresponding to the publicKey and dataKey. - * @param publicKey - The user public key. - * @param dataKey - The key of the data to fetch for the given user. - * @param [customOptions={}] - Additional settings that can optionally be set. - * @param [customOptions.timeout=5000] - Timeout in ms for the registry lookup. - */ -function getJSON(publicKey, dataKey, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, entry, skylink, response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign({}, this.customOptions), customOptions); - return [4 /*yield*/, this.registry.getEntry(publicKey, dataKey, opts)]; - case 1: - entry = _a.sent(); - if (entry === null) { - return [2 /*return*/, null]; - } - skylink = utils_1.parseSkylink(entry.entry.data); - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "get", url: this.getSkylinkUrl(skylink) }))]; - case 2: - response = _a.sent(); - return [2 /*return*/, { data: response.data, revision: entry.entry.revision }]; - } - }); - }); -} -exports.getJSON = getJSON; -/** - * Sets a JSON object at the registry entry corresponding to the publicKey and dataKey. - */ -function setJSON(privateKey, dataKey, json, revision, customOptions) { - if (customOptions === void 0) { customOptions = {}; } - return __awaiter(this, void 0, void 0, function () { - var opts, privateKeyBuffer, file, skylink, entry_1, publicKey, err_1, entry; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign({}, this.customOptions), customOptions); - privateKeyBuffer = buffer_1.Buffer.from(privateKey, "hex"); - file = new File([JSON.stringify(json)], dataKey, { type: "application/json" }); - return [4 /*yield*/, this.uploadFileRequest(file, opts)]; - case 1: - skylink = (_a.sent()).skylink; - if (!(revision === undefined)) return [3 /*break*/, 5]; - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - publicKey = node_forge_1.pki.ed25519.publicKeyFromPrivateKey({ privateKey: privateKeyBuffer }); - return [4 /*yield*/, this.registry.getEntry(utils_1.toHexString(publicKey), dataKey, opts)]; - case 3: - entry_1 = _a.sent(); - revision = entry_1.entry.revision + 1; - return [3 /*break*/, 5]; - case 4: - err_1 = _a.sent(); - revision = 0; - return [3 /*break*/, 5]; - case 5: - entry = { - datakey: dataKey, - data: utils_1.trimUriPrefix(skylink, utils_1.uriSkynetPrefix), - revision: revision - }; - // update the registry - return [4 /*yield*/, this.registry.setEntry(privateKey, entry)]; - case 6: - // update the registry - _a.sent(); - return [2 /*return*/]; - } - }); - }); -} -exports.setJSON = setJSON; diff --git a/node_modules/skynet-js/dist/upload.d.ts b/node_modules/skynet-js/dist/upload.d.ts deleted file mode 100644 index 6431a45..0000000 --- a/node_modules/skynet-js/dist/upload.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { SkynetClient, CustomClientOptions } from "./client"; -declare type CustomUploadOptions = { - portalFileFieldname?: string; - portalDirectoryFileFieldname?: string; - customFilename?: string; -} & CustomClientOptions; -export declare function uploadFile(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; -export declare function uploadFileRequest(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise; -/** - * Uploads a local directory to Skynet. - * @param {Object} directory - File objects to upload, indexed by their path strings. - * @param {string} filename - The name of the directory. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [config.APIKey] - Authentication password to use. - * @param {string} [config.customUserAgent=""] - Custom user agent header to set. - * @param {string} [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. - * @param {Function} [config.onUploadProgress] - Optional callback to track progress. - * @param {string} [customOptions.portalDirectoryfilefieldname="files[]"] - The fieldName for directory files on the portal. - * @returns {Object} data - The returned data. - * @returns {string} data.skylink - The returned skylink. - * @returns {string} data.merkleroot - The hash that is encoded into the skylink. - * @returns {number} data.bitfield - The bitfield that gets encoded into the skylink. - */ -export declare function uploadDirectory(this: SkynetClient, directory: any, filename: string, customOptions?: CustomUploadOptions): Promise; -export declare function uploadDirectoryRequest(this: SkynetClient, directory: any, filename: string, customOptions?: CustomUploadOptions): Promise; -export {}; -//# sourceMappingURL=upload.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/upload.d.ts.map b/node_modules/skynet-js/dist/upload.d.ts.map deleted file mode 100644 index 2b87aa8..0000000 --- a/node_modules/skynet-js/dist/upload.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../src/upload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE7D,aAAK,mBAAmB,GAAG;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,mBAAmB,CAAC;AASxB,wBAAsB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAIrH;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,IAAI,EACV,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,GAAG,CAAC,CAkBd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,mBAAmB,GAClC,OAAO,CAAC,GAAG,CAAC,CAiBd"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/upload.js b/node_modules/skynet-js/dist/upload.js deleted file mode 100644 index cedd273..0000000 --- a/node_modules/skynet-js/dist/upload.js +++ /dev/null @@ -1,152 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -exports.__esModule = true; -exports.uploadDirectoryRequest = exports.uploadDirectory = exports.uploadFileRequest = exports.uploadFile = void 0; -var utils_1 = require("./utils"); -var defaultUploadOptions = __assign(__assign({}, utils_1.defaultOptions("/skynet/skyfile")), { portalFileFieldname: "file", portalDirectoryFileFieldname: "files[]", customFilename: "" }); -function uploadFile(file, customOptions) { - return __awaiter(this, void 0, void 0, function () { - var response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.uploadFileRequest(file, customOptions)]; - case 1: - response = _a.sent(); - return [2 /*return*/, "" + utils_1.uriSkynetPrefix + response.skylink]; - } - }); - }); -} -exports.uploadFile = uploadFile; -function uploadFileRequest(file, customOptions) { - return __awaiter(this, void 0, void 0, function () { - var opts, formData, data; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign(__assign({}, defaultUploadOptions), this.customOptions), customOptions); - formData = new FormData(); - file = ensureFileObjectConsistency(file); - if (opts.customFilename) { - formData.append(opts.portalFileFieldname, file, opts.customFilename); - } - else { - formData.append(opts.portalFileFieldname, file); - } - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "post", data: formData }))]; - case 1: - data = (_a.sent()).data; - return [2 /*return*/, data]; - } - }); - }); -} -exports.uploadFileRequest = uploadFileRequest; -/** - * Uploads a local directory to Skynet. - * @param {Object} directory - File objects to upload, indexed by their path strings. - * @param {string} filename - The name of the directory. - * @param {Object} [customOptions={}] - Additional settings that can optionally be set. - * @param {string} [config.APIKey] - Authentication password to use. - * @param {string} [config.customUserAgent=""] - Custom user agent header to set. - * @param {string} [customOptions.endpointPath="/skynet/skyfile"] - The relative URL path of the portal endpoint to contact. - * @param {Function} [config.onUploadProgress] - Optional callback to track progress. - * @param {string} [customOptions.portalDirectoryfilefieldname="files[]"] - The fieldName for directory files on the portal. - * @returns {Object} data - The returned data. - * @returns {string} data.skylink - The returned skylink. - * @returns {string} data.merkleroot - The hash that is encoded into the skylink. - * @returns {number} data.bitfield - The bitfield that gets encoded into the skylink. - */ -function uploadDirectory(directory, filename, customOptions) { - return __awaiter(this, void 0, void 0, function () { - var response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.uploadDirectoryRequest(directory, filename, customOptions)]; - case 1: - response = _a.sent(); - return [2 /*return*/, "" + utils_1.uriSkynetPrefix + response.skylink]; - } - }); - }); -} -exports.uploadDirectory = uploadDirectory; -function uploadDirectoryRequest(directory, filename, customOptions) { - return __awaiter(this, void 0, void 0, function () { - var opts, formData, data; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - opts = __assign(__assign(__assign({}, defaultUploadOptions), this.customOptions), customOptions); - formData = new FormData(); - Object.entries(directory).forEach(function (_a) { - var path = _a[0], file = _a[1]; - file = ensureFileObjectConsistency(file); - formData.append(opts.portalDirectoryFileFieldname, file, path); - }); - return [4 /*yield*/, this.executeRequest(__assign(__assign({}, opts), { method: "post", data: formData, query: { filename: filename } }))]; - case 1: - data = (_a.sent()).data; - return [2 /*return*/, data]; - } - }); - }); -} -exports.uploadDirectoryRequest = uploadDirectoryRequest; -/** - * Sometimes file object might have had the type property defined manually with - * Object.defineProperty and some browsers (namely firefox) can have problems - * reading it after the file has been appended to form data. To overcome this, - * we recreate the file object using native File constructor with a type defined - * as a constructor argument. - * Related issue: https://github.com/NebulousLabs/skynet-webportal/issues/290 - */ -function ensureFileObjectConsistency(file) { - return new File([file], file.name, { type: utils_1.getFileMimeType(file) }); -} diff --git a/node_modules/skynet-js/dist/utils.d.ts b/node_modules/skynet-js/dist/utils.d.ts deleted file mode 100644 index f62e411..0000000 --- a/node_modules/skynet-js/dist/utils.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export declare const defaultSkynetPortalUrl = "https://siasky.net"; -export declare const uriHandshakePrefix = "hns:"; -export declare const uriHandshakeResolverPrefix = "hnsres:"; -export declare const uriSkynetPrefix = "sia:"; -export declare function addUrlQuery(url: string, query: Record): string; -export declare function defaultOptions(endpointPath: string): { - endpointPath: string; - APIKey: string; - customUserAgent: string; -}; -export declare function defaultPortalUrl(): string; -export declare function getRelativeFilePath(file: File): string; -export declare function getRootDirectory(file: File): string; -/** - * Properly joins paths together to create a URL. Takes a variable number of - * arguments. - */ -export declare function makeUrl(...args: string[]): string; -export declare function parseSkylink(skylink: string): string; -export declare function trimUriPrefix(str: string, prefix: string): string; -export declare function randomNumber(low: number, high: number): number; -export declare function stringToUint8Array(str: string): Uint8Array; -export declare function hexToUint8Array(str: string): Uint8Array; -/** - * Convert a byte array to a hex string. - * From https://stackoverflow.com/a/44608819. - */ -export declare function toHexString(byteArray: Uint8Array): string; -export declare function readData(file: File): Promise; -/** - * Get the file mime type. In case the type is not provided, use mime-db and try - * to guess the file type based on the extension. - */ -export declare function getFileMimeType(file: File): string; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-js/dist/utils.d.ts.map b/node_modules/skynet-js/dist/utils.d.ts.map deleted file mode 100644 index 1e0c68a..0000000 --- a/node_modules/skynet-js/dist/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,0BAA0B,YAAY,CAAC;AACpD,eAAO,MAAM,eAAe,SAAS,CAAC;AAEtC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAI/E;AAED,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM;;;;EAMlD;AAID,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAWD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMtD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKnD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAEjD;AAOD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAqBpD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWjE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9D;AAGD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAE1D;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAEvD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAMzD;AAID,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC,CAOlE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAWlD"} \ No newline at end of file diff --git a/node_modules/skynet-js/dist/utils.js b/node_modules/skynet-js/dist/utils.js deleted file mode 100644 index 0a50e81..0000000 --- a/node_modules/skynet-js/dist/utils.js +++ /dev/null @@ -1,166 +0,0 @@ -"use strict"; -var __spreadArrays = (this && this.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -exports.__esModule = true; -exports.getFileMimeType = exports.readData = exports.toHexString = exports.hexToUint8Array = exports.stringToUint8Array = exports.randomNumber = exports.trimUriPrefix = exports.parseSkylink = exports.makeUrl = exports.getRootDirectory = exports.getRelativeFilePath = exports.defaultPortalUrl = exports.defaultOptions = exports.addUrlQuery = exports.uriSkynetPrefix = exports.uriHandshakeResolverPrefix = exports.uriHandshakePrefix = exports.defaultSkynetPortalUrl = void 0; -var mime_db_1 = __importDefault(require("mime-db")); -var path_browserify_1 = __importDefault(require("path-browserify")); -var url_parse_1 = __importDefault(require("url-parse")); -var url_join_1 = __importDefault(require("url-join")); -var buffer_1 = require("buffer"); -exports.defaultSkynetPortalUrl = "https://siasky.net"; -exports.uriHandshakePrefix = "hns:"; -exports.uriHandshakeResolverPrefix = "hnsres:"; -exports.uriSkynetPrefix = "sia:"; -function addUrlQuery(url, query) { - var parsed = url_parse_1["default"](url); - parsed.set("query", query); - return parsed.toString(); -} -exports.addUrlQuery = addUrlQuery; -function defaultOptions(endpointPath) { - return { - endpointPath: endpointPath, - APIKey: "", - customUserAgent: "" - }; -} -exports.defaultOptions = defaultOptions; -// TODO: This will be smarter. See -// https://github.com/NebulousLabs/skynet-docs/issues/21. -function defaultPortalUrl() { - if (typeof window === "undefined") - return "/"; // default to path root on ssr - return window.location.origin; -} -exports.defaultPortalUrl = defaultPortalUrl; -function getFilePath(file) { - return file.webkitRelativePath || file.path || file.name; -} -function getRelativeFilePath(file) { - var filePath = getFilePath(file); - var _a = path_browserify_1["default"].parse(filePath), root = _a.root, dir = _a.dir, base = _a.base; - var relative = path_browserify_1["default"].normalize(dir).slice(root.length).split(path_browserify_1["default"].sep).slice(1); - return path_browserify_1["default"].join.apply(path_browserify_1["default"], __spreadArrays(relative, [base])); -} -exports.getRelativeFilePath = getRelativeFilePath; -function getRootDirectory(file) { - var filePath = getFilePath(file); - var _a = path_browserify_1["default"].parse(filePath), root = _a.root, dir = _a.dir; - return path_browserify_1["default"].normalize(dir).slice(root.length).split(path_browserify_1["default"].sep)[0]; -} -exports.getRootDirectory = getRootDirectory; -/** - * Properly joins paths together to create a URL. Takes a variable number of - * arguments. - */ -function makeUrl() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return args.reduce(function (acc, cur) { return url_join_1["default"](acc, cur); }); -} -exports.makeUrl = makeUrl; -var SKYLINK_MATCHER = "([a-zA-Z0-9_-]{46})"; -var SKYLINK_DIRECT_REGEX = new RegExp("^" + SKYLINK_MATCHER + "$"); -var SKYLINK_PATHNAME_REGEX = new RegExp("^/?" + SKYLINK_MATCHER + "([/?].*)?$"); -var SKYLINK_REGEXP_MATCH_POSITION = 1; -function parseSkylink(skylink) { - if (typeof skylink !== "string") - throw new Error("Skylink has to be a string, " + typeof skylink + " provided"); - // check for direct skylink match - var matchDirect = skylink.match(SKYLINK_DIRECT_REGEX); - if (matchDirect) - return matchDirect[SKYLINK_REGEXP_MATCH_POSITION]; - // check for skylink prefixed with sia: or sia:// and extract it - // example: sia:XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg - // example: sia://XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg - skylink = trimUriPrefix(skylink, exports.uriSkynetPrefix); - // check for skylink passed in an url and extract it - // example: https://siasky.net/XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg - // pass empty object as second param to disable using location as base url when parsing in browser - var parsed = url_parse_1["default"](skylink, {}); - var matchPathname = parsed.pathname.match(SKYLINK_PATHNAME_REGEX); - if (matchPathname) - return matchPathname[SKYLINK_REGEXP_MATCH_POSITION]; - throw new Error("Could not extract skylink from '" + skylink + "'"); -} -exports.parseSkylink = parseSkylink; -function trimUriPrefix(str, prefix) { - var longPrefix = prefix + "//"; - if (str.startsWith(longPrefix)) { - // longPrefix is exactly at the beginning - return str.slice(longPrefix.length); - } - if (str.startsWith(prefix)) { - // else prefix is exactly at the beginning - return str.slice(prefix.length); - } - return str; -} -exports.trimUriPrefix = trimUriPrefix; -function randomNumber(low, high) { - return Math.random() * (high - low) + low; -} -exports.randomNumber = randomNumber; -// Converts a string to a uint8 array -function stringToUint8Array(str) { - return Uint8Array.from(buffer_1.Buffer.from(str)); -} -exports.stringToUint8Array = stringToUint8Array; -// Converts a hex encoded string to a uint8 array -function hexToUint8Array(str) { - return new Uint8Array(str.match(/.{1,2}/g).map(function (byte) { return parseInt(byte, 16); })); -} -exports.hexToUint8Array = hexToUint8Array; -/** - * Convert a byte array to a hex string. - * From https://stackoverflow.com/a/44608819. - */ -function toHexString(byteArray) { - var s = ""; - byteArray.forEach(function (byte) { - s += ("0" + (byte & 0xff).toString(16)).slice(-2); - }); - return s; -} -exports.toHexString = toHexString; -// A helper function that uses a FileReader to read the contents of the given -// file -function readData(file) { - return new Promise(function (resolve, reject) { - var reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = function () { return resolve(reader.result); }; - reader.onerror = function (error) { return reject(error); }; - }); -} -exports.readData = readData; -/** - * Get the file mime type. In case the type is not provided, use mime-db and try - * to guess the file type based on the extension. - */ -function getFileMimeType(file) { - var _a, _b; - if (file.type) - return file.type; - var extension = file.name.slice(file.name.lastIndexOf(".") + 1); - if (extension) { - for (var type in mime_db_1["default"]) { - if ((_b = (_a = mime_db_1["default"][type]) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.includes(extension)) { - return type; - } - } - } - return ""; -} -exports.getFileMimeType = getFileMimeType; diff --git a/node_modules/skynet-js/node_modules/axios/CHANGELOG.md b/node_modules/skynet-js/node_modules/axios/CHANGELOG.md index 8c6b7d9..6f11ac1 100644 --- a/node_modules/skynet-js/node_modules/axios/CHANGELOG.md +++ b/node_modules/skynet-js/node_modules/axios/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF (#3410) +- Protocol not parsed when setting proxy config from env vars (#3070) +- Updating axios in types to be lower case (#2797) +- Adding a type guard for `AxiosError` (#2949) + +Internal and Tests: + +- Remove the skipping of the `socket` http test (#3364) +- Use different socket for Win32 test (#3375) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + ### 0.21.0 (October 23, 2020) Fixes and Functionality: diff --git a/node_modules/skynet-js/node_modules/axios/README.md b/node_modules/skynet-js/node_modules/axios/README.md index 620feca..44264f6 100755 --- a/node_modules/skynet-js/node_modules/axios/README.md +++ b/node_modules/skynet-js/node_modules/axios/README.md @@ -422,7 +422,7 @@ These are the available config options for making requests. Only the `url` is re httpAgent: new http.Agent({ keepAlive: true }), httpsAgent: new https.Agent({ keepAlive: true }), - // `proxy` defines the hostname and port of the proxy server. + // `proxy` defines the hostname, port, and protocol of the proxy server. // You can also define your proxy using the conventional `http_proxy` and // `https_proxy` environment variables. If you are using environment variables // for your proxy configuration, you can also define a `no_proxy` environment @@ -432,7 +432,9 @@ These are the available config options for making requests. Only the `url` is re // supplies credentials. // This will set an `Proxy-Authorization` header, overwriting any existing // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. proxy: { + protocol: 'https', host: '127.0.0.1', port: 9000, auth: { diff --git a/node_modules/skynet-js/node_modules/axios/dist/axios.js b/node_modules/skynet-js/node_modules/axios/dist/axios.js index 629fcfd..6dd94bd 100644 --- a/node_modules/skynet-js/node_modules/axios/dist/axios.js +++ b/node_modules/skynet-js/node_modules/axios/dist/axios.js @@ -1,4 +1,4 @@ -/* axios v0.21.0 | (c) 2020 by Matt Zabriskie */ +/* axios v0.21.1 | (c) 2020 by Matt Zabriskie */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -110,6 +110,9 @@ return /******/ (function(modules) { // webpackBootstrap }; axios.spread = __webpack_require__(25); + // Expose isAxiosError + axios.isAxiosError = __webpack_require__(26); + module.exports = axios; // Allow use of default import syntax in TypeScript @@ -1729,6 +1732,23 @@ return /******/ (function(modules) { // webpackBootstrap }; +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + + 'use strict'; + + /** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ + module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); + }; + + /***/ }) /******/ ]) }); diff --git a/node_modules/skynet-js/node_modules/axios/dist/axios.map b/node_modules/skynet-js/node_modules/axios/dist/axios.map index c722a64..6d61f7e 100644 --- a/node_modules/skynet-js/node_modules/axios/dist/axios.map +++ b/node_modules/skynet-js/node_modules/axios/dist/axios.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 6b0707aec88359b2feaf","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/core/Axios.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/buildFullPath.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/core/mergeConfig.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,yC;;;;;;ACAA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;ACpDA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA2B;AAC3B;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,6BAA4B;AAC5B,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;;AAEA,wCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC9VA;;AAEA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;ACVA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA,0BAAyB;AACzB,MAAK;AACL;AACA,EAAC;;AAED;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;;AAED;;;;;;;AC9FA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACrEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B;AAC/B,wCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;;;;;;;AC9EA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,cAAc;AACzB,YAAW,MAAM;AACjB,YAAW,eAAe;AAC1B,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAwE;AACxE;AACA;AACA;AACA,wDAAuD;AACvD;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,QAAO,YAAY;AACnB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;AAED;AACA;AACA,EAAC;;AAED;;;;;;;ACjGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACXA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;;;;;;AClLA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACxBA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;ACjBA;;AAEA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzCA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA0C;AAC1C,UAAS;;AAET;AACA,6DAA4D,wBAAwB;AACpF;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,mCAAkC;AAClC,gCAA+B,aAAa,EAAE;AAC9C;AACA;AACA,MAAK;AACL;;;;;;;ACpDA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACpDA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;;;;;;ACnEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL,4BAA2B;AAC3B,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;;;;;;;ACtFA;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA,YAAW,SAAS;AACpB,cAAa;AACb;AACA;AACA;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6b0707aec88359b2feaf","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 14\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/buildFullPath.js\n// module id = 17\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 18\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 20\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 21\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 0ad9e9f79033ec4fb28f","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/core/Axios.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/buildFullPath.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/core/mergeConfig.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js","webpack:///./lib/helpers/isAxiosError.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA,yC;;;;;;ACAA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;;;;ACvDA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,aAAa;AACxB,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oCAAmC,OAAO;AAC1C;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAuB,SAAS,GAAG,SAAS;AAC5C,4BAA2B;AAC3B;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,6BAA4B;AAC5B,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;;AAEA,wCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC9VA;;AAEA;AACA;AACA;AACA,oBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;ACVA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA,0BAAyB;AACzB,MAAK;AACL;AACA,EAAC;;AAED;AACA;AACA;AACA,iDAAgD;AAChD;AACA;AACA;AACA,MAAK;AACL;AACA,EAAC;;AAED;;;;;;;AC9FA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACrEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB;AACA,aAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;;;;;;;ACnDA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gCAA+B;AAC/B,wCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAG;AACH;;;;;;;AC9EA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,cAAc;AACzB,YAAW,MAAM;AACjB,YAAW,eAAe;AAC1B,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAwE;AACxE;AACA;AACA;AACA,wDAAuD;AACvD;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,QAAO,YAAY;AACnB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,EAAC;;AAED;AACA;AACA,EAAC;;AAED;;;;;;;ACjGA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;;;;;;ACXA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;;;;;;AClLA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACxBA;;AAEA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;ACjBA;;AAEA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzCA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2CAA0C;AAC1C,UAAS;;AAET;AACA,6DAA4D,wBAAwB;AACpF;AACA,UAAS;;AAET;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA,mCAAkC;AAClC,gCAA+B,aAAa,EAAE;AAC9C;AACA;AACA,MAAK;AACL;;;;;;;ACpDA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACnBA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;ACbA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA,IAAG;;AAEH;AACA;;;;;;;ACpDA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,iBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;;;;;;ACnEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL,4BAA2B;AAC3B,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;;AAEH;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;;AAEA;AACA;;;;;;;ACtFA;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACxDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA,YAAW,SAAS;AACpB,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1BA;;AAEA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA","file":"axios.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0ad9e9f79033ec4fb28f","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 14\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/buildFullPath.js\n// module id = 17\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 18\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 20\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 21\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAxiosError.js\n// module id = 26\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/skynet-js/node_modules/axios/dist/axios.min.js b/node_modules/skynet-js/node_modules/axios/dist/axios.min.js index abdb244..fc6c8b6 100644 --- a/node_modules/skynet-js/node_modules/axios/dist/axios.min.js +++ b/node_modules/skynet-js/node_modules/axios/dist/axios.min.js @@ -1,3 +1,3 @@ -/* axios v0.21.0 | (c) 2020 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(4),a=n(22),u=n(10),c=r(u);c.Axios=i,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(9),c.all=function(e){return Promise.all(e)},c.spread=n(25),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"undefined"==typeof e}function s(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"[object ArrayBuffer]"===R.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function c(e){return"string"==typeof e}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function d(e){if("[object Object]"!==R.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Date]"===R.call(e)}function h(e){return"[object File]"===R.call(e)}function m(e){return"[object Blob]"===R.call(e)}function y(e){return"[object Function]"===R.call(e)}function g(e){return p(e)&&y(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function x(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function b(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){u.headers[e]={}}),s.forEach(["post","put","patch"],function(e){u.headers[e]=s.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(13),s=n(16),i=n(5),a=n(17),u=n(20),c=n(21),f=n(14);e.exports=function(e){return new Promise(function(t,n){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+m)}var y=a(e.baseURL,e.url);if(l.open(e.method.toUpperCase(),i(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in l?u(l.getAllResponseHeaders()):null,s=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:s,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};o(t,n,i),l=null}},l.onabort=function(){l&&(n(f("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(f("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(f(t,e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=(e.withCredentials||c(y))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;g&&(d[e.xsrfHeaderName]=g)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),n(e),l=null)}),p||(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";var r=n(18),o=n(19);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?i[t]=(i[t]?i[t]:[]).concat([n]):i[t]=i[t]?i[t]+", "+n:n}}),i):i}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){function n(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function o(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(s[o]=n(void 0,e[o])):s[o]=n(e[o],t[o])}t=t||{};var s={},i=["url","method","data"],a=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],c=["validateStatus"];r.forEach(i,function(e){r.isUndefined(t[e])||(s[e]=n(void 0,t[e]))}),r.forEach(a,o),r.forEach(u,function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(s[o]=n(void 0,e[o])):s[o]=n(void 0,t[o])}),r.forEach(c,function(r){r in t?s[r]=n(e[r],t[r]):r in e&&(s[r]=n(void 0,e[r]))});var f=i.concat(a).concat(u).concat(c),p=Object.keys(e).concat(Object.keys(t)).filter(function(e){return f.indexOf(e)===-1});return r.forEach(p,o),s}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); +/* axios v0.21.1 | (c) 2020 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(4),a=n(22),u=n(10),c=r(u);c.Axios=i,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(9),c.all=function(e){return Promise.all(e)},c.spread=n(25),c.isAxiosError=n(26),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===R.call(e)}function o(e){return"undefined"==typeof e}function s(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"[object ArrayBuffer]"===R.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function c(e){return"string"==typeof e}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function d(e){if("[object Object]"!==R.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Date]"===R.call(e)}function h(e){return"[object File]"===R.call(e)}function m(e){return"[object Blob]"===R.call(e)}function y(e){return"[object Function]"===R.call(e)}function g(e){return p(e)&&y(e.pipe)}function v(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function x(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function w(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function b(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){u.headers[e]={}}),s.forEach(["post","put","patch"],function(e){u.headers[e]=s.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(13),s=n(16),i=n(5),a=n(17),u=n(20),c=n(21),f=n(14);e.exports=function(e){return new Promise(function(t,n){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(h+":"+m)}var y=a(e.baseURL,e.url);if(l.open(e.method.toUpperCase(),i(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in l?u(l.getAllResponseHeaders()):null,s=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:s,status:l.status,statusText:l.statusText,headers:r,config:e,request:l};o(t,n,i),l=null}},l.onabort=function(){l&&(n(f("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){n(f("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(f(t,e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=(e.withCredentials||c(y))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;g&&(d[e.xsrfHeaderName]=g)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),n(e),l=null)}),p||(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";var r=n(18),o=n(19);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?i[t]=(i[t]?i[t]:[]).concat([n]):i[t]=i[t]?i[t]+", "+n:n}}),i):i}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){function n(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function o(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(s[o]=n(void 0,e[o])):s[o]=n(e[o],t[o])}t=t||{};var s={},i=["url","method","data"],a=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],c=["validateStatus"];r.forEach(i,function(e){r.isUndefined(t[e])||(s[e]=n(void 0,t[e]))}),r.forEach(a,o),r.forEach(u,function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(s[o]=n(void 0,e[o])):s[o]=n(void 0,t[o])}),r.forEach(c,function(r){r in t?s[r]=n(e[r],t[r]):r in e&&(s[r]=n(void 0,e[r]))});var f=i.concat(a).concat(u).concat(c),p=Object.keys(e).concat(Object.keys(t)).filter(function(e){return f.indexOf(e)===-1});return r.forEach(p,o),s}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t){"use strict";e.exports=function(e){return"object"==typeof e&&e.isAxiosError===!0}}])}); //# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/skynet-js/node_modules/axios/dist/axios.min.map b/node_modules/skynet-js/node_modules/axios/dist/axios.min.map index e8a9bab..a897631 100644 --- a/node_modules/skynet-js/node_modules/axios/dist/axios.min.map +++ b/node_modules/skynet-js/node_modules/axios/dist/axios.min.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///axios.min.js","webpack:///webpack/bootstrap 5db0cd118db1f73a2dc3","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/core/Axios.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/buildFullPath.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/core/mergeConfig.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","createInstance","defaultConfig","context","Axios","instance","bind","prototype","request","utils","extend","mergeConfig","defaults","axios","create","instanceConfig","Cancel","CancelToken","isCancel","all","promises","Promise","spread","default","isArray","val","toString","isUndefined","isBuffer","constructor","isArrayBuffer","isFormData","FormData","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isObject","isPlainObject","Object","getPrototypeOf","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","navigator","product","window","document","forEach","obj","fn","i","l","length","key","hasOwnProperty","merge","assignValue","slice","arguments","a","b","thisArg","stripBOM","content","charCodeAt","args","Array","apply","interceptors","InterceptorManager","response","buildURL","dispatchRequest","config","url","method","toLowerCase","chain","undefined","promise","resolve","interceptor","unshift","fulfilled","rejected","push","then","shift","getUri","params","paramsSerializer","data","encode","encodeURIComponent","serializedParams","parts","v","toISOString","JSON","stringify","join","hashmarkIndex","indexOf","handlers","use","eject","h","throwIfCancellationRequested","cancelToken","throwIfRequested","transformData","headers","transformRequest","common","adapter","transformResponse","reason","reject","fns","value","__CANCEL__","setContentTypeIfUnset","getDefaultAdapter","XMLHttpRequest","process","normalizeHeaderName","DEFAULT_CONTENT_TYPE","Content-Type","parse","e","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","Accept","normalizedName","name","toUpperCase","settle","cookies","buildFullPath","parseHeaders","isURLSameOrigin","createError","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","open","onreadystatechange","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","send","enhanceError","message","code","error","Error","isAxiosError","toJSON","description","number","fileName","lineNumber","columnNumber","stack","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","concat","resolveURL","href","msie","urlParsingNode","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","originURL","userAgent","createElement","location","requestURL","config1","config2","getMergedValue","target","source","mergeDeepProperties","prop","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","axiosKeys","otherKeys","keys","filter","executor","TypeError","resolvePromise","token","callback","arr"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAAUL,EAAQD,EAASM,GEtDjCL,EAAAD,QAAAM,EAAA,IF4DM,SAAUL,EAAQD,EAASM,GG5DjC,YAcA,SAAAS,GAAAC,GACA,GAAAC,GAAA,GAAAC,GAAAF,GACAG,EAAAC,EAAAF,EAAAG,UAAAC,QAAAL,EAQA,OALAM,GAAAC,OAAAL,EAAAD,EAAAG,UAAAJ,GAGAM,EAAAC,OAAAL,EAAAF,GAEAE,EAtBA,GAAAI,GAAAjB,EAAA,GACAc,EAAAd,EAAA,GACAY,EAAAZ,EAAA,GACAmB,EAAAnB,EAAA,IACAoB,EAAApB,EAAA,IAsBAqB,EAAAZ,EAAAW,EAGAC,GAAAT,QAGAS,EAAAC,OAAA,SAAAC,GACA,MAAAd,GAAAU,EAAAE,EAAAD,SAAAG,KAIAF,EAAAG,OAAAxB,EAAA,IACAqB,EAAAI,YAAAzB,EAAA,IACAqB,EAAAK,SAAA1B,EAAA,GAGAqB,EAAAM,IAAA,SAAAC,GACA,MAAAC,SAAAF,IAAAC,IAEAP,EAAAS,OAAA9B,EAAA,IAEAL,EAAAD,QAAA2B,EAGA1B,EAAAD,QAAAqC,QAAAV,GHmEM,SAAU1B,EAAQD,EAASM,GIvHjC,YAgBA,SAAAgC,GAAAC,GACA,yBAAAC,EAAA7B,KAAA4B,GASA,QAAAE,GAAAF,GACA,yBAAAA,GASA,QAAAG,GAAAH,GACA,cAAAA,IAAAE,EAAAF,IAAA,OAAAA,EAAAI,cAAAF,EAAAF,EAAAI,cACA,kBAAAJ,GAAAI,YAAAD,UAAAH,EAAAI,YAAAD,SAAAH,GASA,QAAAK,GAAAL,GACA,+BAAAC,EAAA7B,KAAA4B,GASA,QAAAM,GAAAN,GACA,yBAAAO,WAAAP,YAAAO,UASA,QAAAC,GAAAR,GACA,GAAAS,EAMA,OAJAA,GADA,mBAAAC,0BAAA,OACAA,YAAAC,OAAAX,GAEA,GAAAA,EAAA,QAAAA,EAAAY,iBAAAF,aAWA,QAAAG,GAAAb,GACA,sBAAAA,GASA,QAAAc,GAAAd,GACA,sBAAAA,GASA,QAAAe,GAAAf,GACA,cAAAA,GAAA,gBAAAA,GASA,QAAAgB,GAAAhB,GACA,uBAAAC,EAAA7B,KAAA4B,GACA,QAGA,IAAAlB,GAAAmC,OAAAC,eAAAlB,EACA,eAAAlB,OAAAmC,OAAAnC,UASA,QAAAqC,GAAAnB,GACA,wBAAAC,EAAA7B,KAAA4B,GASA,QAAAoB,GAAApB,GACA,wBAAAC,EAAA7B,KAAA4B,GASA,QAAAqB,GAAArB,GACA,wBAAAC,EAAA7B,KAAA4B,GASA,QAAAsB,GAAAtB,GACA,4BAAAC,EAAA7B,KAAA4B,GASA,QAAAuB,GAAAvB,GACA,MAAAe,GAAAf,IAAAsB,EAAAtB,EAAAwB,MASA,QAAAC,GAAAzB,GACA,yBAAA0B,kBAAA1B,YAAA0B,iBASA,QAAAC,GAAAC,GACA,MAAAA,GAAAC,QAAA,WAAAA,QAAA,WAkBA,QAAAC,KACA,0BAAAC,YAAA,gBAAAA,UAAAC,SACA,iBAAAD,UAAAC,SACA,OAAAD,UAAAC,WAIA,mBAAAC,SACA,mBAAAC,WAgBA,QAAAC,GAAAC,EAAAC,GAEA,UAAAD,GAAA,mBAAAA,GAUA,GALA,gBAAAA,KAEAA,OAGArC,EAAAqC,GAEA,OAAAE,GAAA,EAAAC,EAAAH,EAAAI,OAAmCF,EAAAC,EAAOD,IAC1CD,EAAAjE,KAAA,KAAAgE,EAAAE,KAAAF,OAIA,QAAAK,KAAAL,GACAnB,OAAAnC,UAAA4D,eAAAtE,KAAAgE,EAAAK,IACAJ,EAAAjE,KAAA,KAAAgE,EAAAK,KAAAL,GAuBA,QAAAO,KAEA,QAAAC,GAAA5C,EAAAyC,GACAzB,EAAAP,EAAAgC,KAAAzB,EAAAhB,GACAS,EAAAgC,GAAAE,EAAAlC,EAAAgC,GAAAzC,GACKgB,EAAAhB,GACLS,EAAAgC,GAAAE,KAA4B3C,GACvBD,EAAAC,GACLS,EAAAgC,GAAAzC,EAAA6C,QAEApC,EAAAgC,GAAAzC,EAIA,OAbAS,MAaA6B,EAAA,EAAAC,EAAAO,UAAAN,OAAuCF,EAAAC,EAAOD,IAC9CH,EAAAW,UAAAR,GAAAM,EAEA,OAAAnC,GAWA,QAAAxB,GAAA8D,EAAAC,EAAAC,GAQA,MAPAd,GAAAa,EAAA,SAAAhD,EAAAyC,GACAQ,GAAA,kBAAAjD,GACA+C,EAAAN,GAAA5D,EAAAmB,EAAAiD,GAEAF,EAAAN,GAAAzC,IAGA+C,EASA,QAAAG,GAAAC,GAIA,MAHA,SAAAA,EAAAC,WAAA,KACAD,IAAAN,MAAA,IAEAM,EAlUA,GAAAtE,GAAAd,EAAA,GAMAkC,EAAAgB,OAAAnC,UAAAmB,QA+TAvC,GAAAD,SACAsC,UACAM,gBACAF,WACAG,aACAE,oBACAK,WACAC,WACAC,WACAC,gBACAd,cACAiB,SACAC,SACAC,SACAC,aACAC,WACAE,oBACAK,uBACAK,UACAQ,QACA1D,SACA0C,OACAuB,aJ+HM,SAAUxF,EAAQD,GK5dxB,YAEAC,GAAAD,QAAA,SAAA4E,EAAAY,GACA,kBAEA,OADAI,GAAA,GAAAC,OAAAR,UAAAN,QACAF,EAAA,EAAmBA,EAAAe,EAAAb,OAAiBF,IACpCe,EAAAf,GAAAQ,UAAAR,EAEA,OAAAD,GAAAkB,MAAAN,EAAAI,MLqeM,SAAU3F,EAAQD,EAASM,GM7ejC,YAaA,SAAAY,GAAAW,GACAzB,KAAAsB,SAAAG,EACAzB,KAAA2F,cACAzE,QAAA,GAAA0E,GACAC,SAAA,GAAAD,IAfA,GAAAzE,GAAAjB,EAAA,GACA4F,EAAA5F,EAAA,GACA0F,EAAA1F,EAAA,GACA6F,EAAA7F,EAAA,GACAmB,EAAAnB,EAAA,GAoBAY,GAAAG,UAAAC,QAAA,SAAA8E,GAGA,gBAAAA,IACAA,EAAAf,UAAA,OACAe,EAAAC,IAAAhB,UAAA,IAEAe,QAGAA,EAAA3E,EAAArB,KAAAsB,SAAA0E,GAGAA,EAAAE,OACAF,EAAAE,OAAAF,EAAAE,OAAAC,cACGnG,KAAAsB,SAAA4E,OACHF,EAAAE,OAAAlG,KAAAsB,SAAA4E,OAAAC,cAEAH,EAAAE,OAAA,KAIA,IAAAE,IAAAL,EAAAM,QACAC,EAAAvE,QAAAwE,QAAAP,EAUA,KARAhG,KAAA2F,aAAAzE,QAAAoD,QAAA,SAAAkC,GACAJ,EAAAK,QAAAD,EAAAE,UAAAF,EAAAG,YAGA3G,KAAA2F,aAAAE,SAAAvB,QAAA,SAAAkC,GACAJ,EAAAQ,KAAAJ,EAAAE,UAAAF,EAAAG,YAGAP,EAAAzB,QACA2B,IAAAO,KAAAT,EAAAU,QAAAV,EAAAU,QAGA,OAAAR,IAGAxF,EAAAG,UAAA8F,OAAA,SAAAf,GAEA,MADAA,GAAA3E,EAAArB,KAAAsB,SAAA0E,GACAF,EAAAE,EAAAC,IAAAD,EAAAgB,OAAAhB,EAAAiB,kBAAAjD,QAAA,WAIA7C,EAAAmD,SAAA,0CAAA4B,GAEApF,EAAAG,UAAAiF,GAAA,SAAAD,EAAAD,GACA,MAAAhG,MAAAkB,QAAAG,EAAA2E,OACAE,SACAD,MACAiB,MAAAlB,OAAyBkB,WAKzB/F,EAAAmD,SAAA,+BAAA4B,GAEApF,EAAAG,UAAAiF,GAAA,SAAAD,EAAAiB,EAAAlB,GACA,MAAAhG,MAAAkB,QAAAG,EAAA2E,OACAE,SACAD,MACAiB,aAKArH,EAAAD,QAAAkB,GNofM,SAAUjB,EAAQD,EAASM,GOllBjC,YAIA,SAAAiH,GAAAhF,GACA,MAAAiF,oBAAAjF,GACA6B,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,aATA,GAAA7C,GAAAjB,EAAA,EAmBAL,GAAAD,QAAA,SAAAqG,EAAAe,EAAAC,GAEA,IAAAD,EACA,MAAAf,EAGA,IAAAoB,EACA,IAAAJ,EACAI,EAAAJ,EAAAD,OACG,IAAA7F,EAAAyC,kBAAAoD,GACHK,EAAAL,EAAA5E,eACG,CACH,GAAAkF,KAEAnG,GAAAmD,QAAA0C,EAAA,SAAA7E,EAAAyC,GACA,OAAAzC,GAAA,mBAAAA,KAIAhB,EAAAe,QAAAC,GACAyC,GAAA,KAEAzC,MAGAhB,EAAAmD,QAAAnC,EAAA,SAAAoF,GACApG,EAAAmC,OAAAiE,GACAA,IAAAC,cACSrG,EAAA+B,SAAAqE,KACTA,EAAAE,KAAAC,UAAAH,IAEAD,EAAAV,KAAAO,EAAAvC,GAAA,IAAAuC,EAAAI,SAIAF,EAAAC,EAAAK,KAAA,KAGA,GAAAN,EAAA,CACA,GAAAO,GAAA3B,EAAA4B,QAAA,IACAD,MAAA,IACA3B,IAAAjB,MAAA,EAAA4C,IAGA3B,MAAA4B,QAAA,mBAAAR,EAGA,MAAApB,KP0lBM,SAAUpG,EAAQD,EAASM,GQ9pBjC,YAIA,SAAA0F,KACA5F,KAAA8H,YAHA,GAAA3G,GAAAjB,EAAA,EAcA0F,GAAA3E,UAAA8G,IAAA,SAAArB,EAAAC,GAKA,MAJA3G,MAAA8H,SAAAlB,MACAF,YACAC,aAEA3G,KAAA8H,SAAAnD,OAAA,GAQAiB,EAAA3E,UAAA+G,MAAA,SAAA3H,GACAL,KAAA8H,SAAAzH,KACAL,KAAA8H,SAAAzH,GAAA,OAYAuF,EAAA3E,UAAAqD,QAAA,SAAAE,GACArD,EAAAmD,QAAAtE,KAAA8H,SAAA,SAAAG,GACA,OAAAA,GACAzD,EAAAyD,MAKApI,EAAAD,QAAAgG,GRqqBM,SAAU/F,EAAQD,EAASM,GSxtBjC,YAUA,SAAAgI,GAAAlC,GACAA,EAAAmC,aACAnC,EAAAmC,YAAAC,mBAVA,GAAAjH,GAAAjB,EAAA,GACAmI,EAAAnI,EAAA,GACA0B,EAAA1B,EAAA,GACAoB,EAAApB,EAAA,GAiBAL,GAAAD,QAAA,SAAAoG,GACAkC,EAAAlC,GAGAA,EAAAsC,QAAAtC,EAAAsC,YAGAtC,EAAAkB,KAAAmB,EACArC,EAAAkB,KACAlB,EAAAsC,QACAtC,EAAAuC,kBAIAvC,EAAAsC,QAAAnH,EAAA2D,MACAkB,EAAAsC,QAAAE,WACAxC,EAAAsC,QAAAtC,EAAAE,YACAF,EAAAsC,SAGAnH,EAAAmD,SACA,qDACA,SAAA4B,SACAF,GAAAsC,QAAApC,IAIA,IAAAuC,GAAAzC,EAAAyC,SAAAnH,EAAAmH,OAEA,OAAAA,GAAAzC,GAAAa,KAAA,SAAAhB,GAUA,MATAqC,GAAAlC,GAGAH,EAAAqB,KAAAmB,EACAxC,EAAAqB,KACArB,EAAAyC,QACAtC,EAAA0C,mBAGA7C,GACG,SAAA8C,GAcH,MAbA/G,GAAA+G,KACAT,EAAAlC,GAGA2C,KAAA9C,WACA8C,EAAA9C,SAAAqB,KAAAmB,EACAM,EAAA9C,SAAAqB,KACAyB,EAAA9C,SAAAyC,QACAtC,EAAA0C,qBAKA3G,QAAA6G,OAAAD,OTiuBM,SAAU9I,EAAQD,EAASM,GU7yBjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAAsH,EAAAoB,EAAAO,GAMA,MAJA1H,GAAAmD,QAAAuE,EAAA,SAAArE,GACA0C,EAAA1C,EAAA0C,EAAAoB,KAGApB,IVqzBM,SAAUrH,EAAQD,GWv0BxB,YAEAC,GAAAD,QAAA,SAAAkJ,GACA,SAAAA,MAAAC,cX+0BM,SAAUlJ,EAAQD,EAASM,GYl1BjC,YASA,SAAA8I,GAAAV,EAAAQ,IACA3H,EAAAkB,YAAAiG,IAAAnH,EAAAkB,YAAAiG,EAAA,mBACAA,EAAA,gBAAAQ,GAIA,QAAAG,KACA,GAAAR,EAQA,OAPA,mBAAAS,gBAEAT,EAAAvI,EAAA,IACG,mBAAAiJ,UAAA,qBAAA/F,OAAAnC,UAAAmB,SAAA7B,KAAA4I,WAEHV,EAAAvI,EAAA,KAEAuI,EAtBA,GAAAtH,GAAAjB,EAAA,GACAkJ,EAAAlJ,EAAA,IAEAmJ,GACAC,eAAA,qCAqBAhI,GACAmH,QAAAQ,IAEAV,kBAAA,SAAArB,EAAAoB,GAGA,MAFAc,GAAAd,EAAA,UACAc,EAAAd,EAAA,gBACAnH,EAAAsB,WAAAyE,IACA/F,EAAAqB,cAAA0E,IACA/F,EAAAmB,SAAA4E,IACA/F,EAAAuC,SAAAwD,IACA/F,EAAAoC,OAAA2D,IACA/F,EAAAqC,OAAA0D,GAEAA,EAEA/F,EAAAwB,kBAAAuE,GACAA,EAAAnE,OAEA5B,EAAAyC,kBAAAsD,IACA8B,EAAAV,EAAA,mDACApB,EAAA9E,YAEAjB,EAAA+B,SAAAgE,IACA8B,EAAAV,EAAA,kCACAb,KAAAC,UAAAR,IAEAA,IAGAwB,mBAAA,SAAAxB,GAEA,mBAAAA,GACA,IACAA,EAAAO,KAAA8B,MAAArC,GACO,MAAAsC,IAEP,MAAAtC,KAOAuC,QAAA,EAEAC,eAAA,aACAC,eAAA,eAEAC,kBAAA,EACAC,eAAA,EAEAC,eAAA,SAAAC,GACA,MAAAA,IAAA,KAAAA,EAAA,KAIAzI,GAAAgH,SACAE,QACAwB,OAAA,sCAIA7I,EAAAmD,SAAA,gCAAA4B,GACA5E,EAAAgH,QAAApC,QAGA/E,EAAAmD,SAAA,+BAAA4B,GACA5E,EAAAgH,QAAApC,GAAA/E,EAAA2D,MAAAuE,KAGAxJ,EAAAD,QAAA0B,GZy1BM,SAAUzB,EAAQD,EAASM,Ga17BjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QAAA,SAAA0I,EAAA2B,GACA9I,EAAAmD,QAAAgE,EAAA,SAAAQ,EAAAoB,GACAA,IAAAD,GAAAC,EAAAC,gBAAAF,EAAAE,gBACA7B,EAAA2B,GAAAnB,QACAR,GAAA4B,Qbo8BM,SAAUrK,EAAQD,EAASM,Gc58BjC,YAEA,IAAAiB,GAAAjB,EAAA,GACAkK,EAAAlK,EAAA,IACAmK,EAAAnK,EAAA,IACA4F,EAAA5F,EAAA,GACAoK,EAAApK,EAAA,IACAqK,EAAArK,EAAA,IACAsK,EAAAtK,EAAA,IACAuK,EAAAvK,EAAA,GAEAL,GAAAD,QAAA,SAAAoG,GACA,UAAAjE,SAAA,SAAAwE,EAAAqC,GACA,GAAA8B,GAAA1E,EAAAkB,KACAyD,EAAA3E,EAAAsC,OAEAnH,GAAAsB,WAAAiI,UACAC,GAAA,eAGA,IAAAzJ,GAAA,GAAAgI,eAGA,IAAAlD,EAAA4E,KAAA,CACA,GAAAC,GAAA7E,EAAA4E,KAAAC,UAAA,GACAC,EAAA9E,EAAA4E,KAAAE,SAAAC,SAAA3D,mBAAApB,EAAA4E,KAAAE,WAAA,EACAH,GAAAK,cAAA,SAAAC,KAAAJ,EAAA,IAAAC,GAGA,GAAAI,GAAAZ,EAAAtE,EAAAmF,QAAAnF,EAAAC,IA4EA,IA3EA/E,EAAAkK,KAAApF,EAAAE,OAAAiE,cAAArE,EAAAoF,EAAAlF,EAAAgB,OAAAhB,EAAAiB,mBAAA,GAGA/F,EAAAuI,QAAAzD,EAAAyD,QAGAvI,EAAAmK,mBAAA,WACA,GAAAnK,GAAA,IAAAA,EAAAoK,aAQA,IAAApK,EAAA6I,QAAA7I,EAAAqK,aAAA,IAAArK,EAAAqK,YAAA1D,QAAA,WAKA,GAAA2D,GAAA,yBAAAtK,GAAAqJ,EAAArJ,EAAAuK,yBAAA,KACAC,EAAA1F,EAAA2F,cAAA,SAAA3F,EAAA2F,aAAAzK,EAAA2E,SAAA3E,EAAA0K,aACA/F,GACAqB,KAAAwE,EACA3B,OAAA7I,EAAA6I,OACA8B,WAAA3K,EAAA2K,WACAvD,QAAAkD,EACAxF,SACA9E,UAGAkJ,GAAA7D,EAAAqC,EAAA/C,GAGA3E,EAAA,OAIAA,EAAA4K,QAAA,WACA5K,IAIA0H,EAAA6B,EAAA,kBAAAzE,EAAA,eAAA9E,IAGAA,EAAA,OAIAA,EAAA6K,QAAA,WAGAnD,EAAA6B,EAAA,gBAAAzE,EAAA,KAAA9E,IAGAA,EAAA,MAIAA,EAAA8K,UAAA,WACA,GAAAC,GAAA,cAAAjG,EAAAyD,QAAA,aACAzD,GAAAiG,sBACAA,EAAAjG,EAAAiG,qBAEArD,EAAA6B,EAAAwB,EAAAjG,EAAA,eACA9E,IAGAA,EAAA,MAMAC,EAAA8C,uBAAA,CAEA,GAAAiI,IAAAlG,EAAAmG,iBAAA3B,EAAAU,KAAAlF,EAAA0D,eACAW,EAAA+B,KAAApG,EAAA0D,gBACArD,MAEA6F,KACAvB,EAAA3E,EAAA2D,gBAAAuC,GAuBA,GAlBA,oBAAAhL,IACAC,EAAAmD,QAAAqG,EAAA,SAAAxI,EAAAyC,GACA,mBAAA8F,IAAA,iBAAA9F,EAAAuB,oBAEAwE,GAAA/F,GAGA1D,EAAAmL,iBAAAzH,EAAAzC,KAMAhB,EAAAkB,YAAA2D,EAAAmG,mBACAjL,EAAAiL,kBAAAnG,EAAAmG,iBAIAnG,EAAA2F,aACA,IACAzK,EAAAyK,aAAA3F,EAAA2F,aACO,MAAAnC,GAGP,YAAAxD,EAAA2F,aACA,KAAAnC,GAMA,kBAAAxD,GAAAsG,oBACApL,EAAAqL,iBAAA,WAAAvG,EAAAsG,oBAIA,kBAAAtG,GAAAwG,kBAAAtL,EAAAuL,QACAvL,EAAAuL,OAAAF,iBAAA,WAAAvG,EAAAwG,kBAGAxG,EAAAmC,aAEAnC,EAAAmC,YAAA7B,QAAAO,KAAA,SAAA6F,GACAxL,IAIAA,EAAAyL,QACA/D,EAAA8D,GAEAxL,EAAA,QAIAwJ,IACAA,EAAA,MAIAxJ,EAAA0L,KAAAlC,Odq9BM,SAAU7K,EAAQD,EAASM,GeroCjC,YAEA,IAAAuK,GAAAvK,EAAA,GASAL,GAAAD,QAAA,SAAA2G,EAAAqC,EAAA/C,GACA,GAAAiE,GAAAjE,EAAAG,OAAA8D,cACAjE,GAAAkE,QAAAD,MAAAjE,EAAAkE,QAGAnB,EAAA6B,EACA,mCAAA5E,EAAAkE,OACAlE,EAAAG,OACA,KACAH,EAAA3E,QACA2E,IAPAU,EAAAV,KfspCM,SAAUhG,EAAQD,EAASM,GgBpqCjC,YAEA,IAAA2M,GAAA3M,EAAA,GAYAL,GAAAD,QAAA,SAAAkN,EAAA9G,EAAA+G,EAAA7L,EAAA2E,GACA,GAAAmH,GAAA,GAAAC,OAAAH,EACA,OAAAD,GAAAG,EAAAhH,EAAA+G,EAAA7L,EAAA2E,KhB4qCM,SAAUhG,EAAQD,GiB5rCxB,YAYAC,GAAAD,QAAA,SAAAoN,EAAAhH,EAAA+G,EAAA7L,EAAA2E,GA4BA,MA3BAmH,GAAAhH,SACA+G,IACAC,EAAAD,QAGAC,EAAA9L,UACA8L,EAAAnH,WACAmH,EAAAE,cAAA,EAEAF,EAAAG,OAAA,WACA,OAEAL,QAAA9M,KAAA8M,QACA5C,KAAAlK,KAAAkK,KAEAkD,YAAApN,KAAAoN,YACAC,OAAArN,KAAAqN,OAEAC,SAAAtN,KAAAsN,SACAC,WAAAvN,KAAAuN,WACAC,aAAAxN,KAAAwN,aACAC,MAAAzN,KAAAyN,MAEAzH,OAAAhG,KAAAgG,OACA+G,KAAA/M,KAAA+M,OAGAC,IjBosCM,SAAUnN,EAAQD,EAASM,GkB5uCjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAA8C,uBAGA,WACA,OACAyJ,MAAA,SAAAxD,EAAApB,EAAA6E,EAAAC,EAAAC,EAAAC,GACA,GAAAC,KACAA,GAAAnH,KAAAsD,EAAA,IAAA9C,mBAAA0B,IAEA3H,EAAA8B,SAAA0K,IACAI,EAAAnH,KAAA,cAAAoH,MAAAL,GAAAM,eAGA9M,EAAA6B,SAAA4K,IACAG,EAAAnH,KAAA,QAAAgH,GAGAzM,EAAA6B,SAAA6K,IACAE,EAAAnH,KAAA,UAAAiH,GAGAC,KAAA,GACAC,EAAAnH,KAAA,UAGAvC,SAAA0J,SAAApG,KAAA,OAGAyE,KAAA,SAAAlC,GACA,GAAAgE,GAAA7J,SAAA0J,OAAAG,MAAA,GAAAC,QAAA,aAA4DjE,EAAA,aAC5D,OAAAgE,GAAAE,mBAAAF,EAAA,UAGAG,OAAA,SAAAnE,GACAlK,KAAA0N,MAAAxD,EAAA,GAAA8D,KAAAM,MAAA,YAMA,WACA,OACAZ,MAAA,aACAtB,KAAA,WAA+B,aAC/BiC,OAAA,kBlBsvCM,SAAUxO,EAAQD,EAASM,GmBvyCjC,YAEA,IAAAqO,GAAArO,EAAA,IACAsO,EAAAtO,EAAA,GAWAL,GAAAD,QAAA,SAAAuL,EAAAsD,GACA,MAAAtD,KAAAoD,EAAAE,GACAD,EAAArD,EAAAsD,GAEAA,InB+yCM,SAAU5O,EAAQD,GoBj0CxB,YAQAC,GAAAD,QAAA,SAAAqG,GAIA,sCAAAyI,KAAAzI,KpBy0CM,SAAUpG,EAAQD,GqBr1CxB,YASAC,GAAAD,QAAA,SAAAuL,EAAAwD,GACA,MAAAA,GACAxD,EAAAnH,QAAA,eAAA2K,EAAA3K,QAAA,WACAmH,IrB61CM,SAAUtL,EAAQD,EAASM,GsBz2CjC,YAEA,IAAAiB,GAAAjB,EAAA,GAIA0O,GACA,6DACA,kEACA,gEACA,qCAgBA/O,GAAAD,QAAA,SAAA0I,GACA,GACA1D,GACAzC,EACAsC,EAHAoK,IAKA,OAAAvG,IAEAnH,EAAAmD,QAAAgE,EAAAwG,MAAA,eAAAC,GAKA,GAJAtK,EAAAsK,EAAAlH,QAAA,KACAjD,EAAAzD,EAAA2C,KAAAiL,EAAAC,OAAA,EAAAvK,IAAA0B,cACAhE,EAAAhB,EAAA2C,KAAAiL,EAAAC,OAAAvK,EAAA,IAEAG,EAAA,CACA,GAAAiK,EAAAjK,IAAAgK,EAAA/G,QAAAjD,IAAA,EACA,MAEA,gBAAAA,EACAiK,EAAAjK,IAAAiK,EAAAjK,GAAAiK,EAAAjK,OAAAqK,QAAA9M,IAEA0M,EAAAjK,GAAAiK,EAAAjK,GAAAiK,EAAAjK,GAAA,KAAAzC,OAKA0M,GAnBiBA,ItBo4CX,SAAUhP,EAAQD,EAASM,GuBp6CjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAA8C,uBAIA,WAWA,QAAAiL,GAAAjJ,GACA,GAAAkJ,GAAAlJ,CAWA,OATAmJ,KAEAC,EAAAC,aAAA,OAAAH,GACAA,EAAAE,EAAAF,MAGAE,EAAAC,aAAA,OAAAH,IAIAA,KAAAE,EAAAF,KACAI,SAAAF,EAAAE,SAAAF,EAAAE,SAAAvL,QAAA,YACAwL,KAAAH,EAAAG,KACAC,OAAAJ,EAAAI,OAAAJ,EAAAI,OAAAzL,QAAA,aACA0L,KAAAL,EAAAK,KAAAL,EAAAK,KAAA1L,QAAA,YACA2L,SAAAN,EAAAM,SACAC,KAAAP,EAAAO,KACAC,SAAA,MAAAR,EAAAQ,SAAAC,OAAA,GACAT,EAAAQ,SACA,IAAAR,EAAAQ,UAhCA,GAEAE,GAFAX,EAAA,kBAAAV,KAAAxK,UAAA8L,WACAX,EAAAhL,SAAA4L,cAAA,IA2CA,OARAF,GAAAb,EAAA9K,OAAA8L,SAAAf,MAQA,SAAAgB,GACA,GAAAtB,GAAA1N,EAAA6B,SAAAmN,GAAAjB,EAAAiB,IACA,OAAAtB,GAAAU,WAAAQ,EAAAR,UACAV,EAAAW,OAAAO,EAAAP,SAKA,WACA,kBACA,cvB86CM,SAAU3P,EAAQD,EAASM,GwB9+CjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAAwQ,EAAAC,GAgBA,QAAAC,GAAAC,EAAAC,GACA,MAAArP,GAAAgC,cAAAoN,IAAApP,EAAAgC,cAAAqN,GACArP,EAAA2D,MAAAyL,EAAAC,GACKrP,EAAAgC,cAAAqN,GACLrP,EAAA2D,SAA2B0L,GACtBrP,EAAAe,QAAAsO,GACLA,EAAAxL,QAEAwL,EAGA,QAAAC,GAAAC,GACAvP,EAAAkB,YAAAgO,EAAAK,IAEKvP,EAAAkB,YAAA+N,EAAAM,MACL1K,EAAA0K,GAAAJ,EAAAjK,OAAA+J,EAAAM,KAFA1K,EAAA0K,GAAAJ,EAAAF,EAAAM,GAAAL,EAAAK,IA3BAL,OACA,IAAArK,MAEA2K,GAAA,uBACAC,GAAA,mCACAC,GACA,oEACA,uFACA,sEACA,0EACA,4DAEAC,GAAA,iBAqBA3P,GAAAmD,QAAAqM,EAAA,SAAAD,GACAvP,EAAAkB,YAAAgO,EAAAK,MACA1K,EAAA0K,GAAAJ,EAAAjK,OAAAgK,EAAAK,OAIAvP,EAAAmD,QAAAsM,EAAAH,GAEAtP,EAAAmD,QAAAuM,EAAA,SAAAH,GACAvP,EAAAkB,YAAAgO,EAAAK,IAEKvP,EAAAkB,YAAA+N,EAAAM,MACL1K,EAAA0K,GAAAJ,EAAAjK,OAAA+J,EAAAM,KAFA1K,EAAA0K,GAAAJ,EAAAjK,OAAAgK,EAAAK,MAMAvP,EAAAmD,QAAAwM,EAAA,SAAAJ,GACAA,IAAAL,GACArK,EAAA0K,GAAAJ,EAAAF,EAAAM,GAAAL,EAAAK,IACKA,IAAAN,KACLpK,EAAA0K,GAAAJ,EAAAjK,OAAA+J,EAAAM,MAIA,IAAAK,GAAAJ,EACA1B,OAAA2B,GACA3B,OAAA4B,GACA5B,OAAA6B,GAEAE,EAAA5N,OACA6N,KAAAb,GACAnB,OAAA7L,OAAA6N,KAAAZ,IACAa,OAAA,SAAAtM,GACA,MAAAmM,GAAAlJ,QAAAjD,MAAA,GAKA,OAFAzD,GAAAmD,QAAA0M,EAAAP,GAEAzK,IxBs/CM,SAAUnG,EAAQD,GyB3kDxB,YAQA,SAAA8B,GAAAoL,GACA9M,KAAA8M,UAGApL,EAAAT,UAAAmB,SAAA,WACA,gBAAApC,KAAA8M,QAAA,KAAA9M,KAAA8M,QAAA,KAGApL,EAAAT,UAAA8H,YAAA,EAEAlJ,EAAAD,QAAA8B,GzBklDM,SAAU7B,EAAQD,EAASM,G0BpmDjC,YAUA,SAAAyB,GAAAwP,GACA,qBAAAA,GACA,SAAAC,WAAA,+BAGA,IAAAC,EACArR,MAAAsG,QAAA,GAAAvE,SAAA,SAAAwE,GACA8K,EAAA9K,GAGA,IAAA+K,GAAAtR,IACAmR,GAAA,SAAArE,GACAwE,EAAA3I,SAKA2I,EAAA3I,OAAA,GAAAjH,GAAAoL,GACAuE,EAAAC,EAAA3I,WA1BA,GAAAjH,GAAAxB,EAAA,GAiCAyB,GAAAV,UAAAmH,iBAAA,WACA,GAAApI,KAAA2I,OACA,KAAA3I,MAAA2I,QAQAhH,EAAA6O,OAAA,WACA,GAAA9D,GACA4E,EAAA,GAAA3P,GAAA,SAAAlB,GACAiM,EAAAjM,GAEA,QACA6Q,QACA5E,WAIA7M,EAAAD,QAAA+B,G1B2mDM,SAAU9B,EAAQD,G2BnqDxB,YAsBAC,GAAAD,QAAA,SAAA2R,GACA,gBAAAC,GACA,MAAAD,GAAA7L,MAAA,KAAA8L","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar bind = __webpack_require__(3);\n\tvar Axios = __webpack_require__(4);\n\tvar mergeConfig = __webpack_require__(22);\n\tvar defaults = __webpack_require__(10);\n\t\n\t/**\n\t * Create an instance of Axios\n\t *\n\t * @param {Object} defaultConfig The default config for the instance\n\t * @return {Axios} A new instance of Axios\n\t */\n\tfunction createInstance(defaultConfig) {\n\t var context = new Axios(defaultConfig);\n\t var instance = bind(Axios.prototype.request, context);\n\t\n\t // Copy axios.prototype to instance\n\t utils.extend(instance, Axios.prototype, context);\n\t\n\t // Copy context to instance\n\t utils.extend(instance, context);\n\t\n\t return instance;\n\t}\n\t\n\t// Create the default instance to be exported\n\tvar axios = createInstance(defaults);\n\t\n\t// Expose Axios class to allow class inheritance\n\taxios.Axios = Axios;\n\t\n\t// Factory for creating new instances\n\taxios.create = function create(instanceConfig) {\n\t return createInstance(mergeConfig(axios.defaults, instanceConfig));\n\t};\n\t\n\t// Expose Cancel & CancelToken\n\taxios.Cancel = __webpack_require__(23);\n\taxios.CancelToken = __webpack_require__(24);\n\taxios.isCancel = __webpack_require__(9);\n\t\n\t// Expose all/spread\n\taxios.all = function all(promises) {\n\t return Promise.all(promises);\n\t};\n\taxios.spread = __webpack_require__(25);\n\t\n\tmodule.exports = axios;\n\t\n\t// Allow use of default import syntax in TypeScript\n\tmodule.exports.default = axios;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar bind = __webpack_require__(3);\n\t\n\t/*global toString:true*/\n\t\n\t// utils is a library of generic helper functions non-specific to axios\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * Determine if a value is an Array\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Array, otherwise false\n\t */\n\tfunction isArray(val) {\n\t return toString.call(val) === '[object Array]';\n\t}\n\t\n\t/**\n\t * Determine if a value is undefined\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if the value is undefined, otherwise false\n\t */\n\tfunction isUndefined(val) {\n\t return typeof val === 'undefined';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Buffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Buffer, otherwise false\n\t */\n\tfunction isBuffer(val) {\n\t return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n\t && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n\t}\n\t\n\t/**\n\t * Determine if a value is an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBuffer(val) {\n\t return toString.call(val) === '[object ArrayBuffer]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a FormData\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an FormData, otherwise false\n\t */\n\tfunction isFormData(val) {\n\t return (typeof FormData !== 'undefined') && (val instanceof FormData);\n\t}\n\t\n\t/**\n\t * Determine if a value is a view on an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBufferView(val) {\n\t var result;\n\t if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n\t result = ArrayBuffer.isView(val);\n\t } else {\n\t result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Determine if a value is a String\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a String, otherwise false\n\t */\n\tfunction isString(val) {\n\t return typeof val === 'string';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Number\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Number, otherwise false\n\t */\n\tfunction isNumber(val) {\n\t return typeof val === 'number';\n\t}\n\t\n\t/**\n\t * Determine if a value is an Object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Object, otherwise false\n\t */\n\tfunction isObject(val) {\n\t return val !== null && typeof val === 'object';\n\t}\n\t\n\t/**\n\t * Determine if a value is a plain Object\n\t *\n\t * @param {Object} val The value to test\n\t * @return {boolean} True if value is a plain Object, otherwise false\n\t */\n\tfunction isPlainObject(val) {\n\t if (toString.call(val) !== '[object Object]') {\n\t return false;\n\t }\n\t\n\t var prototype = Object.getPrototypeOf(val);\n\t return prototype === null || prototype === Object.prototype;\n\t}\n\t\n\t/**\n\t * Determine if a value is a Date\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Date, otherwise false\n\t */\n\tfunction isDate(val) {\n\t return toString.call(val) === '[object Date]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a File\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a File, otherwise false\n\t */\n\tfunction isFile(val) {\n\t return toString.call(val) === '[object File]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Blob\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Blob, otherwise false\n\t */\n\tfunction isBlob(val) {\n\t return toString.call(val) === '[object Blob]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Function\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Function, otherwise false\n\t */\n\tfunction isFunction(val) {\n\t return toString.call(val) === '[object Function]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Stream\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Stream, otherwise false\n\t */\n\tfunction isStream(val) {\n\t return isObject(val) && isFunction(val.pipe);\n\t}\n\t\n\t/**\n\t * Determine if a value is a URLSearchParams object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n\t */\n\tfunction isURLSearchParams(val) {\n\t return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n\t}\n\t\n\t/**\n\t * Trim excess whitespace off the beginning and end of a string\n\t *\n\t * @param {String} str The String to trim\n\t * @returns {String} The String freed of excess whitespace\n\t */\n\tfunction trim(str) {\n\t return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\t}\n\t\n\t/**\n\t * Determine if we're running in a standard browser environment\n\t *\n\t * This allows axios to run in a web worker, and react-native.\n\t * Both environments support XMLHttpRequest, but not fully standard globals.\n\t *\n\t * web workers:\n\t * typeof window -> undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * navigator.product -> 'ReactNative'\n\t * nativescript\n\t * navigator.product -> 'NativeScript' or 'NS'\n\t */\n\tfunction isStandardBrowserEnv() {\n\t if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n\t navigator.product === 'NativeScript' ||\n\t navigator.product === 'NS')) {\n\t return false;\n\t }\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object') {\n\t /*eslint no-param-reassign:0*/\n\t obj = [obj];\n\t }\n\t\n\t if (isArray(obj)) {\n\t // Iterate over array values\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t } else {\n\t // Iterate over object keys\n\t for (var key in obj) {\n\t if (Object.prototype.hasOwnProperty.call(obj, key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t if (isPlainObject(result[key]) && isPlainObject(val)) {\n\t result[key] = merge(result[key], val);\n\t } else if (isPlainObject(val)) {\n\t result[key] = merge({}, val);\n\t } else if (isArray(val)) {\n\t result[key] = val.slice();\n\t } else {\n\t result[key] = val;\n\t }\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Extends object a by mutably adding to it the properties of object b.\n\t *\n\t * @param {Object} a The object to be extended\n\t * @param {Object} b The object to copy properties from\n\t * @param {Object} thisArg The object to bind function to\n\t * @return {Object} The resulting value of object a\n\t */\n\tfunction extend(a, b, thisArg) {\n\t forEach(b, function assignValue(val, key) {\n\t if (thisArg && typeof val === 'function') {\n\t a[key] = bind(val, thisArg);\n\t } else {\n\t a[key] = val;\n\t }\n\t });\n\t return a;\n\t}\n\t\n\t/**\n\t * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n\t *\n\t * @param {string} content with BOM\n\t * @return {string} content value without BOM\n\t */\n\tfunction stripBOM(content) {\n\t if (content.charCodeAt(0) === 0xFEFF) {\n\t content = content.slice(1);\n\t }\n\t return content;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isBuffer: isBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isPlainObject: isPlainObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isFunction: isFunction,\n\t isStream: isStream,\n\t isURLSearchParams: isURLSearchParams,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t extend: extend,\n\t trim: trim,\n\t stripBOM: stripBOM\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function bind(fn, thisArg) {\n\t return function wrap() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t return fn.apply(thisArg, args);\n\t };\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar buildURL = __webpack_require__(5);\n\tvar InterceptorManager = __webpack_require__(6);\n\tvar dispatchRequest = __webpack_require__(7);\n\tvar mergeConfig = __webpack_require__(22);\n\t\n\t/**\n\t * Create a new instance of Axios\n\t *\n\t * @param {Object} instanceConfig The default config for the instance\n\t */\n\tfunction Axios(instanceConfig) {\n\t this.defaults = instanceConfig;\n\t this.interceptors = {\n\t request: new InterceptorManager(),\n\t response: new InterceptorManager()\n\t };\n\t}\n\t\n\t/**\n\t * Dispatch a request\n\t *\n\t * @param {Object} config The config specific for this request (merged with this.defaults)\n\t */\n\tAxios.prototype.request = function request(config) {\n\t /*eslint no-param-reassign:0*/\n\t // Allow for axios('example/url'[, config]) a la fetch API\n\t if (typeof config === 'string') {\n\t config = arguments[1] || {};\n\t config.url = arguments[0];\n\t } else {\n\t config = config || {};\n\t }\n\t\n\t config = mergeConfig(this.defaults, config);\n\t\n\t // Set config.method\n\t if (config.method) {\n\t config.method = config.method.toLowerCase();\n\t } else if (this.defaults.method) {\n\t config.method = this.defaults.method.toLowerCase();\n\t } else {\n\t config.method = 'get';\n\t }\n\t\n\t // Hook up interceptors middleware\n\t var chain = [dispatchRequest, undefined];\n\t var promise = Promise.resolve(config);\n\t\n\t this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n\t chain.unshift(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n\t chain.push(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t while (chain.length) {\n\t promise = promise.then(chain.shift(), chain.shift());\n\t }\n\t\n\t return promise;\n\t};\n\t\n\tAxios.prototype.getUri = function getUri(config) {\n\t config = mergeConfig(this.defaults, config);\n\t return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n\t};\n\t\n\t// Provide aliases for supported request methods\n\tutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, config) {\n\t return this.request(mergeConfig(config || {}, {\n\t method: method,\n\t url: url,\n\t data: (config || {}).data\n\t }));\n\t };\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, data, config) {\n\t return this.request(mergeConfig(config || {}, {\n\t method: method,\n\t url: url,\n\t data: data\n\t }));\n\t };\n\t});\n\t\n\tmodule.exports = Axios;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildURL(url, params, paramsSerializer) {\n\t /*eslint no-param-reassign:0*/\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var serializedParams;\n\t if (paramsSerializer) {\n\t serializedParams = paramsSerializer(params);\n\t } else if (utils.isURLSearchParams(params)) {\n\t serializedParams = params.toString();\n\t } else {\n\t var parts = [];\n\t\n\t utils.forEach(params, function serialize(val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t } else {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function parseValue(v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t } else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t serializedParams = parts.join('&');\n\t }\n\t\n\t if (serializedParams) {\n\t var hashmarkIndex = url.indexOf('#');\n\t if (hashmarkIndex !== -1) {\n\t url = url.slice(0, hashmarkIndex);\n\t }\n\t\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n\t }\n\t\n\t return url;\n\t};\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function eject(id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `eject`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function forEach(fn) {\n\t utils.forEach(this.handlers, function forEachHandler(h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar transformData = __webpack_require__(8);\n\tvar isCancel = __webpack_require__(9);\n\tvar defaults = __webpack_require__(10);\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tfunction throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}\n\t\n\t/**\n\t * Dispatch a request to the server using the configured adapter.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Ensure headers exist\n\t config.headers = config.headers || {};\n\t\n\t // Transform request data\n\t config.data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Flatten headers\n\t config.headers = utils.merge(\n\t config.headers.common || {},\n\t config.headers[config.method] || {},\n\t config.headers\n\t );\n\t\n\t utils.forEach(\n\t ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n\t function cleanHeaderConfig(method) {\n\t delete config.headers[method];\n\t }\n\t );\n\t\n\t var adapter = config.adapter || defaults.adapter;\n\t\n\t return adapter(config).then(function onAdapterResolution(response) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t response.data = transformData(\n\t response.data,\n\t response.headers,\n\t config.transformResponse\n\t );\n\t\n\t return response;\n\t }, function onAdapterRejection(reason) {\n\t if (!isCancel(reason)) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t if (reason && reason.response) {\n\t reason.response.data = transformData(\n\t reason.response.data,\n\t reason.response.headers,\n\t config.transformResponse\n\t );\n\t }\n\t }\n\t\n\t return Promise.reject(reason);\n\t });\n\t};\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t /*eslint no-param-reassign:0*/\n\t utils.forEach(fns, function transform(fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function isCancel(value) {\n\t return !!(value && value.__CANCEL__);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar normalizeHeaderName = __webpack_require__(11);\n\t\n\tvar DEFAULT_CONTENT_TYPE = {\n\t 'Content-Type': 'application/x-www-form-urlencoded'\n\t};\n\t\n\tfunction setContentTypeIfUnset(headers, value) {\n\t if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n\t headers['Content-Type'] = value;\n\t }\n\t}\n\t\n\tfunction getDefaultAdapter() {\n\t var adapter;\n\t if (typeof XMLHttpRequest !== 'undefined') {\n\t // For browsers use XHR adapter\n\t adapter = __webpack_require__(12);\n\t } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n\t // For node use HTTP adapter\n\t adapter = __webpack_require__(12);\n\t }\n\t return adapter;\n\t}\n\t\n\tvar defaults = {\n\t adapter: getDefaultAdapter(),\n\t\n\t transformRequest: [function transformRequest(data, headers) {\n\t normalizeHeaderName(headers, 'Accept');\n\t normalizeHeaderName(headers, 'Content-Type');\n\t if (utils.isFormData(data) ||\n\t utils.isArrayBuffer(data) ||\n\t utils.isBuffer(data) ||\n\t utils.isStream(data) ||\n\t utils.isFile(data) ||\n\t utils.isBlob(data)\n\t ) {\n\t return data;\n\t }\n\t if (utils.isArrayBufferView(data)) {\n\t return data.buffer;\n\t }\n\t if (utils.isURLSearchParams(data)) {\n\t setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n\t return data.toString();\n\t }\n\t if (utils.isObject(data)) {\n\t setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n\t return JSON.stringify(data);\n\t }\n\t return data;\n\t }],\n\t\n\t transformResponse: [function transformResponse(data) {\n\t /*eslint no-param-reassign:0*/\n\t if (typeof data === 'string') {\n\t try {\n\t data = JSON.parse(data);\n\t } catch (e) { /* Ignore */ }\n\t }\n\t return data;\n\t }],\n\t\n\t /**\n\t * A timeout in milliseconds to abort a request. If set to 0 (default) a\n\t * timeout is not created.\n\t */\n\t timeout: 0,\n\t\n\t xsrfCookieName: 'XSRF-TOKEN',\n\t xsrfHeaderName: 'X-XSRF-TOKEN',\n\t\n\t maxContentLength: -1,\n\t maxBodyLength: -1,\n\t\n\t validateStatus: function validateStatus(status) {\n\t return status >= 200 && status < 300;\n\t }\n\t};\n\t\n\tdefaults.headers = {\n\t common: {\n\t 'Accept': 'application/json, text/plain, */*'\n\t }\n\t};\n\t\n\tutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n\t defaults.headers[method] = {};\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n\t});\n\t\n\tmodule.exports = defaults;\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n\t utils.forEach(headers, function processHeader(value, name) {\n\t if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n\t headers[normalizedName] = value;\n\t delete headers[name];\n\t }\n\t });\n\t};\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar settle = __webpack_require__(13);\n\tvar cookies = __webpack_require__(16);\n\tvar buildURL = __webpack_require__(5);\n\tvar buildFullPath = __webpack_require__(17);\n\tvar parseHeaders = __webpack_require__(20);\n\tvar isURLSameOrigin = __webpack_require__(21);\n\tvar createError = __webpack_require__(14);\n\t\n\tmodule.exports = function xhrAdapter(config) {\n\t return new Promise(function dispatchXhrRequest(resolve, reject) {\n\t var requestData = config.data;\n\t var requestHeaders = config.headers;\n\t\n\t if (utils.isFormData(requestData)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t var request = new XMLHttpRequest();\n\t\n\t // HTTP basic authentication\n\t if (config.auth) {\n\t var username = config.auth.username || '';\n\t var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n\t requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n\t }\n\t\n\t var fullPath = buildFullPath(config.baseURL, config.url);\n\t request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request.onreadystatechange = function handleLoad() {\n\t if (!request || request.readyState !== 4) {\n\t return;\n\t }\n\t\n\t // The request errored out and we didn't get a response, this will be\n\t // handled by onerror instead\n\t // With one exception: request that using file: protocol, most browsers\n\t // will return status as 0 even though it's a successful request\n\t if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n\t return;\n\t }\n\t\n\t // Prepare the response\n\t var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n\t var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n\t var response = {\n\t data: responseData,\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config,\n\t request: request\n\t };\n\t\n\t settle(resolve, reject, response);\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle browser request cancellation (as opposed to a manual cancellation)\n\t request.onabort = function handleAbort() {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle low level network errors\n\t request.onerror = function handleError() {\n\t // Real errors are hidden from us by the browser\n\t // onerror should only fire if it's a network error\n\t reject(createError('Network Error', config, null, request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle timeout\n\t request.ontimeout = function handleTimeout() {\n\t var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n\t if (config.timeoutErrorMessage) {\n\t timeoutErrorMessage = config.timeoutErrorMessage;\n\t }\n\t reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n\t request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t // Add xsrf header\n\t var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n\t cookies.read(config.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t if ('setRequestHeader' in request) {\n\t utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n\t if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n\t // Remove Content-Type if data is undefined\n\t delete requestHeaders[key];\n\t } else {\n\t // Otherwise add header to the request\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t }\n\t\n\t // Add withCredentials to request if needed\n\t if (!utils.isUndefined(config.withCredentials)) {\n\t request.withCredentials = !!config.withCredentials;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n\t // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n\t if (config.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t // Handle progress if needed\n\t if (typeof config.onDownloadProgress === 'function') {\n\t request.addEventListener('progress', config.onDownloadProgress);\n\t }\n\t\n\t // Not all browsers support upload events\n\t if (typeof config.onUploadProgress === 'function' && request.upload) {\n\t request.upload.addEventListener('progress', config.onUploadProgress);\n\t }\n\t\n\t if (config.cancelToken) {\n\t // Handle cancellation\n\t config.cancelToken.promise.then(function onCanceled(cancel) {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t request.abort();\n\t reject(cancel);\n\t // Clean up request\n\t request = null;\n\t });\n\t }\n\t\n\t if (!requestData) {\n\t requestData = null;\n\t }\n\t\n\t // Send the request\n\t request.send(requestData);\n\t });\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar createError = __webpack_require__(14);\n\t\n\t/**\n\t * Resolve or reject a Promise based on response status.\n\t *\n\t * @param {Function} resolve A function that resolves the promise.\n\t * @param {Function} reject A function that rejects the promise.\n\t * @param {object} response The response.\n\t */\n\tmodule.exports = function settle(resolve, reject, response) {\n\t var validateStatus = response.config.validateStatus;\n\t if (!response.status || !validateStatus || validateStatus(response.status)) {\n\t resolve(response);\n\t } else {\n\t reject(createError(\n\t 'Request failed with status code ' + response.status,\n\t response.config,\n\t null,\n\t response.request,\n\t response\n\t ));\n\t }\n\t};\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar enhanceError = __webpack_require__(15);\n\t\n\t/**\n\t * Create an Error with the specified message, config, error code, request and response.\n\t *\n\t * @param {string} message The error message.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The created error.\n\t */\n\tmodule.exports = function createError(message, config, code, request, response) {\n\t var error = new Error(message);\n\t return enhanceError(error, config, code, request, response);\n\t};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Update an Error with the specified config, error code, and response.\n\t *\n\t * @param {Error} error The error to update.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The error.\n\t */\n\tmodule.exports = function enhanceError(error, config, code, request, response) {\n\t error.config = config;\n\t if (code) {\n\t error.code = code;\n\t }\n\t\n\t error.request = request;\n\t error.response = response;\n\t error.isAxiosError = true;\n\t\n\t error.toJSON = function toJSON() {\n\t return {\n\t // Standard\n\t message: this.message,\n\t name: this.name,\n\t // Microsoft\n\t description: this.description,\n\t number: this.number,\n\t // Mozilla\n\t fileName: this.fileName,\n\t lineNumber: this.lineNumber,\n\t columnNumber: this.columnNumber,\n\t stack: this.stack,\n\t // Axios\n\t config: this.config,\n\t code: this.code\n\t };\n\t };\n\t return error;\n\t};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs support document.cookie\n\t (function standardBrowserEnv() {\n\t return {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t };\n\t })() :\n\t\n\t // Non standard browser env (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return {\n\t write: function write() {},\n\t read: function read() { return null; },\n\t remove: function remove() {}\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar isAbsoluteURL = __webpack_require__(18);\n\tvar combineURLs = __webpack_require__(19);\n\t\n\t/**\n\t * Creates a new URL by combining the baseURL with the requestedURL,\n\t * only when the requestedURL is not already an absolute URL.\n\t * If the requestURL is absolute, this function returns the requestedURL untouched.\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} requestedURL Absolute or relative URL to combine\n\t * @returns {string} The combined full path\n\t */\n\tmodule.exports = function buildFullPath(baseURL, requestedURL) {\n\t if (baseURL && !isAbsoluteURL(requestedURL)) {\n\t return combineURLs(baseURL, requestedURL);\n\t }\n\t return requestedURL;\n\t};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the specified URL is absolute\n\t *\n\t * @param {string} url The URL to test\n\t * @returns {boolean} True if the specified URL is absolute, otherwise false\n\t */\n\tmodule.exports = function isAbsoluteURL(url) {\n\t // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n\t // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n\t // by any combination of letters, digits, plus, period, or hyphen.\n\t return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n\t};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Creates a new URL by combining the specified URLs\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} relativeURL The relative URL\n\t * @returns {string} The combined URL\n\t */\n\tmodule.exports = function combineURLs(baseURL, relativeURL) {\n\t return relativeURL\n\t ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n\t : baseURL;\n\t};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t// Headers whose duplicates are ignored by node\n\t// c.f. https://nodejs.org/api/http.html#http_message_headers\n\tvar ignoreDuplicateOf = [\n\t 'age', 'authorization', 'content-length', 'content-type', 'etag',\n\t 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n\t 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n\t 'referer', 'retry-after', 'user-agent'\n\t];\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {};\n\t var key;\n\t var val;\n\t var i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function parser(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n\t return;\n\t }\n\t if (key === 'set-cookie') {\n\t parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n\t } else {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs have full support of the APIs needed to test\n\t // whether the request URL is of the same origin as current location.\n\t (function standardBrowserEnv() {\n\t var msie = /(msie|trident)/i.test(navigator.userAgent);\n\t var urlParsingNode = document.createElement('a');\n\t var originURL;\n\t\n\t /**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\t function resolveURL(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t }\n\t\n\t originURL = resolveURL(window.location.href);\n\t\n\t /**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestURL The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\t return function isURLSameOrigin(requestURL) {\n\t var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n\t return (parsed.protocol === originURL.protocol &&\n\t parsed.host === originURL.host);\n\t };\n\t })() :\n\t\n\t // Non standard browser envs (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return function isURLSameOrigin() {\n\t return true;\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Config-specific merge-function which creates a new config-object\n\t * by merging two configuration objects together.\n\t *\n\t * @param {Object} config1\n\t * @param {Object} config2\n\t * @returns {Object} New object resulting from merging config2 to config1\n\t */\n\tmodule.exports = function mergeConfig(config1, config2) {\n\t // eslint-disable-next-line no-param-reassign\n\t config2 = config2 || {};\n\t var config = {};\n\t\n\t var valueFromConfig2Keys = ['url', 'method', 'data'];\n\t var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n\t var defaultToConfig2Keys = [\n\t 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n\t 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n\t 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n\t 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n\t 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n\t ];\n\t var directMergeKeys = ['validateStatus'];\n\t\n\t function getMergedValue(target, source) {\n\t if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n\t return utils.merge(target, source);\n\t } else if (utils.isPlainObject(source)) {\n\t return utils.merge({}, source);\n\t } else if (utils.isArray(source)) {\n\t return source.slice();\n\t }\n\t return source;\n\t }\n\t\n\t function mergeDeepProperties(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(config1[prop], config2[prop]);\n\t } else if (!utils.isUndefined(config1[prop])) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t }\n\t\n\t utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(undefined, config2[prop]);\n\t }\n\t });\n\t\n\t utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\t\n\t utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(undefined, config2[prop]);\n\t } else if (!utils.isUndefined(config1[prop])) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t });\n\t\n\t utils.forEach(directMergeKeys, function merge(prop) {\n\t if (prop in config2) {\n\t config[prop] = getMergedValue(config1[prop], config2[prop]);\n\t } else if (prop in config1) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t });\n\t\n\t var axiosKeys = valueFromConfig2Keys\n\t .concat(mergeDeepPropertiesKeys)\n\t .concat(defaultToConfig2Keys)\n\t .concat(directMergeKeys);\n\t\n\t var otherKeys = Object\n\t .keys(config1)\n\t .concat(Object.keys(config2))\n\t .filter(function filterAxiosKeys(key) {\n\t return axiosKeys.indexOf(key) === -1;\n\t });\n\t\n\t utils.forEach(otherKeys, mergeDeepProperties);\n\t\n\t return config;\n\t};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * A `Cancel` is an object that is thrown when an operation is canceled.\n\t *\n\t * @class\n\t * @param {string=} message The message.\n\t */\n\tfunction Cancel(message) {\n\t this.message = message;\n\t}\n\t\n\tCancel.prototype.toString = function toString() {\n\t return 'Cancel' + (this.message ? ': ' + this.message : '');\n\t};\n\t\n\tCancel.prototype.__CANCEL__ = true;\n\t\n\tmodule.exports = Cancel;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar Cancel = __webpack_require__(23);\n\t\n\t/**\n\t * A `CancelToken` is an object that can be used to request cancellation of an operation.\n\t *\n\t * @class\n\t * @param {Function} executor The executor function.\n\t */\n\tfunction CancelToken(executor) {\n\t if (typeof executor !== 'function') {\n\t throw new TypeError('executor must be a function.');\n\t }\n\t\n\t var resolvePromise;\n\t this.promise = new Promise(function promiseExecutor(resolve) {\n\t resolvePromise = resolve;\n\t });\n\t\n\t var token = this;\n\t executor(function cancel(message) {\n\t if (token.reason) {\n\t // Cancellation has already been requested\n\t return;\n\t }\n\t\n\t token.reason = new Cancel(message);\n\t resolvePromise(token.reason);\n\t });\n\t}\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n\t if (this.reason) {\n\t throw this.reason;\n\t }\n\t};\n\t\n\t/**\n\t * Returns an object that contains a new `CancelToken` and a function that, when called,\n\t * cancels the `CancelToken`.\n\t */\n\tCancelToken.source = function source() {\n\t var cancel;\n\t var token = new CancelToken(function executor(c) {\n\t cancel = c;\n\t });\n\t return {\n\t token: token,\n\t cancel: cancel\n\t };\n\t};\n\t\n\tmodule.exports = CancelToken;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function wrap(arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// axios.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 5db0cd118db1f73a2dc3","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 14\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/buildFullPath.js\n// module id = 17\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 18\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 20\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 21\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///axios.min.js","webpack:///webpack/bootstrap 081842adca0968bb3270","webpack:///./index.js","webpack:///./lib/axios.js","webpack:///./lib/utils.js","webpack:///./lib/helpers/bind.js","webpack:///./lib/core/Axios.js","webpack:///./lib/helpers/buildURL.js","webpack:///./lib/core/InterceptorManager.js","webpack:///./lib/core/dispatchRequest.js","webpack:///./lib/core/transformData.js","webpack:///./lib/cancel/isCancel.js","webpack:///./lib/defaults.js","webpack:///./lib/helpers/normalizeHeaderName.js","webpack:///./lib/adapters/xhr.js","webpack:///./lib/core/settle.js","webpack:///./lib/core/createError.js","webpack:///./lib/core/enhanceError.js","webpack:///./lib/helpers/cookies.js","webpack:///./lib/core/buildFullPath.js","webpack:///./lib/helpers/isAbsoluteURL.js","webpack:///./lib/helpers/combineURLs.js","webpack:///./lib/helpers/parseHeaders.js","webpack:///./lib/helpers/isURLSameOrigin.js","webpack:///./lib/core/mergeConfig.js","webpack:///./lib/cancel/Cancel.js","webpack:///./lib/cancel/CancelToken.js","webpack:///./lib/helpers/spread.js","webpack:///./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","createInstance","defaultConfig","context","Axios","instance","bind","prototype","request","utils","extend","mergeConfig","defaults","axios","create","instanceConfig","Cancel","CancelToken","isCancel","all","promises","Promise","spread","isAxiosError","default","isArray","val","toString","isUndefined","isBuffer","constructor","isArrayBuffer","isFormData","FormData","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isObject","isPlainObject","Object","getPrototypeOf","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","str","replace","isStandardBrowserEnv","navigator","product","window","document","forEach","obj","fn","i","l","length","key","hasOwnProperty","merge","assignValue","slice","arguments","a","b","thisArg","stripBOM","content","charCodeAt","args","Array","apply","interceptors","InterceptorManager","response","buildURL","dispatchRequest","config","url","method","toLowerCase","chain","undefined","promise","resolve","interceptor","unshift","fulfilled","rejected","push","then","shift","getUri","params","paramsSerializer","data","encode","encodeURIComponent","serializedParams","parts","v","toISOString","JSON","stringify","join","hashmarkIndex","indexOf","handlers","use","eject","h","throwIfCancellationRequested","cancelToken","throwIfRequested","transformData","headers","transformRequest","common","adapter","transformResponse","reason","reject","fns","value","__CANCEL__","setContentTypeIfUnset","getDefaultAdapter","XMLHttpRequest","process","normalizeHeaderName","DEFAULT_CONTENT_TYPE","Content-Type","parse","e","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","Accept","normalizedName","name","toUpperCase","settle","cookies","buildFullPath","parseHeaders","isURLSameOrigin","createError","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","open","onreadystatechange","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseData","responseType","responseText","statusText","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancel","abort","send","enhanceError","message","code","error","Error","toJSON","description","number","fileName","lineNumber","columnNumber","stack","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","concat","resolveURL","href","msie","urlParsingNode","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","originURL","userAgent","createElement","location","requestURL","config1","config2","getMergedValue","target","source","mergeDeepProperties","prop","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","axiosKeys","otherKeys","keys","filter","executor","TypeError","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAAUL,EAAQD,EAASM,GEtDjCL,EAAAD,QAAAM,EAAA,IF4DM,SAAUL,EAAQD,EAASM,GG5DjC,YAcA,SAAAS,GAAAC,GACA,GAAAC,GAAA,GAAAC,GAAAF,GACAG,EAAAC,EAAAF,EAAAG,UAAAC,QAAAL,EAQA,OALAM,GAAAC,OAAAL,EAAAD,EAAAG,UAAAJ,GAGAM,EAAAC,OAAAL,EAAAF,GAEAE,EAtBA,GAAAI,GAAAjB,EAAA,GACAc,EAAAd,EAAA,GACAY,EAAAZ,EAAA,GACAmB,EAAAnB,EAAA,IACAoB,EAAApB,EAAA,IAsBAqB,EAAAZ,EAAAW,EAGAC,GAAAT,QAGAS,EAAAC,OAAA,SAAAC,GACA,MAAAd,GAAAU,EAAAE,EAAAD,SAAAG,KAIAF,EAAAG,OAAAxB,EAAA,IACAqB,EAAAI,YAAAzB,EAAA,IACAqB,EAAAK,SAAA1B,EAAA,GAGAqB,EAAAM,IAAA,SAAAC,GACA,MAAAC,SAAAF,IAAAC,IAEAP,EAAAS,OAAA9B,EAAA,IAGAqB,EAAAU,aAAA/B,EAAA,IAEAL,EAAAD,QAAA2B,EAGA1B,EAAAD,QAAAsC,QAAAX,GHmEM,SAAU1B,EAAQD,EAASM,GI1HjC,YAgBA,SAAAiC,GAAAC,GACA,yBAAAC,EAAA9B,KAAA6B,GASA,QAAAE,GAAAF,GACA,yBAAAA,GASA,QAAAG,GAAAH,GACA,cAAAA,IAAAE,EAAAF,IAAA,OAAAA,EAAAI,cAAAF,EAAAF,EAAAI,cACA,kBAAAJ,GAAAI,YAAAD,UAAAH,EAAAI,YAAAD,SAAAH,GASA,QAAAK,GAAAL,GACA,+BAAAC,EAAA9B,KAAA6B,GASA,QAAAM,GAAAN,GACA,yBAAAO,WAAAP,YAAAO,UASA,QAAAC,GAAAR,GACA,GAAAS,EAMA,OAJAA,GADA,mBAAAC,0BAAA,OACAA,YAAAC,OAAAX,GAEA,GAAAA,EAAA,QAAAA,EAAAY,iBAAAF,aAWA,QAAAG,GAAAb,GACA,sBAAAA,GASA,QAAAc,GAAAd,GACA,sBAAAA,GASA,QAAAe,GAAAf,GACA,cAAAA,GAAA,gBAAAA,GASA,QAAAgB,GAAAhB,GACA,uBAAAC,EAAA9B,KAAA6B,GACA,QAGA,IAAAnB,GAAAoC,OAAAC,eAAAlB,EACA,eAAAnB,OAAAoC,OAAApC,UASA,QAAAsC,GAAAnB,GACA,wBAAAC,EAAA9B,KAAA6B,GASA,QAAAoB,GAAApB,GACA,wBAAAC,EAAA9B,KAAA6B,GASA,QAAAqB,GAAArB,GACA,wBAAAC,EAAA9B,KAAA6B,GASA,QAAAsB,GAAAtB,GACA,4BAAAC,EAAA9B,KAAA6B,GASA,QAAAuB,GAAAvB,GACA,MAAAe,GAAAf,IAAAsB,EAAAtB,EAAAwB,MASA,QAAAC,GAAAzB,GACA,yBAAA0B,kBAAA1B,YAAA0B,iBASA,QAAAC,GAAAC,GACA,MAAAA,GAAAC,QAAA,WAAAA,QAAA,WAkBA,QAAAC,KACA,0BAAAC,YAAA,gBAAAA,UAAAC,SACA,iBAAAD,UAAAC,SACA,OAAAD,UAAAC,WAIA,mBAAAC,SACA,mBAAAC,WAgBA,QAAAC,GAAAC,EAAAC,GAEA,UAAAD,GAAA,mBAAAA,GAUA,GALA,gBAAAA,KAEAA,OAGArC,EAAAqC,GAEA,OAAAE,GAAA,EAAAC,EAAAH,EAAAI,OAAmCF,EAAAC,EAAOD,IAC1CD,EAAAlE,KAAA,KAAAiE,EAAAE,KAAAF,OAIA,QAAAK,KAAAL,GACAnB,OAAApC,UAAA6D,eAAAvE,KAAAiE,EAAAK,IACAJ,EAAAlE,KAAA,KAAAiE,EAAAK,KAAAL,GAuBA,QAAAO,KAEA,QAAAC,GAAA5C,EAAAyC,GACAzB,EAAAP,EAAAgC,KAAAzB,EAAAhB,GACAS,EAAAgC,GAAAE,EAAAlC,EAAAgC,GAAAzC,GACKgB,EAAAhB,GACLS,EAAAgC,GAAAE,KAA4B3C,GACvBD,EAAAC,GACLS,EAAAgC,GAAAzC,EAAA6C,QAEApC,EAAAgC,GAAAzC,EAIA,OAbAS,MAaA6B,EAAA,EAAAC,EAAAO,UAAAN,OAAuCF,EAAAC,EAAOD,IAC9CH,EAAAW,UAAAR,GAAAM,EAEA,OAAAnC,GAWA,QAAAzB,GAAA+D,EAAAC,EAAAC,GAQA,MAPAd,GAAAa,EAAA,SAAAhD,EAAAyC,GACAQ,GAAA,kBAAAjD,GACA+C,EAAAN,GAAA7D,EAAAoB,EAAAiD,GAEAF,EAAAN,GAAAzC,IAGA+C,EASA,QAAAG,GAAAC,GAIA,MAHA,SAAAA,EAAAC,WAAA,KACAD,IAAAN,MAAA,IAEAM,EAlUA,GAAAvE,GAAAd,EAAA,GAMAmC,EAAAgB,OAAApC,UAAAoB,QA+TAxC,GAAAD,SACAuC,UACAM,gBACAF,WACAG,aACAE,oBACAK,WACAC,WACAC,WACAC,gBACAd,cACAiB,SACAC,SACAC,SACAC,aACAC,WACAE,oBACAK,uBACAK,UACAQ,QACA3D,SACA2C,OACAuB,aJkIM,SAAUzF,EAAQD,GK/dxB,YAEAC,GAAAD,QAAA,SAAA6E,EAAAY,GACA,kBAEA,OADAI,GAAA,GAAAC,OAAAR,UAAAN,QACAF,EAAA,EAAmBA,EAAAe,EAAAb,OAAiBF,IACpCe,EAAAf,GAAAQ,UAAAR,EAEA,OAAAD,GAAAkB,MAAAN,EAAAI,MLweM,SAAU5F,EAAQD,EAASM,GMhfjC,YAaA,SAAAY,GAAAW,GACAzB,KAAAsB,SAAAG,EACAzB,KAAA4F,cACA1E,QAAA,GAAA2E,GACAC,SAAA,GAAAD,IAfA,GAAA1E,GAAAjB,EAAA,GACA6F,EAAA7F,EAAA,GACA2F,EAAA3F,EAAA,GACA8F,EAAA9F,EAAA,GACAmB,EAAAnB,EAAA,GAoBAY,GAAAG,UAAAC,QAAA,SAAA+E,GAGA,gBAAAA,IACAA,EAAAf,UAAA,OACAe,EAAAC,IAAAhB,UAAA,IAEAe,QAGAA,EAAA5E,EAAArB,KAAAsB,SAAA2E,GAGAA,EAAAE,OACAF,EAAAE,OAAAF,EAAAE,OAAAC,cACGpG,KAAAsB,SAAA6E,OACHF,EAAAE,OAAAnG,KAAAsB,SAAA6E,OAAAC,cAEAH,EAAAE,OAAA,KAIA,IAAAE,IAAAL,EAAAM,QACAC,EAAAxE,QAAAyE,QAAAP,EAUA,KARAjG,KAAA4F,aAAA1E,QAAAqD,QAAA,SAAAkC,GACAJ,EAAAK,QAAAD,EAAAE,UAAAF,EAAAG,YAGA5G,KAAA4F,aAAAE,SAAAvB,QAAA,SAAAkC,GACAJ,EAAAQ,KAAAJ,EAAAE,UAAAF,EAAAG,YAGAP,EAAAzB,QACA2B,IAAAO,KAAAT,EAAAU,QAAAV,EAAAU,QAGA,OAAAR,IAGAzF,EAAAG,UAAA+F,OAAA,SAAAf,GAEA,MADAA,GAAA5E,EAAArB,KAAAsB,SAAA2E,GACAF,EAAAE,EAAAC,IAAAD,EAAAgB,OAAAhB,EAAAiB,kBAAAjD,QAAA,WAIA9C,EAAAoD,SAAA,0CAAA4B,GAEArF,EAAAG,UAAAkF,GAAA,SAAAD,EAAAD,GACA,MAAAjG,MAAAkB,QAAAG,EAAA4E,OACAE,SACAD,MACAiB,MAAAlB,OAAyBkB,WAKzBhG,EAAAoD,SAAA,+BAAA4B,GAEArF,EAAAG,UAAAkF,GAAA,SAAAD,EAAAiB,EAAAlB,GACA,MAAAjG,MAAAkB,QAAAG,EAAA4E,OACAE,SACAD,MACAiB,aAKAtH,EAAAD,QAAAkB,GNufM,SAAUjB,EAAQD,EAASM,GOrlBjC,YAIA,SAAAkH,GAAAhF,GACA,MAAAiF,oBAAAjF,GACA6B,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,YACAA,QAAA,aACAA,QAAA,aATA,GAAA9C,GAAAjB,EAAA,EAmBAL,GAAAD,QAAA,SAAAsG,EAAAe,EAAAC,GAEA,IAAAD,EACA,MAAAf,EAGA,IAAAoB,EACA,IAAAJ,EACAI,EAAAJ,EAAAD,OACG,IAAA9F,EAAA0C,kBAAAoD,GACHK,EAAAL,EAAA5E,eACG,CACH,GAAAkF,KAEApG,GAAAoD,QAAA0C,EAAA,SAAA7E,EAAAyC,GACA,OAAAzC,GAAA,mBAAAA,KAIAjB,EAAAgB,QAAAC,GACAyC,GAAA,KAEAzC,MAGAjB,EAAAoD,QAAAnC,EAAA,SAAAoF,GACArG,EAAAoC,OAAAiE,GACAA,IAAAC,cACStG,EAAAgC,SAAAqE,KACTA,EAAAE,KAAAC,UAAAH,IAEAD,EAAAV,KAAAO,EAAAvC,GAAA,IAAAuC,EAAAI,SAIAF,EAAAC,EAAAK,KAAA,KAGA,GAAAN,EAAA,CACA,GAAAO,GAAA3B,EAAA4B,QAAA,IACAD,MAAA,IACA3B,IAAAjB,MAAA,EAAA4C,IAGA3B,MAAA4B,QAAA,mBAAAR,EAGA,MAAApB,KP6lBM,SAAUrG,EAAQD,EAASM,GQjqBjC,YAIA,SAAA2F,KACA7F,KAAA+H,YAHA,GAAA5G,GAAAjB,EAAA,EAcA2F,GAAA5E,UAAA+G,IAAA,SAAArB,EAAAC,GAKA,MAJA5G,MAAA+H,SAAAlB,MACAF,YACAC,aAEA5G,KAAA+H,SAAAnD,OAAA,GAQAiB,EAAA5E,UAAAgH,MAAA,SAAA5H,GACAL,KAAA+H,SAAA1H,KACAL,KAAA+H,SAAA1H,GAAA,OAYAwF,EAAA5E,UAAAsD,QAAA,SAAAE,GACAtD,EAAAoD,QAAAvE,KAAA+H,SAAA,SAAAG,GACA,OAAAA,GACAzD,EAAAyD,MAKArI,EAAAD,QAAAiG,GRwqBM,SAAUhG,EAAQD,EAASM,GS3tBjC,YAUA,SAAAiI,GAAAlC,GACAA,EAAAmC,aACAnC,EAAAmC,YAAAC,mBAVA,GAAAlH,GAAAjB,EAAA,GACAoI,EAAApI,EAAA,GACA0B,EAAA1B,EAAA,GACAoB,EAAApB,EAAA,GAiBAL,GAAAD,QAAA,SAAAqG,GACAkC,EAAAlC,GAGAA,EAAAsC,QAAAtC,EAAAsC,YAGAtC,EAAAkB,KAAAmB,EACArC,EAAAkB,KACAlB,EAAAsC,QACAtC,EAAAuC,kBAIAvC,EAAAsC,QAAApH,EAAA4D,MACAkB,EAAAsC,QAAAE,WACAxC,EAAAsC,QAAAtC,EAAAE,YACAF,EAAAsC,SAGApH,EAAAoD,SACA,qDACA,SAAA4B,SACAF,GAAAsC,QAAApC,IAIA,IAAAuC,GAAAzC,EAAAyC,SAAApH,EAAAoH,OAEA,OAAAA,GAAAzC,GAAAa,KAAA,SAAAhB,GAUA,MATAqC,GAAAlC,GAGAH,EAAAqB,KAAAmB,EACAxC,EAAAqB,KACArB,EAAAyC,QACAtC,EAAA0C,mBAGA7C,GACG,SAAA8C,GAcH,MAbAhH,GAAAgH,KACAT,EAAAlC,GAGA2C,KAAA9C,WACA8C,EAAA9C,SAAAqB,KAAAmB,EACAM,EAAA9C,SAAAqB,KACAyB,EAAA9C,SAAAyC,QACAtC,EAAA0C,qBAKA5G,QAAA8G,OAAAD,OTouBM,SAAU/I,EAAQD,EAASM,GUhzBjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAAuH,EAAAoB,EAAAO,GAMA,MAJA3H,GAAAoD,QAAAuE,EAAA,SAAArE,GACA0C,EAAA1C,EAAA0C,EAAAoB,KAGApB,IVwzBM,SAAUtH,EAAQD,GW10BxB,YAEAC,GAAAD,QAAA,SAAAmJ,GACA,SAAAA,MAAAC,cXk1BM,SAAUnJ,EAAQD,EAASM,GYr1BjC,YASA,SAAA+I,GAAAV,EAAAQ,IACA5H,EAAAmB,YAAAiG,IAAApH,EAAAmB,YAAAiG,EAAA,mBACAA,EAAA,gBAAAQ,GAIA,QAAAG,KACA,GAAAR,EAQA,OAPA,mBAAAS,gBAEAT,EAAAxI,EAAA,IACG,mBAAAkJ,UAAA,qBAAA/F,OAAApC,UAAAoB,SAAA9B,KAAA6I,WAEHV,EAAAxI,EAAA,KAEAwI,EAtBA,GAAAvH,GAAAjB,EAAA,GACAmJ,EAAAnJ,EAAA,IAEAoJ,GACAC,eAAA,qCAqBAjI,GACAoH,QAAAQ,IAEAV,kBAAA,SAAArB,EAAAoB,GAGA,MAFAc,GAAAd,EAAA,UACAc,EAAAd,EAAA,gBACApH,EAAAuB,WAAAyE,IACAhG,EAAAsB,cAAA0E,IACAhG,EAAAoB,SAAA4E,IACAhG,EAAAwC,SAAAwD,IACAhG,EAAAqC,OAAA2D,IACAhG,EAAAsC,OAAA0D,GAEAA,EAEAhG,EAAAyB,kBAAAuE,GACAA,EAAAnE,OAEA7B,EAAA0C,kBAAAsD,IACA8B,EAAAV,EAAA,mDACApB,EAAA9E,YAEAlB,EAAAgC,SAAAgE,IACA8B,EAAAV,EAAA,kCACAb,KAAAC,UAAAR,IAEAA,IAGAwB,mBAAA,SAAAxB,GAEA,mBAAAA,GACA,IACAA,EAAAO,KAAA8B,MAAArC,GACO,MAAAsC,IAEP,MAAAtC,KAOAuC,QAAA,EAEAC,eAAA,aACAC,eAAA,eAEAC,kBAAA,EACAC,eAAA,EAEAC,eAAA,SAAAC,GACA,MAAAA,IAAA,KAAAA,EAAA,KAIA1I,GAAAiH,SACAE,QACAwB,OAAA,sCAIA9I,EAAAoD,SAAA,gCAAA4B,GACA7E,EAAAiH,QAAApC,QAGAhF,EAAAoD,SAAA,+BAAA4B,GACA7E,EAAAiH,QAAApC,GAAAhF,EAAA4D,MAAAuE,KAGAzJ,EAAAD,QAAA0B,GZ41BM,SAAUzB,EAAQD,EAASM,Ga77BjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QAAA,SAAA2I,EAAA2B,GACA/I,EAAAoD,QAAAgE,EAAA,SAAAQ,EAAAoB,GACAA,IAAAD,GAAAC,EAAAC,gBAAAF,EAAAE,gBACA7B,EAAA2B,GAAAnB,QACAR,GAAA4B,Qbu8BM,SAAUtK,EAAQD,EAASM,Gc/8BjC,YAEA,IAAAiB,GAAAjB,EAAA,GACAmK,EAAAnK,EAAA,IACAoK,EAAApK,EAAA,IACA6F,EAAA7F,EAAA,GACAqK,EAAArK,EAAA,IACAsK,EAAAtK,EAAA,IACAuK,EAAAvK,EAAA,IACAwK,EAAAxK,EAAA,GAEAL,GAAAD,QAAA,SAAAqG,GACA,UAAAlE,SAAA,SAAAyE,EAAAqC,GACA,GAAA8B,GAAA1E,EAAAkB,KACAyD,EAAA3E,EAAAsC,OAEApH,GAAAuB,WAAAiI,UACAC,GAAA,eAGA,IAAA1J,GAAA,GAAAiI,eAGA,IAAAlD,EAAA4E,KAAA,CACA,GAAAC,GAAA7E,EAAA4E,KAAAC,UAAA,GACAC,EAAA9E,EAAA4E,KAAAE,SAAAC,SAAA3D,mBAAApB,EAAA4E,KAAAE,WAAA,EACAH,GAAAK,cAAA,SAAAC,KAAAJ,EAAA,IAAAC,GAGA,GAAAI,GAAAZ,EAAAtE,EAAAmF,QAAAnF,EAAAC,IA4EA,IA3EAhF,EAAAmK,KAAApF,EAAAE,OAAAiE,cAAArE,EAAAoF,EAAAlF,EAAAgB,OAAAhB,EAAAiB,mBAAA,GAGAhG,EAAAwI,QAAAzD,EAAAyD,QAGAxI,EAAAoK,mBAAA,WACA,GAAApK,GAAA,IAAAA,EAAAqK,aAQA,IAAArK,EAAA8I,QAAA9I,EAAAsK,aAAA,IAAAtK,EAAAsK,YAAA1D,QAAA,WAKA,GAAA2D,GAAA,yBAAAvK,GAAAsJ,EAAAtJ,EAAAwK,yBAAA,KACAC,EAAA1F,EAAA2F,cAAA,SAAA3F,EAAA2F,aAAA1K,EAAA4E,SAAA5E,EAAA2K,aACA/F,GACAqB,KAAAwE,EACA3B,OAAA9I,EAAA8I,OACA8B,WAAA5K,EAAA4K,WACAvD,QAAAkD,EACAxF,SACA/E,UAGAmJ,GAAA7D,EAAAqC,EAAA/C,GAGA5E,EAAA,OAIAA,EAAA6K,QAAA,WACA7K,IAIA2H,EAAA6B,EAAA,kBAAAzE,EAAA,eAAA/E,IAGAA,EAAA,OAIAA,EAAA8K,QAAA,WAGAnD,EAAA6B,EAAA,gBAAAzE,EAAA,KAAA/E,IAGAA,EAAA,MAIAA,EAAA+K,UAAA,WACA,GAAAC,GAAA,cAAAjG,EAAAyD,QAAA,aACAzD,GAAAiG,sBACAA,EAAAjG,EAAAiG,qBAEArD,EAAA6B,EAAAwB,EAAAjG,EAAA,eACA/E,IAGAA,EAAA,MAMAC,EAAA+C,uBAAA,CAEA,GAAAiI,IAAAlG,EAAAmG,iBAAA3B,EAAAU,KAAAlF,EAAA0D,eACAW,EAAA+B,KAAApG,EAAA0D,gBACArD,MAEA6F,KACAvB,EAAA3E,EAAA2D,gBAAAuC,GAuBA,GAlBA,oBAAAjL,IACAC,EAAAoD,QAAAqG,EAAA,SAAAxI,EAAAyC,GACA,mBAAA8F,IAAA,iBAAA9F,EAAAuB,oBAEAwE,GAAA/F,GAGA3D,EAAAoL,iBAAAzH,EAAAzC,KAMAjB,EAAAmB,YAAA2D,EAAAmG,mBACAlL,EAAAkL,kBAAAnG,EAAAmG,iBAIAnG,EAAA2F,aACA,IACA1K,EAAA0K,aAAA3F,EAAA2F,aACO,MAAAnC,GAGP,YAAAxD,EAAA2F,aACA,KAAAnC,GAMA,kBAAAxD,GAAAsG,oBACArL,EAAAsL,iBAAA,WAAAvG,EAAAsG,oBAIA,kBAAAtG,GAAAwG,kBAAAvL,EAAAwL,QACAxL,EAAAwL,OAAAF,iBAAA,WAAAvG,EAAAwG,kBAGAxG,EAAAmC,aAEAnC,EAAAmC,YAAA7B,QAAAO,KAAA,SAAA6F,GACAzL,IAIAA,EAAA0L,QACA/D,EAAA8D,GAEAzL,EAAA,QAIAyJ,IACAA,EAAA,MAIAzJ,EAAA2L,KAAAlC,Odw9BM,SAAU9K,EAAQD,EAASM,GexoCjC,YAEA,IAAAwK,GAAAxK,EAAA,GASAL,GAAAD,QAAA,SAAA4G,EAAAqC,EAAA/C,GACA,GAAAiE,GAAAjE,EAAAG,OAAA8D,cACAjE,GAAAkE,QAAAD,MAAAjE,EAAAkE,QAGAnB,EAAA6B,EACA,mCAAA5E,EAAAkE,OACAlE,EAAAG,OACA,KACAH,EAAA5E,QACA4E,IAPAU,EAAAV,KfypCM,SAAUjG,EAAQD,EAASM,GgBvqCjC,YAEA,IAAA4M,GAAA5M,EAAA,GAYAL,GAAAD,QAAA,SAAAmN,EAAA9G,EAAA+G,EAAA9L,EAAA4E,GACA,GAAAmH,GAAA,GAAAC,OAAAH,EACA,OAAAD,GAAAG,EAAAhH,EAAA+G,EAAA9L,EAAA4E,KhB+qCM,SAAUjG,EAAQD,GiB/rCxB,YAYAC,GAAAD,QAAA,SAAAqN,EAAAhH,EAAA+G,EAAA9L,EAAA4E,GA4BA,MA3BAmH,GAAAhH,SACA+G,IACAC,EAAAD,QAGAC,EAAA/L,UACA+L,EAAAnH,WACAmH,EAAAhL,cAAA,EAEAgL,EAAAE,OAAA,WACA,OAEAJ,QAAA/M,KAAA+M,QACA5C,KAAAnK,KAAAmK,KAEAiD,YAAApN,KAAAoN,YACAC,OAAArN,KAAAqN,OAEAC,SAAAtN,KAAAsN,SACAC,WAAAvN,KAAAuN,WACAC,aAAAxN,KAAAwN,aACAC,MAAAzN,KAAAyN,MAEAxH,OAAAjG,KAAAiG,OACA+G,KAAAhN,KAAAgN,OAGAC,IjBusCM,SAAUpN,EAAQD,EAASM,GkB/uCjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAA+C,uBAGA,WACA,OACAwJ,MAAA,SAAAvD,EAAApB,EAAA4E,EAAAC,EAAAC,EAAAC,GACA,GAAAC,KACAA,GAAAlH,KAAAsD,EAAA,IAAA9C,mBAAA0B,IAEA5H,EAAA+B,SAAAyK,IACAI,EAAAlH,KAAA,cAAAmH,MAAAL,GAAAM,eAGA9M,EAAA8B,SAAA2K,IACAG,EAAAlH,KAAA,QAAA+G,GAGAzM,EAAA8B,SAAA4K,IACAE,EAAAlH,KAAA,UAAAgH,GAGAC,KAAA,GACAC,EAAAlH,KAAA,UAGAvC,SAAAyJ,SAAAnG,KAAA,OAGAyE,KAAA,SAAAlC,GACA,GAAA+D,GAAA5J,SAAAyJ,OAAAG,MAAA,GAAAC,QAAA,aAA4DhE,EAAA,aAC5D,OAAA+D,GAAAE,mBAAAF,EAAA,UAGAG,OAAA,SAAAlE,GACAnK,KAAA0N,MAAAvD,EAAA,GAAA6D,KAAAM,MAAA,YAMA,WACA,OACAZ,MAAA,aACArB,KAAA,WAA+B,aAC/BgC,OAAA,kBlByvCM,SAAUxO,EAAQD,EAASM,GmB1yCjC,YAEA,IAAAqO,GAAArO,EAAA,IACAsO,EAAAtO,EAAA,GAWAL,GAAAD,QAAA,SAAAwL,EAAAqD,GACA,MAAArD,KAAAmD,EAAAE,GACAD,EAAApD,EAAAqD,GAEAA,InBkzCM,SAAU5O,EAAQD,GoBp0CxB,YAQAC,GAAAD,QAAA,SAAAsG,GAIA,sCAAAwI,KAAAxI,KpB40CM,SAAUrG,EAAQD,GqBx1CxB,YASAC,GAAAD,QAAA,SAAAwL,EAAAuD,GACA,MAAAA,GACAvD,EAAAnH,QAAA,eAAA0K,EAAA1K,QAAA,WACAmH,IrBg2CM,SAAUvL,EAAQD,EAASM,GsB52CjC,YAEA,IAAAiB,GAAAjB,EAAA,GAIA0O,GACA,6DACA,kEACA,gEACA,qCAgBA/O,GAAAD,QAAA,SAAA2I,GACA,GACA1D,GACAzC,EACAsC,EAHAmK,IAKA,OAAAtG,IAEApH,EAAAoD,QAAAgE,EAAAuG,MAAA,eAAAC,GAKA,GAJArK,EAAAqK,EAAAjH,QAAA,KACAjD,EAAA1D,EAAA4C,KAAAgL,EAAAC,OAAA,EAAAtK,IAAA0B,cACAhE,EAAAjB,EAAA4C,KAAAgL,EAAAC,OAAAtK,EAAA,IAEAG,EAAA,CACA,GAAAgK,EAAAhK,IAAA+J,EAAA9G,QAAAjD,IAAA,EACA,MAEA,gBAAAA,EACAgK,EAAAhK,IAAAgK,EAAAhK,GAAAgK,EAAAhK,OAAAoK,QAAA7M,IAEAyM,EAAAhK,GAAAgK,EAAAhK,GAAAgK,EAAAhK,GAAA,KAAAzC,OAKAyM,GAnBiBA,ItBu4CX,SAAUhP,EAAQD,EAASM,GuBv6CjC,YAEA,IAAAiB,GAAAjB,EAAA,EAEAL,GAAAD,QACAuB,EAAA+C,uBAIA,WAWA,QAAAgL,GAAAhJ,GACA,GAAAiJ,GAAAjJ,CAWA,OATAkJ,KAEAC,EAAAC,aAAA,OAAAH,GACAA,EAAAE,EAAAF,MAGAE,EAAAC,aAAA,OAAAH,IAIAA,KAAAE,EAAAF,KACAI,SAAAF,EAAAE,SAAAF,EAAAE,SAAAtL,QAAA,YACAuL,KAAAH,EAAAG,KACAC,OAAAJ,EAAAI,OAAAJ,EAAAI,OAAAxL,QAAA,aACAyL,KAAAL,EAAAK,KAAAL,EAAAK,KAAAzL,QAAA,YACA0L,SAAAN,EAAAM,SACAC,KAAAP,EAAAO,KACAC,SAAA,MAAAR,EAAAQ,SAAAC,OAAA,GACAT,EAAAQ,SACA,IAAAR,EAAAQ,UAhCA,GAEAE,GAFAX,EAAA,kBAAAV,KAAAvK,UAAA6L,WACAX,EAAA/K,SAAA2L,cAAA,IA2CA,OARAF,GAAAb,EAAA7K,OAAA6L,SAAAf,MAQA,SAAAgB,GACA,GAAAtB,GAAA1N,EAAA8B,SAAAkN,GAAAjB,EAAAiB,IACA,OAAAtB,GAAAU,WAAAQ,EAAAR,UACAV,EAAAW,OAAAO,EAAAP,SAKA,WACA,kBACA,cvBi7CM,SAAU3P,EAAQD,EAASM,GwBj/CjC,YAEA,IAAAiB,GAAAjB,EAAA,EAUAL,GAAAD,QAAA,SAAAwQ,EAAAC,GAgBA,QAAAC,GAAAC,EAAAC,GACA,MAAArP,GAAAiC,cAAAmN,IAAApP,EAAAiC,cAAAoN,GACArP,EAAA4D,MAAAwL,EAAAC,GACKrP,EAAAiC,cAAAoN,GACLrP,EAAA4D,SAA2ByL,GACtBrP,EAAAgB,QAAAqO,GACLA,EAAAvL,QAEAuL,EAGA,QAAAC,GAAAC,GACAvP,EAAAmB,YAAA+N,EAAAK,IAEKvP,EAAAmB,YAAA8N,EAAAM,MACLzK,EAAAyK,GAAAJ,EAAAhK,OAAA8J,EAAAM,KAFAzK,EAAAyK,GAAAJ,EAAAF,EAAAM,GAAAL,EAAAK,IA3BAL,OACA,IAAApK,MAEA0K,GAAA,uBACAC,GAAA,mCACAC,GACA,oEACA,uFACA,sEACA,0EACA,4DAEAC,GAAA,iBAqBA3P,GAAAoD,QAAAoM,EAAA,SAAAD,GACAvP,EAAAmB,YAAA+N,EAAAK,MACAzK,EAAAyK,GAAAJ,EAAAhK,OAAA+J,EAAAK,OAIAvP,EAAAoD,QAAAqM,EAAAH,GAEAtP,EAAAoD,QAAAsM,EAAA,SAAAH,GACAvP,EAAAmB,YAAA+N,EAAAK,IAEKvP,EAAAmB,YAAA8N,EAAAM,MACLzK,EAAAyK,GAAAJ,EAAAhK,OAAA8J,EAAAM,KAFAzK,EAAAyK,GAAAJ,EAAAhK,OAAA+J,EAAAK,MAMAvP,EAAAoD,QAAAuM,EAAA,SAAAJ,GACAA,IAAAL,GACApK,EAAAyK,GAAAJ,EAAAF,EAAAM,GAAAL,EAAAK,IACKA,IAAAN,KACLnK,EAAAyK,GAAAJ,EAAAhK,OAAA8J,EAAAM,MAIA,IAAAK,GAAAJ,EACA1B,OAAA2B,GACA3B,OAAA4B,GACA5B,OAAA6B,GAEAE,EAAA3N,OACA4N,KAAAb,GACAnB,OAAA5L,OAAA4N,KAAAZ,IACAa,OAAA,SAAArM,GACA,MAAAkM,GAAAjJ,QAAAjD,MAAA,GAKA,OAFA1D,GAAAoD,QAAAyM,EAAAP,GAEAxK,IxBy/CM,SAAUpG,EAAQD,GyB9kDxB,YAQA,SAAA8B,GAAAqL,GACA/M,KAAA+M,UAGArL,EAAAT,UAAAoB,SAAA,WACA,gBAAArC,KAAA+M,QAAA,KAAA/M,KAAA+M,QAAA,KAGArL,EAAAT,UAAA+H,YAAA,EAEAnJ,EAAAD,QAAA8B,GzBqlDM,SAAU7B,EAAQD,EAASM,G0BvmDjC,YAUA,SAAAyB,GAAAwP,GACA,qBAAAA,GACA,SAAAC,WAAA,+BAGA,IAAAC,EACArR,MAAAuG,QAAA,GAAAxE,SAAA,SAAAyE,GACA6K,EAAA7K,GAGA,IAAA8K,GAAAtR,IACAmR,GAAA,SAAApE,GACAuE,EAAA1I,SAKA0I,EAAA1I,OAAA,GAAAlH,GAAAqL,GACAsE,EAAAC,EAAA1I,WA1BA,GAAAlH,GAAAxB,EAAA,GAiCAyB,GAAAV,UAAAoH,iBAAA,WACA,GAAArI,KAAA4I,OACA,KAAA5I,MAAA4I,QAQAjH,EAAA6O,OAAA,WACA,GAAA7D,GACA2E,EAAA,GAAA3P,GAAA,SAAAlB,GACAkM,EAAAlM,GAEA,QACA6Q,QACA3E,WAIA9M,EAAAD,QAAA+B,G1B8mDM,SAAU9B,EAAQD,G2BtqDxB,YAsBAC,GAAAD,QAAA,SAAA2R,GACA,gBAAAC,GACA,MAAAD,GAAA5L,MAAA,KAAA6L,M3B+qDM,SAAU3R,EAAQD,G4BvsDxB,YAQAC,GAAAD,QAAA,SAAA6R,GACA,sBAAAA,MAAAxP,gBAAA","file":"axios.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar bind = __webpack_require__(3);\n\tvar Axios = __webpack_require__(4);\n\tvar mergeConfig = __webpack_require__(22);\n\tvar defaults = __webpack_require__(10);\n\t\n\t/**\n\t * Create an instance of Axios\n\t *\n\t * @param {Object} defaultConfig The default config for the instance\n\t * @return {Axios} A new instance of Axios\n\t */\n\tfunction createInstance(defaultConfig) {\n\t var context = new Axios(defaultConfig);\n\t var instance = bind(Axios.prototype.request, context);\n\t\n\t // Copy axios.prototype to instance\n\t utils.extend(instance, Axios.prototype, context);\n\t\n\t // Copy context to instance\n\t utils.extend(instance, context);\n\t\n\t return instance;\n\t}\n\t\n\t// Create the default instance to be exported\n\tvar axios = createInstance(defaults);\n\t\n\t// Expose Axios class to allow class inheritance\n\taxios.Axios = Axios;\n\t\n\t// Factory for creating new instances\n\taxios.create = function create(instanceConfig) {\n\t return createInstance(mergeConfig(axios.defaults, instanceConfig));\n\t};\n\t\n\t// Expose Cancel & CancelToken\n\taxios.Cancel = __webpack_require__(23);\n\taxios.CancelToken = __webpack_require__(24);\n\taxios.isCancel = __webpack_require__(9);\n\t\n\t// Expose all/spread\n\taxios.all = function all(promises) {\n\t return Promise.all(promises);\n\t};\n\taxios.spread = __webpack_require__(25);\n\t\n\t// Expose isAxiosError\n\taxios.isAxiosError = __webpack_require__(26);\n\t\n\tmodule.exports = axios;\n\t\n\t// Allow use of default import syntax in TypeScript\n\tmodule.exports.default = axios;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar bind = __webpack_require__(3);\n\t\n\t/*global toString:true*/\n\t\n\t// utils is a library of generic helper functions non-specific to axios\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * Determine if a value is an Array\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Array, otherwise false\n\t */\n\tfunction isArray(val) {\n\t return toString.call(val) === '[object Array]';\n\t}\n\t\n\t/**\n\t * Determine if a value is undefined\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if the value is undefined, otherwise false\n\t */\n\tfunction isUndefined(val) {\n\t return typeof val === 'undefined';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Buffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Buffer, otherwise false\n\t */\n\tfunction isBuffer(val) {\n\t return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n\t && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n\t}\n\t\n\t/**\n\t * Determine if a value is an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBuffer(val) {\n\t return toString.call(val) === '[object ArrayBuffer]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a FormData\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an FormData, otherwise false\n\t */\n\tfunction isFormData(val) {\n\t return (typeof FormData !== 'undefined') && (val instanceof FormData);\n\t}\n\t\n\t/**\n\t * Determine if a value is a view on an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBufferView(val) {\n\t var result;\n\t if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n\t result = ArrayBuffer.isView(val);\n\t } else {\n\t result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Determine if a value is a String\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a String, otherwise false\n\t */\n\tfunction isString(val) {\n\t return typeof val === 'string';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Number\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Number, otherwise false\n\t */\n\tfunction isNumber(val) {\n\t return typeof val === 'number';\n\t}\n\t\n\t/**\n\t * Determine if a value is an Object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Object, otherwise false\n\t */\n\tfunction isObject(val) {\n\t return val !== null && typeof val === 'object';\n\t}\n\t\n\t/**\n\t * Determine if a value is a plain Object\n\t *\n\t * @param {Object} val The value to test\n\t * @return {boolean} True if value is a plain Object, otherwise false\n\t */\n\tfunction isPlainObject(val) {\n\t if (toString.call(val) !== '[object Object]') {\n\t return false;\n\t }\n\t\n\t var prototype = Object.getPrototypeOf(val);\n\t return prototype === null || prototype === Object.prototype;\n\t}\n\t\n\t/**\n\t * Determine if a value is a Date\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Date, otherwise false\n\t */\n\tfunction isDate(val) {\n\t return toString.call(val) === '[object Date]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a File\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a File, otherwise false\n\t */\n\tfunction isFile(val) {\n\t return toString.call(val) === '[object File]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Blob\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Blob, otherwise false\n\t */\n\tfunction isBlob(val) {\n\t return toString.call(val) === '[object Blob]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Function\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Function, otherwise false\n\t */\n\tfunction isFunction(val) {\n\t return toString.call(val) === '[object Function]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Stream\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Stream, otherwise false\n\t */\n\tfunction isStream(val) {\n\t return isObject(val) && isFunction(val.pipe);\n\t}\n\t\n\t/**\n\t * Determine if a value is a URLSearchParams object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n\t */\n\tfunction isURLSearchParams(val) {\n\t return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n\t}\n\t\n\t/**\n\t * Trim excess whitespace off the beginning and end of a string\n\t *\n\t * @param {String} str The String to trim\n\t * @returns {String} The String freed of excess whitespace\n\t */\n\tfunction trim(str) {\n\t return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\t}\n\t\n\t/**\n\t * Determine if we're running in a standard browser environment\n\t *\n\t * This allows axios to run in a web worker, and react-native.\n\t * Both environments support XMLHttpRequest, but not fully standard globals.\n\t *\n\t * web workers:\n\t * typeof window -> undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * navigator.product -> 'ReactNative'\n\t * nativescript\n\t * navigator.product -> 'NativeScript' or 'NS'\n\t */\n\tfunction isStandardBrowserEnv() {\n\t if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n\t navigator.product === 'NativeScript' ||\n\t navigator.product === 'NS')) {\n\t return false;\n\t }\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object') {\n\t /*eslint no-param-reassign:0*/\n\t obj = [obj];\n\t }\n\t\n\t if (isArray(obj)) {\n\t // Iterate over array values\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t } else {\n\t // Iterate over object keys\n\t for (var key in obj) {\n\t if (Object.prototype.hasOwnProperty.call(obj, key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t if (isPlainObject(result[key]) && isPlainObject(val)) {\n\t result[key] = merge(result[key], val);\n\t } else if (isPlainObject(val)) {\n\t result[key] = merge({}, val);\n\t } else if (isArray(val)) {\n\t result[key] = val.slice();\n\t } else {\n\t result[key] = val;\n\t }\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Extends object a by mutably adding to it the properties of object b.\n\t *\n\t * @param {Object} a The object to be extended\n\t * @param {Object} b The object to copy properties from\n\t * @param {Object} thisArg The object to bind function to\n\t * @return {Object} The resulting value of object a\n\t */\n\tfunction extend(a, b, thisArg) {\n\t forEach(b, function assignValue(val, key) {\n\t if (thisArg && typeof val === 'function') {\n\t a[key] = bind(val, thisArg);\n\t } else {\n\t a[key] = val;\n\t }\n\t });\n\t return a;\n\t}\n\t\n\t/**\n\t * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n\t *\n\t * @param {string} content with BOM\n\t * @return {string} content value without BOM\n\t */\n\tfunction stripBOM(content) {\n\t if (content.charCodeAt(0) === 0xFEFF) {\n\t content = content.slice(1);\n\t }\n\t return content;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isBuffer: isBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isPlainObject: isPlainObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isFunction: isFunction,\n\t isStream: isStream,\n\t isURLSearchParams: isURLSearchParams,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t extend: extend,\n\t trim: trim,\n\t stripBOM: stripBOM\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function bind(fn, thisArg) {\n\t return function wrap() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t return fn.apply(thisArg, args);\n\t };\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar buildURL = __webpack_require__(5);\n\tvar InterceptorManager = __webpack_require__(6);\n\tvar dispatchRequest = __webpack_require__(7);\n\tvar mergeConfig = __webpack_require__(22);\n\t\n\t/**\n\t * Create a new instance of Axios\n\t *\n\t * @param {Object} instanceConfig The default config for the instance\n\t */\n\tfunction Axios(instanceConfig) {\n\t this.defaults = instanceConfig;\n\t this.interceptors = {\n\t request: new InterceptorManager(),\n\t response: new InterceptorManager()\n\t };\n\t}\n\t\n\t/**\n\t * Dispatch a request\n\t *\n\t * @param {Object} config The config specific for this request (merged with this.defaults)\n\t */\n\tAxios.prototype.request = function request(config) {\n\t /*eslint no-param-reassign:0*/\n\t // Allow for axios('example/url'[, config]) a la fetch API\n\t if (typeof config === 'string') {\n\t config = arguments[1] || {};\n\t config.url = arguments[0];\n\t } else {\n\t config = config || {};\n\t }\n\t\n\t config = mergeConfig(this.defaults, config);\n\t\n\t // Set config.method\n\t if (config.method) {\n\t config.method = config.method.toLowerCase();\n\t } else if (this.defaults.method) {\n\t config.method = this.defaults.method.toLowerCase();\n\t } else {\n\t config.method = 'get';\n\t }\n\t\n\t // Hook up interceptors middleware\n\t var chain = [dispatchRequest, undefined];\n\t var promise = Promise.resolve(config);\n\t\n\t this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n\t chain.unshift(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n\t chain.push(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t while (chain.length) {\n\t promise = promise.then(chain.shift(), chain.shift());\n\t }\n\t\n\t return promise;\n\t};\n\t\n\tAxios.prototype.getUri = function getUri(config) {\n\t config = mergeConfig(this.defaults, config);\n\t return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n\t};\n\t\n\t// Provide aliases for supported request methods\n\tutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, config) {\n\t return this.request(mergeConfig(config || {}, {\n\t method: method,\n\t url: url,\n\t data: (config || {}).data\n\t }));\n\t };\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, data, config) {\n\t return this.request(mergeConfig(config || {}, {\n\t method: method,\n\t url: url,\n\t data: data\n\t }));\n\t };\n\t});\n\t\n\tmodule.exports = Axios;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildURL(url, params, paramsSerializer) {\n\t /*eslint no-param-reassign:0*/\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var serializedParams;\n\t if (paramsSerializer) {\n\t serializedParams = paramsSerializer(params);\n\t } else if (utils.isURLSearchParams(params)) {\n\t serializedParams = params.toString();\n\t } else {\n\t var parts = [];\n\t\n\t utils.forEach(params, function serialize(val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t } else {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function parseValue(v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t } else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t serializedParams = parts.join('&');\n\t }\n\t\n\t if (serializedParams) {\n\t var hashmarkIndex = url.indexOf('#');\n\t if (hashmarkIndex !== -1) {\n\t url = url.slice(0, hashmarkIndex);\n\t }\n\t\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n\t }\n\t\n\t return url;\n\t};\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function eject(id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `eject`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function forEach(fn) {\n\t utils.forEach(this.handlers, function forEachHandler(h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar transformData = __webpack_require__(8);\n\tvar isCancel = __webpack_require__(9);\n\tvar defaults = __webpack_require__(10);\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tfunction throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}\n\t\n\t/**\n\t * Dispatch a request to the server using the configured adapter.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Ensure headers exist\n\t config.headers = config.headers || {};\n\t\n\t // Transform request data\n\t config.data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Flatten headers\n\t config.headers = utils.merge(\n\t config.headers.common || {},\n\t config.headers[config.method] || {},\n\t config.headers\n\t );\n\t\n\t utils.forEach(\n\t ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n\t function cleanHeaderConfig(method) {\n\t delete config.headers[method];\n\t }\n\t );\n\t\n\t var adapter = config.adapter || defaults.adapter;\n\t\n\t return adapter(config).then(function onAdapterResolution(response) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t response.data = transformData(\n\t response.data,\n\t response.headers,\n\t config.transformResponse\n\t );\n\t\n\t return response;\n\t }, function onAdapterRejection(reason) {\n\t if (!isCancel(reason)) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t if (reason && reason.response) {\n\t reason.response.data = transformData(\n\t reason.response.data,\n\t reason.response.headers,\n\t config.transformResponse\n\t );\n\t }\n\t }\n\t\n\t return Promise.reject(reason);\n\t });\n\t};\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t /*eslint no-param-reassign:0*/\n\t utils.forEach(fns, function transform(fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function isCancel(value) {\n\t return !!(value && value.__CANCEL__);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar normalizeHeaderName = __webpack_require__(11);\n\t\n\tvar DEFAULT_CONTENT_TYPE = {\n\t 'Content-Type': 'application/x-www-form-urlencoded'\n\t};\n\t\n\tfunction setContentTypeIfUnset(headers, value) {\n\t if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n\t headers['Content-Type'] = value;\n\t }\n\t}\n\t\n\tfunction getDefaultAdapter() {\n\t var adapter;\n\t if (typeof XMLHttpRequest !== 'undefined') {\n\t // For browsers use XHR adapter\n\t adapter = __webpack_require__(12);\n\t } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n\t // For node use HTTP adapter\n\t adapter = __webpack_require__(12);\n\t }\n\t return adapter;\n\t}\n\t\n\tvar defaults = {\n\t adapter: getDefaultAdapter(),\n\t\n\t transformRequest: [function transformRequest(data, headers) {\n\t normalizeHeaderName(headers, 'Accept');\n\t normalizeHeaderName(headers, 'Content-Type');\n\t if (utils.isFormData(data) ||\n\t utils.isArrayBuffer(data) ||\n\t utils.isBuffer(data) ||\n\t utils.isStream(data) ||\n\t utils.isFile(data) ||\n\t utils.isBlob(data)\n\t ) {\n\t return data;\n\t }\n\t if (utils.isArrayBufferView(data)) {\n\t return data.buffer;\n\t }\n\t if (utils.isURLSearchParams(data)) {\n\t setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n\t return data.toString();\n\t }\n\t if (utils.isObject(data)) {\n\t setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n\t return JSON.stringify(data);\n\t }\n\t return data;\n\t }],\n\t\n\t transformResponse: [function transformResponse(data) {\n\t /*eslint no-param-reassign:0*/\n\t if (typeof data === 'string') {\n\t try {\n\t data = JSON.parse(data);\n\t } catch (e) { /* Ignore */ }\n\t }\n\t return data;\n\t }],\n\t\n\t /**\n\t * A timeout in milliseconds to abort a request. If set to 0 (default) a\n\t * timeout is not created.\n\t */\n\t timeout: 0,\n\t\n\t xsrfCookieName: 'XSRF-TOKEN',\n\t xsrfHeaderName: 'X-XSRF-TOKEN',\n\t\n\t maxContentLength: -1,\n\t maxBodyLength: -1,\n\t\n\t validateStatus: function validateStatus(status) {\n\t return status >= 200 && status < 300;\n\t }\n\t};\n\t\n\tdefaults.headers = {\n\t common: {\n\t 'Accept': 'application/json, text/plain, */*'\n\t }\n\t};\n\t\n\tutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n\t defaults.headers[method] = {};\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n\t});\n\t\n\tmodule.exports = defaults;\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n\t utils.forEach(headers, function processHeader(value, name) {\n\t if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n\t headers[normalizedName] = value;\n\t delete headers[name];\n\t }\n\t });\n\t};\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar settle = __webpack_require__(13);\n\tvar cookies = __webpack_require__(16);\n\tvar buildURL = __webpack_require__(5);\n\tvar buildFullPath = __webpack_require__(17);\n\tvar parseHeaders = __webpack_require__(20);\n\tvar isURLSameOrigin = __webpack_require__(21);\n\tvar createError = __webpack_require__(14);\n\t\n\tmodule.exports = function xhrAdapter(config) {\n\t return new Promise(function dispatchXhrRequest(resolve, reject) {\n\t var requestData = config.data;\n\t var requestHeaders = config.headers;\n\t\n\t if (utils.isFormData(requestData)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t var request = new XMLHttpRequest();\n\t\n\t // HTTP basic authentication\n\t if (config.auth) {\n\t var username = config.auth.username || '';\n\t var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n\t requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n\t }\n\t\n\t var fullPath = buildFullPath(config.baseURL, config.url);\n\t request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request.onreadystatechange = function handleLoad() {\n\t if (!request || request.readyState !== 4) {\n\t return;\n\t }\n\t\n\t // The request errored out and we didn't get a response, this will be\n\t // handled by onerror instead\n\t // With one exception: request that using file: protocol, most browsers\n\t // will return status as 0 even though it's a successful request\n\t if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n\t return;\n\t }\n\t\n\t // Prepare the response\n\t var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n\t var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n\t var response = {\n\t data: responseData,\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config,\n\t request: request\n\t };\n\t\n\t settle(resolve, reject, response);\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle browser request cancellation (as opposed to a manual cancellation)\n\t request.onabort = function handleAbort() {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle low level network errors\n\t request.onerror = function handleError() {\n\t // Real errors are hidden from us by the browser\n\t // onerror should only fire if it's a network error\n\t reject(createError('Network Error', config, null, request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle timeout\n\t request.ontimeout = function handleTimeout() {\n\t var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n\t if (config.timeoutErrorMessage) {\n\t timeoutErrorMessage = config.timeoutErrorMessage;\n\t }\n\t reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n\t request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t // Add xsrf header\n\t var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n\t cookies.read(config.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t if ('setRequestHeader' in request) {\n\t utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n\t if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n\t // Remove Content-Type if data is undefined\n\t delete requestHeaders[key];\n\t } else {\n\t // Otherwise add header to the request\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t }\n\t\n\t // Add withCredentials to request if needed\n\t if (!utils.isUndefined(config.withCredentials)) {\n\t request.withCredentials = !!config.withCredentials;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n\t // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n\t if (config.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t // Handle progress if needed\n\t if (typeof config.onDownloadProgress === 'function') {\n\t request.addEventListener('progress', config.onDownloadProgress);\n\t }\n\t\n\t // Not all browsers support upload events\n\t if (typeof config.onUploadProgress === 'function' && request.upload) {\n\t request.upload.addEventListener('progress', config.onUploadProgress);\n\t }\n\t\n\t if (config.cancelToken) {\n\t // Handle cancellation\n\t config.cancelToken.promise.then(function onCanceled(cancel) {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t request.abort();\n\t reject(cancel);\n\t // Clean up request\n\t request = null;\n\t });\n\t }\n\t\n\t if (!requestData) {\n\t requestData = null;\n\t }\n\t\n\t // Send the request\n\t request.send(requestData);\n\t });\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar createError = __webpack_require__(14);\n\t\n\t/**\n\t * Resolve or reject a Promise based on response status.\n\t *\n\t * @param {Function} resolve A function that resolves the promise.\n\t * @param {Function} reject A function that rejects the promise.\n\t * @param {object} response The response.\n\t */\n\tmodule.exports = function settle(resolve, reject, response) {\n\t var validateStatus = response.config.validateStatus;\n\t if (!response.status || !validateStatus || validateStatus(response.status)) {\n\t resolve(response);\n\t } else {\n\t reject(createError(\n\t 'Request failed with status code ' + response.status,\n\t response.config,\n\t null,\n\t response.request,\n\t response\n\t ));\n\t }\n\t};\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar enhanceError = __webpack_require__(15);\n\t\n\t/**\n\t * Create an Error with the specified message, config, error code, request and response.\n\t *\n\t * @param {string} message The error message.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The created error.\n\t */\n\tmodule.exports = function createError(message, config, code, request, response) {\n\t var error = new Error(message);\n\t return enhanceError(error, config, code, request, response);\n\t};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Update an Error with the specified config, error code, and response.\n\t *\n\t * @param {Error} error The error to update.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The error.\n\t */\n\tmodule.exports = function enhanceError(error, config, code, request, response) {\n\t error.config = config;\n\t if (code) {\n\t error.code = code;\n\t }\n\t\n\t error.request = request;\n\t error.response = response;\n\t error.isAxiosError = true;\n\t\n\t error.toJSON = function toJSON() {\n\t return {\n\t // Standard\n\t message: this.message,\n\t name: this.name,\n\t // Microsoft\n\t description: this.description,\n\t number: this.number,\n\t // Mozilla\n\t fileName: this.fileName,\n\t lineNumber: this.lineNumber,\n\t columnNumber: this.columnNumber,\n\t stack: this.stack,\n\t // Axios\n\t config: this.config,\n\t code: this.code\n\t };\n\t };\n\t return error;\n\t};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs support document.cookie\n\t (function standardBrowserEnv() {\n\t return {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t };\n\t })() :\n\t\n\t // Non standard browser env (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return {\n\t write: function write() {},\n\t read: function read() { return null; },\n\t remove: function remove() {}\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar isAbsoluteURL = __webpack_require__(18);\n\tvar combineURLs = __webpack_require__(19);\n\t\n\t/**\n\t * Creates a new URL by combining the baseURL with the requestedURL,\n\t * only when the requestedURL is not already an absolute URL.\n\t * If the requestURL is absolute, this function returns the requestedURL untouched.\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} requestedURL Absolute or relative URL to combine\n\t * @returns {string} The combined full path\n\t */\n\tmodule.exports = function buildFullPath(baseURL, requestedURL) {\n\t if (baseURL && !isAbsoluteURL(requestedURL)) {\n\t return combineURLs(baseURL, requestedURL);\n\t }\n\t return requestedURL;\n\t};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the specified URL is absolute\n\t *\n\t * @param {string} url The URL to test\n\t * @returns {boolean} True if the specified URL is absolute, otherwise false\n\t */\n\tmodule.exports = function isAbsoluteURL(url) {\n\t // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n\t // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n\t // by any combination of letters, digits, plus, period, or hyphen.\n\t return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n\t};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Creates a new URL by combining the specified URLs\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} relativeURL The relative URL\n\t * @returns {string} The combined URL\n\t */\n\tmodule.exports = function combineURLs(baseURL, relativeURL) {\n\t return relativeURL\n\t ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n\t : baseURL;\n\t};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t// Headers whose duplicates are ignored by node\n\t// c.f. https://nodejs.org/api/http.html#http_message_headers\n\tvar ignoreDuplicateOf = [\n\t 'age', 'authorization', 'content-length', 'content-type', 'etag',\n\t 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n\t 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n\t 'referer', 'retry-after', 'user-agent'\n\t];\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {};\n\t var key;\n\t var val;\n\t var i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function parser(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n\t return;\n\t }\n\t if (key === 'set-cookie') {\n\t parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n\t } else {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs have full support of the APIs needed to test\n\t // whether the request URL is of the same origin as current location.\n\t (function standardBrowserEnv() {\n\t var msie = /(msie|trident)/i.test(navigator.userAgent);\n\t var urlParsingNode = document.createElement('a');\n\t var originURL;\n\t\n\t /**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\t function resolveURL(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t }\n\t\n\t originURL = resolveURL(window.location.href);\n\t\n\t /**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestURL The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\t return function isURLSameOrigin(requestURL) {\n\t var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n\t return (parsed.protocol === originURL.protocol &&\n\t parsed.host === originURL.host);\n\t };\n\t })() :\n\t\n\t // Non standard browser envs (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return function isURLSameOrigin() {\n\t return true;\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Config-specific merge-function which creates a new config-object\n\t * by merging two configuration objects together.\n\t *\n\t * @param {Object} config1\n\t * @param {Object} config2\n\t * @returns {Object} New object resulting from merging config2 to config1\n\t */\n\tmodule.exports = function mergeConfig(config1, config2) {\n\t // eslint-disable-next-line no-param-reassign\n\t config2 = config2 || {};\n\t var config = {};\n\t\n\t var valueFromConfig2Keys = ['url', 'method', 'data'];\n\t var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n\t var defaultToConfig2Keys = [\n\t 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n\t 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n\t 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n\t 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n\t 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n\t ];\n\t var directMergeKeys = ['validateStatus'];\n\t\n\t function getMergedValue(target, source) {\n\t if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n\t return utils.merge(target, source);\n\t } else if (utils.isPlainObject(source)) {\n\t return utils.merge({}, source);\n\t } else if (utils.isArray(source)) {\n\t return source.slice();\n\t }\n\t return source;\n\t }\n\t\n\t function mergeDeepProperties(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(config1[prop], config2[prop]);\n\t } else if (!utils.isUndefined(config1[prop])) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t }\n\t\n\t utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(undefined, config2[prop]);\n\t }\n\t });\n\t\n\t utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\t\n\t utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n\t if (!utils.isUndefined(config2[prop])) {\n\t config[prop] = getMergedValue(undefined, config2[prop]);\n\t } else if (!utils.isUndefined(config1[prop])) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t });\n\t\n\t utils.forEach(directMergeKeys, function merge(prop) {\n\t if (prop in config2) {\n\t config[prop] = getMergedValue(config1[prop], config2[prop]);\n\t } else if (prop in config1) {\n\t config[prop] = getMergedValue(undefined, config1[prop]);\n\t }\n\t });\n\t\n\t var axiosKeys = valueFromConfig2Keys\n\t .concat(mergeDeepPropertiesKeys)\n\t .concat(defaultToConfig2Keys)\n\t .concat(directMergeKeys);\n\t\n\t var otherKeys = Object\n\t .keys(config1)\n\t .concat(Object.keys(config2))\n\t .filter(function filterAxiosKeys(key) {\n\t return axiosKeys.indexOf(key) === -1;\n\t });\n\t\n\t utils.forEach(otherKeys, mergeDeepProperties);\n\t\n\t return config;\n\t};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * A `Cancel` is an object that is thrown when an operation is canceled.\n\t *\n\t * @class\n\t * @param {string=} message The message.\n\t */\n\tfunction Cancel(message) {\n\t this.message = message;\n\t}\n\t\n\tCancel.prototype.toString = function toString() {\n\t return 'Cancel' + (this.message ? ': ' + this.message : '');\n\t};\n\t\n\tCancel.prototype.__CANCEL__ = true;\n\t\n\tmodule.exports = Cancel;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar Cancel = __webpack_require__(23);\n\t\n\t/**\n\t * A `CancelToken` is an object that can be used to request cancellation of an operation.\n\t *\n\t * @class\n\t * @param {Function} executor The executor function.\n\t */\n\tfunction CancelToken(executor) {\n\t if (typeof executor !== 'function') {\n\t throw new TypeError('executor must be a function.');\n\t }\n\t\n\t var resolvePromise;\n\t this.promise = new Promise(function promiseExecutor(resolve) {\n\t resolvePromise = resolve;\n\t });\n\t\n\t var token = this;\n\t executor(function cancel(message) {\n\t if (token.reason) {\n\t // Cancellation has already been requested\n\t return;\n\t }\n\t\n\t token.reason = new Cancel(message);\n\t resolvePromise(token.reason);\n\t });\n\t}\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n\t if (this.reason) {\n\t throw this.reason;\n\t }\n\t};\n\t\n\t/**\n\t * Returns an object that contains a new `CancelToken` and a function that, when called,\n\t * cancels the `CancelToken`.\n\t */\n\tCancelToken.source = function source() {\n\t var cancel;\n\t var token = new CancelToken(function executor(c) {\n\t cancel = c;\n\t });\n\t return {\n\t token: token,\n\t cancel: cancel\n\t };\n\t};\n\t\n\tmodule.exports = CancelToken;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function wrap(arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the payload is an error thrown by Axios\n\t *\n\t * @param {*} payload The value to test\n\t * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n\t */\n\tmodule.exports = function isAxiosError(payload) {\n\t return (typeof payload === 'object') && (payload.isAxiosError === true);\n\t};\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// axios.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 081842adca0968bb3270","module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 4\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 5\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 6\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 7\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 8\n// module chunks = 0","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 9\n// module chunks = 0","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 10\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 11\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 12\n// module chunks = 0","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 13\n// module chunks = 0","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 14\n// module chunks = 0","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 16\n// module chunks = 0","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/buildFullPath.js\n// module id = 17\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 18\n// module chunks = 0","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 19\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 20\n// module chunks = 0","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 21\n// module chunks = 0","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAxiosError.js\n// module id = 26\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/skynet-js/node_modules/axios/index.d.ts b/node_modules/skynet-js/node_modules/axios/index.d.ts index c860d86..c74e93c 100644 --- a/node_modules/skynet-js/node_modules/axios/index.d.ts +++ b/node_modules/skynet-js/node_modules/axios/index.d.ts @@ -153,8 +153,9 @@ export interface AxiosStatic extends AxiosInstance { isCancel(value: any): boolean; all(values: (T | Promise)[]): Promise; spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; } -declare const Axios: AxiosStatic; +declare const axios: AxiosStatic; -export default Axios; +export default axios; diff --git a/node_modules/skynet-js/node_modules/axios/lib/adapters/http.js b/node_modules/skynet-js/node_modules/axios/lib/adapters/http.js index 135c93a..f32241f 100755 --- a/node_modules/skynet-js/node_modules/axios/lib/adapters/http.js +++ b/node_modules/skynet-js/node_modules/axios/lib/adapters/http.js @@ -16,6 +16,31 @@ var enhanceError = require('../core/enhanceError'); var isHttps = /https:?/; +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + /*eslint consistent-return:0*/ module.exports = function httpAdapter(config) { return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { @@ -126,11 +151,11 @@ module.exports = function httpAdapter(config) { }); } - if (shouldProxy) { proxy = { host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol }; if (parsedProxyUrl.auth) { @@ -145,17 +170,8 @@ module.exports = function httpAdapter(config) { } if (proxy) { - options.hostname = proxy.host; - options.host = proxy.host; options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - options.port = proxy.port; - options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path; - - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; - } + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); } var transport; diff --git a/node_modules/skynet-js/node_modules/axios/lib/axios.js b/node_modules/skynet-js/node_modules/axios/lib/axios.js index 8142437..c6357b0 100644 --- a/node_modules/skynet-js/node_modules/axios/lib/axios.js +++ b/node_modules/skynet-js/node_modules/axios/lib/axios.js @@ -47,6 +47,9 @@ axios.all = function all(promises) { }; axios.spread = require('./helpers/spread'); +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + module.exports = axios; // Allow use of default import syntax in TypeScript diff --git a/node_modules/skynet-js/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/skynet-js/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 0000000..29ff41a --- /dev/null +++ b/node_modules/skynet-js/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/skynet-js/node_modules/axios/package.json b/node_modules/skynet-js/node_modules/axios/package.json index f3e412d..659ef02 100644 --- a/node_modules/skynet-js/node_modules/axios/package.json +++ b/node_modules/skynet-js/node_modules/axios/package.json @@ -1,6 +1,6 @@ { "name": "axios", - "version": "0.21.0", + "version": "0.21.1", "description": "Promise based HTTP client for the browser and node.js", "main": "index.js", "scripts": { diff --git a/node_modules/skynet-js/node_modules/mime-db/HISTORY.md b/node_modules/skynet-js/node_modules/mime-db/HISTORY.md deleted file mode 100644 index 56d792f..0000000 --- a/node_modules/skynet-js/node_modules/mime-db/HISTORY.md +++ /dev/null @@ -1,458 +0,0 @@ -1.45.0 / 2020-09-22 -=================== - - * Add `application/ubjson` with extension `.ubj` - * Add `image/avif` with extension `.avif` - * Add `image/ktx2` with extension `.ktx2` - * Add extension `.dbf` to `application/vnd.dbf` - * Add extension `.rar` to `application/vnd.rar` - * Add extension `.td` to `application/urc-targetdesc+xml` - * Add new upstream MIME types - * Fix extension of `application/vnd.apple.keynote` to be `.key` - -1.44.0 / 2020-04-22 -=================== - - * Add charsets from IANA - * Add extension `.cjs` to `application/node` - * Add new upstream MIME types - -1.43.0 / 2020-01-05 -=================== - - * Add `application/x-keepass2` with extension `.kdbx` - * Add extension `.mxmf` to `audio/mobile-xmf` - * Add extensions from IANA for `application/*+xml` types - * Add new upstream MIME types - -1.42.0 / 2019-09-25 -=================== - - * Add `image/vnd.ms-dds` with extension `.dds` - * Add new upstream MIME types - * Remove compressible from `multipart/mixed` - -1.41.0 / 2019-08-30 -=================== - - * Add new upstream MIME types - * Add `application/toml` with extension `.toml` - * Mark `font/ttf` as compressible - -1.40.0 / 2019-04-20 -=================== - - * Add extensions from IANA for `model/*` types - * Add `text/mdx` with extension `.mdx` - -1.39.0 / 2019-04-04 -=================== - - * Add extensions `.siv` and `.sieve` to `application/sieve` - * Add new upstream MIME types - -1.38.0 / 2019-02-04 -=================== - - * Add extension `.nq` to `application/n-quads` - * Add extension `.nt` to `application/n-triples` - * Add new upstream MIME types - * Mark `text/less` as compressible - -1.37.0 / 2018-10-19 -=================== - - * Add extensions to HEIC image types - * Add new upstream MIME types - -1.36.0 / 2018-08-20 -=================== - - * Add Apple file extensions from IANA - * Add extensions from IANA for `image/*` types - * Add new upstream MIME types - -1.35.0 / 2018-07-15 -=================== - - * Add extension `.owl` to `application/rdf+xml` - * Add new upstream MIME types - - Removes extension `.woff` from `application/font-woff` - -1.34.0 / 2018-06-03 -=================== - - * Add extension `.csl` to `application/vnd.citationstyles.style+xml` - * Add extension `.es` to `application/ecmascript` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/turtle` - * Mark all XML-derived types as compressible - -1.33.0 / 2018-02-15 -=================== - - * Add extensions from IANA for `message/*` types - * Add new upstream MIME types - * Fix some incorrect OOXML types - * Remove `application/font-woff2` - -1.32.0 / 2017-11-29 -=================== - - * Add new upstream MIME types - * Update `text/hjson` to registered `application/hjson` - * Add `text/shex` with extension `.shex` - -1.31.0 / 2017-10-25 -=================== - - * Add `application/raml+yaml` with extension `.raml` - * Add `application/wasm` with extension `.wasm` - * Add new `font` type from IANA - * Add new upstream font extensions - * Add new upstream MIME types - * Add extensions for JPEG-2000 images - -1.30.0 / 2017-08-27 -=================== - - * Add `application/vnd.ms-outlook` - * Add `application/x-arj` - * Add extension `.mjs` to `application/javascript` - * Add glTF types and extensions - * Add new upstream MIME types - * Add `text/x-org` - * Add VirtualBox MIME types - * Fix `source` records for `video/*` types that are IANA - * Update `font/opentype` to registered `font/otf` - -1.29.0 / 2017-07-10 -=================== - - * Add `application/fido.trusted-apps+json` - * Add extension `.wadl` to `application/vnd.sun.wadl+xml` - * Add new upstream MIME types - * Add `UTF-8` as default charset for `text/css` - -1.28.0 / 2017-05-14 -=================== - - * Add new upstream MIME types - * Add extension `.gz` to `application/gzip` - * Update extensions `.md` and `.markdown` to be `text/markdown` - -1.27.0 / 2017-03-16 -=================== - - * Add new upstream MIME types - * Add `image/apng` with extension `.apng` - -1.26.0 / 2017-01-14 -=================== - - * Add new upstream MIME types - * Add extension `.geojson` to `application/geo+json` - -1.25.0 / 2016-11-11 -=================== - - * Add new upstream MIME types - -1.24.0 / 2016-09-18 -=================== - - * Add `audio/mp3` - * Add new upstream MIME types - -1.23.0 / 2016-05-01 -=================== - - * Add new upstream MIME types - * Add extension `.3gpp` to `audio/3gpp` - -1.22.0 / 2016-02-15 -=================== - - * Add `text/slim` - * Add extension `.rng` to `application/xml` - * Add new upstream MIME types - * Fix extension of `application/dash+xml` to be `.mpd` - * Update primary extension to `.m4a` for `audio/mp4` - -1.21.0 / 2016-01-06 -=================== - - * Add Google document types - * Add new upstream MIME types - -1.20.0 / 2015-11-10 -=================== - - * Add `text/x-suse-ymp` - * Add new upstream MIME types - -1.19.0 / 2015-09-17 -=================== - - * Add `application/vnd.apple.pkpass` - * Add new upstream MIME types - -1.18.0 / 2015-09-03 -=================== - - * Add new upstream MIME types - -1.17.0 / 2015-08-13 -=================== - - * Add `application/x-msdos-program` - * Add `audio/g711-0` - * Add `image/vnd.mozilla.apng` - * Add extension `.exe` to `application/x-msdos-program` - -1.16.0 / 2015-07-29 -=================== - - * Add `application/vnd.uri-map` - -1.15.0 / 2015-07-13 -=================== - - * Add `application/x-httpd-php` - -1.14.0 / 2015-06-25 -=================== - - * Add `application/scim+json` - * Add `application/vnd.3gpp.ussd+xml` - * Add `application/vnd.biopax.rdf+xml` - * Add `text/x-processing` - -1.13.0 / 2015-06-07 -=================== - - * Add nginx as a source - * Add `application/x-cocoa` - * Add `application/x-java-archive-diff` - * Add `application/x-makeself` - * Add `application/x-perl` - * Add `application/x-pilot` - * Add `application/x-redhat-package-manager` - * Add `application/x-sea` - * Add `audio/x-m4a` - * Add `audio/x-realaudio` - * Add `image/x-jng` - * Add `text/mathml` - -1.12.0 / 2015-06-05 -=================== - - * Add `application/bdoc` - * Add `application/vnd.hyperdrive+json` - * Add `application/x-bdoc` - * Add extension `.rtf` to `text/rtf` - -1.11.0 / 2015-05-31 -=================== - - * Add `audio/wav` - * Add `audio/wave` - * Add extension `.litcoffee` to `text/coffeescript` - * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` - * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` - -1.10.0 / 2015-05-19 -=================== - - * Add `application/vnd.balsamiq.bmpr` - * Add `application/vnd.microsoft.portable-executable` - * Add `application/x-ns-proxy-autoconfig` - -1.9.1 / 2015-04-19 -================== - - * Remove `.json` extension from `application/manifest+json` - - This is causing bugs downstream - -1.9.0 / 2015-04-19 -================== - - * Add `application/manifest+json` - * Add `application/vnd.micro+json` - * Add `image/vnd.zbrush.pcx` - * Add `image/x-ms-bmp` - -1.8.0 / 2015-03-13 -================== - - * Add `application/vnd.citationstyles.style+xml` - * Add `application/vnd.fastcopy-disk-image` - * Add `application/vnd.gov.sk.xmldatacontainer+xml` - * Add extension `.jsonld` to `application/ld+json` - -1.7.0 / 2015-02-08 -================== - - * Add `application/vnd.gerber` - * Add `application/vnd.msa-disk-image` - -1.6.1 / 2015-02-05 -================== - - * Community extensions ownership transferred from `node-mime` - -1.6.0 / 2015-01-29 -================== - - * Add `application/jose` - * Add `application/jose+json` - * Add `application/json-seq` - * Add `application/jwk+json` - * Add `application/jwk-set+json` - * Add `application/jwt` - * Add `application/rdap+json` - * Add `application/vnd.gov.sk.e-form+xml` - * Add `application/vnd.ims.imsccv1p3` - -1.5.0 / 2014-12-30 -================== - - * Add `application/vnd.oracle.resource+json` - * Fix various invalid MIME type entries - - `application/mbox+xml` - - `application/oscp-response` - - `application/vwg-multiplexed` - - `audio/g721` - -1.4.0 / 2014-12-21 -================== - - * Add `application/vnd.ims.imsccv1p2` - * Fix various invalid MIME type entries - - `application/vnd-acucobol` - - `application/vnd-curl` - - `application/vnd-dart` - - `application/vnd-dxr` - - `application/vnd-fdf` - - `application/vnd-mif` - - `application/vnd-sema` - - `application/vnd-wap-wmlc` - - `application/vnd.adobe.flash-movie` - - `application/vnd.dece-zip` - - `application/vnd.dvb_service` - - `application/vnd.micrografx-igx` - - `application/vnd.sealed-doc` - - `application/vnd.sealed-eml` - - `application/vnd.sealed-mht` - - `application/vnd.sealed-ppt` - - `application/vnd.sealed-tiff` - - `application/vnd.sealed-xls` - - `application/vnd.sealedmedia.softseal-html` - - `application/vnd.sealedmedia.softseal-pdf` - - `application/vnd.wap-slc` - - `application/vnd.wap-wbxml` - - `audio/vnd.sealedmedia.softseal-mpeg` - - `image/vnd-djvu` - - `image/vnd-svf` - - `image/vnd-wap-wbmp` - - `image/vnd.sealed-png` - - `image/vnd.sealedmedia.softseal-gif` - - `image/vnd.sealedmedia.softseal-jpg` - - `model/vnd-dwf` - - `model/vnd.parasolid.transmit-binary` - - `model/vnd.parasolid.transmit-text` - - `text/vnd-a` - - `text/vnd-curl` - - `text/vnd.wap-wml` - * Remove example template MIME types - - `application/example` - - `audio/example` - - `image/example` - - `message/example` - - `model/example` - - `multipart/example` - - `text/example` - - `video/example` - -1.3.1 / 2014-12-16 -================== - - * Fix missing extensions - - `application/json5` - - `text/hjson` - -1.3.0 / 2014-12-07 -================== - - * Add `application/a2l` - * Add `application/aml` - * Add `application/atfx` - * Add `application/atxml` - * Add `application/cdfx+xml` - * Add `application/dii` - * Add `application/json5` - * Add `application/lxf` - * Add `application/mf4` - * Add `application/vnd.apache.thrift.compact` - * Add `application/vnd.apache.thrift.json` - * Add `application/vnd.coffeescript` - * Add `application/vnd.enphase.envoy` - * Add `application/vnd.ims.imsccv1p1` - * Add `text/csv-schema` - * Add `text/hjson` - * Add `text/markdown` - * Add `text/yaml` - -1.2.0 / 2014-11-09 -================== - - * Add `application/cea` - * Add `application/dit` - * Add `application/vnd.gov.sk.e-form+zip` - * Add `application/vnd.tmd.mediaflex.api+xml` - * Type `application/epub+zip` is now IANA-registered - -1.1.2 / 2014-10-23 -================== - - * Rebuild database for `application/x-www-form-urlencoded` change - -1.1.1 / 2014-10-20 -================== - - * Mark `application/x-www-form-urlencoded` as compressible. - -1.1.0 / 2014-09-28 -================== - - * Add `application/font-woff2` - -1.0.3 / 2014-09-25 -================== - - * Fix engine requirement in package - -1.0.2 / 2014-09-25 -================== - - * Add `application/coap-group+json` - * Add `application/dcd` - * Add `application/vnd.apache.thrift.binary` - * Add `image/vnd.tencent.tap` - * Mark all JSON-derived types as compressible - * Update `text/vtt` data - -1.0.1 / 2014-08-30 -================== - - * Fix extension ordering - -1.0.0 / 2014-08-30 -================== - - * Add `application/atf` - * Add `application/merge-patch+json` - * Add `multipart/x-mixed-replace` - * Add `source: 'apache'` metadata - * Add `source: 'iana'` metadata - * Remove badly-assumed charset data diff --git a/node_modules/skynet-js/node_modules/mime-db/LICENSE b/node_modules/skynet-js/node_modules/mime-db/LICENSE deleted file mode 100644 index a7ae8ee..0000000 --- a/node_modules/skynet-js/node_modules/mime-db/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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/skynet-js/node_modules/mime-db/README.md b/node_modules/skynet-js/node_modules/mime-db/README.md deleted file mode 100644 index f1e6391..0000000 --- a/node_modules/skynet-js/node_modules/mime-db/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# mime-db - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][travis-image]][travis-url] -[![Coverage Status][coveralls-image]][coveralls-url] - -This is a database of all mime types. -It consists of a single, public JSON file and does not include any logic, -allowing it to remain as un-opinionated as possible with an API. -It aggregates data from the following sources: - -- http://www.iana.org/assignments/media-types/media-types.xhtml -- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types - -## Installation - -```bash -npm install mime-db -``` - -### Database Download - -If you're crazy enough to use this in the browser, you can just grab the -JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to -replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) -as the JSON format may change in the future. - -``` -https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json -``` - -## Usage - - - -```js -var db = require('mime-db') - -// grab data on .js files -var data = db['application/javascript'] -``` - -## Data Structure - -The JSON file is a map lookup for lowercased mime types. -Each mime type has the following properties: - -- `.source` - where the mime type is defined. - If not set, it's probably a custom media type. - - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) - - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) - - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) -- `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type can be gzipped. -- `.charset` - the default charset associated with this type, if any. - -If unknown, every property could be `undefined`. - -## Contributing - -To edit the database, only make PRs against `src/custom-types.json` or -`src/custom-suffix.json`. - -The `src/custom-types.json` file is a JSON object with the MIME type as the -keys and the values being an object with the following keys: - -- `compressible` - leave out if you don't know, otherwise `true`/`false` to - indicate whether the data represented by the type is typically compressible. -- `extensions` - include an array of file extensions that are associated with - the type. -- `notes` - human-readable notes about the type, typically what the type is. -- `sources` - include an array of URLs of where the MIME type and the associated - extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); - links to type aggregating sites and Wikipedia are _not acceptable_. - -To update the build, run `npm run build`. - -### Adding Custom Media Types - -The best way to get new media types included in this library is to register -them with the IANA. The community registration procedure is outlined in -[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types -registered with the IANA are automatically pulled into this library. - -If that is not possible / feasible, they can be added directly here as a -"custom" type. To do this, it is required to have a primary source that -definitively lists the media type. If an extension is going to be listed as -associateed with this media type, the source must definitively link the -media type and extension as well. - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://badgen.net/npm/node/mime-db -[node-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/mime-db -[npm-url]: https://npmjs.org/package/mime-db -[npm-version-image]: https://badgen.net/npm/v/mime-db -[travis-image]: https://badgen.net/travis/jshttp/mime-db/master -[travis-url]: https://travis-ci.org/jshttp/mime-db diff --git a/node_modules/skynet-js/node_modules/mime-db/db.json b/node_modules/skynet-js/node_modules/mime-db/db.json deleted file mode 100644 index 05cfa68..0000000 --- a/node_modules/skynet-js/node_modules/mime-db/db.json +++ /dev/null @@ -1,8242 +0,0 @@ -{ - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/3gpp-ims+xml": { - "source": "iana", - "compressible": true - }, - "application/a2l": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/activity+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamcontrol+json": { - "source": "iana", - "compressible": true - }, - "application/alto-updatestreamparams+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": ["ez"] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": ["aw"] - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atom"] - }, - "application/atomcat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomcat"] - }, - "application/atomdeleted+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomdeleted"] - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["atomsvc"] - }, - "application/atsc-dwd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dwd"] - }, - "application/atsc-dynamic-event-message": { - "source": "iana" - }, - "application/atsc-held+xml": { - "source": "iana", - "compressible": true, - "extensions": ["held"] - }, - "application/atsc-rdt+json": { - "source": "iana", - "compressible": true - }, - "application/atsc-rsat+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsat"] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana", - "compressible": true - }, - "application/bacnet-xdd+zip": { - "source": "iana", - "compressible": false - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/beep+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xcs"] - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/captive+json": { - "source": "iana", - "compressible": true - }, - "application/cbor": { - "source": "iana" - }, - "application/cbor-seq": { - "source": "iana" - }, - "application/cccex": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana", - "compressible": true - }, - "application/ccxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ccxml"] - }, - "application/cdfx+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdfx"] - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": ["cdmia"] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": ["cdmic"] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": ["cdmid"] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": ["cdmio"] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": ["cdmiq"] - }, - "application/cdni": { - "source": "iana" - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana", - "compressible": true - }, - "application/cellml+xml": { - "source": "iana", - "compressible": true - }, - "application/cfw": { - "source": "iana" - }, - "application/clue+xml": { - "source": "iana", - "compressible": true - }, - "application/clue_info+xml": { - "source": "iana", - "compressible": true - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana", - "compressible": true - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/coap-payload": { - "source": "iana" - }, - "application/commonground": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/cose": { - "source": "iana" - }, - "application/cose-key": { - "source": "iana" - }, - "application/cose-key-set": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana", - "compressible": true - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana", - "compressible": true - }, - "application/cstadata+xml": { - "source": "iana", - "compressible": true - }, - "application/csvm+json": { - "source": "iana", - "compressible": true - }, - "application/cu-seeme": { - "source": "apache", - "extensions": ["cu"] - }, - "application/cwt": { - "source": "iana" - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpd"] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "compressible": true, - "extensions": ["davmount"] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana", - "compressible": true - }, - "application/dicom": { - "source": "iana" - }, - "application/dicom+json": { - "source": "iana", - "compressible": true - }, - "application/dicom+xml": { - "source": "iana", - "compressible": true - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/dns+json": { - "source": "iana", - "compressible": true - }, - "application/dns-message": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dbk"] - }, - "application/dots+cbor": { - "source": "iana" - }, - "application/dskpp+xml": { - "source": "iana", - "compressible": true - }, - "application/dssc+der": { - "source": "iana", - "extensions": ["dssc"] - }, - "application/dssc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdssc"] - }, - "application/dvcs": { - "source": "iana" - }, - "application/ecmascript": { - "source": "iana", - "compressible": true, - "extensions": ["ecma","es"] - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/efi": { - "source": "iana" - }, - "application/emergencycalldata.cap+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/emergencycalldata.comment+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.control+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.deviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.ecall.msd": { - "source": "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.serviceinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.subscriberinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/emergencycalldata.veds+xml": { - "source": "iana", - "compressible": true - }, - "application/emma+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emma"] - }, - "application/emotionml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["emotionml"] - }, - "application/encaprtp": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana", - "compressible": true - }, - "application/epub+zip": { - "source": "iana", - "compressible": false, - "extensions": ["epub"] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": ["exi"] - }, - "application/expect-ct-report+json": { - "source": "iana", - "compressible": true - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fdt"] - }, - "application/fhir+json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fhir+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/fido.trusted-apps+json": { - "compressible": true - }, - "application/fits": { - "source": "iana" - }, - "application/flexfec": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": ["pfr"] - }, - "application/font-woff": { - "source": "iana", - "compressible": false - }, - "application/framework-attributes+xml": { - "source": "iana", - "compressible": true - }, - "application/geo+json": { - "source": "iana", - "compressible": true, - "extensions": ["geojson"] - }, - "application/geo+json-seq": { - "source": "iana" - }, - "application/geopackage+sqlite3": { - "source": "iana" - }, - "application/geoxacml+xml": { - "source": "iana", - "compressible": true - }, - "application/gltf-buffer": { - "source": "iana" - }, - "application/gml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["gml"] - }, - "application/gpx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["gpx"] - }, - "application/gxf": { - "source": "apache", - "extensions": ["gxf"] - }, - "application/gzip": { - "source": "iana", - "compressible": false, - "extensions": ["gz"] - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana", - "compressible": true - }, - "application/hjson": { - "extensions": ["hjson"] - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": ["stk"] - }, - "application/ibe-key-request+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pkg-reply+xml": { - "source": "iana", - "compressible": true - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ink","inkml"] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": ["ipfix"] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana", - "compressible": true, - "extensions": ["its"] - }, - "application/java-archive": { - "source": "apache", - "compressible": false, - "extensions": ["jar","war","ear"] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": ["ser"] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": ["class"] - }, - "application/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["js","mjs"] - }, - "application/jf2feed+json": { - "source": "iana", - "compressible": true - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["json","map"] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": ["json5"] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": ["jsonml"] - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana", - "compressible": true - }, - "application/kpml-response+xml": { - "source": "iana", - "compressible": true - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": ["jsonld"] - }, - "application/lgr+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lgr"] - }, - "application/link-format": { - "source": "iana" - }, - "application/load-control+xml": { - "source": "iana", - "compressible": true - }, - "application/lost+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lostxml"] - }, - "application/lostsync+xml": { - "source": "iana", - "compressible": true - }, - "application/lpf+zip": { - "source": "iana", - "compressible": false - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": ["hqx"] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": ["cpt"] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mads"] - }, - "application/manifest+json": { - "charset": "UTF-8", - "compressible": true, - "extensions": ["webmanifest"] - }, - "application/marc": { - "source": "iana", - "extensions": ["mrc"] - }, - "application/marcxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mrcx"] - }, - "application/mathematica": { - "source": "iana", - "extensions": ["ma","nb","mb"] - }, - "application/mathml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mathml"] - }, - "application/mathml-content+xml": { - "source": "iana", - "compressible": true - }, - "application/mathml-presentation+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-deregister+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-envelope+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-msk-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-protection-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-reception-report+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-register-response+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-schedule+xml": { - "source": "iana", - "compressible": true - }, - "application/mbms-user-service-description+xml": { - "source": "iana", - "compressible": true - }, - "application/mbox": { - "source": "iana", - "extensions": ["mbox"] - }, - "application/media-policy-dataset+xml": { - "source": "iana", - "compressible": true - }, - "application/media_control+xml": { - "source": "iana", - "compressible": true - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mscml"] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "compressible": true, - "extensions": ["metalink"] - }, - "application/metalink4+xml": { - "source": "iana", - "compressible": true, - "extensions": ["meta4"] - }, - "application/mets+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mets"] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mipc": { - "source": "iana" - }, - "application/mmt-aei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["maei"] - }, - "application/mmt-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musd"] - }, - "application/mods+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mods"] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": ["m21","mp21"] - }, - "application/mp4": { - "source": "iana", - "extensions": ["mp4s","m4p"] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/mrb-publish+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/msc-ivr+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msc-mixer+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": ["doc","dot"] - }, - "application/mud+json": { - "source": "iana", - "compressible": true - }, - "application/multipart-core": { - "source": "iana" - }, - "application/mxf": { - "source": "iana", - "extensions": ["mxf"] - }, - "application/n-quads": { - "source": "iana", - "extensions": ["nq"] - }, - "application/n-triples": { - "source": "iana", - "extensions": ["nt"] - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-groupinfo": { - "source": "iana", - "charset": "US-ASCII" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana", - "compressible": true - }, - "application/node": { - "source": "iana", - "extensions": ["cjs"] - }, - "application/nss": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": false, - "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] - }, - "application/oda": { - "source": "iana", - "extensions": ["oda"] - }, - "application/odm+xml": { - "source": "iana", - "compressible": true - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["opf"] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogx"] - }, - "application/omdoc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["omdoc"] - }, - "application/onenote": { - "source": "apache", - "extensions": ["onetoc","onetoc2","onetmp","onepkg"] - }, - "application/opc-nodeset+xml": { - "source": "iana", - "compressible": true - }, - "application/oscore": { - "source": "iana" - }, - "application/oxps": { - "source": "iana", - "extensions": ["oxps"] - }, - "application/p2p-overlay+xml": { - "source": "iana", - "compressible": true, - "extensions": ["relo"] - }, - "application/parityfec": { - "source": "iana" - }, - "application/passport": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xer"] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": ["pdf"] - }, - "application/pdx": { - "source": "iana" - }, - "application/pem-certificate-chain": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": ["pgp"] - }, - "application/pgp-keys": { - "source": "iana" - }, - "application/pgp-signature": { - "source": "iana", - "extensions": ["asc","sig"] - }, - "application/pics-rules": { - "source": "apache", - "extensions": ["prf"] - }, - "application/pidf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pidf-diff+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/pkcs10": { - "source": "iana", - "extensions": ["p10"] - }, - "application/pkcs12": { - "source": "iana" - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": ["p7m","p7c"] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": ["p7s"] - }, - "application/pkcs8": { - "source": "iana", - "extensions": ["p8"] - }, - "application/pkcs8-encrypted": { - "source": "iana" - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": ["ac"] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": ["cer"] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": ["crl"] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": ["pkipath"] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": ["pki"] - }, - "application/pls+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pls"] - }, - "application/poc-settings+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": ["ai","eps","ps"] - }, - "application/ppsp-tracker+json": { - "source": "iana", - "compressible": true - }, - "application/problem+json": { - "source": "iana", - "compressible": true - }, - "application/problem+xml": { - "source": "iana", - "compressible": true - }, - "application/provenance+xml": { - "source": "iana", - "compressible": true, - "extensions": ["provx"] - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": ["cww"] - }, - "application/prs.hpub+zip": { - "source": "iana", - "compressible": false - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana", - "compressible": true - }, - "application/pskc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["pskcxml"] - }, - "application/pvd+json": { - "source": "iana", - "compressible": true - }, - "application/qsig": { - "source": "iana" - }, - "application/raml+yaml": { - "compressible": true, - "extensions": ["raml"] - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rdf","owl"] - }, - "application/reginfo+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rif"] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": ["rnc"] - }, - "application/remote-printing": { - "source": "iana" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resource-lists+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rl"] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rld"] - }, - "application/rfc+xml": { - "source": "iana", - "compressible": true - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana", - "compressible": true - }, - "application/rls-services+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rs"] - }, - "application/route-apd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rapd"] - }, - "application/route-s-tsid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sls"] - }, - "application/route-usd+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rusd"] - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": ["gbr"] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": ["mft"] - }, - "application/rpki-publication": { - "source": "iana" - }, - "application/rpki-roa": { - "source": "iana", - "extensions": ["roa"] - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rsd"] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": ["rss"] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana", - "compressible": true - }, - "application/samlmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/sarif+json": { - "source": "iana", - "compressible": true - }, - "application/sbe": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sbml"] - }, - "application/scaip+xml": { - "source": "iana", - "compressible": true - }, - "application/scim+json": { - "source": "iana", - "compressible": true - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": ["scq"] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": ["scs"] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": ["spq"] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": ["spp"] - }, - "application/sdp": { - "source": "iana", - "extensions": ["sdp"] - }, - "application/secevent+jwt": { - "source": "iana" - }, - "application/senml+cbor": { - "source": "iana" - }, - "application/senml+json": { - "source": "iana", - "compressible": true - }, - "application/senml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["senmlx"] - }, - "application/senml-etch+cbor": { - "source": "iana" - }, - "application/senml-etch+json": { - "source": "iana", - "compressible": true - }, - "application/senml-exi": { - "source": "iana" - }, - "application/sensml+cbor": { - "source": "iana" - }, - "application/sensml+json": { - "source": "iana", - "compressible": true - }, - "application/sensml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sensmlx"] - }, - "application/sensml-exi": { - "source": "iana" - }, - "application/sep+xml": { - "source": "iana", - "compressible": true - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": ["setpay"] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": ["setreg"] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "compressible": true, - "extensions": ["shf"] - }, - "application/sieve": { - "source": "iana", - "extensions": ["siv","sieve"] - }, - "application/simple-filter+xml": { - "source": "iana", - "compressible": true - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/sipc": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "iana" - }, - "application/smil+xml": { - "source": "iana", - "compressible": true, - "extensions": ["smi","smil"] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": ["rq"] - }, - "application/sparql-results+xml": { - "source": "iana", - "compressible": true, - "extensions": ["srx"] - }, - "application/spirits-event+xml": { - "source": "iana", - "compressible": true - }, - "application/sql": { - "source": "iana" - }, - "application/srgs": { - "source": "iana", - "extensions": ["gram"] - }, - "application/srgs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["grxml"] - }, - "application/sru+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sru"] - }, - "application/ssdl+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ssdl"] - }, - "application/ssml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ssml"] - }, - "application/stix+json": { - "source": "iana", - "compressible": true - }, - "application/swid+xml": { - "source": "iana", - "compressible": true, - "extensions": ["swidtag"] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/taxii+json": { - "source": "iana", - "compressible": true - }, - "application/td+json": { - "source": "iana", - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tei","teicorpus"] - }, - "application/tetra_isi": { - "source": "iana" - }, - "application/thraud+xml": { - "source": "iana", - "compressible": true, - "extensions": ["tfi"] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": ["tsd"] - }, - "application/tlsrpt+gzip": { - "source": "iana" - }, - "application/tlsrpt+json": { - "source": "iana", - "compressible": true - }, - "application/tnauthlist": { - "source": "iana" - }, - "application/toml": { - "compressible": true, - "extensions": ["toml"] - }, - "application/trickle-ice-sdpfrag": { - "source": "iana" - }, - "application/trig": { - "source": "iana" - }, - "application/ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ttml"] - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/tzif": { - "source": "iana" - }, - "application/tzif-leap": { - "source": "iana" - }, - "application/ubjson": { - "compressible": false, - "extensions": ["ubj"] - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/urc-ressheet+xml": { - "source": "iana", - "compressible": true, - "extensions": ["rsheet"] - }, - "application/urc-targetdesc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["td"] - }, - "application/urc-uisocketdesc+xml": { - "source": "iana", - "compressible": true - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana", - "compressible": true - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.1000minds.decision-model+xml": { - "source": "iana", - "compressible": true, - "extensions": ["1km"] - }, - "application/vnd.3gpp-prose+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp-v2x-local-service-information": { - "source": "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.gmop+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mc-signalling-ear": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-payload": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-signalling": { - "source": "iana" - }, - "application/vnd.3gpp.mcdata-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcdata-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-floor-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-signed+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-ue-init-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcptt-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-command+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-affiliation-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-location-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-service-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-transmission-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-ue-config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mcvideo-user-profile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.mid-call+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": ["plb"] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": ["psb"] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": ["pvb"] - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp.sms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-ext+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.srvcc-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.state-and-event-info+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp.ussd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": ["tcap"] - }, - "application/vnd.3lightssoftware.imagescal": { - "source": "iana" - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": ["pwn"] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": ["aso"] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": ["imp"] - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": ["acu"] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": ["atc","acutc"] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "compressible": false, - "extensions": ["air"] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": ["fcdt"] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": ["fxp","fxpl"] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdp"] - }, - "application/vnd.adobe.xfdf": { - "source": "iana", - "extensions": ["xfdf"] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata": { - "source": "iana" - }, - "application/vnd.afpc.afplinedata-pagedef": { - "source": "iana" - }, - "application/vnd.afpc.foca-charset": { - "source": "iana" - }, - "application/vnd.afpc.foca-codedfont": { - "source": "iana" - }, - "application/vnd.afpc.foca-codepage": { - "source": "iana" - }, - "application/vnd.afpc.modca": { - "source": "iana" - }, - "application/vnd.afpc.modca-formdef": { - "source": "iana" - }, - "application/vnd.afpc.modca-mediummap": { - "source": "iana" - }, - "application/vnd.afpc.modca-objectcontainer": { - "source": "iana" - }, - "application/vnd.afpc.modca-overlay": { - "source": "iana" - }, - "application/vnd.afpc.modca-pagesegment": { - "source": "iana" - }, - "application/vnd.ah-barcode": { - "source": "iana" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": ["ahead"] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": ["azf"] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": ["azs"] - }, - "application/vnd.amadeus+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": ["azw"] - }, - "application/vnd.amazon.mobi8-ebook": { - "source": "iana" - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": ["acc"] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": ["ami"] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.android.ota": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": ["apk"] - }, - "application/vnd.anki": { - "source": "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": ["cii"] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": ["fti"] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": ["atx"] - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.aplextor.warrp+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apothekende.reservation+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mpkg"] - }, - "application/vnd.apple.keynote": { - "source": "iana", - "extensions": ["key"] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": ["m3u8"] - }, - "application/vnd.apple.numbers": { - "source": "iana", - "extensions": ["numbers"] - }, - "application/vnd.apple.pages": { - "source": "iana", - "extensions": ["pages"] - }, - "application/vnd.apple.pkpass": { - "compressible": false, - "extensions": ["pkpass"] - }, - "application/vnd.arastra.swi": { - "source": "iana" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": ["swi"] - }, - "application/vnd.artisan+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": ["iota"] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": ["aep"] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avalon+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.avistar+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["bmml"] - }, - "application/vnd.balsamiq.bmpr": { - "source": "iana" - }, - "application/vnd.banana-accounting": { - "source": "iana" - }, - "application/vnd.bbf.usp.error": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg": { - "source": "iana" - }, - "application/vnd.bbf.usp.msg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.bint.med-content": { - "source": "iana" - }, - "application/vnd.biopax.rdf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.blink-idb-value-wrapper": { - "source": "iana" - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": ["mpm"] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": ["bmi"] - }, - "application/vnd.bpf": { - "source": "iana" - }, - "application/vnd.bpf3": { - "source": "iana" - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": ["rep"] - }, - "application/vnd.byu.uapi+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.capasystems-pg+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "compressible": true, - "extensions": ["cdxml"] - }, - "application/vnd.chess-pgn": { - "source": "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": ["mmd"] - }, - "application/vnd.ciedi": { - "source": "iana" - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": ["cdy"] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana", - "compressible": true, - "extensions": ["csl"] - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": ["cla"] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": ["rp9"] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": ["c4g","c4d","c4f","c4p","c4u"] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": ["c11amc"] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": ["c11amz"] - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.document-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.presentation-template": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet": { - "source": "iana" - }, - "application/vnd.collabio.xodocuments.spreadsheet-template": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.comicbook+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.comicbook-rar": { - "source": "iana" - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": ["csp"] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": ["cdbcmsg"] - }, - "application/vnd.coreos.ignition+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": ["cmc"] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": ["clkx"] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": ["clkk"] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": ["clkp"] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": ["clkt"] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": ["clkw"] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wbs"] - }, - "application/vnd.cryptii.pipe+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.crypto-shade-file": { - "source": "iana" - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": ["pml"] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": ["ppd"] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": ["car"] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": ["pcurl"] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.d2l.coursepackage1p0+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.d3m-dataset": { - "source": "iana" - }, - "application/vnd.d3m-problem": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": ["dart"] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": ["rdz"] - }, - "application/vnd.datapackage+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dataresource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dbf": { - "source": "iana", - "extensions": ["dbf"] - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": ["uvf","uvvf","uvd","uvvd"] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uvt","uvvt"] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": ["uvx","uvvx"] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": ["uvz","uvvz"] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": ["fe_launch"] - }, - "application/vnd.desmume.movie": { - "source": "iana" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dna": { - "source": "iana", - "extensions": ["dna"] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": ["mlp"] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": ["dpg"] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": ["dfac"] - }, - "application/vnd.drive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": ["kpxx"] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": ["ait"] - }, - "application/vnd.dvb.dvbisl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": ["svc"] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": ["geo"] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecip.rlp": { - "source": "iana" - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": ["mag"] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.efi.img": { - "source": "iana" - }, - "application/vnd.efi.iso": { - "source": "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": ["nml"] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": ["esf"] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": ["msf"] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": ["qam"] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": ["slt"] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": ["ssf"] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.espass-espass+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "compressible": true, - "extensions": ["es3","et3"] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.etsi.cug+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.sci+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.evolv.ecig.profile": { - "source": "iana" - }, - "application/vnd.evolv.ecig.settings": { - "source": "iana" - }, - "application/vnd.evolv.ecig.theme": { - "source": "iana" - }, - "application/vnd.exstream-empower+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.exstream-package": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": ["ez2"] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": ["ez3"] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "iana", - "extensions": ["fdf"] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": ["mseed"] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": ["seed","dataless"] - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.ficlab.flb+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.filmit.zfc": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": ["gph"] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": ["ftc"] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": ["fm","frame","maker","book"] - }, - "application/vnd.frogans.fnc": { - "source": "iana", - "extensions": ["fnc"] - }, - "application/vnd.frogans.ltf": { - "source": "iana", - "extensions": ["ltf"] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": ["fsc"] - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": ["oas"] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": ["oa2"] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": ["oa3"] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": ["fg5"] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": ["bh2"] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": ["ddd"] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": ["xdw"] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": ["xbd"] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.futoin+cbor": { - "source": "iana" - }, - "application/vnd.futoin+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": ["fzs"] - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": ["txd"] - }, - "application/vnd.gentics.grd+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geo+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": ["ggb"] - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": ["ggt"] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": ["gex","gre"] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": ["gxt"] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": ["g2w"] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": ["g3w"] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": ["gmx"] - }, - "application/vnd.google-apps.document": { - "compressible": false, - "extensions": ["gdoc"] - }, - "application/vnd.google-apps.presentation": { - "compressible": false, - "extensions": ["gslides"] - }, - "application/vnd.google-apps.spreadsheet": { - "compressible": false, - "extensions": ["gsheet"] - }, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["kml"] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": ["kmz"] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": ["gqf","gqs"] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": ["gac"] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": ["ghf"] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": ["gim"] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": ["grv"] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": ["gtm"] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": ["tpl"] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": ["vcg"] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "compressible": true, - "extensions": ["hal"] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zmm"] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": ["hbci"] - }, - "application/vnd.hc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.hdt": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": ["les"] - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": ["hpgl"] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": ["hpid"] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": ["hps"] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": ["jlt"] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": ["pcl"] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": ["pclxl"] - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana", - "extensions": ["sfd-hdstx"] - }, - "application/vnd.hyper+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyper-item+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hyperdrive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "iana" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": ["mpy"] - }, - "application/vnd.ibm.modcap": { - "source": "iana", - "extensions": ["afp","listafp","list3820"] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": ["irm"] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": ["sc"] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": ["icc","icm"] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": ["igl"] - }, - "application/vnd.imagemeter.folder+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.imagemeter.image+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": ["ivp"] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": ["ivu"] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.informix-visionary": { - "source": "iana" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": ["igm"] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": ["xpw","xpx"] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": ["i2g"] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": ["qbo"] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": ["qfx"] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": ["rcprofile"] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "compressible": true, - "extensions": ["irp"] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": ["xpr"] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": ["fcs"] - }, - "application/vnd.iso11783-10+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.jam": { - "source": "iana", - "extensions": ["jam"] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": ["rms"] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": ["jisp"] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": ["joda"] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": ["ktz","ktr"] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": ["karbon"] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": ["chrt"] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": ["kfo"] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": ["flw"] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": ["kon"] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": ["kpr","kpt"] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": ["ksp"] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": ["kwd","kwt"] - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": ["htke"] - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": ["kia"] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": ["kne","knp"] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": ["skp","skd","skt","skm"] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": ["sse"] - }, - "application/vnd.las": { - "source": "iana" - }, - "application/vnd.las.las+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.las.las+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lasxml"] - }, - "application/vnd.laszip": { - "source": "iana" - }, - "application/vnd.leap+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.liberty-request+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": ["lbd"] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "compressible": true, - "extensions": ["lbe"] - }, - "application/vnd.logipipe.circuit+zip": { - "source": "iana", - "compressible": false - }, - "application/vnd.loom": { - "source": "iana" - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": ["123"] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": ["apr"] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": ["pre"] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": ["nsf"] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": ["org"] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": ["scm"] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": ["lwp"] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": ["portpkg"] - }, - "application/vnd.mapbox-vector-tile": { - "source": "iana" - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": ["mcd"] - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": ["mc1"] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": ["cdkey"] - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": ["mwf"] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": ["mfm"] - }, - "application/vnd.micro+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": ["flo"] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": ["igx"] - }, - "application/vnd.microsoft.portable-executable": { - "source": "iana" - }, - "application/vnd.microsoft.windows.thumbnail-cache": { - "source": "iana" - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": ["mif"] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": ["daf"] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": ["dis"] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": ["mbk"] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": ["mqy"] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": ["msl"] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": ["plc"] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": ["txf"] - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": ["mpn"] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": ["mpc"] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xul"] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": ["cil"] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": ["cab"] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": ["xlam"] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": ["xlsb"] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": ["xlsm"] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": ["xltm"] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": ["eot"] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": ["chm"] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": ["ims"] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": ["lrm"] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": ["thmx"] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-outlook": { - "compressible": false, - "extensions": ["msg"] - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": ["cat"] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": ["stl"] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": ["ppt","pps","pot"] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": ["ppam"] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": ["pptm"] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": ["sldm"] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": ["ppsm"] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": ["potm"] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-printschematicket+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": ["mpp","mpt"] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-windows.devicepairing": { - "source": "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": ["docm"] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": ["dotm"] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": ["wps","wks","wcm","wdb"] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": ["wpl"] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": ["xps"] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": ["mseq"] - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": ["mus"] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": ["msty"] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": ["taglet"] - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nearst.inv+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": ["nlu"] - }, - "application/vnd.nimn": { - "source": "iana" - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": ["ntf","nitf"] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": ["nnd"] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": ["nns"] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": ["nnw"] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana", - "compressible": true, - "extensions": ["ac"] - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": ["ngdat"] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "iana", - "extensions": ["n-gage"] - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": ["rpst"] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": ["rpss"] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": ["edm"] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": ["edx"] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": ["ext"] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": ["odc"] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": ["otc"] - }, - "application/vnd.oasis.opendocument.database": { - "source": "iana", - "extensions": ["odb"] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": ["odf"] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": ["odft"] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": ["odg"] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": ["otg"] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": ["odi"] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": ["oti"] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["odp"] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": ["otp"] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": ["ods"] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": ["ots"] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": ["odt"] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": ["odm"] - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": ["ott"] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": ["oth"] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.ocf+cbor": { - "source": "iana" - }, - "application/vnd.oci.image.manifest.v1+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": ["xo"] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dd2"] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+cbor": { - "source": "iana" - }, - "application/vnd.oma.lwm2m+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+tlv": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.omads-email+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-file+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omads-folder+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.onepager": { - "source": "iana" - }, - "application/vnd.onepagertamp": { - "source": "iana" - }, - "application/vnd.onepagertamx": { - "source": "iana" - }, - "application/vnd.onepagertat": { - "source": "iana" - }, - "application/vnd.onepagertatp": { - "source": "iana" - }, - "application/vnd.onepagertatx": { - "source": "iana" - }, - "application/vnd.openblox.game+xml": { - "source": "iana", - "compressible": true, - "extensions": ["obgx"] - }, - "application/vnd.openblox.game-binary": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": ["oxt"] - }, - "application/vnd.openstreetmap.data+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osm"] - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": ["pptx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": ["sldx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": ["ppsx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "iana", - "extensions": ["potx"] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": ["xlsx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "iana", - "extensions": ["xltx"] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": ["docx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "iana", - "extensions": ["dotx"] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": ["mgp"] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": ["dp"] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": ["esa"] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.oxli.countgraph": { - "source": "iana" - }, - "application/vnd.pagerduty+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.palm": { - "source": "iana", - "extensions": ["pdb","pqa","oprc"] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "iana" - }, - "application/vnd.patentdive": { - "source": "iana" - }, - "application/vnd.patientecommsdoc": { - "source": "iana" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": ["paw"] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": ["str"] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": ["ei6"] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": ["efif"] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": ["wg"] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": ["plf"] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": ["pbd"] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": ["box"] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": ["mgz"] - }, - "application/vnd.psfs": { - "source": "iana" - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": ["qps"] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": ["ptid"] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quarantainenet": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.rar": { - "source": "iana", - "extensions": ["rar"] - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": ["bed"] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": ["mxl"] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["musicxml"] - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.restful+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": ["cryptonote"] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": ["cod"] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": ["rm"] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": ["rmvb"] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "compressible": true, - "extensions": ["link66"] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": ["st"] - }, - "application/vnd.sar": { - "source": "iana" - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": ["see"] - }, - "application/vnd.sema": { - "source": "iana", - "extensions": ["sema"] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": ["semd"] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": ["semf"] - }, - "application/vnd.shade-save-file": { - "source": "iana" - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": ["ifm"] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": ["itp"] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": ["iif"] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": ["ipk"] - }, - "application/vnd.shootproof+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shopkick+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.shp": { - "source": "iana" - }, - "application/vnd.shx": { - "source": "iana" - }, - "application/vnd.sigrok.session": { - "source": "iana" - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": ["twd","twds"] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": ["mmf"] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": ["teacher"] - }, - "application/vnd.snesdev-page-table": { - "source": "iana" - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana", - "compressible": true, - "extensions": ["fo"] - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "compressible": true, - "extensions": ["sdkm","sdkd"] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": ["dxp"] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": ["sfs"] - }, - "application/vnd.sqlite3": { - "source": "iana" - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": ["sdc"] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": ["sda"] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": ["sdd"] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": ["smf"] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": ["sdw","vor"] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": ["sgl"] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": ["smzip"] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": ["sm"] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wadl"] - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": ["sxc"] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": ["stc"] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": ["sxd"] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": ["std"] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": ["sxi"] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": ["sti"] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": ["sxm"] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": ["sxw"] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": ["sxg"] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": ["stw"] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": ["sus","susp"] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": ["svd"] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.sycle+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": ["sis","sisx"] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xsm"] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["bdm"] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["xdm"] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["ddf"] - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana", - "charset": "UTF-8", - "compressible": true - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tableschema+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": ["tao"] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": ["pcap","cap","dmp"] - }, - "application/vnd.think-cell.ppttc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.tml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": ["tmo"] - }, - "application/vnd.tri.onesource": { - "source": "iana" - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": ["tpt"] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": ["mxs"] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": ["tra"] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": ["ufd","ufdl"] - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": ["utz"] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": ["umj"] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": ["unityweb"] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["uoml"] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.uri-map": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": ["vcx"] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.vel+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.veryant.thin": { - "source": "iana" - }, - "application/vnd.ves.encrypted": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": ["vsd","vst","vss","vsw"] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": ["vis"] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": ["vsf"] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["wbxml"] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": ["wmlc"] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": ["wmlsc"] - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": ["wtb"] - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": ["nbp"] - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": ["wpd"] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": ["wqd"] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": ["stf"] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.wv.ssp+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": ["xar"] - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": ["xfdl"] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana", - "compressible": true - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": ["hvd"] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": ["hvs"] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": ["hvp"] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": ["osf"] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["osfpvg"] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": ["saf"] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": ["spf"] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": ["cmp"] - }, - "application/vnd.youtube.yt": { - "source": "iana" - }, - "application/vnd.zul": { - "source": "iana", - "extensions": ["zir","zirz"] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "compressible": true, - "extensions": ["zaz"] - }, - "application/voicexml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["vxml"] - }, - "application/voucher-cms+json": { - "source": "iana", - "compressible": true - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/wasm": { - "compressible": true, - "extensions": ["wasm"] - }, - "application/watcherinfo+xml": { - "source": "iana", - "compressible": true - }, - "application/webpush-options+json": { - "source": "iana", - "compressible": true - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": ["wgt"] - }, - "application/winhlp": { - "source": "apache", - "extensions": ["hlp"] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wsdl"] - }, - "application/wspolicy+xml": { - "source": "iana", - "compressible": true, - "extensions": ["wspolicy"] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["7z"] - }, - "application/x-abiword": { - "source": "apache", - "extensions": ["abw"] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": ["ace"] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": ["dmg"] - }, - "application/x-arj": { - "compressible": false, - "extensions": ["arj"] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": ["aab","x32","u32","vox"] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": ["aam"] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": ["aas"] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": ["bcpio"] - }, - "application/x-bdoc": { - "compressible": false, - "extensions": ["bdoc"] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": ["torrent"] - }, - "application/x-blorb": { - "source": "apache", - "extensions": ["blb","blorb"] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": ["bz"] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": ["bz2","boz"] - }, - "application/x-cbr": { - "source": "apache", - "extensions": ["cbr","cba","cbt","cbz","cb7"] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": ["vcd"] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": ["cfs"] - }, - "application/x-chat": { - "source": "apache", - "extensions": ["chat"] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": ["pgn"] - }, - "application/x-chrome-extension": { - "extensions": ["crx"] - }, - "application/x-cocoa": { - "source": "nginx", - "extensions": ["cco"] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-conference": { - "source": "apache", - "extensions": ["nsc"] - }, - "application/x-cpio": { - "source": "apache", - "extensions": ["cpio"] - }, - "application/x-csh": { - "source": "apache", - "extensions": ["csh"] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": ["deb","udeb"] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": ["dgc"] - }, - "application/x-director": { - "source": "apache", - "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] - }, - "application/x-doom": { - "source": "apache", - "extensions": ["wad"] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "compressible": true, - "extensions": ["ncx"] - }, - "application/x-dtbook+xml": { - "source": "apache", - "compressible": true, - "extensions": ["dtb"] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "compressible": true, - "extensions": ["res"] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": ["dvi"] - }, - "application/x-envoy": { - "source": "apache", - "extensions": ["evy"] - }, - "application/x-eva": { - "source": "apache", - "extensions": ["eva"] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": ["bdf"] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": ["gsf"] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": ["psf"] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": ["pcf"] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": ["snf"] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-type1": { - "source": "apache", - "extensions": ["pfa","pfb","pfm","afm"] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": ["arc"] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": ["spl"] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": ["gca"] - }, - "application/x-glulx": { - "source": "apache", - "extensions": ["ulx"] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": ["gnumeric"] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": ["gramps"] - }, - "application/x-gtar": { - "source": "apache", - "extensions": ["gtar"] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": ["hdf"] - }, - "application/x-httpd-php": { - "compressible": true, - "extensions": ["php"] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": ["install"] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": ["iso"] - }, - "application/x-java-archive-diff": { - "source": "nginx", - "extensions": ["jardiff"] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": ["jnlp"] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-keepass2": { - "extensions": ["kdbx"] - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": ["latex"] - }, - "application/x-lua-bytecode": { - "extensions": ["luac"] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": ["lzh","lha"] - }, - "application/x-makeself": { - "source": "nginx", - "extensions": ["run"] - }, - "application/x-mie": { - "source": "apache", - "extensions": ["mie"] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": ["prc","mobi"] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": ["application"] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": ["lnk"] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": ["wmd"] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": ["wmz"] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": ["xbap"] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": ["mdb"] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": ["obd"] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": ["crd"] - }, - "application/x-msclip": { - "source": "apache", - "extensions": ["clp"] - }, - "application/x-msdos-program": { - "extensions": ["exe"] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": ["exe","dll","com","bat","msi"] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": ["mvb","m13","m14"] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": ["wmf","wmz","emf","emz"] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": ["mny"] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": ["pub"] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": ["scd"] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": ["trm"] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": ["wri"] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": ["nc","cdf"] - }, - "application/x-ns-proxy-autoconfig": { - "compressible": true, - "extensions": ["pac"] - }, - "application/x-nzb": { - "source": "apache", - "extensions": ["nzb"] - }, - "application/x-perl": { - "source": "nginx", - "extensions": ["pl","pm"] - }, - "application/x-pilot": { - "source": "nginx", - "extensions": ["prc","pdb"] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": ["p12","pfx"] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": ["p7b","spc"] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": ["p7r"] - }, - "application/x-pki-message": { - "source": "iana" - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": ["rar"] - }, - "application/x-redhat-package-manager": { - "source": "nginx", - "extensions": ["rpm"] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": ["ris"] - }, - "application/x-sea": { - "source": "nginx", - "extensions": ["sea"] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": ["sh"] - }, - "application/x-shar": { - "source": "apache", - "extensions": ["shar"] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": ["swf"] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": ["xap"] - }, - "application/x-sql": { - "source": "apache", - "extensions": ["sql"] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": ["sit"] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": ["sitx"] - }, - "application/x-subrip": { - "source": "apache", - "extensions": ["srt"] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": ["sv4cpio"] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": ["sv4crc"] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": ["t3"] - }, - "application/x-tads": { - "source": "apache", - "extensions": ["gam"] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": ["tar"] - }, - "application/x-tcl": { - "source": "apache", - "extensions": ["tcl","tk"] - }, - "application/x-tex": { - "source": "apache", - "extensions": ["tex"] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": ["tfm"] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": ["texinfo","texi"] - }, - "application/x-tgif": { - "source": "apache", - "extensions": ["obj"] - }, - "application/x-ustar": { - "source": "apache", - "extensions": ["ustar"] - }, - "application/x-virtualbox-hdd": { - "compressible": true, - "extensions": ["hdd"] - }, - "application/x-virtualbox-ova": { - "compressible": true, - "extensions": ["ova"] - }, - "application/x-virtualbox-ovf": { - "compressible": true, - "extensions": ["ovf"] - }, - "application/x-virtualbox-vbox": { - "compressible": true, - "extensions": ["vbox"] - }, - "application/x-virtualbox-vbox-extpack": { - "compressible": false, - "extensions": ["vbox-extpack"] - }, - "application/x-virtualbox-vdi": { - "compressible": true, - "extensions": ["vdi"] - }, - "application/x-virtualbox-vhd": { - "compressible": true, - "extensions": ["vhd"] - }, - "application/x-virtualbox-vmdk": { - "compressible": true, - "extensions": ["vmdk"] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": ["src"] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": ["webapp"] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "iana", - "extensions": ["der","crt","pem"] - }, - "application/x-x509-ca-ra-cert": { - "source": "iana" - }, - "application/x-x509-next-ca-cert": { - "source": "iana" - }, - "application/x-xfig": { - "source": "apache", - "extensions": ["fig"] - }, - "application/x-xliff+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xlf"] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": ["xpi"] - }, - "application/x-xz": { - "source": "apache", - "extensions": ["xz"] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana", - "compressible": true - }, - "application/xaml+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xaml"] - }, - "application/xcap-att+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xav"] - }, - "application/xcap-caps+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xca"] - }, - "application/xcap-diff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xdf"] - }, - "application/xcap-el+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xel"] - }, - "application/xcap-error+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xer"] - }, - "application/xcap-ns+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xns"] - }, - "application/xcon-conference-info+xml": { - "source": "iana", - "compressible": true - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana", - "compressible": true - }, - "application/xenc+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xenc"] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xhtml","xht"] - }, - "application/xhtml-voice+xml": { - "source": "apache", - "compressible": true - }, - "application/xliff+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xlf"] - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml","xsl","xsd","rng"] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": ["dtd"] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/xmpp+xml": { - "source": "iana", - "compressible": true - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xop"] - }, - "application/xproc+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xpl"] - }, - "application/xslt+xml": { - "source": "iana", - "compressible": true, - "extensions": ["xsl","xslt"] - }, - "application/xspf+xml": { - "source": "apache", - "compressible": true, - "extensions": ["xspf"] - }, - "application/xv+xml": { - "source": "iana", - "compressible": true, - "extensions": ["mxml","xhvml","xvml","xvm"] - }, - "application/yang": { - "source": "iana", - "extensions": ["yang"] - }, - "application/yang-data+json": { - "source": "iana", - "compressible": true - }, - "application/yang-data+xml": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+json": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+xml": { - "source": "iana", - "compressible": true - }, - "application/yin+xml": { - "source": "iana", - "compressible": true, - "extensions": ["yin"] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": ["zip"] - }, - "application/zlib": { - "source": "iana" - }, - "application/zstd": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana", - "compressible": false, - "extensions": ["3gpp"] - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/aac": { - "source": "iana" - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": ["adp"] - }, - "audio/amr": { - "source": "iana" - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": ["au","snd"] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/evs": { - "source": "iana" - }, - "audio/flexfec": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g711-0": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/melp": { - "source": "iana" - }, - "audio/melp1200": { - "source": "iana" - }, - "audio/melp2400": { - "source": "iana" - }, - "audio/melp600": { - "source": "iana" - }, - "audio/mhas": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": ["mid","midi","kar","rmi"] - }, - "audio/mobile-xmf": { - "source": "iana", - "extensions": ["mxmf"] - }, - "audio/mp3": { - "compressible": false, - "extensions": ["mp3"] - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["m4a","mp4a"] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["oga","ogg","spx"] - }, - "audio/opus": { - "source": "iana" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": ["s3m"] - }, - "audio/silk": { - "source": "apache", - "extensions": ["sil"] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sofa": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tetra_acelp": { - "source": "iana" - }, - "audio/tetra_acelp_bb": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/tsvcis": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/usac": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": ["uva","uvva"] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": ["eol"] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": ["dra"] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": ["dts"] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": ["dtshd"] - }, - "audio/vnd.dts.uhd": { - "source": "iana" - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": ["lvp"] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": ["pya"] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": ["ecelp4800"] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": ["ecelp7470"] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": ["ecelp9600"] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.presonus.multitrack": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": ["rip"] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/wav": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/wave": { - "compressible": false, - "extensions": ["wav"] - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": ["weba"] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": ["aac"] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": ["aif","aiff","aifc"] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": ["caf"] - }, - "audio/x-flac": { - "source": "apache", - "extensions": ["flac"] - }, - "audio/x-m4a": { - "source": "nginx", - "extensions": ["m4a"] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": ["mka"] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": ["m3u"] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": ["wax"] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": ["wma"] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": ["ram","ra"] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": ["rmp"] - }, - "audio/x-realaudio": { - "source": "nginx", - "extensions": ["ra"] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": ["wav"] - }, - "audio/xm": { - "source": "apache", - "extensions": ["xm"] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": ["cdx"] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": ["cif"] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": ["cmdf"] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": ["cml"] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": ["csml"] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": ["xyz"] - }, - "font/collection": { - "source": "iana", - "extensions": ["ttc"] - }, - "font/otf": { - "source": "iana", - "compressible": true, - "extensions": ["otf"] - }, - "font/sfnt": { - "source": "iana" - }, - "font/ttf": { - "source": "iana", - "compressible": true, - "extensions": ["ttf"] - }, - "font/woff": { - "source": "iana", - "extensions": ["woff"] - }, - "font/woff2": { - "source": "iana", - "extensions": ["woff2"] - }, - "image/aces": { - "source": "iana", - "extensions": ["exr"] - }, - "image/apng": { - "compressible": false, - "extensions": ["apng"] - }, - "image/avci": { - "source": "iana" - }, - "image/avcs": { - "source": "iana" - }, - "image/avif": { - "compressible": false, - "extensions": ["avif"] - }, - "image/bmp": { - "source": "iana", - "compressible": true, - "extensions": ["bmp"] - }, - "image/cgm": { - "source": "iana", - "extensions": ["cgm"] - }, - "image/dicom-rle": { - "source": "iana", - "extensions": ["drle"] - }, - "image/emf": { - "source": "iana", - "extensions": ["emf"] - }, - "image/fits": { - "source": "iana", - "extensions": ["fits"] - }, - "image/g3fax": { - "source": "iana", - "extensions": ["g3"] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": ["gif"] - }, - "image/heic": { - "source": "iana", - "extensions": ["heic"] - }, - "image/heic-sequence": { - "source": "iana", - "extensions": ["heics"] - }, - "image/heif": { - "source": "iana", - "extensions": ["heif"] - }, - "image/heif-sequence": { - "source": "iana", - "extensions": ["heifs"] - }, - "image/hej2k": { - "source": "iana", - "extensions": ["hej2"] - }, - "image/hsj2": { - "source": "iana", - "extensions": ["hsj2"] - }, - "image/ief": { - "source": "iana", - "extensions": ["ief"] - }, - "image/jls": { - "source": "iana", - "extensions": ["jls"] - }, - "image/jp2": { - "source": "iana", - "compressible": false, - "extensions": ["jp2","jpg2"] - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": ["jpeg","jpg","jpe"] - }, - "image/jph": { - "source": "iana", - "extensions": ["jph"] - }, - "image/jphc": { - "source": "iana", - "extensions": ["jhc"] - }, - "image/jpm": { - "source": "iana", - "compressible": false, - "extensions": ["jpm"] - }, - "image/jpx": { - "source": "iana", - "compressible": false, - "extensions": ["jpx","jpf"] - }, - "image/jxr": { - "source": "iana", - "extensions": ["jxr"] - }, - "image/jxra": { - "source": "iana", - "extensions": ["jxra"] - }, - "image/jxrs": { - "source": "iana", - "extensions": ["jxrs"] - }, - "image/jxs": { - "source": "iana", - "extensions": ["jxs"] - }, - "image/jxsc": { - "source": "iana", - "extensions": ["jxsc"] - }, - "image/jxsi": { - "source": "iana", - "extensions": ["jxsi"] - }, - "image/jxss": { - "source": "iana", - "extensions": ["jxss"] - }, - "image/ktx": { - "source": "iana", - "extensions": ["ktx"] - }, - "image/ktx2": { - "source": "iana", - "extensions": ["ktx2"] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": ["png"] - }, - "image/prs.btif": { - "source": "iana", - "extensions": ["btif"] - }, - "image/prs.pti": { - "source": "iana", - "extensions": ["pti"] - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": ["sgi"] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": ["svg","svgz"] - }, - "image/t38": { - "source": "iana", - "extensions": ["t38"] - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": ["tif","tiff"] - }, - "image/tiff-fx": { - "source": "iana", - "extensions": ["tfx"] - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": ["psd"] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana", - "extensions": ["azv"] - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": ["uvi","uvvi","uvg","uvvg"] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": ["djvu","djv"] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": ["dwg"] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": ["dxf"] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": ["fbs"] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": ["fpx"] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": ["fst"] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": ["mmr"] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": ["rlc"] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana", - "extensions": ["ico"] - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.mozilla.apng": { - "source": "iana" - }, - "image/vnd.ms-dds": { - "extensions": ["dds"] - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": ["mdi"] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": ["wdp"] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": ["npx"] - }, - "image/vnd.pco.b16": { - "source": "iana", - "extensions": ["b16"] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana", - "extensions": ["tap"] - }, - "image/vnd.valve.source.texture": { - "source": "iana", - "extensions": ["vtf"] - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": ["wbmp"] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": ["xif"] - }, - "image/vnd.zbrush.pcx": { - "source": "iana", - "extensions": ["pcx"] - }, - "image/webp": { - "source": "apache", - "extensions": ["webp"] - }, - "image/wmf": { - "source": "iana", - "extensions": ["wmf"] - }, - "image/x-3ds": { - "source": "apache", - "extensions": ["3ds"] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": ["ras"] - }, - "image/x-cmx": { - "source": "apache", - "extensions": ["cmx"] - }, - "image/x-freehand": { - "source": "apache", - "extensions": ["fh","fhc","fh4","fh5","fh7"] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": ["ico"] - }, - "image/x-jng": { - "source": "nginx", - "extensions": ["jng"] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": ["sid"] - }, - "image/x-ms-bmp": { - "source": "nginx", - "compressible": true, - "extensions": ["bmp"] - }, - "image/x-pcx": { - "source": "apache", - "extensions": ["pcx"] - }, - "image/x-pict": { - "source": "apache", - "extensions": ["pic","pct"] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": ["pnm"] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": ["pbm"] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": ["pgm"] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": ["ppm"] - }, - "image/x-rgb": { - "source": "apache", - "extensions": ["rgb"] - }, - "image/x-tga": { - "source": "apache", - "extensions": ["tga"] - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": ["xbm"] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": ["xpm"] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": ["xwd"] - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana", - "extensions": [ - "disposition-notification" - ] - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana", - "extensions": ["u8msg"] - }, - "message/global-delivery-status": { - "source": "iana", - "extensions": ["u8dsn"] - }, - "message/global-disposition-notification": { - "source": "iana", - "extensions": ["u8mdn"] - }, - "message/global-headers": { - "source": "iana", - "extensions": ["u8hdr"] - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/news": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": ["eml","mime"] - }, - "message/s-http": { - "source": "iana" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "iana" - }, - "message/vnd.wfa.wsc": { - "source": "iana", - "extensions": ["wsc"] - }, - "model/3mf": { - "source": "iana", - "extensions": ["3mf"] - }, - "model/e57": { - "source": "iana" - }, - "model/gltf+json": { - "source": "iana", - "compressible": true, - "extensions": ["gltf"] - }, - "model/gltf-binary": { - "source": "iana", - "compressible": true, - "extensions": ["glb"] - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": ["igs","iges"] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": ["msh","mesh","silo"] - }, - "model/mtl": { - "source": "iana", - "extensions": ["mtl"] - }, - "model/obj": { - "source": "iana", - "extensions": ["obj"] - }, - "model/stl": { - "source": "iana", - "extensions": ["stl"] - }, - "model/vnd.collada+xml": { - "source": "iana", - "compressible": true, - "extensions": ["dae"] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": ["dwf"] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": ["gdl"] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": ["gtw"] - }, - "model/vnd.moml+xml": { - "source": "iana", - "compressible": true - }, - "model/vnd.mts": { - "source": "iana", - "extensions": ["mts"] - }, - "model/vnd.opengex": { - "source": "iana", - "extensions": ["ogex"] - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana", - "extensions": ["x_b"] - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana", - "extensions": ["x_t"] - }, - "model/vnd.rosette.annotated-data-model": { - "source": "iana" - }, - "model/vnd.usdz+zip": { - "source": "iana", - "compressible": false, - "extensions": ["usdz"] - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana", - "extensions": ["bsp"] - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": ["vtu"] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": ["wrl","vrml"] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": ["x3db","x3dbz"] - }, - "model/x3d+fastinfoset": { - "source": "iana", - "extensions": ["x3db"] - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": ["x3dv","x3dvz"] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": ["x3d","x3dz"] - }, - "model/x3d-vrml": { - "source": "iana", - "extensions": ["x3dv"] - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana" - }, - "multipart/multilingual": { - "source": "iana" - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/vnd.bint.med-plus": { - "source": "iana" - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": ["appcache","manifest"] - }, - "text/calendar": { - "source": "iana", - "extensions": ["ics","ifb"] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": ["coffee","litcoffee"] - }, - "text/css": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["css"] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": ["csv"] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "iana" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/flexfec": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/gff3": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": ["html","htm","shtml"] - }, - "text/jade": { - "extensions": ["jade"] - }, - "text/javascript": { - "source": "iana", - "compressible": true - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": ["jsx"] - }, - "text/less": { - "compressible": true, - "extensions": ["less"] - }, - "text/markdown": { - "source": "iana", - "compressible": true, - "extensions": ["markdown","md"] - }, - "text/mathml": { - "source": "nginx", - "extensions": ["mml"] - }, - "text/mdx": { - "compressible": true, - "extensions": ["mdx"] - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["n3"] - }, - "text/parameters": { - "source": "iana", - "charset": "UTF-8" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": ["txt","text","conf","def","list","log","in","ini"] - }, - "text/provenance-notation": { - "source": "iana", - "charset": "UTF-8" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": ["dsc"] - }, - "text/prs.prop.logic": { - "source": "iana" - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": ["rtx"] - }, - "text/rtf": { - "source": "iana", - "compressible": true, - "extensions": ["rtf"] - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": ["sgml","sgm"] - }, - "text/shaclc": { - "source": "iana" - }, - "text/shex": { - "extensions": ["shex"] - }, - "text/slim": { - "extensions": ["slim","slm"] - }, - "text/spdx": { - "source": "iana", - "extensions": ["spdx"] - }, - "text/strings": { - "source": "iana" - }, - "text/stylus": { - "extensions": ["stylus","styl"] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": ["tsv"] - }, - "text/troff": { - "source": "iana", - "extensions": ["t","tr","roff","man","me","ms"] - }, - "text/turtle": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["ttl"] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": ["uri","uris","urls"] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": ["vcard"] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.ascii-art": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": ["curl"] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": ["dcurl"] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": ["mcurl"] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": ["scurl"] - }, - "text/vnd.debian.copyright": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": ["sub"] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.ficlab.flt": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": ["fly"] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": ["flx"] - }, - "text/vnd.gml": { - "source": "iana" - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": ["gv"] - }, - "text/vnd.hans": { - "source": "iana" - }, - "text/vnd.hgl": { - "source": "iana" - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": ["3dml"] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": ["spot"] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.senx.warpscript": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "iana" - }, - "text/vnd.sosi": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "charset": "UTF-8", - "extensions": ["jad"] - }, - "text/vnd.trolltech.linguist": { - "source": "iana", - "charset": "UTF-8" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": ["wml"] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": ["wmls"] - }, - "text/vtt": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": ["vtt"] - }, - "text/x-asm": { - "source": "apache", - "extensions": ["s","asm"] - }, - "text/x-c": { - "source": "apache", - "extensions": ["c","cc","cxx","cpp","h","hh","dic"] - }, - "text/x-component": { - "source": "nginx", - "extensions": ["htc"] - }, - "text/x-fortran": { - "source": "apache", - "extensions": ["f","for","f77","f90"] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": ["hbs"] - }, - "text/x-java-source": { - "source": "apache", - "extensions": ["java"] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": ["lua"] - }, - "text/x-markdown": { - "compressible": true, - "extensions": ["mkd"] - }, - "text/x-nfo": { - "source": "apache", - "extensions": ["nfo"] - }, - "text/x-opml": { - "source": "apache", - "extensions": ["opml"] - }, - "text/x-org": { - "compressible": true, - "extensions": ["org"] - }, - "text/x-pascal": { - "source": "apache", - "extensions": ["p","pas"] - }, - "text/x-processing": { - "compressible": true, - "extensions": ["pde"] - }, - "text/x-sass": { - "extensions": ["sass"] - }, - "text/x-scss": { - "extensions": ["scss"] - }, - "text/x-setext": { - "source": "apache", - "extensions": ["etx"] - }, - "text/x-sfv": { - "source": "apache", - "extensions": ["sfv"] - }, - "text/x-suse-ymp": { - "compressible": true, - "extensions": ["ymp"] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": ["uu"] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": ["vcs"] - }, - "text/x-vcard": { - "source": "apache", - "extensions": ["vcf"] - }, - "text/xml": { - "source": "iana", - "compressible": true, - "extensions": ["xml"] - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "extensions": ["yaml","yml"] - }, - "video/1d-interleaved-parityfec": { - "source": "iana" - }, - "video/3gpp": { - "source": "iana", - "extensions": ["3gp","3gpp"] - }, - "video/3gpp-tt": { - "source": "iana" - }, - "video/3gpp2": { - "source": "iana", - "extensions": ["3g2"] - }, - "video/bmpeg": { - "source": "iana" - }, - "video/bt656": { - "source": "iana" - }, - "video/celb": { - "source": "iana" - }, - "video/dv": { - "source": "iana" - }, - "video/encaprtp": { - "source": "iana" - }, - "video/flexfec": { - "source": "iana" - }, - "video/h261": { - "source": "iana", - "extensions": ["h261"] - }, - "video/h263": { - "source": "iana", - "extensions": ["h263"] - }, - "video/h263-1998": { - "source": "iana" - }, - "video/h263-2000": { - "source": "iana" - }, - "video/h264": { - "source": "iana", - "extensions": ["h264"] - }, - "video/h264-rcdo": { - "source": "iana" - }, - "video/h264-svc": { - "source": "iana" - }, - "video/h265": { - "source": "iana" - }, - "video/iso.segment": { - "source": "iana" - }, - "video/jpeg": { - "source": "iana", - "extensions": ["jpgv"] - }, - "video/jpeg2000": { - "source": "iana" - }, - "video/jpm": { - "source": "apache", - "extensions": ["jpm","jpgm"] - }, - "video/mj2": { - "source": "iana", - "extensions": ["mj2","mjp2"] - }, - "video/mp1s": { - "source": "iana" - }, - "video/mp2p": { - "source": "iana" - }, - "video/mp2t": { - "source": "iana", - "extensions": ["ts"] - }, - "video/mp4": { - "source": "iana", - "compressible": false, - "extensions": ["mp4","mp4v","mpg4"] - }, - "video/mp4v-es": { - "source": "iana" - }, - "video/mpeg": { - "source": "iana", - "compressible": false, - "extensions": ["mpeg","mpg","mpe","m1v","m2v"] - }, - "video/mpeg4-generic": { - "source": "iana" - }, - "video/mpv": { - "source": "iana" - }, - "video/nv": { - "source": "iana" - }, - "video/ogg": { - "source": "iana", - "compressible": false, - "extensions": ["ogv"] - }, - "video/parityfec": { - "source": "iana" - }, - "video/pointer": { - "source": "iana" - }, - "video/quicktime": { - "source": "iana", - "compressible": false, - "extensions": ["qt","mov"] - }, - "video/raptorfec": { - "source": "iana" - }, - "video/raw": { - "source": "iana" - }, - "video/rtp-enc-aescm128": { - "source": "iana" - }, - "video/rtploopback": { - "source": "iana" - }, - "video/rtx": { - "source": "iana" - }, - "video/smpte291": { - "source": "iana" - }, - "video/smpte292m": { - "source": "iana" - }, - "video/ulpfec": { - "source": "iana" - }, - "video/vc1": { - "source": "iana" - }, - "video/vc2": { - "source": "iana" - }, - "video/vnd.cctv": { - "source": "iana" - }, - "video/vnd.dece.hd": { - "source": "iana", - "extensions": ["uvh","uvvh"] - }, - "video/vnd.dece.mobile": { - "source": "iana", - "extensions": ["uvm","uvvm"] - }, - "video/vnd.dece.mp4": { - "source": "iana" - }, - "video/vnd.dece.pd": { - "source": "iana", - "extensions": ["uvp","uvvp"] - }, - "video/vnd.dece.sd": { - "source": "iana", - "extensions": ["uvs","uvvs"] - }, - "video/vnd.dece.video": { - "source": "iana", - "extensions": ["uvv","uvvv"] - }, - "video/vnd.directv.mpeg": { - "source": "iana" - }, - "video/vnd.directv.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "iana" - }, - "video/vnd.dvb.file": { - "source": "iana", - "extensions": ["dvb"] - }, - "video/vnd.fvt": { - "source": "iana", - "extensions": ["fvt"] - }, - "video/vnd.hns.video": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "iana" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "iana" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "iana" - }, - "video/vnd.motorola.video": { - "source": "iana" - }, - "video/vnd.motorola.videop": { - "source": "iana" - }, - "video/vnd.mpegurl": { - "source": "iana", - "extensions": ["mxu","m4u"] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "iana", - "extensions": ["pyv"] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "iana" - }, - "video/vnd.nokia.mp4vr": { - "source": "iana" - }, - "video/vnd.nokia.videovoip": { - "source": "iana" - }, - "video/vnd.objectvideo": { - "source": "iana" - }, - "video/vnd.radgamettools.bink": { - "source": "iana" - }, - "video/vnd.radgamettools.smacker": { - "source": "iana" - }, - "video/vnd.sealed.mpeg1": { - "source": "iana" - }, - "video/vnd.sealed.mpeg4": { - "source": "iana" - }, - "video/vnd.sealed.swf": { - "source": "iana" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "iana" - }, - "video/vnd.uvvu.mp4": { - "source": "iana", - "extensions": ["uvu","uvvu"] - }, - "video/vnd.vivo": { - "source": "iana", - "extensions": ["viv"] - }, - "video/vnd.youtube.yt": { - "source": "iana" - }, - "video/vp8": { - "source": "iana" - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": ["webm"] - }, - "video/x-f4v": { - "source": "apache", - "extensions": ["f4v"] - }, - "video/x-fli": { - "source": "apache", - "extensions": ["fli"] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": ["flv"] - }, - "video/x-m4v": { - "source": "apache", - "extensions": ["m4v"] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": ["mkv","mk3d","mks"] - }, - "video/x-mng": { - "source": "apache", - "extensions": ["mng"] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": ["asf","asx"] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": ["vob"] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": ["wm"] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": ["wmv"] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": ["wmx"] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": ["wvx"] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": ["avi"] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": ["movie"] - }, - "video/x-smv": { - "source": "apache", - "extensions": ["smv"] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": ["ice"] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -} diff --git a/node_modules/skynet-js/node_modules/mime-db/index.js b/node_modules/skynet-js/node_modules/mime-db/index.js deleted file mode 100644 index 551031f..0000000 --- a/node_modules/skynet-js/node_modules/mime-db/index.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * mime-db - * Copyright(c) 2014 Jonathan Ong - * MIT Licensed - */ - -/** - * Module exports. - */ - -module.exports = require('./db.json') diff --git a/node_modules/skynet-js/node_modules/mime-db/package.json b/node_modules/skynet-js/node_modules/mime-db/package.json deleted file mode 100644 index 243b45f..0000000 --- a/node_modules/skynet-js/node_modules/mime-db/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "mime-db", - "description": "Media Type Database", - "version": "1.45.0", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)", - "Robert Kieffer (http://github.com/broofa)" - ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": "jshttp/mime-db", - "devDependencies": { - "bluebird": "3.7.2", - "co": "4.6.0", - "cogent": "1.0.1", - "csv-parse": "4.12.0", - "eslint": "7.9.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.22.0", - "eslint-plugin-markdown": "1.0.2", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.2.1", - "eslint-plugin-standard": "4.0.1", - "gnode": "0.1.2", - "mocha": "8.1.3", - "nyc": "15.1.0", - "raw-body": "2.4.1", - "stream-to-array": "2.3.0" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "db.json", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "test-travis": "nyc --reporter=text npm test", - "update": "npm run fetch && npm run build", - "version": "node scripts/version-history.js && git add HISTORY.md" - } -} diff --git a/node_modules/skynet-js/package.json b/node_modules/skynet-js/package.json index 613fbff..7998a88 100644 --- a/node_modules/skynet-js/package.json +++ b/node_modules/skynet-js/package.json @@ -1,8 +1,16 @@ { "name": "skynet-js", - "version": "2.7.0", + "version": "4.0.12-beta", "description": "Sia Skynet Javascript Client", - "main": "dist/index.js", + "main": "dist/cjs/index.js", + "types": "dist/cjs/index.d.ts", + "module": "dist/mjs/index.js", + "exports": { + ".": { + "import": "./dist/mjs/index.js", + "require": "./dist/cjs/index.js" + } + }, "files": [ "dist/*" ], @@ -12,26 +20,17 @@ "not OperaMini all" ], "scripts": { - "test": "jest", - "build": "rimraf dist && babel src --out-dir dist --extensions .ts --ignore src/**/*.test.ts && tsc --project tsconfig.build.json", - "lint:eslint": "eslint --ext .ts utils src", + "build": "rimraf dist && tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json", + "lint": "yarn lint:tsc && yarn lint:eslint", + "lint:eslint": "eslint --ext .ts utils src --max-warnings 0", "lint:tsc": "tsc", - "prepublishOnly": "yarn build" - }, - "jest": { - "testTimeout": 60000, - "clearMocks": true, - "rootDir": "src" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } + "prepublishOnly": "yarn build", + "test": "jest --coverage", + "prepare": "husky install" }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "eslint --ext .ts --fix", - "tsc --esModuleInterop --noemit", + "eslint --ext .ts utils src --max-warnings 0", "prettier --write" ], "*.{json,yml,md}": [ @@ -40,55 +39,57 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/NebulousLabs/skynet-js.git" + "url": "git+https://github.com/SkynetLabs/skynet-js.git" }, "keywords": [ "sia", "skynet" ], "author": "Karol Wypchlo", - "license": "ISC", + "license": "MIT", "bugs": { - "url": "https://github.com/NebulousLabs/skynet-js/issues" + "url": "https://github.com/SkynetLabs/skynet-js/issues" }, - "homepage": "https://github.com/NebulousLabs/skynet-js", + "homepage": "https://github.com/SkynetLabs/skynet-js", "dependencies": { - "@babel/runtime": "^7.11.2", "axios": "^0.21.0", + "base32-decode": "^1.0.0", + "base32-encode": "^1.1.1", + "base64-js": "^1.3.1", "blakejs": "^1.1.0", "buffer": "^6.0.1", - "mime-db": "^1.45.0", - "node-forge": "^0.10.0", + "mime": "^2.5.2", "path-browserify": "^1.0.1", + "post-me": "^0.4.5", "randombytes": "^2.1.0", + "sjcl": "^1.0.8", + "skynet-mysky-utils": "^0.2.2", + "tus-js-client": "^2.2.0", + "tweetnacl": "^1.0.3", "url-join": "^4.0.1", - "url-parse": "^1.4.7" + "url-parse": "^1.5.1" }, "devDependencies": { - "@babel/cli": "^7.11.6", - "@babel/core": "^7.11.6", - "@babel/plugin-proposal-class-properties": "^7.10.4", - "@babel/plugin-transform-runtime": "^7.11.5", - "@babel/preset-env": "^7.11.5", - "@babel/preset-typescript": "^7.10.4", - "@types/jest": "^26.0.14", - "@types/mime-db": "^1.43.0", - "@types/node": "^14.11.2", - "@types/node-forge": "^0.9.5", + "@types/base64-js": "^1.3.0", + "@types/jest": "^26.0.23", + "@types/mime": "^2.0.3", + "@types/node": "^15.0.1", "@types/randombytes": "^2.0.0", + "@types/sjcl": "^1.0.29", "@types/url-join": "^4.0.0", "@types/url-parse": "^1.4.3", "@typescript-eslint/eslint-plugin": "^4.3.0", "@typescript-eslint/parser": "^4.3.0", "axios-mock-adapter": "^1.18.2", - "babel-plugin-transform-class-properties": "^6.24.1", "eslint": "^7.11.0", - "eslint-plugin-compat": "^3.8.0", - "husky": "^4.3.0", - "jest": "^26.4.2", - "lint-staged": "^10.3.0", + "eslint-plugin-jsdoc": "^35.0.0", + "husky": "^6.0.0", + "jest": "^26.6.3", + "lint-staged": "^11.0.0", "prettier": "^2.1.1", "rimraf": "^3.0.2", - "typescript": "^4.0.3" + "ts-jest": "^26.5.5", + "ts-node": "^10.0.0", + "typescript": "^4.2.4" } } diff --git a/node_modules/skynet-mysky-utils/.eslintrc.json b/node_modules/skynet-mysky-utils/.eslintrc.json new file mode 100644 index 0000000..d344d8b --- /dev/null +++ b/node_modules/skynet-mysky-utils/.eslintrc.json @@ -0,0 +1,27 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": ["jsdoc", "@typescript-eslint"], + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "env": { + "browser": true, + "jest": true + }, + "extends": [ + "eslint:recommended", + "plugin:jsdoc/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/no-non-null-assertion": 0, + + "jsdoc/require-description": 0, + "jsdoc/require-param-type": 0, + "jsdoc/require-property-type": 0, + "jsdoc/require-returns-type": 0, + "jsdoc/require-throws": 0 + } +} diff --git a/node_modules/skynet-mysky-utils/CHANGELOG.md b/node_modules/skynet-mysky-utils/CHANGELOG.md new file mode 100644 index 0000000..cfd351e --- /dev/null +++ b/node_modules/skynet-mysky-utils/CHANGELOG.md @@ -0,0 +1,43 @@ +# Changelog + +## [0.2.3] + +### Added + +- `removeAdjacentChars` function. + +## [0.2.2] + +### Added + +- `CustomUserIDOptions` type. + +## [0.2.0] + +### Added + +- Path helpers: `getPathDomain`, `getParentPath`, `sanitizePath` +- String helper: `trimSuffix` +- Permissions helpers: `permCategoryToString`, `permTypeToString` + +### Removed + +- Storage listener helpers + +## [0.1.2] + +### Changed + +- Fix createFullScreenIframe and monitorWindowError + +## [0.1.1] + +### Added + +- CheckPermissionResponse type + +## [0.1.0] + +### Added + +- First release diff --git a/node_modules/skynet-mysky-utils/README.md b/node_modules/skynet-mysky-utils/README.md new file mode 100644 index 0000000..084bca2 --- /dev/null +++ b/node_modules/skynet-mysky-utils/README.md @@ -0,0 +1,3 @@ +# skynet-mysky-utils + +Skynet common MySky utilities. diff --git a/node_modules/skynet-mysky-utils/babel.config.json b/node_modules/skynet-mysky-utils/babel.config.json new file mode 100644 index 0000000..816276a --- /dev/null +++ b/node_modules/skynet-mysky-utils/babel.config.json @@ -0,0 +1,3 @@ +{ + "presets": ["@babel/preset-typescript", "@babel/preset-env"] +} diff --git a/node_modules/skynet-mysky-utils/dist/index.d.ts b/node_modules/skynet-mysky-utils/dist/index.d.ts new file mode 100644 index 0000000..17304cf --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/index.d.ts @@ -0,0 +1,20 @@ +export { getPathDomain, getParentPath, sanitizePath } from "./paths"; +export { Permission, PermCategory, PermType, permCategoryToString, permTypeToString, PermDiscoverable, PermHidden, PermLegacySkyID, PermRead, PermWrite, } from "./permissions"; +export { createFullScreenIframe, createIframe, ensureUrl, removeAdjacentChars, trimSuffix, } from "./utils"; +export { dispatchedErrorEvent, errorWindowClosed, monitorWindowError, } from "./window-listener"; +import { Permission } from "./permissions"; +export declare const defaultHandshakeMaxAttempts = 150; +export declare const defaultHandshakeAttemptsInterval = 100; +export declare type CheckPermissionsResponse = { + grantedPermissions: Permission[]; + failedPermissions: Permission[]; +}; +/** + * Custom options for mySky.userID(). + * + * @property [legacyAppID] - Deprecated. The legacy app ID. For compatibility with SkyID. + */ +export declare type CustomUserIDOptions = { + legacyAppID?: string; +}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/index.d.ts.map b/node_modules/skynet-mysky-utils/dist/index.d.ts.map new file mode 100644 index 0000000..046b418 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EACL,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAEhB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,QAAQ,EACR,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAEpD,oBAAY,wBAAwB,GAAG;IACrC,kBAAkB,EAAE,UAAU,EAAE,CAAC;IACjC,iBAAiB,EAAE,UAAU,EAAE,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,oBAAY,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/index.js b/node_modules/skynet-mysky-utils/dist/index.js new file mode 100644 index 0000000..4aec5d1 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/index.js @@ -0,0 +1,39 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +exports.__esModule = true; +exports.defaultHandshakeAttemptsInterval = exports.defaultHandshakeMaxAttempts = exports.monitorWindowError = exports.errorWindowClosed = exports.dispatchedErrorEvent = exports.trimSuffix = exports.removeAdjacentChars = exports.ensureUrl = exports.createIframe = exports.createFullScreenIframe = exports.PermWrite = exports.PermRead = exports.PermLegacySkyID = exports.PermHidden = exports.PermDiscoverable = exports.permTypeToString = exports.permCategoryToString = exports.PermType = exports.PermCategory = exports.Permission = exports.sanitizePath = exports.getParentPath = exports.getPathDomain = void 0; +var paths_1 = require("./paths"); +__createBinding(exports, paths_1, "getPathDomain"); +__createBinding(exports, paths_1, "getParentPath"); +__createBinding(exports, paths_1, "sanitizePath"); +var permissions_1 = require("./permissions"); +__createBinding(exports, permissions_1, "Permission"); +__createBinding(exports, permissions_1, "PermCategory"); +__createBinding(exports, permissions_1, "PermType"); +__createBinding(exports, permissions_1, "permCategoryToString"); +__createBinding(exports, permissions_1, "permTypeToString"); +// Constants +__createBinding(exports, permissions_1, "PermDiscoverable"); +__createBinding(exports, permissions_1, "PermHidden"); +__createBinding(exports, permissions_1, "PermLegacySkyID"); +__createBinding(exports, permissions_1, "PermRead"); +__createBinding(exports, permissions_1, "PermWrite"); +var utils_1 = require("./utils"); +__createBinding(exports, utils_1, "createFullScreenIframe"); +__createBinding(exports, utils_1, "createIframe"); +__createBinding(exports, utils_1, "ensureUrl"); +__createBinding(exports, utils_1, "removeAdjacentChars"); +__createBinding(exports, utils_1, "trimSuffix"); +var window_listener_1 = require("./window-listener"); +__createBinding(exports, window_listener_1, "dispatchedErrorEvent"); +__createBinding(exports, window_listener_1, "errorWindowClosed"); +__createBinding(exports, window_listener_1, "monitorWindowError"); +exports.defaultHandshakeMaxAttempts = 150; +exports.defaultHandshakeAttemptsInterval = 100; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/index.js.map b/node_modules/skynet-mysky-utils/dist/index.js.map new file mode 100644 index 0000000..e6b4956 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,iCAAqE;AAA5D,mDAAa;AAAE,mDAAa;AAAE,kDAAY;AACnD,6CAYuB;AAXrB,sDAAU;AACV,wDAAY;AACZ,oDAAQ;AACR,gEAAoB;AACpB,4DAAgB;AAChB,YAAY;AACZ,4DAAgB;AAChB,sDAAU;AACV,2DAAe;AACf,oDAAQ;AACR,qDAAS;AAEX,iCAMiB;AALf,4DAAsB;AACtB,kDAAY;AACZ,+CAAS;AACT,yDAAmB;AACnB,gDAAU;AAEZ,qDAI2B;AAHzB,oEAAoB;AACpB,iEAAiB;AACjB,kEAAkB;AAKP,QAAA,2BAA2B,GAAG,GAAG,CAAC;AAClC,QAAA,gCAAgC,GAAG,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/paths.d.ts b/node_modules/skynet-mysky-utils/dist/paths.d.ts new file mode 100644 index 0000000..4990088 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/paths.d.ts @@ -0,0 +1,22 @@ +/** + * Gets the root path domain for the given path. + * + * @param path - The given path. + * @returns - The path domain. + */ +export declare function getPathDomain(path: string): string; +/** + * Gets the parent path for the given path. + * + * @param path - The given path. + * @returns - The parent path, or null if no parent. + */ +export declare function getParentPath(path: string): string | null; +/** + * Sanitizes the path by removing trailing slashes and removing repeating adjacent slashes. + * + * @param path - The given path + * @returns - The sanitized path. + */ +export declare function sanitizePath(path: string): string; +//# sourceMappingURL=paths.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/paths.d.ts.map b/node_modules/skynet-mysky-utils/dist/paths.d.ts.map new file mode 100644 index 0000000..7e20406 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/paths.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWzD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQjD"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/paths.js b/node_modules/skynet-mysky-utils/dist/paths.js new file mode 100644 index 0000000..fd8450c --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/paths.js @@ -0,0 +1,46 @@ +"use strict"; +exports.__esModule = true; +exports.sanitizePath = exports.getParentPath = exports.getPathDomain = void 0; +var utils_1 = require("./utils"); +/** + * Gets the root path domain for the given path. + * + * @param path - The given path. + * @returns - The path domain. + */ +function getPathDomain(path) { + return path.split("/")[0]; +} +exports.getPathDomain = getPathDomain; +/** + * Gets the parent path for the given path. + * + * @param path - The given path. + * @returns - The parent path, or null if no parent. + */ +function getParentPath(path) { + path = sanitizePath(path); + var pathArray = path.split("/"); + if (pathArray.length <= 1) { + return null; + } + pathArray.pop(); + path = pathArray.join("/"); + return path; +} +exports.getParentPath = getParentPath; +/** + * Sanitizes the path by removing trailing slashes and removing repeating adjacent slashes. + * + * @param path - The given path + * @returns - The sanitized path. + */ +function sanitizePath(path) { + // Remove trailing slashes. + path = utils_1.trimSuffix(path, "/"); + // Remove duplicate adjacent slashes. + path = utils_1.removeAdjacentChars(path, "/"); + return path; +} +exports.sanitizePath = sanitizePath; +//# sourceMappingURL=paths.js.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/paths.js.map b/node_modules/skynet-mysky-utils/dist/paths.js.map new file mode 100644 index 0000000..0393274 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/paths.js.map @@ -0,0 +1 @@ +{"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":";;;AAAA,iCAA0D;AAE1D;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AAFD,sCAEC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IAED,SAAS,CAAC,GAAG,EAAE,CAAC;IAChB,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,sCAWC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,IAAY;IACvC,2BAA2B;IAC3B,IAAI,GAAG,kBAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAE7B,qCAAqC;IACrC,IAAI,GAAG,2BAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAEtC,OAAO,IAAI,CAAC;AACd,CAAC;AARD,oCAQC"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/permissions.d.ts b/node_modules/skynet-mysky-utils/dist/permissions.d.ts new file mode 100644 index 0000000..42f21f4 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/permissions.d.ts @@ -0,0 +1,44 @@ +export declare class Permission { + requestor: string; + path: string; + category: PermCategory; + permType: PermType; + constructor(requestor: string, path: string, category: PermCategory, permType: PermType); +} +export declare const PermDiscoverable = 1; +export declare const PermHidden = 2; +export declare const PermLegacySkyID = 3; +/** + * Defines what type of file is being requested. Discoverable files are visible + * to the entire world, hidden files are only visible to the user (unless + * shared), and LegacySkyID files are supported files from the legacy SkyID + * login system. + */ +export declare enum PermCategory { + Discoverable, + Hidden, + LegacySkyID +} +export declare const PermRead = 4; +export declare const PermWrite = 5; +export declare enum PermType { + Read, + Write +} +/** + * Converts the given permission category to a human-readable string. + * + * @param category - The given category. + * @returns - The string. + * @throws - Will throw if the category is not valid. + */ +export declare function permCategoryToString(category: PermCategory): string; +/** + * Converts the given permission type to a human-readable string. + * + * @param permType - The given type. + * @returns - The string. + * @throws - Will throw if the type is not valid. + */ +export declare function permTypeToString(permType: PermType): string; +//# sourceMappingURL=permissions.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/permissions.d.ts.map b/node_modules/skynet-mysky-utils/dist/permissions.d.ts.map new file mode 100644 index 0000000..d5b0ddc --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/permissions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU;IAEZ,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,QAAQ;gBAHlB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ;CAS5B;AAGD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC;;;;;GAKG;AACH,oBAAY,YAAY;IACtB,YAA+B;IAC/B,MAAmB;IACnB,WAA6B;CAC9B;AAGD,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B,oBAAY,QAAQ;IAClB,IAAe;IACf,KAAiB;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAUnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAQ3D"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/permissions.js b/node_modules/skynet-mysky-utils/dist/permissions.js new file mode 100644 index 0000000..912d809 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/permissions.js @@ -0,0 +1,85 @@ +"use strict"; +exports.__esModule = true; +exports.permTypeToString = exports.permCategoryToString = exports.PermType = exports.PermWrite = exports.PermRead = exports.PermCategory = exports.PermLegacySkyID = exports.PermHidden = exports.PermDiscoverable = exports.Permission = void 0; +var Permission = /** @class */ (function () { + function Permission(requestor, path, category, permType) { + this.requestor = requestor; + this.path = path; + this.category = category; + this.permType = permType; + if (typeof category !== "number" || !(category in PermCategory)) { + throw new Error("Invalid 'category' enum value " + category); + } + if (typeof permType !== "number" || !(permType in PermType)) { + throw new Error("Invalid 'permType' enum value " + permType); + } + } + return Permission; +}()); +exports.Permission = Permission; +// Define category constants for non-TS users. +exports.PermDiscoverable = 1; +exports.PermHidden = 2; +exports.PermLegacySkyID = 3; +/** + * Defines what type of file is being requested. Discoverable files are visible + * to the entire world, hidden files are only visible to the user (unless + * shared), and LegacySkyID files are supported files from the legacy SkyID + * login system. + */ +var PermCategory; +(function (PermCategory) { + PermCategory[PermCategory["Discoverable"] = exports.PermDiscoverable] = "Discoverable"; + PermCategory[PermCategory["Hidden"] = exports.PermHidden] = "Hidden"; + PermCategory[PermCategory["LegacySkyID"] = exports.PermLegacySkyID] = "LegacySkyID"; +})(PermCategory = exports.PermCategory || (exports.PermCategory = {})); +// Define type constants for non-TS users. +exports.PermRead = 4; +exports.PermWrite = 5; +var PermType; +(function (PermType) { + PermType[PermType["Read"] = exports.PermRead] = "Read"; + PermType[PermType["Write"] = exports.PermWrite] = "Write"; +})(PermType = exports.PermType || (exports.PermType = {})); +/** + * Converts the given permission category to a human-readable string. + * + * @param category - The given category. + * @returns - The string. + * @throws - Will throw if the category is not valid. + */ +function permCategoryToString(category) { + if (category === PermCategory.Discoverable) { + return "Discoverable"; + } + else if (category === PermCategory.Hidden) { + return "Hidden"; + } + else if (category === PermCategory.LegacySkyID) { + return "LegacySkyID"; + } + else { + throw new Error("Invalid permission category " + category); + } +} +exports.permCategoryToString = permCategoryToString; +/** + * Converts the given permission type to a human-readable string. + * + * @param permType - The given type. + * @returns - The string. + * @throws - Will throw if the type is not valid. + */ +function permTypeToString(permType) { + if (permType === PermType.Read) { + return "Read"; + } + else if (permType === PermType.Write) { + return "Write"; + } + else { + throw new Error("Invalid permission type " + permType); + } +} +exports.permTypeToString = permTypeToString; +//# sourceMappingURL=permissions.js.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/permissions.js.map b/node_modules/skynet-mysky-utils/dist/permissions.js.map new file mode 100644 index 0000000..6b801a7 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/permissions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":";;;AAAA;IACE,oBACS,SAAiB,EACjB,IAAY,EACZ,QAAsB,EACtB,QAAkB;QAHlB,cAAS,GAAT,SAAS,CAAQ;QACjB,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAc;QACtB,aAAQ,GAAR,QAAQ,CAAU;QAEzB,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,IAAI,YAAY,CAAC,EAAE;YAC/D,MAAM,IAAI,KAAK,CAAC,mCAAiC,QAAU,CAAC,CAAC;SAC9D;QACD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE;YAC3D,MAAM,IAAI,KAAK,CAAC,mCAAiC,QAAU,CAAC,CAAC;SAC9D;IACH,CAAC;IACH,iBAAC;AAAD,CAAC,AAdD,IAcC;AAdY,gCAAU;AAgBvB,8CAA8C;AACjC,QAAA,gBAAgB,GAAG,CAAC,CAAC;AACrB,QAAA,UAAU,GAAG,CAAC,CAAC;AACf,QAAA,eAAe,GAAG,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,4CAAe,wBAAgB,kBAAA,CAAA;IAC/B,sCAAS,kBAAU,YAAA,CAAA;IACnB,2CAAc,uBAAe,iBAAA,CAAA;AAC/B,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,0CAA0C;AAC7B,QAAA,QAAQ,GAAG,CAAC,CAAC;AACb,QAAA,SAAS,GAAG,CAAC,CAAC;AAE3B,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,4BAAO,gBAAQ,UAAA,CAAA;IACf,6BAAQ,iBAAS,WAAA,CAAA;AACnB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,QAAsB;IACzD,IAAI,QAAQ,KAAK,YAAY,CAAC,YAAY,EAAE;QAC1C,OAAO,cAAc,CAAC;KACvB;SAAM,IAAI,QAAQ,KAAK,YAAY,CAAC,MAAM,EAAE;QAC3C,OAAO,QAAQ,CAAC;KACjB;SAAM,IAAI,QAAQ,KAAK,YAAY,CAAC,WAAW,EAAE;QAChD,OAAO,aAAa,CAAC;KACtB;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,iCAA+B,QAAU,CAAC,CAAC;KAC5D;AACH,CAAC;AAVD,oDAUC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,IAAI,QAAQ,KAAK,QAAQ,CAAC,IAAI,EAAE;QAC9B,OAAO,MAAM,CAAC;KACf;SAAM,IAAI,QAAQ,KAAK,QAAQ,CAAC,KAAK,EAAE;QACtC,OAAO,OAAO,CAAC;KAChB;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,6BAA2B,QAAU,CAAC,CAAC;KACxD;AACH,CAAC;AARD,4CAQC"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/utils.d.ts b/node_modules/skynet-mysky-utils/dist/utils.d.ts new file mode 100644 index 0000000..b3ce987 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/utils.d.ts @@ -0,0 +1,20 @@ +/** + * Creates an invisible iframe with the given src and adds it to the page. + */ +export declare function createIframe(srcUrl: string, name: string): HTMLIFrameElement; +/** + * Creates a full-screen iframe with the given src and adds it to the page. + */ +export declare function createFullScreenIframe(srcUrl: string, name: string): HTMLIFrameElement; +export declare function ensureUrl(url: string): string; +export declare function removeAdjacentChars(str: string, char: string): string; +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export declare function trimSuffix(str: string, suffix: string, limit?: number): string; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/utils.d.ts.map b/node_modules/skynet-mysky-utils/dist/utils.d.ts.map new file mode 100644 index 0000000..b42caf7 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAe5E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,iBAAiB,CA4BnB;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAUrE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,CAWR"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/utils.js b/node_modules/skynet-mysky-utils/dist/utils.js new file mode 100644 index 0000000..ee4bd99 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/utils.js @@ -0,0 +1,94 @@ +"use strict"; +exports.__esModule = true; +exports.trimSuffix = exports.removeAdjacentChars = exports.ensureUrl = exports.createFullScreenIframe = exports.createIframe = void 0; +/** + * Creates an invisible iframe with the given src and adds it to the page. + */ +function createIframe(srcUrl, name) { + srcUrl = ensureUrl(srcUrl); + var childFrame = document.createElement("iframe"); + childFrame.src = srcUrl; + childFrame.name = name; + childFrame.style.display = "none"; + // Set sandbox permissions. + // TODO: Enable sandboxing? + // childFrame.sandbox.add("allow-same-origin"); + // childFrame.sandbox.add("allow-scripts"); + document.body.appendChild(childFrame); + return childFrame; +} +exports.createIframe = createIframe; +/** + * Creates a full-screen iframe with the given src and adds it to the page. + */ +function createFullScreenIframe(srcUrl, name) { + srcUrl = ensureUrl(srcUrl); + var childFrame = document.createElement("iframe"); + childFrame.src = srcUrl; + childFrame.name = name; + // Set properties to make the iframe full-screen. + childFrame.style.position = "fixed"; + childFrame.style.top = "0"; + childFrame.style.left = "0"; + childFrame.style.bottom = "0"; + childFrame.style.right = "0"; + childFrame.style.width = "100%"; + childFrame.style.height = "100%"; + childFrame.style.border = "none"; + childFrame.style.margin = "0"; + childFrame.style.padding = "0"; + childFrame.style.overflow = "hidden"; + childFrame.style.zIndex = "999999"; + // Set sandbox permissions. + // TODO: Enable sandboxing? + // childFrame.sandbox.add("allow-same-origin"); + // childFrame.sandbox.add("allow-scripts"); + document.body.appendChild(childFrame); + return childFrame; +} +exports.createFullScreenIframe = createFullScreenIframe; +function ensureUrl(url) { + return ensurePrefix(url, "https://"); +} +exports.ensureUrl = ensureUrl; +function removeAdjacentChars(str, char) { + var pathArray = Array.from(str); + for (var i = 0; i < pathArray.length - 1;) { + if (pathArray[i] === char && pathArray[i + 1] === char) { + pathArray.splice(i, 1); + } + else { + i++; + } + } + return pathArray.join(""); +} +exports.removeAdjacentChars = removeAdjacentChars; +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +function trimSuffix(str, suffix, limit) { + while (str.endsWith(suffix)) { + if (limit !== undefined && limit <= 0) { + break; + } + str = str.substring(0, str.length - suffix.length); + if (limit) { + limit -= 1; + } + } + return str; +} +exports.trimSuffix = trimSuffix; +function ensurePrefix(s, prefix) { + if (!s.startsWith(prefix)) { + s = "" + prefix + s; + } + return s; +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/utils.js.map b/node_modules/skynet-mysky-utils/dist/utils.js.map new file mode 100644 index 0000000..5b68a93 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,YAAY,CAAC,MAAc,EAAE,IAAY;IACvD,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAE3B,IAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;IACrD,UAAU,CAAC,GAAG,GAAG,MAAM,CAAC;IACxB,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IAElC,2BAA2B;IAC3B,2BAA2B;IAC3B,+CAA+C;IAC/C,2CAA2C;IAE3C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,UAAU,CAAC;AACpB,CAAC;AAfD,oCAeC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CACpC,MAAc,EACd,IAAY;IAEZ,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAE3B,IAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;IACrD,UAAU,CAAC,GAAG,GAAG,MAAM,CAAC;IACxB,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;IAEvB,iDAAiD;IACjD,UAAU,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACpC,UAAU,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;IAC3B,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;IAC5B,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;IAC9B,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;IAC7B,UAAU,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC;IAChC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACjC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;IAC9B,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACrC,UAAU,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC;IAEnC,2BAA2B;IAC3B,2BAA2B;IAC3B,+CAA+C;IAC/C,2CAA2C;IAE3C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,UAAU,CAAC;AACpB,CAAC;AA/BD,wDA+BC;AAED,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,YAAY,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACvC,CAAC;AAFD,8BAEC;AAED,SAAgB,mBAAmB,CAAC,GAAW,EAAE,IAAY;IAC3D,IAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,GAAI;QAC1C,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;YACtD,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACxB;aAAM;YACL,CAAC,EAAE,CAAC;SACL;KACF;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC;AAVD,kDAUC;AAED;;;;;;;GAOG;AACH,SAAgB,UAAU,CACxB,GAAW,EACX,MAAc,EACd,KAAc;IAEd,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC3B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,IAAI,CAAC,EAAE;YACrC,MAAM;SACP;QACD,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,KAAK,EAAE;YACT,KAAK,IAAI,CAAC,CAAC;SACZ;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAfD,gCAeC;AAED,SAAS,YAAY,CAAC,CAAS,EAAE,MAAc;IAC7C,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACzB,CAAC,GAAG,KAAG,MAAM,GAAG,CAAG,CAAC;KACrB;IACD,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/window-listener.d.ts b/node_modules/skynet-mysky-utils/dist/window-listener.d.ts new file mode 100644 index 0000000..56c94d0 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/window-listener.d.ts @@ -0,0 +1,13 @@ +export declare const errorWindowClosed = "window-closed"; +export declare const dispatchedErrorEvent = "catchError"; +export declare class PromiseController { + cleanup(): void; +} +/** + * Checks if there has been an error from the window on an interval. + */ +export declare function monitorWindowError(): { + promise: Promise; + controller: PromiseController; +}; +//# sourceMappingURL=window-listener.d.ts.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/window-listener.d.ts.map b/node_modules/skynet-mysky-utils/dist/window-listener.d.ts.map new file mode 100644 index 0000000..28a31ac --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/window-listener.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"window-listener.d.ts","sourceRoot":"","sources":["../src/window-listener.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,qBAAa,iBAAiB;IAC5B,OAAO;CAGR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,UAAU,EAAE,iBAAiB,CAAC;CAC/B,CA0BA"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/window-listener.js b/node_modules/skynet-mysky-utils/dist/window-listener.js new file mode 100644 index 0000000..f732aa4 --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/window-listener.js @@ -0,0 +1,42 @@ +"use strict"; +exports.__esModule = true; +exports.monitorWindowError = exports.PromiseController = exports.dispatchedErrorEvent = exports.errorWindowClosed = void 0; +exports.errorWindowClosed = "window-closed"; +exports.dispatchedErrorEvent = "catchError"; +var PromiseController = /** @class */ (function () { + function PromiseController() { + } + PromiseController.prototype.cleanup = function () { + // Empty until implemented in monitorWindowError. + }; + return PromiseController; +}()); +exports.PromiseController = PromiseController; +/** + * Checks if there has been an error from the window on an interval. + */ +function monitorWindowError() { + var controller = new PromiseController(); + var abortController = new AbortController(); + var promise = new Promise(function (resolve, reject) { + var handleEvent = function (e) { + window.removeEventListener(exports.dispatchedErrorEvent, handleEvent); + var err = e.detail; + reject(err); + }; + // @ts-expect-error doesn't recognize signal option. + window.addEventListener(exports.dispatchedErrorEvent, handleEvent, { + signal: abortController.signal + }); + // Initialize cleanup function. + controller.cleanup = function () { + // Abort the event listener. + abortController.abort(); + // Cleanup the promise. + resolve(); + }; + }); + return { promise: promise, controller: controller }; +} +exports.monitorWindowError = monitorWindowError; +//# sourceMappingURL=window-listener.js.map \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/dist/window-listener.js.map b/node_modules/skynet-mysky-utils/dist/window-listener.js.map new file mode 100644 index 0000000..54a10dd --- /dev/null +++ b/node_modules/skynet-mysky-utils/dist/window-listener.js.map @@ -0,0 +1 @@ +{"version":3,"file":"window-listener.js","sourceRoot":"","sources":["../src/window-listener.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,eAAe,CAAC;AACpC,QAAA,oBAAoB,GAAG,YAAY,CAAC;AAEjD;IAAA;IAIA,CAAC;IAHC,mCAAO,GAAP;QACE,iDAAiD;IACnD,CAAC;IACH,wBAAC;AAAD,CAAC,AAJD,IAIC;AAJY,8CAAiB;AAM9B;;GAEG;AACH,SAAgB,kBAAkB;IAIhC,IAAM,UAAU,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC3C,IAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAE9C,IAAM,OAAO,GAAkB,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACzD,IAAM,WAAW,GAAG,UAAU,CAAM;YAClC,MAAM,CAAC,mBAAmB,CAAC,4BAAoB,EAAE,WAAW,CAAC,CAAC;YAE9D,IAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC;QACF,oDAAoD;QACpD,MAAM,CAAC,gBAAgB,CAAC,4BAAoB,EAAE,WAAW,EAAE;YACzD,MAAM,EAAE,eAAe,CAAC,MAAM;SAC/B,CAAC,CAAC;QAEH,+BAA+B;QAC/B,UAAU,CAAC,OAAO,GAAG;YACnB,4BAA4B;YAC5B,eAAe,CAAC,KAAK,EAAE,CAAC;YACxB,uBAAuB;YACvB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,CAAC;AACjC,CAAC;AA7BD,gDA6BC"} \ No newline at end of file diff --git a/node_modules/skynet-mysky-utils/package.json b/node_modules/skynet-mysky-utils/package.json new file mode 100644 index 0000000..87cc72e --- /dev/null +++ b/node_modules/skynet-mysky-utils/package.json @@ -0,0 +1,51 @@ +{ + "name": "skynet-mysky-utils", + "version": "0.2.3", + "description": "Skynet common MySky utilities", + "main": "dist/index.js", + "scripts": { + "build": "rimraf dist && tsc --project tsconfig.build.json", + "lint": "npm run lint:tsc && npm run lint:eslint", + "lint:eslint": "eslint --ext .ts src", + "lint:tsc": "tsc", + "prepublishOnly": "npm run build", + "test": "jest" + }, + "jest": { + "rootDir": "src" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/SkynetHQ/skynet-mysky-utils.git" + }, + "keywords": [ + "sia", + "skynet", + "mysky", + "dac", + "provider" + ], + "author": "Marcin Swieczkowski", + "license": "MIT", + "bugs": { + "url": "https://github.com/SkynetHQ/skynet-mysky-utils/issues" + }, + "homepage": "https://github.com/SkynetHQ/skynet-mysky-utils#readme", + "dependencies": { + "post-me": "^0.4.5" + }, + "devDependencies": { + "@babel/preset-env": "^7.13.12", + "@babel/preset-typescript": "^7.13.0", + "@types/jest": "^26.0.22", + "@types/node": "^14.14.31", + "@typescript-eslint/eslint-plugin": "^4.16.1", + "@typescript-eslint/parser": "^4.16.1", + "eslint": "^7.21.0", + "eslint-plugin-jsdoc": "^32.2.0", + "jest": "^26.6.3", + "prettier": "^2.2.1", + "rimraf": "^3.0.2", + "typescript": "^4.2.2" + } +} diff --git a/node_modules/skynet-mysky-utils/src/index.ts b/node_modules/skynet-mysky-utils/src/index.ts new file mode 100644 index 0000000..9fc507c --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/index.ts @@ -0,0 +1,45 @@ +export { getPathDomain, getParentPath, sanitizePath } from "./paths"; +export { + Permission, + PermCategory, + PermType, + permCategoryToString, + permTypeToString, + // Constants + PermDiscoverable, + PermHidden, + PermLegacySkyID, + PermRead, + PermWrite, +} from "./permissions"; +export { + createFullScreenIframe, + createIframe, + ensureUrl, + removeAdjacentChars, + trimSuffix, +} from "./utils"; +export { + dispatchedErrorEvent, + errorWindowClosed, + monitorWindowError, +} from "./window-listener"; + +import { Permission } from "./permissions"; + +export const defaultHandshakeMaxAttempts = 150; +export const defaultHandshakeAttemptsInterval = 100; + +export type CheckPermissionsResponse = { + grantedPermissions: Permission[]; + failedPermissions: Permission[]; +}; + +/** + * Custom options for mySky.userID(). + * + * @property [legacyAppID] - Deprecated. The legacy app ID. For compatibility with SkyID. + */ +export type CustomUserIDOptions = { + legacyAppID?: string; +}; diff --git a/node_modules/skynet-mysky-utils/src/paths.test.ts b/node_modules/skynet-mysky-utils/src/paths.test.ts new file mode 100644 index 0000000..674def0 --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/paths.test.ts @@ -0,0 +1,40 @@ +import { getParentPath, getPathDomain, sanitizePath } from "./paths"; + +describe("getPathDomain", () => { + const paths = [ + ["path.hns/path", "path.hns"], + ["path.hns//path/path/", "path.hns"], + ]; + + it.each(paths)("domain for path %s should be %s", (path, pathDomain) => { + const receivedDomain = getPathDomain(path); + expect(receivedDomain).toEqual(pathDomain); + }); +}); + +describe("parentPath", () => { + const paths: Array<[string, string | null]> = [ + ["app.hns/path/file.json", "app.hns/path"], + ["app.hns///path///file.json", "app.hns/path"], + ["app.hns//path", "app.hns"], + ["app.hns/path/", "app.hns"], + ["app.hns//", null], + ]; + + it.each(paths)("parent path for %s should be %s", (path, parentPath) => { + const receivedPath = getParentPath(path); + expect(receivedPath).toEqual(parentPath); + }); +}); + +describe("sanitizePath", () => { + const paths = [ + ["test.hns", "test.hns"], + ["path.hns", "path.hns"], + ]; + + it.each(paths)("path %s should be sanitized to %s", (path, sanitizedPath) => { + const receivedPath = sanitizePath(path); + expect(receivedPath).toEqual(sanitizedPath); + }); +}); diff --git a/node_modules/skynet-mysky-utils/src/paths.ts b/node_modules/skynet-mysky-utils/src/paths.ts new file mode 100644 index 0000000..38fcb51 --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/paths.ts @@ -0,0 +1,46 @@ +import { removeAdjacentChars, trimSuffix } from "./utils"; + +/** + * Gets the root path domain for the given path. + * + * @param path - The given path. + * @returns - The path domain. + */ +export function getPathDomain(path: string): string { + return path.split("/")[0]; +} + +/** + * Gets the parent path for the given path. + * + * @param path - The given path. + * @returns - The parent path, or null if no parent. + */ +export function getParentPath(path: string): string | null { + path = sanitizePath(path); + const pathArray = path.split("/"); + + if (pathArray.length <= 1) { + return null; + } + + pathArray.pop(); + path = pathArray.join("/"); + return path; +} + +/** + * Sanitizes the path by removing trailing slashes and removing repeating adjacent slashes. + * + * @param path - The given path + * @returns - The sanitized path. + */ +export function sanitizePath(path: string): string { + // Remove trailing slashes. + path = trimSuffix(path, "/"); + + // Remove duplicate adjacent slashes. + path = removeAdjacentChars(path, "/"); + + return path; +} diff --git a/node_modules/skynet-mysky-utils/src/permissions.test.ts b/node_modules/skynet-mysky-utils/src/permissions.test.ts new file mode 100644 index 0000000..60e7433 --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/permissions.test.ts @@ -0,0 +1,12 @@ +import { Permission, PermHidden, PermWrite } from "./index"; + +describe("new Permission()", () => { + it("Should reject invalid enum values", () => { + expect( + () => new Permission("test", "test", PermWrite, PermWrite) + ).toThrowError("Invalid 'category' enum value 5"); + expect( + () => new Permission("test", "test", PermHidden, PermHidden) + ).toThrowError("Invalid 'permType' enum value 2"); + }); +}); diff --git a/node_modules/skynet-mysky-utils/src/permissions.ts b/node_modules/skynet-mysky-utils/src/permissions.ts new file mode 100644 index 0000000..614a97a --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/permissions.ts @@ -0,0 +1,77 @@ +export class Permission { + constructor( + public requestor: string, + public path: string, + public category: PermCategory, + public permType: PermType + ) { + if (typeof category !== "number" || !(category in PermCategory)) { + throw new Error(`Invalid 'category' enum value ${category}`); + } + if (typeof permType !== "number" || !(permType in PermType)) { + throw new Error(`Invalid 'permType' enum value ${permType}`); + } + } +} + +// Define category constants for non-TS users. +export const PermDiscoverable = 1; +export const PermHidden = 2; +export const PermLegacySkyID = 3; + +/** + * Defines what type of file is being requested. Discoverable files are visible + * to the entire world, hidden files are only visible to the user (unless + * shared), and LegacySkyID files are supported files from the legacy SkyID + * login system. + */ +export enum PermCategory { + Discoverable = PermDiscoverable, + Hidden = PermHidden, + LegacySkyID = PermLegacySkyID, +} + +// Define type constants for non-TS users. +export const PermRead = 4; +export const PermWrite = 5; + +export enum PermType { + Read = PermRead, + Write = PermWrite, +} + +/** + * Converts the given permission category to a human-readable string. + * + * @param category - The given category. + * @returns - The string. + * @throws - Will throw if the category is not valid. + */ +export function permCategoryToString(category: PermCategory): string { + if (category === PermCategory.Discoverable) { + return "Discoverable"; + } else if (category === PermCategory.Hidden) { + return "Hidden"; + } else if (category === PermCategory.LegacySkyID) { + return "LegacySkyID"; + } else { + throw new Error(`Invalid permission category ${category}`); + } +} + +/** + * Converts the given permission type to a human-readable string. + * + * @param permType - The given type. + * @returns - The string. + * @throws - Will throw if the type is not valid. + */ +export function permTypeToString(permType: PermType): string { + if (permType === PermType.Read) { + return "Read"; + } else if (permType === PermType.Write) { + return "Write"; + } else { + throw new Error(`Invalid permission type ${permType}`); + } +} diff --git a/node_modules/skynet-mysky-utils/src/utils.ts b/node_modules/skynet-mysky-utils/src/utils.ts new file mode 100644 index 0000000..da45c50 --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/utils.ts @@ -0,0 +1,103 @@ +/** + * Creates an invisible iframe with the given src and adds it to the page. + */ +export function createIframe(srcUrl: string, name: string): HTMLIFrameElement { + srcUrl = ensureUrl(srcUrl); + + const childFrame = document.createElement("iframe")!; + childFrame.src = srcUrl; + childFrame.name = name; + childFrame.style.display = "none"; + + // Set sandbox permissions. + // TODO: Enable sandboxing? + // childFrame.sandbox.add("allow-same-origin"); + // childFrame.sandbox.add("allow-scripts"); + + document.body.appendChild(childFrame); + return childFrame; +} + +/** + * Creates a full-screen iframe with the given src and adds it to the page. + */ +export function createFullScreenIframe( + srcUrl: string, + name: string +): HTMLIFrameElement { + srcUrl = ensureUrl(srcUrl); + + const childFrame = document.createElement("iframe")!; + childFrame.src = srcUrl; + childFrame.name = name; + + // Set properties to make the iframe full-screen. + childFrame.style.position = "fixed"; + childFrame.style.top = "0"; + childFrame.style.left = "0"; + childFrame.style.bottom = "0"; + childFrame.style.right = "0"; + childFrame.style.width = "100%"; + childFrame.style.height = "100%"; + childFrame.style.border = "none"; + childFrame.style.margin = "0"; + childFrame.style.padding = "0"; + childFrame.style.overflow = "hidden"; + childFrame.style.zIndex = "999999"; + + // Set sandbox permissions. + // TODO: Enable sandboxing? + // childFrame.sandbox.add("allow-same-origin"); + // childFrame.sandbox.add("allow-scripts"); + + document.body.appendChild(childFrame); + return childFrame; +} + +export function ensureUrl(url: string): string { + return ensurePrefix(url, "https://"); +} + +export function removeAdjacentChars(str: string, char: string): string { + const pathArray = Array.from(str); + for (let i = 0; i < pathArray.length - 1; ) { + if (pathArray[i] === char && pathArray[i + 1] === char) { + pathArray.splice(i, 1); + } else { + i++; + } + } + return pathArray.join(""); +} + +/** + * Removes a suffix from the end of the string. + * + * @param str - The string to process. + * @param suffix - The suffix to remove. + * @param [limit] - Maximum amount of times to trim. No limit by default. + * @returns - The processed string. + */ +export function trimSuffix( + str: string, + suffix: string, + limit?: number +): string { + while (str.endsWith(suffix)) { + if (limit !== undefined && limit <= 0) { + break; + } + str = str.substring(0, str.length - suffix.length); + if (limit) { + limit -= 1; + } + } + return str; +} + +function ensurePrefix(s: string, prefix: string): string { + if (!s.startsWith(prefix)) { + s = `${prefix}${s}`; + } + return s; +} diff --git a/node_modules/skynet-mysky-utils/src/window-listener.ts b/node_modules/skynet-mysky-utils/src/window-listener.ts new file mode 100644 index 0000000..e43c04b --- /dev/null +++ b/node_modules/skynet-mysky-utils/src/window-listener.ts @@ -0,0 +1,42 @@ +export const errorWindowClosed = "window-closed"; +export const dispatchedErrorEvent = "catchError"; + +export class PromiseController { + cleanup() { + // Empty until implemented in monitorWindowError. + } +} + +/** + * Checks if there has been an error from the window on an interval. + */ +export function monitorWindowError(): { + promise: Promise; + controller: PromiseController; +} { + const controller = new PromiseController(); + const abortController = new AbortController(); + + const promise: Promise = new Promise((resolve, reject) => { + const handleEvent = function (e: any) { + window.removeEventListener(dispatchedErrorEvent, handleEvent); + + const err = e.detail; + reject(err); + }; + // @ts-expect-error doesn't recognize signal option. + window.addEventListener(dispatchedErrorEvent, handleEvent, { + signal: abortController.signal, + }); + + // Initialize cleanup function. + controller.cleanup = () => { + // Abort the event listener. + abortController.abort(); + // Cleanup the promise. + resolve(); + }; + }); + + return { promise, controller }; +} diff --git a/node_modules/skynet-mysky-utils/tsconfig.build.json b/node_modules/skynet-mysky-utils/tsconfig.build.json new file mode 100644 index 0000000..b5af187 --- /dev/null +++ b/node_modules/skynet-mysky-utils/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "isolatedModules": true, + "noImplicitAny": true, + "sourceMap": true, + "strict": true, + + "outDir": "dist", + "types": ["node"], + "typeRoots": ["./types", "./node_modules/@types"] + }, + "exclude": ["src/*.test.ts"] +} diff --git a/node_modules/skynet-mysky-utils/tsconfig.json b/node_modules/skynet-mysky-utils/tsconfig.json new file mode 100644 index 0000000..c9e6df2 --- /dev/null +++ b/node_modules/skynet-mysky-utils/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "isolatedModules": true, + "noEmit": true, + "noImplicitAny": true, + "sourceMap": true, + "strict": true, + + "outDir": "dist", + "types": ["jest", "node"], + "typeRoots": ["./types", "./node_modules/@types"] + } +} diff --git a/node_modules/split-on-first/index.d.ts b/node_modules/split-on-first/index.d.ts deleted file mode 100644 index 6123bef..0000000 --- a/node_modules/split-on-first/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** -Split a string on the first occurrence of a given separator. - -@param string - The string to split. -@param separator - The separator to split on. - -@example -``` -import splitOnFirst = require('split-on-first'); - -splitOnFirst('a-b-c', '-'); -//=> ['a', 'b-c'] - -splitOnFirst('key:value:value2', ':'); -//=> ['key', 'value:value2'] - -splitOnFirst('a---b---c', '---'); -//=> ['a', 'b---c'] - -splitOnFirst('a-b-c', '+'); -//=> ['a-b-c'] -``` -*/ -declare function splitOnFirst( - string: string, - separator: string -): [string, string?]; - -export = splitOnFirst; diff --git a/node_modules/split-on-first/index.js b/node_modules/split-on-first/index.js deleted file mode 100644 index d914070..0000000 --- a/node_modules/split-on-first/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -module.exports = (string, separator) => { - if (!(typeof string === 'string' && typeof separator === 'string')) { - throw new TypeError('Expected the arguments to be of type `string`'); - } - - if (separator === '') { - return [string]; - } - - const separatorIndex = string.indexOf(separator); - - if (separatorIndex === -1) { - return [string]; - } - - return [ - string.slice(0, separatorIndex), - string.slice(separatorIndex + separator.length) - ]; -}; diff --git a/node_modules/split-on-first/license b/node_modules/split-on-first/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/split-on-first/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -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/split-on-first/package.json b/node_modules/split-on-first/package.json deleted file mode 100644 index 1082ec4..0000000 --- a/node_modules/split-on-first/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "split-on-first", - "version": "1.1.0", - "description": "Split a string on the first occurance of a given separator", - "license": "MIT", - "repository": "sindresorhus/split-on-first", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=6" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "split", - "string", - "first", - "occurrence", - "separator", - "delimiter", - "text" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/split-on-first/readme.md b/node_modules/split-on-first/readme.md deleted file mode 100644 index 2463cf1..0000000 --- a/node_modules/split-on-first/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# split-on-first [![Build Status](https://travis-ci.com/sindresorhus/split-on-first.svg?branch=master)](https://travis-ci.com/sindresorhus/split-on-first) - -> Split a string on the first occurrence of a given separator - -This is similar to [`String#split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), but that one splits on all the occurrences, not just the first one. - - -## Install - -``` -$ npm install split-on-first -``` - - -## Usage - -```js -const splitOnFirst = require('split-on-first'); - -splitOnFirst('a-b-c', '-'); -//=> ['a', 'b-c'] - -splitOnFirst('key:value:value2', ':'); -//=> ['key', 'value:value2'] - -splitOnFirst('a---b---c', '---'); -//=> ['a', 'b---c'] - -splitOnFirst('a-b-c', '+'); -//=> ['a-b-c'] -``` - - -## API - -### splitOnFirst(string, separator) - -#### string - -Type: `string` - -The string to split. - -#### separator - -Type: `string` - -The separator to split on. - - -## Related - -- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/strict-uri-encode/index.js b/node_modules/strict-uri-encode/index.js deleted file mode 100644 index affabef..0000000 --- a/node_modules/strict-uri-encode/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`); diff --git a/node_modules/strict-uri-encode/license b/node_modules/strict-uri-encode/license deleted file mode 100644 index 0f8cf79..0000000 --- a/node_modules/strict-uri-encode/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Kevin Martensson (github.com/kevva) - -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/strict-uri-encode/package.json b/node_modules/strict-uri-encode/package.json deleted file mode 100644 index 565fb63..0000000 --- a/node_modules/strict-uri-encode/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "strict-uri-encode", - "version": "2.0.0", - "description": "A stricter URI encode adhering to RFC 3986", - "license": "MIT", - "repository": "kevva/strict-uri-encode", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "component", - "encode", - "RFC3986", - "uri" - ], - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/node_modules/strict-uri-encode/readme.md b/node_modules/strict-uri-encode/readme.md deleted file mode 100644 index 05e3fee..0000000 --- a/node_modules/strict-uri-encode/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strict-uri-encode [![Build Status](https://travis-ci.org/kevva/strict-uri-encode.svg?branch=master)](https://travis-ci.org/kevva/strict-uri-encode) - -> A stricter URI encode adhering to [RFC 3986](http://tools.ietf.org/html/rfc3986) - - -## Install - -``` -$ npm install --save strict-uri-encode -``` - - -## Usage - -```js -const strictUriEncode = require('strict-uri-encode'); - -strictUriEncode('unicorn!foobar'); -//=> 'unicorn%21foobar' - -strictUriEncode('unicorn*foobar'); -//=> 'unicorn%2Afoobar' -``` - - -## API - -### strictUriEncode(string) - -#### string - -Type: `string`, `number` - -String to URI encode. - - -## License - -MIT © [Kevin Mårtensson](http://github.com/kevva) diff --git a/node_modules/tus-js-client/LICENSE b/node_modules/tus-js-client/LICENSE new file mode 100644 index 0000000..b982943 --- /dev/null +++ b/node_modules/tus-js-client/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 tus - Resumable File Uploads + +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/tus-js-client/README.md b/node_modules/tus-js-client/README.md new file mode 100644 index 0000000..f763347 --- /dev/null +++ b/node_modules/tus-js-client/README.md @@ -0,0 +1,72 @@ +# tus-js-client + +Tus logo + +> **tus** is a protocol based on HTTP for *resumable file uploads*. Resumable +> means that an upload can be interrupted at any moment and can be resumed without +> re-uploading the previous data again. An interruption may happen willingly, if +> the user wants to pause, or by accident in case of an network issue or server +> outage. + +tus-js-client is a pure **JavaScript** client for the [tus resumable upload protocol](http://tus.io) and can be used inside **browsers**, **Node.js**, +**React Native** and **Apache Cordova** applications. + +**Protocol version:** 1.0.0 + +This branch contains tus-js-client v2. If you are looking for the previous major release, after which [breaking changes](https://tus.io/blog/2020/05/04/tus-js-client-200/) have been introduced, please look at the [v1.8.0 tag](https://github.com/tus/tus-js-client/tree/v1.8.0). + +## Example + +```js +input.addEventListener("change", function(e) { + // Get the selected file from the input element + var file = e.target.files[0] + + // Create a new tus upload + var upload = new tus.Upload(file, { + endpoint: "http://localhost:1080/files/", + retryDelays: [0, 3000, 5000, 10000, 20000], + metadata: { + filename: file.name, + filetype: file.type + }, + onError: function(error) { + console.log("Failed because: " + error) + }, + onProgress: function(bytesUploaded, bytesTotal) { + var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2) + console.log(bytesUploaded, bytesTotal, percentage + "%") + }, + onSuccess: function() { + console.log("Download %s from %s", upload.file.name, upload.url) + } + }) + + // Check if there are any previous uploads to continue. + upload.findPreviousUploads().then(function (previousUploads) { + // Found previous uploads so we select the first one. + if (previousUploads.length) { + upload.resumeFromPreviousUpload(previousUploads[0]) + } + + // Start the upload + upload.start() + }) +}) +``` + +## Documentation + +* [Installation & Requirements](/docs/installation.md) +* [Usage & Examples](/docs/usage.md) +* [API Reference](/docs/api.md) +* [Contribution Guidelines](/docs/contributing.md) +* [FAQ & Common issues](/docs/faq.md) + +## Build status + +[![Build Status](https://travis-ci.org/tus/tus-js-client.svg?branch=master)](https://travis-ci.org/tus/tus-js-client) + +## License + +This project is licensed under the MIT license, see `LICENSE`. diff --git a/node_modules/tus-js-client/bin/browserstack-jasmine.js b/node_modules/tus-js-client/bin/browserstack-jasmine.js new file mode 100644 index 0000000..c3ad526 --- /dev/null +++ b/node_modules/tus-js-client/bin/browserstack-jasmine.js @@ -0,0 +1,104 @@ +/* eslint no-console: 0 */ + +const browserstack = require('browserstack-runner') + +const BS_USERNAME = process.env.BROWSERSTACK_USERNAME +const BS_KEY = process.env.BROWSERSTACK_KEY + +// A list of available browsers is available at: +// https://www.browserstack.com/list-of-browsers-and-platforms/js_testing +const browsers = [ + 'ie_10', + 'ie_11', + + 'edge_previous', + 'edge_current', + + 'chrome_previous', + 'chrome_current', + + 'firefox_previous', + 'firefox_current', + + 'safari_previous', + 'safari_current', + + 'opera_previous', + 'opera_current', + + { + os : 'ios', + os_version: '12.1', + device : 'iPhone XS', + realMobile: true, + }, + { + os : 'ios', + os_version: '11.0', + device : 'iPhone X', + realMobile: true, + }, + { + os : 'ios', + os_version: '10.3', + device : 'iPhone 7', + realMobile: true, + }, +] + +if (!BS_USERNAME || BS_USERNAME == '' || !BS_KEY || BS_KEY == '') { + console.log('Please provide the BROWSERSTACK_USERNAME and BROWSERSTACK_KEY environment variables.') + process.exit(1) +} + +function runTests (cb) { + browserstack.run({ + username : BS_USERNAME, + key : BS_KEY, + test_path : 'test/SpecRunner.html', + test_framework : 'jasmine2', + test_server_port: 8081, + browsers, + }, (err, reports) => { + if (err) { + return cb(err) + } + + // Enable to see full report + console.log(JSON.stringify(reports, null, 2)) + console.log('Test Finished') + console.log('') + + reports.forEach((report) => { + const testCount = report.suites.testCounts.total + + if (testCount === 0) { + console.log(`✘ ${report.browser}: No tests ran, which is considered a failure`) + process.exitCode = 1 + return + } + + if (report.suites.status !== 'passed') { + console.log(`✘ ${report.browser}: Test suite failed`) + process.exitCode = 1 + return + } + + console.log(`✓ ${report.browser}: Test suite passed`) + }) + + if (reports.length != browsers.length) { + console.log(`✘ Only received ${reports.length} reports but expected ${browsers.length}!`) + process.exitCode = 1 + } + + cb() + }) +} + +runTests((err) => { + if (err) { + console.log(err) + process.exitCode = 1 + } +}) diff --git a/node_modules/tus-js-client/bin/puppeteer-jasmine.js b/node_modules/tus-js-client/bin/puppeteer-jasmine.js new file mode 100644 index 0000000..316d342 --- /dev/null +++ b/node_modules/tus-js-client/bin/puppeteer-jasmine.js @@ -0,0 +1,52 @@ +/* eslint no-console: 0 */ + +/** + * This script will open the tests' SpecRunner.html to allow the tests to be + * executed, forward all of the results to the stdout and will finally exit + * according to the result. + */ + +const puppeteer = require('puppeteer') +const path = require('path') + +// Enable this flag to not run Puppeteer in headless mode. +const DEBUG = false + +// File-URL pointing to the SpecRunner.html file +const testURL = `file://${path.join(__dirname, '..', 'test', 'SpecRunner.html')}` + +async function closeBrowser (browser) { + if (DEBUG) return + await browser.close() +} + +(async () => { + const browser = await puppeteer.launch({ + args : ['--no-sandbox', '--disable-setuid-sandbox'], + headless: !DEBUG, + }) + + // Stop if the tests didn't complete after one minute. + const closeTimeout = setTimeout(async () => { + console.log('Puppeteer tests timed out after 60s') + process.exitCode = 2 + await closeBrowser(browser) + }, 60 * 1000) + + // Forward all messages from the console to stdout. + // The SpecRunner.html contains a reporter which writes the test results + // to the console, so we can forward them to stdout. + const page = await browser.newPage() + page.on('console', consoleObj => console.log(consoleObj.text())) + + // The reporter in test/spec/helpers/puppeteer/reporter.js will call the + // __jasmineCallback function once all tests have been completed. + // The passed argument is a boolean indicating the test result. + await page.exposeFunction('__jasmineCallback', async (passed) => { + process.exitCode = passed ? 0 : 1 + clearTimeout(closeTimeout) + await closeBrowser(browser) + }) + + await page.goto(testURL) +})() diff --git a/node_modules/tus-js-client/bin/test b/node_modules/tus-js-client/bin/test new file mode 100755 index 0000000..0995708 --- /dev/null +++ b/node_modules/tus-js-client/bin/test @@ -0,0 +1,26 @@ +#!/bin/bash +# Exit immediately if an error occurs without continuing +set -e + +# Move into a known directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR/.. + +# Run tests in both environments by default +TEST_TARGET=${TEST_TARGET:-"node browser"} + +# Node.js tests +if [[ $TEST_TARGET == *"node"* ]]; then + npm run test-node +fi + +# Browser tests using Puppeteer and on BrowserStack +if [[ $TEST_TARGET == *"browser"* ]]; then + npm run test-puppeteer + + if [ "${CI}" = "true" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then + npm run test-browserstack + else + echo "Skipping sauce-test as this is not a master CI branch test run" + fi +fi diff --git a/node_modules/tus-js-client/demos/browser/demo.css b/node_modules/tus-js-client/demos/browser/demo.css new file mode 100644 index 0000000..3c02cec --- /dev/null +++ b/node_modules/tus-js-client/demos/browser/demo.css @@ -0,0 +1,11 @@ +body { + padding-top: 40px; +} + +.progress { + height: 32px; +} + +a.btn { + margin-bottom: 2px; +} diff --git a/node_modules/tus-js-client/demos/browser/demo.js b/node_modules/tus-js-client/demos/browser/demo.js new file mode 100644 index 0000000..f6dc436 --- /dev/null +++ b/node_modules/tus-js-client/demos/browser/demo.js @@ -0,0 +1,137 @@ +/* global tus */ +/* eslint no-console: 0 */ + +var upload = null +var uploadIsRunning = false +var toggleBtn = document.querySelector('#toggle-btn') +var input = document.querySelector('input[type=file]') +var progress = document.querySelector('.progress') +var progressBar = progress.querySelector('.bar') +var alertBox = document.querySelector('#support-alert') +var uploadList = document.querySelector('#upload-list') +var chunkInput = document.querySelector('#chunksize') +var parallelInput = document.querySelector('#paralleluploads') +var endpointInput = document.querySelector('#endpoint') + +if (!tus.isSupported) { + alertBox.classList.remove('hidden') +} + +if (!toggleBtn) { + throw new Error('Toggle button not found on this page. Aborting upload-demo. ') +} + +toggleBtn.addEventListener('click', (e) => { + e.preventDefault() + + if (upload) { + if (uploadIsRunning) { + upload.abort() + toggleBtn.textContent = 'resume upload' + uploadIsRunning = false + } else { + upload.start() + toggleBtn.textContent = 'pause upload' + uploadIsRunning = true + } + } else if (input.files.length > 0) { + startUpload() + } else { + input.click() + } +}) + +input.addEventListener('change', startUpload) + +function startUpload () { + var file = input.files[0] + // Only continue if a file has actually been selected. + // IE will trigger a change event even if we reset the input element + // using reset() and we do not want to blow up later. + if (!file) { + return + } + + var endpoint = endpointInput.value + var chunkSize = parseInt(chunkInput.value, 10) + if (isNaN(chunkSize)) { + chunkSize = Infinity + } + + var parallelUploads = parseInt(parallelInput.value, 10) + if (isNaN(parallelUploads)) { + parallelUploads = 1 + } + + toggleBtn.textContent = 'pause upload' + + var options = { + endpoint, + chunkSize, + retryDelays: [0, 1000, 3000, 5000], + parallelUploads, + metadata : { + filename: file.name, + filetype: file.type, + }, + onError (error) { + if (error.originalRequest) { + if (window.confirm(`Failed because: ${error}\nDo you want to retry?`)) { + upload.start() + uploadIsRunning = true + return + } + } else { + window.alert(`Failed because: ${error}`) + } + + reset() + }, + onProgress (bytesUploaded, bytesTotal) { + var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2) + progressBar.style.width = `${percentage}%` + console.log(bytesUploaded, bytesTotal, `${percentage}%`) + }, + onSuccess () { + var anchor = document.createElement('a') + anchor.textContent = `Download ${upload.file.name} (${upload.file.size} bytes)` + anchor.href = upload.url + anchor.className = 'btn btn-success' + uploadList.appendChild(anchor) + + reset() + }, + } + + upload = new tus.Upload(file, options) + upload.findPreviousUploads().then((previousUploads) => { + askToResumeUpload(previousUploads, upload) + + upload.start() + uploadIsRunning = true + }) +} + +function reset () { + input.value = '' + toggleBtn.textContent = 'start upload' + upload = null + uploadIsRunning = false +} + +function askToResumeUpload (previousUploads, upload) { + if (previousUploads.length === 0) return + + let text = 'You tried to upload this file previously at these times:\n\n' + previousUploads.forEach((previousUpload, index) => { + text += `[${index}] ${previousUpload.creationTime}\n` + }) + text += '\nEnter the corresponding number to resume an upload or press Cancel to start a new upload' + + const answer = prompt(text) + const index = parseInt(answer, 10) + + if (!isNaN(index) && previousUploads[index]) { + upload.resumeFromPreviousUpload(previousUploads[index]) + } +} diff --git a/node_modules/tus-js-client/demos/browser/index.html b/node_modules/tus-js-client/demos/browser/index.html new file mode 100644 index 0000000..8cf243d --- /dev/null +++ b/node_modules/tus-js-client/demos/browser/index.html @@ -0,0 +1,95 @@ + + + + + tus-js-client demo - File Upload + + + + +
+

tus-js-client demo - File Upload

+ +

+ This demo shows the basic functionality of the tus protocol. You can select a file using the controls below and start/pause the upload as you wish. +

+ +

+ For a prettier demo please go to the + tus.io website. + This demo is just here to aid developers. +

+ +

+ A demo where a video is recorded from your webcam while being simultaneously uploaded, can be found here. +

+ + + +
+ +

+ + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ +
+ + + +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+

Uploads

+

+ Succesful uploads will be listed here. Try one! +

+ + + + + + + diff --git a/node_modules/tus-js-client/demos/browser/video.html b/node_modules/tus-js-client/demos/browser/video.html new file mode 100644 index 0000000..da24b6a --- /dev/null +++ b/node_modules/tus-js-client/demos/browser/video.html @@ -0,0 +1,65 @@ + + + + + tus-js-client demo - Stream Video + + + + +
+

tus-js-client demo - Stream Video

+ +

+ This demo shows tus' support for uploading streams while the data is still arriving. Using the controls below you can start recording a video from your webcam which is directly uploaded to the specified tus endpoint. This is different from regular file uploads since the entire video size is not known in advance. tus' support for deferring the upload length makes this possible. +

+ + + +
+ + + + + + + + + + +
+ + + +
+ + + +
+ +

+ + + +
+ +

Uploads

+

+ Succesful uploads will be listed here. Try one! +

+
    + +
+ +
+ + + + + diff --git a/node_modules/tus-js-client/demos/browser/video.js b/node_modules/tus-js-client/demos/browser/video.js new file mode 100644 index 0000000..7e6b476 --- /dev/null +++ b/node_modules/tus-js-client/demos/browser/video.js @@ -0,0 +1,149 @@ +/* global tus */ +/* eslint no-console: 0 */ + +var stopRecording = null +var upload = null +var recordBtn = document.querySelector('#record-btn') +var alertBox = document.querySelector('#support-alert') +var progressBox = document.querySelector('#progress-note') +var uploadList = document.querySelector('#upload-list') +var chunkInput = document.querySelector('#chunksize') +var endpointInput = document.querySelector('#endpoint') + +if (!tus.isSupported) { + alertBox.classList.remove('hidden') +} + +if (!recordBtn) { + throw new Error('Record button not found on this page. Aborting upload-demo.') +} + +recordBtn.addEventListener('click', (e) => { + e.preventDefault() + if (stopRecording) { + recordBtn.textContent = 'Start Recording' + stopRecording() + } else { + recordBtn.textContent = 'Stop Recording' + startStreamUpload() + } +}) + +function startUpload (file) { + var endpoint = endpointInput.value + var chunkSize = parseInt(chunkInput.value, 10) + if (isNaN(chunkSize)) { + chunkSize = Infinity + } + + var options = { + resume : false, + endpoint, + chunkSize, + retryDelays : [0, 1000, 3000, 5000], + uploadLengthDeferred: true, + metadata : { + filename: 'webcam.webm', + filetype: 'video/webm', + }, + onError (error) { + if (error.originalRequest) { + if (window.confirm(`Failed because: ${error}\nDo you want to retry?`)) { + upload.start() + return + } + } else { + window.alert(`Failed because: ${error}`) + } + + reset() + }, + onProgress (bytesUploaded) { + progressBox.textContent = `Uploaded ${bytesUploaded} bytes so far.` + }, + onSuccess () { + var listItem = document.createElement('li') + + var video = document.createElement('video') + video.controls = true + video.src = upload.url + listItem.appendChild(video) + + var lineBreak = document.createElement('br') + listItem.appendChild(lineBreak) + + var anchor = document.createElement('a') + anchor.textContent = `Download ${options.metadata.filename}` + anchor.href = upload.url + anchor.className = 'btn btn-success' + listItem.appendChild(anchor) + + uploadList.appendChild(listItem) + reset() + }, + } + + upload = new tus.Upload(file, options) + upload.start() +} + +function startStreamUpload () { + navigator.mediaDevices.getUserMedia({ video: true }) + .then(stream => { + const mr = new MediaRecorder(stream) + const chunks = [] + let done = false + let onDataAvailable = null + + mr.onerror = onError + mr.onstop = () => { + done = true + if (onDataAvailable) onDataAvailable(readableRecorder.read()) + } + mr.ondataavailable = event => { + chunks.push(event.data) + if (onDataAvailable) { + onDataAvailable(readableRecorder.read()) + onDataAvailable = undefined + } + } + + mr.start(1000) + + const readableRecorder = { + read () { + if (done && chunks.length === 0) { + return Promise.resolve({ done: true }) + } + + if (chunks.length > 0) { + return Promise.resolve({ value: chunks.shift(), done: false }) + } + + return new Promise((resolve) => { onDataAvailable = resolve }) + }, + } + + startUpload(readableRecorder) + + stopRecording = () => { + stream.getTracks().forEach(t => t.stop()) + mr.stop() + stopRecording = null + } + }) + .catch(onError) +} + +function reset () { + upload = null +} + +function onError (error) { + console.log(error) + alert(`An error occurred: ${error}`) + + upload = null + stopRecording = null + recordBtn.textContent = 'Start Recording' +} diff --git a/node_modules/tus-js-client/demos/cordova/.npmignore b/node_modules/tus-js-client/demos/cordova/.npmignore new file mode 100644 index 0000000..fd29596 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/.npmignore @@ -0,0 +1,2 @@ +# OS X +.DS_Store diff --git a/node_modules/tus-js-client/demos/cordova/README.md b/node_modules/tus-js-client/demos/cordova/README.md new file mode 100644 index 0000000..a6d72dc --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/README.md @@ -0,0 +1,19 @@ +# Apache Cordova demo + +This demo shows how tus-js-client can be used inside an Apache Cordova application. +The `cordova-plugin-camera` and `cordova-plugin-file` plugins allow it to access the device's photos library using native file system. + +## Instructions + +1. Build the tus-js-client files before running the Cordova demo: + +```sh +cd ../.. +npm run dist +``` + +2. Execute the Cordova demo: + +```sh +cordova run android +``` diff --git a/node_modules/tus-js-client/demos/cordova/config.xml b/node_modules/tus-js-client/demos/cordova/config.xml new file mode 100644 index 0000000..ec77fad --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/config.xml @@ -0,0 +1,29 @@ + + + tus + + A sample Apache Cordova application that using the tus protocol. + + + Marius Kleidl + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/tus-js-client/demos/cordova/hooks/README.md b/node_modules/tus-js-client/demos/cordova/hooks/README.md new file mode 100644 index 0000000..574ad4c --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/hooks/README.md @@ -0,0 +1,23 @@ + +# Cordova Hooks + +Cordova Hooks represent special scripts which could be added by application and plugin developers or even by your own build system to customize cordova commands. See Hooks Guide for more details: http://cordova.apache.org/docs/en/edge/guide_appdev_hooks_index.md.html#Hooks%20Guide. diff --git a/node_modules/tus-js-client/demos/cordova/hooks/before_prepare/copy_tus_files.js b/node_modules/tus-js-client/demos/cordova/hooks/before_prepare/copy_tus_files.js new file mode 100755 index 0000000..2954f74 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/hooks/before_prepare/copy_tus_files.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node + +const fs = require('fs') +const path = require('path') + +const rootDir = path.join(__dirname, '..', '..') +const tusJsPath = path.join(rootDir, '..', '..', 'dist', 'tus.js') +const assetsDir = path.join(rootDir, 'www', 'js', 'tus.js') + +fs.copyFile(tusJsPath, assetsDir, (err) => { + if (err) throw err +}) diff --git a/node_modules/tus-js-client/demos/cordova/package.json b/node_modules/tus-js-client/demos/cordova/package.json new file mode 100644 index 0000000..a7b6e76 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/package.json @@ -0,0 +1,29 @@ +{ + "name": "tus-cordova-example", + "displayName": "tus", + "version": "1.0.0", + "description": "A sample Apache Cordova application that using the tus protocol.", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Apache Cordova Team", + "license": "Apache-2.0", + "dependencies": { + "cordova-android": "^7.1.4", + "cordova-plugin-camera": "^4.0.3", + "cordova-plugin-file": "^6.0.1", + "cordova-plugin-whitelist": "^1.3.3", + "tus-js-client": "^1.5.2" + }, + "cordova": { + "plugins": { + "cordova-plugin-camera": {}, + "cordova-plugin-file": {}, + "cordova-plugin-whitelist": {} + }, + "platforms": [ + "android" + ] + } +} \ No newline at end of file diff --git a/node_modules/tus-js-client/demos/cordova/res/README.md b/node_modules/tus-js-client/demos/cordova/res/README.md new file mode 100644 index 0000000..bffb33b --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/res/README.md @@ -0,0 +1,29 @@ + + +Note that these image resources are not copied into a project when a project +is created with the CLI. Although there are default image resources in a +newly-created project, those come from the platform-specific project template, +which can generally be found in the platform's `template` directory. Until +icon and splashscreen support is added to the CLI, these image resources +aren't used directly. + +See https://issues.apache.org/jira/browse/CB-5145 diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-36-ldpi.png b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-36-ldpi.png new file mode 100644 index 0000000..cd5032a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-36-ldpi.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-48-mdpi.png b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-48-mdpi.png new file mode 100644 index 0000000..e79c606 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-48-mdpi.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-72-hdpi.png b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-72-hdpi.png new file mode 100644 index 0000000..4d27634 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-72-hdpi.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-96-xhdpi.png b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-96-xhdpi.png new file mode 100644 index 0000000..ec7ffbf Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/android/icon-96-xhdpi.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-48-type5.png b/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-48-type5.png new file mode 100644 index 0000000..8ad8bac Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-48-type5.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-50-type3.png b/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-50-type3.png new file mode 100644 index 0000000..c6ddf84 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-50-type3.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-80-type4.png b/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-80-type4.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/bada-wac/icon-80-type4.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/bada/icon-128.png b/node_modules/tus-js-client/demos/cordova/res/icon/bada/icon-128.png new file mode 100644 index 0000000..3516df3 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/bada/icon-128.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/blackberry/icon-80.png b/node_modules/tus-js-client/demos/cordova/res/icon/blackberry/icon-80.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/blackberry/icon-80.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/blackberry10/icon-80.png b/node_modules/tus-js-client/demos/cordova/res/icon/blackberry10/icon-80.png new file mode 100644 index 0000000..f86a27a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/blackberry10/icon-80.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-57-2x.png b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-57-2x.png new file mode 100644 index 0000000..efd9c37 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-57-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-57.png b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-57.png new file mode 100644 index 0000000..c795fc4 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-57.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-72-2x.png b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-72-2x.png new file mode 100644 index 0000000..dd819da Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-72-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-72.png b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-72.png new file mode 100644 index 0000000..b1cfde7 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/ios/icon-72.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/tizen/icon-128.png b/node_modules/tus-js-client/demos/cordova/res/icon/tizen/icon-128.png new file mode 100644 index 0000000..3516df3 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/tizen/icon-128.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/webos/icon-64.png b/node_modules/tus-js-client/demos/cordova/res/icon/webos/icon-64.png new file mode 100644 index 0000000..03b3849 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/webos/icon-64.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-173-tile.png b/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-173-tile.png new file mode 100644 index 0000000..4f15e20 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-173-tile.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-48.png b/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-48.png new file mode 100644 index 0000000..8ad8bac Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-48.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-62-tile.png b/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-62-tile.png new file mode 100644 index 0000000..aab6061 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/icon/windows-phone/icon-62-tile.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-hdpi-landscape.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-hdpi-landscape.png new file mode 100644 index 0000000..a61e2b1 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-hdpi-landscape.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-hdpi-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-hdpi-portrait.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-hdpi-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-ldpi-landscape.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-ldpi-landscape.png new file mode 100644 index 0000000..f3934cd Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-ldpi-landscape.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-ldpi-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-ldpi-portrait.png new file mode 100644 index 0000000..65ad163 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-ldpi-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-mdpi-landscape.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-mdpi-landscape.png new file mode 100644 index 0000000..a1b697c Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-mdpi-landscape.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-mdpi-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-mdpi-portrait.png new file mode 100644 index 0000000..ea15693 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-mdpi-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-xhdpi-landscape.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-xhdpi-landscape.png new file mode 100644 index 0000000..79f2f09 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-xhdpi-landscape.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-xhdpi-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-xhdpi-portrait.png new file mode 100644 index 0000000..c2e8042 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/android/screen-xhdpi-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type3.png b/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type3.png new file mode 100755 index 0000000..ea15693 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type3.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type4.png b/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type4.png new file mode 100755 index 0000000..5d6a28a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type4.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type5.png b/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type5.png new file mode 100755 index 0000000..bd64f76 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/bada-wac/screen-type5.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/bada/screen-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/bada/screen-portrait.png new file mode 100644 index 0000000..5d6a28a Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/bada/screen-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/blackberry/screen-225.png b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry/screen-225.png new file mode 100644 index 0000000..29873e9 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry/screen-225.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-1280x768.png b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-1280x768.png new file mode 100644 index 0000000..5f4bca9 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-1280x768.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-720x720.png b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-720x720.png new file mode 100644 index 0000000..fe1756f Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-720x720.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-768x1280.png b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-768x1280.png new file mode 100644 index 0000000..0fb9c1b Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/blackberry10/splash-768x1280.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-landscape-2x.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-landscape-2x.png new file mode 100644 index 0000000..0b50ed7 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-landscape-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-landscape.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-landscape.png new file mode 100644 index 0000000..b2f6019 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-landscape.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-portrait-2x.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-portrait-2x.png new file mode 100644 index 0000000..cdac6a7 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-portrait-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-portrait.png new file mode 100644 index 0000000..7f1792c Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-ipad-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-landscape-2x.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-landscape-2x.png new file mode 100644 index 0000000..0165669 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-landscape-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-landscape.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-landscape.png new file mode 100644 index 0000000..d154883 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-landscape.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait-2x.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait-2x.png new file mode 100644 index 0000000..bd24886 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait-568h-2x.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait-568h-2x.png new file mode 100644 index 0000000..10ed683 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait-568h-2x.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait.png b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait.png new file mode 100644 index 0000000..6fcba56 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/ios/screen-iphone-portrait.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/tizen/README.md b/node_modules/tus-js-client/demos/cordova/res/screen/tizen/README.md new file mode 100644 index 0000000..82c3f21 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/res/screen/tizen/README.md @@ -0,0 +1,24 @@ + + +# Tizen Splash Screen + +Splash screens are unsupported on the Tizen platform. diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/webos/screen-64.png b/node_modules/tus-js-client/demos/cordova/res/screen/webos/screen-64.png new file mode 100644 index 0000000..03b3849 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/webos/screen-64.png differ diff --git a/node_modules/tus-js-client/demos/cordova/res/screen/windows-phone/screen-portrait.jpg b/node_modules/tus-js-client/demos/cordova/res/screen/windows-phone/screen-portrait.jpg new file mode 100644 index 0000000..479d3e4 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/res/screen/windows-phone/screen-portrait.jpg differ diff --git a/node_modules/tus-js-client/demos/cordova/www/css/index.css b/node_modules/tus-js-client/demos/cordova/www/css/index.css new file mode 100644 index 0000000..41a6cf0 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/www/css/index.css @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +* { + -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ +} + +body { + -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ + -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ + -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ + background-color:#E4E4E4; + background-attachment:fixed; + font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; + font-size:15px; + height:100%; + margin:0px; + padding:0px; + width:100%; +} + +.Logo__image { + max-width: 80%; +} + +.Logo__wrapper { + text-align: center; + margin: 40px 0 20px; +} + +ol.List { + list-style: none; + counter-reset: item; + + padding: 0; + margin: 0 10%; +} + +ol.List li { + counter-increment: item; +} + +ol.List li:before { + display: inline-block; + + height: 2em; + width: 2em; + margin-right: 0.5em; + + text-align: center; + line-height: 2em; + + color: white; + font-style: italic; + font-weight: bold; + content: counter(item); + + border-radius: 100%; + background-color: #48aa92; +} + +.List__content { + text-align: center; + margin: 15px 0; +} + +.File__button, +.Upload__button { + background: #48aa92; + color: white; + + border: 0; + border-radius: 4px; + + padding: 1em 1.5em; +} + +.File__link, +.Upload__link { + text-align: center; + font-style: italic; +} + +.Upload__progress { + font-style: italic; +} + +.Upload__progress progress:not([value]) { + display: none; +} \ No newline at end of file diff --git a/node_modules/tus-js-client/demos/cordova/www/img/logo.png b/node_modules/tus-js-client/demos/cordova/www/img/logo.png new file mode 100644 index 0000000..17e2b33 Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/www/img/logo.png differ diff --git a/node_modules/tus-js-client/demos/cordova/www/img/tus2.png b/node_modules/tus-js-client/demos/cordova/www/img/tus2.png new file mode 100644 index 0000000..d4cdddd Binary files /dev/null and b/node_modules/tus-js-client/demos/cordova/www/img/tus2.png differ diff --git a/node_modules/tus-js-client/demos/cordova/www/index.html b/node_modules/tus-js-client/demos/cordova/www/index.html new file mode 100644 index 0000000..0302ed6 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/www/index.html @@ -0,0 +1,56 @@ + + + + + + + + + + + tus-js-client demo for Apache Corodva + + +
+ +
+ +
    +
  1. + Select a file for uploading: +
    + + +
    +
  2. +
  3. + Start (and pause) the upload: +
    + + +
    + +
    +
    +
    +
  4. +
  5. + Succesful upload will be listed here: + +
  6. + +
+ + + + + + diff --git a/node_modules/tus-js-client/demos/cordova/www/js/index.js b/node_modules/tus-js-client/demos/cordova/www/js/index.js new file mode 100644 index 0000000..03cd1e8 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/www/js/index.js @@ -0,0 +1,118 @@ +/* global tus Camera */ + +var upload = null +var uploadIsRunning = false +var file = null + +var uploadButton = document.querySelector('#js-upload-button') +var fileInput = document.querySelector('#js-upload-file') +var fileLink = document.querySelector('#js-file-link') +var progressBar = document.querySelector('#js-upload-progress') +var progressText = document.querySelector('#js-upload-progress-text') +var uploadLink = document.querySelector('#js-upload-link') + +fileInput.addEventListener('click', openFilePicker) + +function resetUpload () { + if (upload) { + upload.abort() + upload = null + } + + uploadButton.textContent = 'Start Upload' + uploadLink.textContent = 'not available yet' + progressText.textContent = '' + progressBar.removeAttribute('value') +} + +uploadButton.addEventListener('click', toggleUpload) + +function openFilePicker () { + resetUpload() + + var options = { + // Camera is a global cordova-specific object used for configuring camera access. + // See https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/#module_Camera + destinationType : Camera.DestinationType.FILE_URI, + sourceType : Camera.PictureSourceType.PHOTOLIBRARY, + encodingType : Camera.EncodingType.JPEG, + mediaType : Camera.MediaType.PICTURE, + // Allow simple editing of image before selection. + allowEdit : true, + // Rotate the image to correct for the orientation of the device during + // capture to fix orientation quirks on Android + correctOrientation: true, + } + + navigator.camera.getPicture(getFileEntry, (error) => { + window.alert(`Unable to obtain picture: ${error}`) + }, options) +} + +function getFileEntry (imgUri) { + window.resolveLocalFileSystemURL(imgUri, (fileEntry) => { + fileEntry.file((fileObj) => { + file = fileObj + fileLink.textContent = file.name + }) + }, (error) => { + window.alert(`Could not create FileEntry: ${error}`) + }) +} + +function toggleUpload () { + if (!upload) { + if (!file) return + + var options = { + endpoint : 'https://tusd.tusdemo.net/files/', + retryDelays: [0, 1000, 3000, 5000], + metadata : { + filename: file.name, + filetype: file.type, + }, + onError (error) { + if (error.originalRequest) { + if (window.confirm(`Failed because: ${error}\nDo you want to retry?`)) { + upload.start() + uploadIsRunning = true + return + } + } else { + window.alert(`Failed because: ${error}`) + } + + resetUpload() + }, + onProgress (bytesUploaded, bytesTotal) { + var progress = bytesUploaded / bytesTotal + var percentage = `${(progress * 100).toFixed(2)}%` + progressBar.value = progress + progressText.textContent = percentage + }, + onSuccess () { + var anchor = document.createElement('a') + anchor.textContent = `Download ${upload.file.name} (${upload.file.size} bytes)` + anchor.target = '_blank' + anchor.href = upload.url + + uploadLink.innerHTML = '' + uploadLink.appendChild(anchor) + }, + } + + upload = new tus.Upload(file, options) + + upload.start() + uploadIsRunning = true + uploadButton.textContent = 'Pause Upload' + } else if (uploadIsRunning) { + upload.abort() + uploadButton.textContent = 'Resume Upload' + uploadIsRunning = false + } else { + upload.start() + uploadButton.textContent = 'Pause Upload' + uploadIsRunning = true + } +} diff --git a/node_modules/tus-js-client/demos/cordova/yarn.lock b/node_modules/tus-js-client/demos/cordova/yarn.lock new file mode 100644 index 0000000..41cf8e9 --- /dev/null +++ b/node_modules/tus-js-client/demos/cordova/yarn.lock @@ -0,0 +1,390 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +abbrev@*, abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +android-versions@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/android-versions/-/android-versions-1.4.0.tgz#807ea2941d7e5780e6dd61c5d9b7b6f3c0706e09" + integrity sha512-GnomfYsBq+nZh3c3UH/4r9Jt6FuTxdhUJbeHIdYOH5xBhQ8I0ZzC2/RM5IFFIjrzuNWSHb8JWP1lPK0/a26jrg== + dependencies: + semver "^5.4.1" + +ansi@*, ansi@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21" + integrity sha1-DELU+xcWDVqa8eSEus4cZpIsGyE= + +balanced-match@*, balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-js@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" + integrity sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE= + +big-integer@1.6.32: + version "1.6.32" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.32.tgz#5867458b25ecd5bcb36b627c30bb501a13c07e89" + integrity sha512-ljKJdR3wk9thHfLj4DtrNiOSTxvGFaMjWrG4pW75juXC4j7+XuKJVFdg4kgFMYp85PVkO05dFMj2dk2xVsH4xw== + +big-integer@1.6.x, big-integer@^1.6.7: + version "1.6.48" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" + integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== + +bplist-parser@*: + version "0.3.0" + resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.3.0.tgz#ba50666370f61bbf94881636cd9f7d23c5286090" + integrity sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA== + dependencies: + big-integer "1.6.x" + +bplist-parser@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/bplist-parser/-/bplist-parser-0.1.1.tgz#d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6" + integrity sha1-1g1dzCDLptx+HymbNdPh+V2vuuY= + dependencies: + big-integer "^1.6.7" + +brace-expansion@*: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +buffer-from@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-0.1.2.tgz#15f4b9bcef012044df31142c14333caf6e0260d0" + integrity sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg== + +combine-errors@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/combine-errors/-/combine-errors-3.0.3.tgz#f4df6740083e5703a3181110c2b10551f003da86" + integrity sha1-9N9nQAg+VwOjGBEQwrEFUfAD2oY= + dependencies: + custom-error-instance "2.1.1" + lodash.uniqby "4.5.0" + +concat-map@*, concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +cordova-android@^7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/cordova-android/-/cordova-android-7.1.4.tgz#25261ad66cc64f42a30b70be005901fa30e2430e" + integrity sha512-Rtvu002I83uzfVyCsE6p2krFKVHt9TSAqZUATes+zH+o9cdxYGrLHY+PKCQo4SLCdSMdrkIHCDnQPTYTp/d7+g== + dependencies: + android-versions "1.4.0" + base64-js "1.2.0" + big-integer "1.6.32" + cordova-common "2.2.5" + elementtree "0.1.6" + glob "5.0.15" + nopt "3.0.1" + path-is-absolute "1.0.1" + plist "2.1.0" + properties-parser "0.2.3" + q "1.4.1" + sax "0.3.5" + semver "5.5.0" + shelljs "0.5.3" + xmlbuilder "8.2.2" + +cordova-common@2.2.5: + version "2.2.5" + resolved "https://registry.yarnpkg.com/cordova-common/-/cordova-common-2.2.5.tgz#f93cef2ad494cfcbf56c46e3d612aaa9cb5fcc32" + integrity sha1-+TzvKtSUz8v1bEbj1hKqqctfzDI= + dependencies: + ansi "^0.3.1" + bplist-parser "^0.1.0" + cordova-registry-mapper "^1.1.8" + elementtree "0.1.6" + glob "^5.0.13" + minimatch "^3.0.0" + plist "^2.1.0" + q "^1.4.1" + shelljs "^0.5.3" + underscore "^1.8.3" + unorm "^1.3.3" + +cordova-plugin-camera@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cordova-plugin-camera/-/cordova-plugin-camera-4.1.0.tgz#6474a3e080c4662aa00fd7425705d301c693ddc0" + integrity sha512-fCLhWjWYn49q3X5xaypAPgTz6MAWSKFFQvD2Gpi5SuVlrRPRphtX2jIqR2zCBuDTBR082QVnlc+yUDXt65Mjgw== + +cordova-plugin-file@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz#f3911479f8357e9aacb5576674f8d95b31a1fb20" + integrity sha512-m7cughw327CjONN/qjzsTpSesLaeybksQh420/gRuSXJX5Zt9NfgsSbqqKDon6jnQ9Mm7h7imgyO2uJ34XMBtA== + +cordova-plugin-whitelist@^1.3.3: + version "1.3.4" + resolved "https://registry.yarnpkg.com/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz#31938545c7c3e7de35c20ab08c2c3afa06e8a3f9" + integrity sha512-EYC5eQFVkoYXq39l7tYKE6lEjHJ04mvTmKXxGL7quHLdFPfJMNzru/UYpn92AOfpl3PQaZmou78C7EgmFOwFQQ== + +cordova-registry-mapper@*, cordova-registry-mapper@^1.1.8: + version "1.1.15" + resolved "https://registry.yarnpkg.com/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz#e244b9185b8175473bff6079324905115f83dc7c" + integrity sha1-4kS5GFuBdUc7/2B5MkkFEV+D3Hw= + +custom-error-instance@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/custom-error-instance/-/custom-error-instance-2.1.1.tgz#3cf6391487a6629a6247eb0ca0ce00081b7e361a" + integrity sha1-PPY5FIemYppiR+sMoM4ACBt+Nho= + +elementtree@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/elementtree/-/elementtree-0.1.6.tgz#2ac4c46ea30516c8c4cbdb5e3ac7418e592de20c" + integrity sha1-KsTEbqMFFsjEy9teOsdBjlkt4gw= + dependencies: + sax "0.3.5" + +extend@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +glob@5.0.15, glob@^5.0.13: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2: + version "4.2.6" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" + integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== + +inflight@*, inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@*, inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +js-base64@^2.4.9: + version "2.6.4" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4" + integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ== + +lodash._baseiteratee@~4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash._baseiteratee/-/lodash._baseiteratee-4.7.0.tgz#34a9b5543572727c3db2e78edae3c0e9e66bd102" + integrity sha1-NKm1VDVycnw9sueO2uPA6eZr0QI= + dependencies: + lodash._stringtopath "~4.8.0" + +lodash._basetostring@~4.12.0: + version "4.12.0" + resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz#9327c9dc5158866b7fa4b9d42f4638e5766dd9df" + integrity sha1-kyfJ3FFYhmt/pLnUL0Y45XZt2d8= + +lodash._baseuniq@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" + integrity sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg= + dependencies: + lodash._createset "~4.0.0" + lodash._root "~3.0.0" + +lodash._createset@~4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" + integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= + +lodash._root@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= + +lodash._stringtopath@~4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/lodash._stringtopath/-/lodash._stringtopath-4.8.0.tgz#941bcf0e64266e5fc1d66fed0a6959544c576824" + integrity sha1-lBvPDmQmbl/B1m/tCmlZVExXaCQ= + dependencies: + lodash._basetostring "~4.12.0" + +lodash.throttle@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" + integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= + +lodash.uniqby@4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.5.0.tgz#a3a17bbf62eeb6240f491846e97c1c4e2a5e1e21" + integrity sha1-o6F7v2LutiQPSRhG6XwcTipeHiE= + dependencies: + lodash._baseiteratee "~4.7.0" + lodash._baseuniq "~4.6.0" + +minimatch@*, "minimatch@2 || 3", minimatch@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +nopt@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.1.tgz#bce5c42446a3291f47622a370abbf158fbbacbfd" + integrity sha1-vOXEJEajKR9HYio3CrvxWPu6y/0= + dependencies: + abbrev "1" + +once@*, once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +path-is-absolute@1.0.1, path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +plist@2.1.0, plist@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/plist/-/plist-2.1.0.tgz#57ccdb7a0821df21831217a3cad54e3e146a1025" + integrity sha1-V8zbeggh3yGDEhejytVOPhRqECU= + dependencies: + base64-js "1.2.0" + xmlbuilder "8.2.2" + xmldom "0.1.x" + +proper-lockfile@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-2.0.1.tgz#159fb06193d32003f4b3691dd2ec1a634aa80d1d" + integrity sha1-FZ+wYZPTIAP0s2kd0uwaY0qoDR0= + dependencies: + graceful-fs "^4.1.2" + retry "^0.10.0" + +properties-parser@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/properties-parser/-/properties-parser-0.2.3.tgz#f7591255f707abbff227c7b56b637dbb0373a10f" + integrity sha1-91kSVfcHq7/yJ8e1a2N9uwNzoQ8= + +q@1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e" + integrity sha1-VXBbzZPF82c1MMLCy8DCs63cKG4= + +q@^1.4.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= + +retry@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" + integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= + +sax@0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/sax/-/sax-0.3.5.tgz#88fcfc1f73c0c8bbd5b7c776b6d3f3501eed073d" + integrity sha1-iPz8H3PAyLvVt8d2ttPzUB7tBz0= + +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + +semver@^5.4.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +shelljs@0.5.3, shelljs@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.5.3.tgz#c54982b996c76ef0c1e6b59fbdc5825f5b713113" + integrity sha1-xUmCuZbHbvDB5rWfvcWCX1txMRM= + +tus-js-client@^1.5.2: + version "1.8.0" + resolved "https://registry.yarnpkg.com/tus-js-client/-/tus-js-client-1.8.0.tgz#0402357bdaa90e9dee6f6734c24473808bff272b" + integrity sha512-qPX3TywqzxocTxUZtcS8X7Aik72SVMa0jKi4hWyfvRV+s9raVzzYGaP4MoJGaF0yOgm2+b6jXaVEHogxcJ8LGw== + dependencies: + buffer-from "^0.1.1" + combine-errors "^3.0.3" + extend "^3.0.2" + js-base64 "^2.4.9" + lodash.throttle "^4.1.1" + proper-lockfile "^2.0.1" + url-parse "^1.4.3" + +underscore@*, underscore@^1.8.3: + version "1.12.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.12.1.tgz#7bb8cc9b3d397e201cf8553336d262544ead829e" + integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== + +unorm@*, unorm@^1.3.3: + version "1.6.0" + resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" + integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== + +url-parse@^1.4.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" + integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +wrappy@*, wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +xmlbuilder@8.2.2: + version "8.2.2" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773" + integrity sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M= + +xmldom@*: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.5.0.tgz#193cb96b84aa3486127ea6272c4596354cb4962e" + integrity sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA== + +xmldom@0.1.x: + version "0.1.31" + resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.1.31.tgz#b76c9a1bd9f0a9737e5a72dc37231cf38375e2ff" + integrity sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ== diff --git a/node_modules/tus-js-client/demos/nodejs/index.js b/node_modules/tus-js-client/demos/nodejs/index.js new file mode 100644 index 0000000..87bd3ca --- /dev/null +++ b/node_modules/tus-js-client/demos/nodejs/index.js @@ -0,0 +1,30 @@ +/* eslint no-console: 0 */ + +var fs = require('fs') +var tus = require('../..') + +var path = '/home/marius/Downloads/setup_enter_the_gungeon_2.1.9_(64bit)_(29557).exe';//__dirname + "/../../README.md"; +var file = fs.createReadStream(path); +var size = fs.statSync(path).size; + +var options = { + endpoint: "http://localhost:1080/files/", + metadata: { + filename: 'README.md', + filetype: 'text/plain', + }, + uploadSize: size, + onError (error) { + throw error + }, + onProgress (bytesUploaded, bytesTotal) { + var percentage = (bytesUploaded / bytesTotal * 100).toFixed(2) + console.log(bytesUploaded, bytesTotal, `${percentage}%`) + }, + onSuccess () { + console.log('Upload finished:', upload.url) + }, +} + +var upload = new tus.Upload(file, options) +upload.start() diff --git a/node_modules/tus-js-client/demos/reactnative/.babelrc b/node_modules/tus-js-client/demos/reactnative/.babelrc new file mode 100644 index 0000000..d07dbdd --- /dev/null +++ b/node_modules/tus-js-client/demos/reactnative/.babelrc @@ -0,0 +1,9 @@ +{ + "presets": [ + [ "@babel/preset-env", { + "modules": false, + "corejs": false, + "forceAllTransforms": true + } ] + ] +} diff --git a/node_modules/tus-js-client/demos/reactnative/App.js b/node_modules/tus-js-client/demos/reactnative/App.js new file mode 100644 index 0000000..664f564 --- /dev/null +++ b/node_modules/tus-js-client/demos/reactnative/App.js @@ -0,0 +1,169 @@ +/* eslint-disable no-console */ + +import React from 'react' +import { + StyleSheet, + Text, + View, + Button, + Image, + Linking +} from 'react-native' +import { ImagePicker, Permissions } from 'expo' +import tus from 'tus-js-client' + +const styles = StyleSheet.create({ + container: { + flex : 1, + backgroundColor: '#fff', + alignItems : 'center', + justifyContent : 'center', + }, + heading: { + fontSize : 20, + fontWeight : 'bold', + marginBottom: 10, + }, +}) + +export default class App extends React.Component { + constructor () { + super() + + this.state = { + uploadedBytes: 0, + totalBytes : 0, + file : null, + status : 'no file selected', + uploadUrl : null, + } + + this.startUpload = this.startUpload.bind(this) + this.selectPhotoTapped = this.selectPhotoTapped.bind(this) + this.openUploadUrl = this.openUploadUrl.bind(this) + } + + getFileExtension (uri) { + const match = /\.([a-zA-Z]+)$/.exec(uri) + if (match !== null) { + return match[1] + } + + return '' + } + + getMimeType (extension) { + if (extension === 'jpg') return 'image/jpeg' + return `image/${extension}` + } + + selectPhotoTapped () { + Permissions.askAsync(Permissions.CAMERA_ROLL).then((isAllowed) => { + if (!isAllowed) return + + ImagePicker.launchImageLibraryAsync({}) + .then((result) => { + if (!result.cancelled) { + this.setState({ + file : result, + status: 'file selected', + }) + } + }) + }) + } + + startUpload () { + const { file } = this.state + + if (!file) return + + const extension = this.getFileExtension(file.uri) + const upload = new tus.Upload(file, { + endpoint : 'https://tusd.tusdemo.net/files/', + retryDelays: [0, 1000, 3000, 5000], + metadata : { + filename: `photo.${extension}`, + filetype: this.getMimeType(extension), + }, + onError: (error) => { + this.setState({ + status: `upload failed ${error}`, + }) + }, + onProgress: (uploadedBytes, totalBytes) => { + this.setState({ + totalBytes, + uploadedBytes, + }) + }, + onSuccess: () => { + this.setState({ + status : 'upload finished', + uploadUrl: upload.url, + }) + console.log('Upload URL:', upload.url) + }, + }) + + upload.start() + + this.setState({ + status : 'upload started', + uploadedBytes: 0, + totalBytes : 0, + uploadUrl : null, + }) + } + + openUploadUrl () { + Linking.openURL(this.state.uploadUrl) + } + + render () { + return ( + + tus-js-client running in React Native + + { this.state.file !== null + && ( + + )} + +